query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
e561e11bcf379ef5dc139c210017366b
Only allow a list of trusted parameters through.
[ { "docid": "858649ffd357e0baf62f3ffa60d8bc77", "score": "0.0", "text": "def event_params\n params.require(:event).permit(:name, :body, :date, :status, :location, :latitude, :longitude, :image)\n # , :state, :city, :street, :country\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.74768823", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "36956168ba2889cff7bf17d9f1db41b8", "score": "0.71700543", "text": "def set_param_whitelist(*param_list)\n self.param_whitelist = param_list\n end", "title": "" }, { "docid": "aa06a193f057b6be7c0713a5bd30d5fb", "score": "0.7044907", "text": "def strong_params\n params.require(:listing).permit(param_whitelist)\n end", "title": "" }, { "docid": "55ec6c1cf1b67ffe1cee0d4fec651d18", "score": "0.7009515", "text": "def allowed_params(*list)\n list.flatten!\n @list_of_allowed_params ||= []\n @list_of_allowed_params += list.map(&:to_s)\n\n params.each do |key, value|\n next if @list_of_allowed_params.index(key.to_s).present?\n\n fail! \"Parameter :#{key} is not allowed\", key.to_sym\n end\n end", "title": "" }, { "docid": "505e334c1850c398069b6fb3948ce481", "score": "0.69897616", "text": "def sanitise!\n @params.keep_if {|k,v| whitelisted? k}\n end", "title": "" }, { "docid": "bfb292096090145a067e31d8fef10853", "score": "0.6773957", "text": "def param_whitelist\n whitelist = [\n :title, :description, :skills,\n :positions, :category, :salary_period,\n :started_at, :finished_at,\n :deadline,\n :salary_min, :salary_max, :hours,\n :equity_min, :equity_max,\n :privacy,\n :owner_id, :owner_type,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n unless action_name === 'create'\n whitelist.delete(:owner_id)\n whitelist.delete(:owner_type)\n end\n \n whitelist\n end", "title": "" }, { "docid": "236e1766ee20eef4883ed724b83e4176", "score": "0.6758029", "text": "def param_whitelist\n [\n :name,\n :tagline, :contact, :summary, :stage,\n :website, :facebook, :twitter, :linkedin, :github,\n :founded_at,\n community_ids: [],\n sectors: [\n :commercial,\n :social,\n :research\n ],\n privacy: [\n contact: [],\n kpis: []\n ],\n permission: [\n listings: [],\n profile: [],\n posts: [],\n kpis: []\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end", "title": "" }, { "docid": "53d67b9c2ed1e0132c46653273fc708d", "score": "0.67139274", "text": "def whitelisted_args\n args.select(&:allowed)\n end", "title": "" }, { "docid": "603f4a45e5efa778afca5372ae8a96dc", "score": "0.6638781", "text": "def param_whitelist\n [:role]\n end", "title": "" }, { "docid": "caf5e21ffb495f1a2566ca6a564a6fdb", "score": "0.6633307", "text": "def allowed_arguments(arguments); end", "title": "" }, { "docid": "3d346c1d1b79565bee6df41a22a6f28d", "score": "0.6630876", "text": "def strong_params\n params.require(:resource).permit(param_whitelist)\n end", "title": "" }, { "docid": "c31ef48e8fd467d94158d7ac7f405a3f", "score": "0.65786487", "text": "def list_params\n params.permit(:id, :public_id, :name, :list, :visibility, values: [])\n end", "title": "" }, { "docid": "b29cf4bc4a27d4b199de5b6034f9f8a0", "score": "0.6551157", "text": "def safe_params\n params\n .require( self.class.model_class.name.underscore.to_sym )\n .permit( self.class.params_list )\n end", "title": "" }, { "docid": "585f461bf01ed1ef8d34fd5295a96dca", "score": "0.6529035", "text": "def param_whitelist\n whitelist = [\n :message,\n :privacy,\n :author_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:author_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "585f461bf01ed1ef8d34fd5295a96dca", "score": "0.6529035", "text": "def param_whitelist\n whitelist = [\n :message,\n :privacy,\n :author_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:author_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "cac0774e508766d2f487cbca3db95df0", "score": "0.650781", "text": "def allow_params?\n definition[:param_tokens]\n end", "title": "" }, { "docid": "58d1451e57b0e767db2fc6721dfaa6be", "score": "0.64761394", "text": "def allowed_parameters\n parameters.keys\n end", "title": "" }, { "docid": "37d1c971f6495de3cdd63a3ef049674e", "score": "0.64282405", "text": "def param_whitelist\n whitelist = [\n :name,\n :overview,\n :website, :facebook, :twitter,\n :privacy,\n :avatar_id, :community_id, :category_ids,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n unless action_name === 'create'\n whitelist.delete(:community_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "c436017f4e8bd819f3d933587dfa070a", "score": "0.63983387", "text": "def filtered_parameters; end", "title": "" }, { "docid": "c72da3a0192ce226285be9c2a583d24a", "score": "0.63592577", "text": "def strong_params\n params.require(:post).permit(param_whitelist)\n end", "title": "" }, { "docid": "7646659415933bf751273d76b1d11b40", "score": "0.6339914", "text": "def whitelisted_observation_params\n return unless params[:observation]\n\n params[:observation].permit(whitelisted_observation_args)\n end", "title": "" }, { "docid": "2c8e2be272a55477bfc4c0dfc6baa7a7", "score": "0.6327032", "text": "def strong_params\n params.require(:community_member).permit(param_whitelist)\n end", "title": "" }, { "docid": "b453d9a67af21a3c28a62e1848094a41", "score": "0.63192505", "text": "def strong_params\n params.require(:kpi).permit(param_whitelist)\n end", "title": "" }, { "docid": "706df0e25391ed2b932f54a646bb0a10", "score": "0.6280703", "text": "def list_name_param opts={}\n params.require(:list).permit(:name)\n end", "title": "" }, { "docid": "839591b72f27e154e4840464f1f4684d", "score": "0.6278046", "text": "def whitelist=(lst)\n uri.querystring_params[\"whitelist\"] = lst.split(\",\").map(&:strip).reject{|e|e.blank?}\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.62771213", "text": "def strong_params\n params.require(:request).permit(param_whitelist)\n end", "title": "" }, { "docid": "e64490ed35123aafa1b4627bd165517d", "score": "0.62693745", "text": "def allowed_params\n [:title, :description, :is_template, :template_id, :user_id, :color]\n end", "title": "" }, { "docid": "094cae2a77f3def05726eb7961449324", "score": "0.62682945", "text": "def allowed; end", "title": "" }, { "docid": "cc60076a498957ddcd05472aa576a2b1", "score": "0.62651163", "text": "def param_whitelist\n case action_name\n when 'create'\n [:type, :author_id, :participant_ids]\n else\n [:participant_ids]\n end\n end", "title": "" }, { "docid": "fc43ee8cb2466a60d4a69a04461c601a", "score": "0.62642586", "text": "def check_params; true; end", "title": "" }, { "docid": "fc43ee8cb2466a60d4a69a04461c601a", "score": "0.62642586", "text": "def check_params; true; end", "title": "" }, { "docid": "19bd0484ed1e2d35b30d23b301d20f7c", "score": "0.6229388", "text": "def unsafe_params\n ActiveSupport::Deprecation.warn(\"Using `unsafe_params` isn't a great plan\", caller(1))\n params.dup.tap(&:permit!)\n end", "title": "" }, { "docid": "19bd0484ed1e2d35b30d23b301d20f7c", "score": "0.6229388", "text": "def unsafe_params\n ActiveSupport::Deprecation.warn(\"Using `unsafe_params` isn't a great plan\", caller(1))\n params.dup.tap(&:permit!)\n end", "title": "" }, { "docid": "91bfe6d464d263aa01e776f24583d1d9", "score": "0.6213818", "text": "def permitir_parametros\n params.permit!\n end", "title": "" }, { "docid": "21e97a45d3f9fc907204c8dfd146be09", "score": "0.62028986", "text": "def required_params(*list)\n list.flatten!\n @list_of_allowed_params ||= []\n @list_of_allowed_params += list.map(&:to_s)\n list.map(&:to_s).each do |param|\n next if params[param].present?\n\n fail! \"Parameter :#{param} should be present\", param\n end\n end", "title": "" }, { "docid": "e291b3969196368dd4f7080a354ebb08", "score": "0.61983657", "text": "def permitir_parametros\n \t\tparams.permit!\n \tend", "title": "" }, { "docid": "e012d7306b402a37012f98bfd4ffdb10", "score": "0.61918944", "text": "def strong_params\n params.require(:team).permit(param_whitelist)\n end", "title": "" }, { "docid": "9ac9542f33069f9d46e4393194623b4c", "score": "0.61912215", "text": "def snippets_list_params\n params.require(:snippets_list).permit(:is_public, :tags)\n end", "title": "" }, { "docid": "69d3720ae33b0a9e88f3a951595e767f", "score": "0.6184765", "text": "def sanitize_parameters!(sanitizer, params)\n endian = params[:endian] || self.endian\n fields = params[:fields] || self.fields\n hide = params[:hide] || self.hide\n\n params[:endian] = endian unless endian.nil?\n params[:fields] = fields\n params[:hide] = hide\n\n # add default parameters\n default_parameters.each do |k,v|\n params[k] = v unless params.has_key?(k)\n end\n\n # ensure mandatory parameters exist\n mandatory_parameters.each do |prm|\n if not params.has_key?(prm)\n raise ArgumentError, \"parameter ':#{prm}' must be specified \" +\n \"in #{self}\"\n end\n end\n\n super(sanitizer, params)\n end", "title": "" }, { "docid": "a322581bdbf994c8ac99b2f8da40b18f", "score": "0.61772996", "text": "def user_params\n params.require(:user).permit(:first_name,:last_name,:email).tap do |whitelisted|\n p params[:user][:role_ids].reject { |c| c.empty? }\n whitelisted[:role_ids] = params[:user][:role_ids].reject { |c| c.empty? }\n end\nend", "title": "" }, { "docid": "9e289c8e3757ad76ffbd2a6991acef28", "score": "0.61578906", "text": "def allowed_params\n %i[\n user_defined_id_statelocal\n user_defined_id_cdc\n user_defined_id_nndss\n first_name\n middle_name\n last_name\n date_of_birth\n age\n sex\n white\n black_or_african_american\n american_indian_or_alaska_native\n asian\n native_hawaiian_or_other_pacific_islander\n ethnicity\n primary_language\n secondary_language\n interpretation_required\n nationality\n address_line_1\n foreign_address_line_1\n address_city\n address_state\n address_line_2\n address_zip\n address_county\n monitored_address_line_1\n monitored_address_city\n monitored_address_state\n monitored_address_line_2\n monitored_address_zip\n monitored_address_county\n foreign_address_city\n foreign_address_country\n foreign_address_line_2\n foreign_address_zip\n foreign_address_line_3\n foreign_address_state\n foreign_monitored_address_line_1\n foreign_monitored_address_city\n foreign_monitored_address_state\n foreign_monitored_address_line_2\n foreign_monitored_address_zip\n foreign_monitored_address_county\n primary_telephone\n primary_telephone_type\n secondary_telephone\n secondary_telephone_type\n email\n preferred_contact_method\n preferred_contact_time\n port_of_origin\n source_of_report\n source_of_report_specify\n flight_or_vessel_number\n flight_or_vessel_carrier\n port_of_entry_into_usa\n travel_related_notes\n additional_planned_travel_type\n additional_planned_travel_destination\n additional_planned_travel_destination_state\n additional_planned_travel_destination_country\n additional_planned_travel_port_of_departure\n date_of_departure\n date_of_arrival\n additional_planned_travel_start_date\n additional_planned_travel_end_date\n additional_planned_travel_related_notes\n last_date_of_exposure\n potential_exposure_location\n potential_exposure_country\n contact_of_known_case\n contact_of_known_case_id\n travel_to_affected_country_or_area\n was_in_health_care_facility_with_known_cases\n was_in_health_care_facility_with_known_cases_facility_name\n laboratory_personnel\n laboratory_personnel_facility_name\n healthcare_personnel\n healthcare_personnel_facility_name\n exposure_notes\n crew_on_passenger_or_cargo_flight\n monitoring_plan\n exposure_risk_assessment\n member_of_a_common_exposure_cohort\n member_of_a_common_exposure_cohort_type\n isolation\n jurisdiction_id\n assigned_user\n symptom_onset\n case_status\n ]\n end", "title": "" }, { "docid": "4f7be6ec5bf491c0125e1c2091de0a80", "score": "0.61395127", "text": "def place_allow_list_params\n params.permit(:place_id, :group_category_id, :enable)\n end", "title": "" }, { "docid": "3512da8c3cbc10950f1c278d883a22d0", "score": "0.6128934", "text": "def check_permit!\n tracker.find_call(:method => :permit!).each do |result|\n if params? result[:call].target and not result[:chain].include? :slice\n warn_on_permit! result\n end\n end\n end", "title": "" }, { "docid": "3ae7a4551c9ded91965010fecb51d76b", "score": "0.6116012", "text": "def validate_parameters(allow: [], required: nil, require_any_of: nil) # rubocop:disable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity\n if required\n raise ArgumentError, \"Expected required parameters as Array of Symbols, got #{required}\" unless required.is_a?(Array) && required.all? { |r| r.is_a?(Symbol) }\n raise ArgumentError, \"#{@__resource_name__}: `#{required}` must be provided\" unless @opts.is_a?(Hash) && required.all? { |req| @opts.key?(req) && !@opts[req].nil? && @opts[req] != \"\" }\n allow += required\n end\n\n if require_any_of\n raise ArgumentError, \"Expected required parameters as Array of Symbols, got #{require_any_of}\" unless require_any_of.is_a?(Array) && require_any_of.all? { |r| r.is_a?(Symbol) }\n raise ArgumentError, \"#{@__resource_name__}: One of `#{require_any_of}` must be provided.\" unless @opts.is_a?(Hash) && require_any_of.any? { |req| @opts.key?(req) && !@opts[req].nil? && @opts[req] != \"\" }\n allow += require_any_of\n end\n\n allow += %i(client_args stub_data aws_region aws_endpoint aws_retry_limit aws_retry_backoff resource_data)\n raise ArgumentError, \"Scalar arguments not supported\" unless defined?(@opts.keys)\n raise ArgumentError, \"Unexpected arguments found\" unless @opts.keys.all? { |a| allow.include?(a) }\n raise ArgumentError, \"Provided parameter should not be empty\" unless @opts.values.all? do |a|\n return true if a.instance_of?(Integer)\n return true if [TrueClass, FalseClass].include?(a.class)\n !a.empty?\n end\n true\n end", "title": "" }, { "docid": "356c5fd5dcbe9214f1330792fa2e18b5", "score": "0.61158365", "text": "def param_whitelist\n whitelist = [\n :name,\n :details,\n :completed,\n :started_at, :finished_at,\n :team_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:team_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "f19218511bb46b261576fd4a0359ddd0", "score": "0.6112491", "text": "def public_list_params\n params.require(:public_list).permit(:name, :description, places_attributes: [])\n end", "title": "" }, { "docid": "76ec9935ef327d0b5d1af534978cb4f8", "score": "0.6111488", "text": "def voter_list_params\n params.require(:voter_list).permit(:user_id, :selection_process_id, :estado, :search, :admission)\n end", "title": "" }, { "docid": "96a4c3e9d28624613a41897ea478af4c", "score": "0.6111325", "text": "def list_params\n params.require(:list).permit(:name, :description, :user_id)\n end", "title": "" }, { "docid": "b275e68d657aac7565b7da55922cbcae", "score": "0.6102179", "text": "def should_filter_params(*keys)\n ::ActiveSupport::Deprecation.warn(\"use: should filter_param\")\n keys.each do |key|\n should filter_param(key)\n end\n end", "title": "" }, { "docid": "5775dd2574b8acbba92a6a825c2a30b7", "score": "0.6079451", "text": "def allow_scopes(*args)\n @target.filterable_scopes = args\n end", "title": "" }, { "docid": "7e3b725e746658a932308b2245800100", "score": "0.6065513", "text": "def list_params\n params.require(:list).permit(:user_id)\n end", "title": "" }, { "docid": "b436ac15f83c93ec97a7852cc3cd560d", "score": "0.6064122", "text": "def list_params\n params.require(:list).permit(\n :name, :user_id, :location_ids => []\n )\n end", "title": "" }, { "docid": "f5b444bcf4dbe089582ac3c3cf81ca92", "score": "0.60615236", "text": "def price_list_params\n params.fetch(:price_list, {}).permit(PriceList::PERMITED_PARAMS)\n end", "title": "" }, { "docid": "d5df8448adfa675e6d25aeb23d7a5e34", "score": "0.6058738", "text": "def sanitize_query_fields\n allowed_fields = @list.property_index_keys\n return request.query_parameters.select {|key, val| allowed_fields.include?(key)}\n end", "title": "" }, { "docid": "61d793e7f8b92dfddfe9ee932db6bae5", "score": "0.60527927", "text": "def my_list_params\n params.require(:my_list).permit(:user_id, :query)\n end", "title": "" }, { "docid": "3da9117a80cdfd040f0f0ed9d3ffed55", "score": "0.60501283", "text": "def allowable_params(unfiltered_params)\n unfiltered_params.permit(:property_id, :branch_id, :client_name, :branch_name,\n :department, :reference_number, :address_name, :address_number, :address_street,\n :address2, :address3, :address4, :address_postcode, :country, :display_address,\n :property_bedrooms, :property_bathrooms, :property_ensuites, :property_reception_rooms,\n :property_kitchens, :display_property_type, :property_type, :property_style,\n :property_age, :floor_area, :floor_area_units, :property_feature1, :property_feature2,\n :property_feature3, :property_feature4, :property_feature5, :property_feature6,\n :property_feature7, :property_feature8, :property_feature9, :property_feature10,\n :price, :for_sale_poa, :price_qualifier, :property_tenure, :sale_by,\n :development_opportunity, :investment_opportunity, :estimated_rental_income,\n :availability, :main_summary, :full_description, :date_last_modified,\n :featured_property, :region_id, :latitude, :longitude,\n flags_attributes: [:title],\n images_attributes: [:url, :modified],\n floorplans_attributes: [:url, :modified],\n epc_graphs_attributes: [:url, :modified],\n epc_front_pages_attributes: [:url, :modified],\n brochures_attributes: [:url, :modified],\n virtual_tours_attributes: [:url, :modified],\n external_links_attributes: [:url, :description, :modified])\n end", "title": "" }, { "docid": "b63e6e97815a8745ab85cd8f7dd5b4fb", "score": "0.6045103", "text": "def excluded_from_filter_parameters; end", "title": "" }, { "docid": "84bd386d5b2a0d586dca327046a81a63", "score": "0.6032686", "text": "def good_params\n permit_params\n end", "title": "" }, { "docid": "25220437209ae6056988e50c38a01211", "score": "0.6025226", "text": "def trust_params\n trusts = params.select { |k, _v| k.starts_with?(\"vault_entry_\") }\n permitted_params = {}\n trusts.keys.each do |trust|\n permitted_params[trust] = [:id, :name, :notes, :document_id, agent_ids: [], trustee_ids: [], successor_trustee_ids: [], share_ids: [],\n share_with_contact_ids: []]\n end\n trusts.permit(permitted_params)\n end", "title": "" }, { "docid": "08a3b9a8de9dd7334ffe66919731cb94", "score": "0.60225105", "text": "def permit_params!(params)\n if @allow_all_params\n params.permit!\n elsif @allowed_params\n @allowed_params.each do |resource, attributes|\n if params[resource].respond_to? :permit\n params[resource] = params[resource].permit(*attributes)\n end\n end\n end\n end", "title": "" }, { "docid": "4aa2ef6967e8f3024acea2b3d1cfd9e5", "score": "0.6019055", "text": "def allow_list_all?\n false\n end", "title": "" }, { "docid": "45791845cef485d15b7014088dd0be8d", "score": "0.60152686", "text": "def allowed_params\n %i[title body]\n end", "title": "" }, { "docid": "cb7fc4ad3e08a4341c6395a2c154c575", "score": "0.6009825", "text": "def filter_params(_sub_object_attribute = nil)\n required = :returns_lbtt_party\n attribute_list = Lbtt::Party.attribute_list\n params.require(required).permit(attribute_list) if params[required]\n end", "title": "" }, { "docid": "cb7fc4ad3e08a4341c6395a2c154c575", "score": "0.6009825", "text": "def filter_params(_sub_object_attribute = nil)\n required = :returns_lbtt_party\n attribute_list = Lbtt::Party.attribute_list\n params.require(required).permit(attribute_list) if params[required]\n end", "title": "" }, { "docid": "bd826c318f811361676f5282a9256071", "score": "0.6003619", "text": "def filter_parameters; end", "title": "" }, { "docid": "0c9d4c365c1621bdf0a6b700bd6e3bef", "score": "0.59931374", "text": "def cleanedParams(params)\n params.select {|k, v| ALLOWED_PARAMS.include? k}\n end", "title": "" }, { "docid": "71f97bda880101aa36b21017c0787f98", "score": "0.5989032", "text": "def validate_params\n invalid_parameter = @params.find { |key, value| !ConsolidatedScreeningList::PARAMETERS.key?(key) }\n raise ArgumentError, \"Invalid parameter: #{@params}\" if invalid_parameter\n end", "title": "" }, { "docid": "67fe19aa3f1169678aa999df9f0f7e95", "score": "0.5984926", "text": "def list_params\n params.permit(:name)\n end", "title": "" }, { "docid": "6af3741c8644ee63d155db59be10a774", "score": "0.59798354", "text": "def allowed_params\n %i[\n lock_version\n comments\n organization\n job_title\n pronouns\n year_of_birth\n gender\n ethnicity\n opted_in\n invite_status\n acceptance_status\n registered\n registration_type\n can_share\n registration_number\n can_photo\n can_record\n name\n name_sort_by\n name_sort_by_confirmed\n pseudonym\n pseudonym_sort_by\n pseudonym_sort_by_confirmed\n ]\n end", "title": "" }, { "docid": "f023b3871638291b75273a71bc75459c", "score": "0.59747314", "text": "def page_list_params\n params.permit(:url_list)\n params[:page_list].permit!\n end", "title": "" }, { "docid": "d78d0776c63005d7f56f3a21b5e4c50a", "score": "0.59729695", "text": "def user_list_params\n params.require(:user_list).permit(:user_id, :list_id)\n end", "title": "" }, { "docid": "4cf4346dd54b99fe0a7782ceaf7c26be", "score": "0.5971315", "text": "def quotation_list_params\n params.require(:quotation_list).permit!\n end", "title": "" }, { "docid": "38ed4234ecadfc5889a7c25028dc9a58", "score": "0.5965672", "text": "def sanitize(params = {})\n blacklist = options.fetch(:blacklist, []).map(&:to_s)\n redacted_string = options.fetch(:redacted_string, 'REDACTED')\n params.each do |param, _value|\n params[param] = redacted_string if blacklist.include?(param.to_s)\n end\n end", "title": "" }, { "docid": "157e773497f78353899720ad034a906a", "score": "0.5962804", "text": "def white_list_params\n params.require(:white_list).permit(:ip, :comment)\n end", "title": "" }, { "docid": "5fc4ba2ae074a90a66c53c25e751f3f0", "score": "0.5960231", "text": "def black_list_params\n params.require(:black_list).permit(:user)\n end", "title": "" }, { "docid": "63f5e4e9733f9e6b3f98d5e069440292", "score": "0.595559", "text": "def black_list_params\r\n params.require(:black_list).permit(:user)\r\n end", "title": "" }, { "docid": "8e519fbf8b7f524a91ac5c7f842a6121", "score": "0.59538776", "text": "def validate_params_present!; end", "title": "" }, { "docid": "037a774fcd9c86ff09a88570fba7bebd", "score": "0.59527713", "text": "def filter_for ownable\n # get the class name of the ownable\n class_name = ownable.class_name_to_sym.to_s\n \n # make sure params format is as follows:\n # { ownable_class_name: {param1: :value, param2: :value} }\n params.required(class_name)\n\n # return {} if !params || params.empty?\n\n # get a list of attributes that are allowed for this item\n # could be true, false, or an array of allowed attributes\n allowed_attributes = attributes_for(ownable)\n\n # decide how to handle the received attributes\n if allowed_attributes == true\n \n # allow all\n params.permit!\n\n elsif allowed_attributes == false\n \n # allow none\n params.permit *[]\n\n else\n \n # filter out everything except allowed_attributes\n params.permit *allowed_attributes\n \n raise params.to_yaml\n end\n\n end", "title": "" }, { "docid": "d4e0fd0cd70ef3707f081791087f33b6", "score": "0.5949399", "text": "def validate_parameters(allow: [], required: nil, require_any_of: nil)\n opts = @opts\n allow += %i(azure_retry_limit azure_retry_backoff azure_retry_backoff_factor\n endpoint api_version required_parameters allowed_parameters display_name method)\n Validators.validate_parameters(resource_name: @__resource_name__,\n allow: allow, required: required,\n require_any_of: require_any_of, opts: opts)\n true\n end", "title": "" }, { "docid": "d7f0d4c3dc66c34a6e17c0a14432c0e9", "score": "0.5946416", "text": "def verification_list_params\n params.require(:verification_list).permit!\n end", "title": "" }, { "docid": "5ed866fb3c6ebdffbc794d04bb9f2531", "score": "0.5945795", "text": "def list_params\n params.fetch(:list, {}).permit(\n :name\n )\n end", "title": "" }, { "docid": "ba0704d4182a1a6fb0a743f6eb9cd25e", "score": "0.59403497", "text": "def check_params\n\t\t\t return []\t\t\t \n\tend", "title": "" }, { "docid": "229afde2ab7c3109de2027d47fba2c70", "score": "0.5937114", "text": "def white_list_params(params, allowed_values, ignored_values = [])\n result = {}\n params.each_pair do |key, value|\n if allowed_values.include? key\n result[key] = value\n elsif !ignored_values.include?(key)\n raise SwaggerInvalidException.new(\"Unknown property [#{key}] with value [#{value}]#{list_or_none(allowed_values, 'properties')}\")\n end\n end\n result\n end", "title": "" }, { "docid": "a99f218b156087cc665291b5dfc21e1f", "score": "0.59363353", "text": "def validate_parameters(allow: [], required: nil, require_any_of: nil)\n if required\n raise ArgumentError, \"Expected required parameters as Array of Symbols, got #{required}\" unless required.is_a?(Array) && required.all? { |r| r.is_a?(Symbol) }\n raise ArgumentError, \"#{@__resource_name__}: region must be provided via environment variable or hash parameter\" if required.include?(:region) && (!@opts.is_a?(Hash) || (@opts[:region].nil? || @opts[:region] == \"\"))\n raise ArgumentError, \"#{@__resource_name__}: `#{required}` must be provided\" unless @opts.is_a?(Hash) && required.all? { |req| @opts.key?(req) && !@opts[req].nil? && @opts[req] != \"\" }\n\n allow += required\n end\n\n if require_any_of\n raise ArgumentError, \"Expected required parameters as Array of Symbols, got #{require_any_of}\" unless require_any_of.is_a?(Array) && require_any_of.all? { |r| r.is_a?(Symbol) }\n raise ArgumentError, \"#{@__resource_name__}: One of `#{require_any_of}` must be provided.\" unless @opts.is_a?(Hash) && require_any_of.any? { |req| @opts.key?(req) && !@opts[req].nil? && @opts[req] != \"\" }\n\n allow += require_any_of\n end\n\n allow += %i{region} unless allow.include?(:region)\n allow += %i{endpoint} unless allow.include?(:endpoint)\n @opts.delete(:region) if @opts.is_a?(Hash) && @opts[:region].nil?\n\n raise ArgumentError, \"Scalar arguments not supported\" unless defined?(@opts.keys)\n raise ArgumentError, \"Unexpected arguments found\" unless @opts.keys.all? { |a| allow.include?(a) }\n raise ArgumentError, \"Provided parameter should not be empty\" unless @opts.values.all? do |a|\n return true if a.instance_of?(Integer) || a.instance_of?(TrueClass) || a.instance_of?(FalseClass)\n\n !a.empty?\n end\n\n true\n end", "title": "" }, { "docid": "527035c39c066958cc202c06528f2673", "score": "0.59362227", "text": "def patient_list_params\n params.require(:patient_list).permit!\n end", "title": "" }, { "docid": "ab49b0baeea5bf6f204adca9e864094e", "score": "0.59332967", "text": "def secure_params(require_param, permit_keys)\n params.require(require_param).permit(*permit_keys)\n end", "title": "" }, { "docid": "5b53a222b1dec771125370679892e873", "score": "0.5929766", "text": "def sanitize(raw_parameters = {})\n kept_params = {}\n sanitize_nesting(kept_params, @whitelist, symbolize_recursive(raw_parameters))\n kept_params\n end", "title": "" }, { "docid": "d8b02fce801fc219417d86d0ca117836", "score": "0.59260756", "text": "def _valid_params\n valid_params # method private cause needed only for internal usage\n end", "title": "" }, { "docid": "d8b02fce801fc219417d86d0ca117836", "score": "0.59260756", "text": "def _valid_params\n valid_params # method private cause needed only for internal usage\n end", "title": "" }, { "docid": "f70301232281d001a4e52bd9ba4d20f5", "score": "0.5921627", "text": "def room_allowed_params\n end", "title": "" }, { "docid": "a1a9495fb0e2abd93f64e7d722073f1f", "score": "0.59203607", "text": "def interest_list_params\n params.require(:interest_list).permit(:name, :public, :user_id)\n end", "title": "" }, { "docid": "b3e49440054c3ad3ddb77e29e74a8e4b", "score": "0.59200895", "text": "def sanitized_allowed_attributes=(attributes)\n sanitizer_vendor.safe_list_sanitizer.allowed_attributes = attributes\n end", "title": "" }, { "docid": "7d35b10ac04b461c800fcfea1623a8bb", "score": "0.591923", "text": "def sanitize_by_param(allowed=[], default='id')\n sanitize_params params && params[:by], allowed, default\n end", "title": "" }, { "docid": "7d35b10ac04b461c800fcfea1623a8bb", "score": "0.591923", "text": "def sanitize_by_param(allowed=[], default='id')\n sanitize_params params && params[:by], allowed, default\n end", "title": "" }, { "docid": "9bd89e2fd22e220afe97917f75377374", "score": "0.59133667", "text": "def whitelist\n gather_params(self.jsonschema) if self.jsonschema.present? && self.jsonschema.key?('properties')\n end", "title": "" }, { "docid": "1685d76d665d2c26af736aa987ac8b51", "score": "0.5912647", "text": "def permitted_params\n params.permit!\n end", "title": "" }, { "docid": "7f38dfb5bc4d7e89f8aa414e3097f268", "score": "0.5905095", "text": "def allow_access_list(opts)\n opts = check_params(opts,[:self_ips])\n super(opts)\n end", "title": "" }, { "docid": "bf71f22b6a3d024d9581258c3391dd13", "score": "0.59014034", "text": "def filter_params(params); end", "title": "" }, { "docid": "925ab7429771692d76184dc744dc843c", "score": "0.58916956", "text": "def user_list_params\n params.require(:user_list).permit(:user_id, :user_name)\n end", "title": "" }, { "docid": "1c1ee6cc45fd852cab3c1e192bec902b", "score": "0.5888005", "text": "def parametro_params\r\n params.require(:parametro).tap do |whitelisted|\r\n whitelisted[:clave] = params[:parametro][:clave]\r\n whitelisted[:valor] = params[:parametro][:valor]\r\n whitelisted[:bloqueado] = params[:parametro][:bloqueado]\r\n\r\n for i in 0..params[:parametro].count do\r\n whitelisted[\"valor#{i}\".to_sym] = params[:parametro][\"valor#{i}\".to_sym]\r\n end\r\n end\r\n # params.require(:parametro).permit(:clave, :valor)\r\n end", "title": "" }, { "docid": "b248e725f40ba361d6e0529f389090df", "score": "0.5884956", "text": "def filter_by_param(params={})\n if (sub_keys = params[\"allowed_keys\"])\n sub_keys.split(',').select do |key|\n self.allowed_keys.any? {|allowed_key| key.start_with?(allowed_key)}\n end\n else\n self.allowed_keys\n end\n end", "title": "" } ]
af630984682f1a0b5a68e6092af0d102
Update properties of this object
[ { "docid": "42002bc27007a54b1101e97b6316c940", "score": "0.0", "text": "def update!(**args)\n @basic_config = args[:basic_config] if args.key?(:basic_config)\n end", "title": "" } ]
[ { "docid": "184b1b1ed771473d3eb9f338c0734c38", "score": "0.73066413", "text": "def update *args\n opts = args.extract_options!\n fill_properties opts\n self.save\n end", "title": "" }, { "docid": "5076c5a88404ae72986f958710f5687a", "score": "0.72631145", "text": "def update(properties)\n @__hash__.update(properties)\n end", "title": "" }, { "docid": "60506d5995c168a570c84bcbafd6d01b", "score": "0.7164913", "text": "def update props\n # not an alias because doc\n put props\n end", "title": "" }, { "docid": "ec25850e7b3d73876b69868b5e566a7a", "score": "0.71243227", "text": "def update_properties(hash)\n hash.each do |key, value|\n self.send(\"#{key}=\", value)\n end\n end", "title": "" }, { "docid": "22938231f10efd60d4530259d1ab7161", "score": "0.7061904", "text": "def update_props(properties)\n fail 'not implemented'\n end", "title": "" }, { "docid": "22938231f10efd60d4530259d1ab7161", "score": "0.7061904", "text": "def update_props(properties)\n fail 'not implemented'\n end", "title": "" }, { "docid": "150fa2bdc1fc43d28ac45e2278a1f797", "score": "0.7012263", "text": "def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end", "title": "" }, { "docid": "b46342a57789464175130c5171865a4f", "score": "0.69842774", "text": "def update_properties(props)\n load_properties(force: true)\n\n deep_merge = proc do |_, old_value, new_value|\n if old_value.is_a?(Hash) && new_value.is_a?(Hash)\n old_value.merge(new_value, &deep_merge)\n else\n new_value\n end\n end\n\n props = properties.merge(props || {}, &deep_merge)\n save_properties(properties.merge(props || {}))\n self\n end", "title": "" }, { "docid": "e72f78e0e269f94de07625d4972f0298", "score": "0.69181895", "text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "title": "" }, { "docid": "e72f78e0e269f94de07625d4972f0298", "score": "0.69181895", "text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "title": "" }, { "docid": "e72f78e0e269f94de07625d4972f0298", "score": "0.69181895", "text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "title": "" }, { "docid": "e72f78e0e269f94de07625d4972f0298", "score": "0.69181895", "text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "title": "" }, { "docid": "e72f78e0e269f94de07625d4972f0298", "score": "0.69181895", "text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "title": "" }, { "docid": "e72f78e0e269f94de07625d4972f0298", "score": "0.69181895", "text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "title": "" }, { "docid": "e72f78e0e269f94de07625d4972f0298", "score": "0.69181895", "text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "title": "" }, { "docid": "e72f78e0e269f94de07625d4972f0298", "score": "0.69181895", "text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "title": "" }, { "docid": "e72f78e0e269f94de07625d4972f0298", "score": "0.69181895", "text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "title": "" }, { "docid": "e72f78e0e269f94de07625d4972f0298", "score": "0.69181895", "text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "title": "" }, { "docid": "e72f78e0e269f94de07625d4972f0298", "score": "0.69181895", "text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "title": "" }, { "docid": "e72f78e0e269f94de07625d4972f0298", "score": "0.69181895", "text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "title": "" }, { "docid": "e72f78e0e269f94de07625d4972f0298", "score": "0.69181895", "text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "title": "" }, { "docid": "e72f78e0e269f94de07625d4972f0298", "score": "0.69181895", "text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "title": "" }, { "docid": "e72f78e0e269f94de07625d4972f0298", "score": "0.69181895", "text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "title": "" }, { "docid": "e72f78e0e269f94de07625d4972f0298", "score": "0.69181895", "text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "title": "" }, { "docid": "4aa62f56c7ec71b9c7d914558501001b", "score": "0.67206186", "text": "def update\n update_obj\n end", "title": "" }, { "docid": "10e41ec39ba2af73495ccece21c2d8a3", "score": "0.6709326", "text": "def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end", "title": "" }, { "docid": "b0508d605628b9b1ec78fe5f0697a746", "score": "0.67057854", "text": "def update_properties(hash)\n hash.each_pair do |k, v|\n self.set_property_value(k.to_s, v)\n end\n end", "title": "" }, { "docid": "092b765ad7cf3ce4b6bf4e7d8a2e6af7", "score": "0.6696149", "text": "def update(attrs)\n super(attrs)\n end", "title": "" }, { "docid": "092b765ad7cf3ce4b6bf4e7d8a2e6af7", "score": "0.6696149", "text": "def update(attrs)\n super(attrs)\n end", "title": "" }, { "docid": "092b765ad7cf3ce4b6bf4e7d8a2e6af7", "score": "0.6696149", "text": "def update(attrs)\n super(attrs)\n end", "title": "" }, { "docid": "092b765ad7cf3ce4b6bf4e7d8a2e6af7", "score": "0.6696149", "text": "def update(attrs)\n super(attrs)\n end", "title": "" }, { "docid": "092b765ad7cf3ce4b6bf4e7d8a2e6af7", "score": "0.6696149", "text": "def update(attrs)\n super(attrs)\n end", "title": "" }, { "docid": "092b765ad7cf3ce4b6bf4e7d8a2e6af7", "score": "0.6696149", "text": "def update(attrs)\n super(attrs)\n end", "title": "" }, { "docid": "092b765ad7cf3ce4b6bf4e7d8a2e6af7", "score": "0.6696149", "text": "def update(attrs)\n super(attrs)\n end", "title": "" }, { "docid": "d9b090f93fdffad34c5489c4c437c6f3", "score": "0.6662612", "text": "def update_properties(properties_element)\n end", "title": "" }, { "docid": "b7ed68c679d7eaccf546a282fab6e985", "score": "0.66259164", "text": "def apply\n update_keys\n update_columns\n update_properties\n end", "title": "" }, { "docid": "769b77b7f7f9f82ae847f5968eb201dc", "score": "0.6571848", "text": "def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end", "title": "" }, { "docid": "769b77b7f7f9f82ae847f5968eb201dc", "score": "0.6571848", "text": "def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end", "title": "" }, { "docid": "137759bf2b87f1ca55eb78e668747d15", "score": "0.6539236", "text": "def update!(**args)\n @property = args[:property] if args.key?(:property)\n end", "title": "" }, { "docid": "137759bf2b87f1ca55eb78e668747d15", "score": "0.6539236", "text": "def update!(**args)\n @property = args[:property] if args.key?(:property)\n end", "title": "" }, { "docid": "137759bf2b87f1ca55eb78e668747d15", "score": "0.6539236", "text": "def update!(**args)\n @property = args[:property] if args.key?(:property)\n end", "title": "" }, { "docid": "137759bf2b87f1ca55eb78e668747d15", "score": "0.6539236", "text": "def update!(**args)\n @property = args[:property] if args.key?(:property)\n end", "title": "" }, { "docid": "137759bf2b87f1ca55eb78e668747d15", "score": "0.6539236", "text": "def update!(**args)\n @property = args[:property] if args.key?(:property)\n end", "title": "" }, { "docid": "137759bf2b87f1ca55eb78e668747d15", "score": "0.6539236", "text": "def update!(**args)\n @property = args[:property] if args.key?(:property)\n end", "title": "" }, { "docid": "862f7aa179e3e1751693f78772c09a99", "score": "0.65159345", "text": "def assign_properties(properties); end", "title": "" }, { "docid": "328c68b6c30673dac05ca930f5da533c", "score": "0.6458067", "text": "def update_attributes(attrs)\n self.update(attrs)\n end", "title": "" }, { "docid": "328c68b6c30673dac05ca930f5da533c", "score": "0.6458067", "text": "def update_attributes(attrs)\n self.update(attrs)\n end", "title": "" }, { "docid": "d8b3bf9ec121e23dad3af2edca6e6094", "score": "0.6421526", "text": "def update(attributes); end", "title": "" }, { "docid": "63cce5e99d8dc677403b00708afc27c9", "score": "0.641709", "text": "def update\n @prop.update_attributes(prop_params)\n respond_with @prop, location: backstage_scene_props_path\n end", "title": "" }, { "docid": "3dc790e8b6e9e65eb288c97798a4c7f2", "score": "0.64154994", "text": "def set_properties inst\n model.properties.find_all { |p| model.updatable?(p.name) }.each do |p|\n inst.send(\"#{p.name}=\".to_sym, params[p.name.to_s]) if params.has_key?(p.name.to_s)\n end\n inst\n end", "title": "" }, { "docid": "9373755ebb61f1f274f6c8504a5acace", "score": "0.64146614", "text": "def reload(props = {})\n reset_changes\n super\n assign_attributes(props)\n self\n end", "title": "" }, { "docid": "fb68247cb1373a6c71a42a2aa69f1dcb", "score": "0.64143723", "text": "def update(attrs)\n @attrs = attrs\n self\n end", "title": "" }, { "docid": "fb68247cb1373a6c71a42a2aa69f1dcb", "score": "0.64143723", "text": "def update(attrs)\n @attrs = attrs\n self\n end", "title": "" }, { "docid": "23eb6f5fbeae4bf9f56ac93a4126b4b5", "score": "0.6389745", "text": "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end", "title": "" }, { "docid": "71d6a0160cffce28db4d0a25d6dbda13", "score": "0.6385747", "text": "def update!(**args)\n @count = args[:count] if args.key?(:count)\n @properties = args[:properties] if args.key?(:properties)\n end", "title": "" }, { "docid": "9b95f8bc66f32e7ebbe7e63224d1ebaf", "score": "0.6364864", "text": "def update(attributes)\n attributes.each do |name, value|\n self[name] = value\n end\n end", "title": "" }, { "docid": "575f3d0c94f466263e302883e13868a6", "score": "0.6330631", "text": "def _update\n update!\n end", "title": "" }, { "docid": "7c6d5966289f9347f75aa7b24903a328", "score": "0.6327251", "text": "def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type]))) unless attribute_get(property).nil?\n end\n end\n @attributes[:original][property] = attribute_get(property)\n @dirty[property] = nil\n @attributes[:copied][property] = NOT_SET\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end", "title": "" }, { "docid": "210886bcfd68fae88847f8b3464d4058", "score": "0.6325362", "text": "def update_properties!(scraper)\n log \"Updating assets for #{self.slug}\"\n# only update active properties\n Property.where(source_id: self.id, status: 1).find_each do |prop|\n begin\n scraper.update_property(prop)\n rescue Exception => e\n log \"there was a connection error #{e.message} - #{e.class}\"\n end\n end\n end", "title": "" }, { "docid": "da63345424fc9aecef032928485bd149", "score": "0.6319025", "text": "def update\n \n end", "title": "" }, { "docid": "749afa4ff068e21c7d78bbad94c19d6c", "score": "0.6313444", "text": "def update!(attributes); end", "title": "" }, { "docid": "e8639be61ed6393bc612a8aef27789d3", "score": "0.6312355", "text": "def update!(**args)\n @border = args[:border] if args.key?(:border)\n @fields = args[:fields] if args.key?(:fields)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n end", "title": "" }, { "docid": "6284f332cbe8c998b16d5e816c5d21ed", "score": "0.6291622", "text": "def update!(**args)\n @display_name = args[:display_name] if args.key?(:display_name)\n @parent = args[:parent] if args.key?(:parent)\n @property = args[:property] if args.key?(:property)\n @property_type = args[:property_type] if args.key?(:property_type)\n end", "title": "" }, { "docid": "6284f332cbe8c998b16d5e816c5d21ed", "score": "0.6291622", "text": "def update!(**args)\n @display_name = args[:display_name] if args.key?(:display_name)\n @parent = args[:parent] if args.key?(:parent)\n @property = args[:property] if args.key?(:property)\n @property_type = args[:property_type] if args.key?(:property_type)\n end", "title": "" }, { "docid": "5a8e82caac01cee661bc875a5b0cf723", "score": "0.6283673", "text": "def refresh\n set_attributes\n end", "title": "" }, { "docid": "9e076ce17f1607b2a6248469b63b9c05", "score": "0.62797445", "text": "def training_updated_properties=(value)\n @training_updated_properties = value\n end", "title": "" }, { "docid": "309d8f89c45737b781ca7c15a61b00a5", "score": "0.6273536", "text": "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @size_bytes = args[:size_bytes] if args.key?(:size_bytes)\n end", "title": "" }, { "docid": "309d8f89c45737b781ca7c15a61b00a5", "score": "0.6273536", "text": "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @size_bytes = args[:size_bytes] if args.key?(:size_bytes)\n end", "title": "" }, { "docid": "60d8c4f58de490a0d7cdd918c16a2cce", "score": "0.6269463", "text": "def update(attrs)\n @attrs.update(attrs)\n self\n end", "title": "" }, { "docid": "60d8c4f58de490a0d7cdd918c16a2cce", "score": "0.6269463", "text": "def update(attrs)\n @attrs.update(attrs)\n self\n end", "title": "" }, { "docid": "60d8c4f58de490a0d7cdd918c16a2cce", "score": "0.6269463", "text": "def update(attrs)\n @attrs.update(attrs)\n self\n end", "title": "" }, { "docid": "60d8c4f58de490a0d7cdd918c16a2cce", "score": "0.6269463", "text": "def update(attrs)\n @attrs.update(attrs)\n self\n end", "title": "" }, { "docid": "7a41bc9d5a07220fb8626d1fa90d2d79", "score": "0.62639254", "text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end", "title": "" }, { "docid": "f88ac8dac0e7b4769636f755e65a14ba", "score": "0.6261997", "text": "def update!(**args)\n @fields = args[:fields] if args.key?(:fields)\n @properties = args[:properties] if args.key?(:properties)\n end", "title": "" }, { "docid": "f88ac8dac0e7b4769636f755e65a14ba", "score": "0.6261997", "text": "def update!(**args)\n @fields = args[:fields] if args.key?(:fields)\n @properties = args[:properties] if args.key?(:properties)\n end", "title": "" }, { "docid": "f88ac8dac0e7b4769636f755e65a14ba", "score": "0.6261997", "text": "def update!(**args)\n @fields = args[:fields] if args.key?(:fields)\n @properties = args[:properties] if args.key?(:properties)\n end", "title": "" }, { "docid": "f88ac8dac0e7b4769636f755e65a14ba", "score": "0.6261997", "text": "def update!(**args)\n @fields = args[:fields] if args.key?(:fields)\n @properties = args[:properties] if args.key?(:properties)\n end", "title": "" }, { "docid": "f88ac8dac0e7b4769636f755e65a14ba", "score": "0.6261997", "text": "def update!(**args)\n @fields = args[:fields] if args.key?(:fields)\n @properties = args[:properties] if args.key?(:properties)\n end", "title": "" }, { "docid": "f88ac8dac0e7b4769636f755e65a14ba", "score": "0.6261997", "text": "def update!(**args)\n @fields = args[:fields] if args.key?(:fields)\n @properties = args[:properties] if args.key?(:properties)\n end", "title": "" }, { "docid": "afd53a32bf51a2ff3c438cbf011b1ee6", "score": "0.6261246", "text": "def update!\n saved = false\n retries = RETRIES\n while !saved\n begin\n res = Persistence::Setup.db.save_doc(@properties)\n @properties = Persistence::Setup.db.get(res['id'])\n saved = true\n rescue Exception => ex\n raise ex if ex.http_code != 409\n if(retries > 0)\n @new_properties = Persistence::Setup.db.get(@properties['_id'])\n @properties.each_pair do |k,v|\n if k != \"_rev\" && k != \"_id\"\n @new_properties[k] = v\n end\n end\n @properties = @new_properties\n else\n raise ex\n end\n end\n end\n :ok\n end", "title": "" }, { "docid": "118090da310d688caa13dea348732f3c", "score": "0.62579167", "text": "def update(attributes={})\n self.class.update(self, attributes)\n end", "title": "" }, { "docid": "91dc386ff8fa066852510a5d62b13078", "score": "0.62170374", "text": "def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end", "title": "" }, { "docid": "91dc386ff8fa066852510a5d62b13078", "score": "0.62170374", "text": "def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end", "title": "" }, { "docid": "6249943d1eeff63f8f611fcf73254058", "score": "0.62152076", "text": "def update\n \n end", "title": "" }, { "docid": "1c12f310aca206a2cefff8c291007668", "score": "0.6210263", "text": "def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end", "title": "" }, { "docid": "3dfb66c3e13f181393bb4510e9fcd51f", "score": "0.62083745", "text": "def set_update(attrs = {})\n @movement.attributes = attrs.slice(*attributes_for_update)\n set_details\n\n @movement.balance = get_updated_balance\n @movement.gross_total = original_total\n @movement.set_state_by_balance!\n @movement.discounted = ( discount > 0 )\n\n @movement.balance_inventory = balance_inventory\n @movement.delivered = @movement.details.all? {|v| v.balance <= 0}\n\n @errors.new(movement).set_errors\n end", "title": "" }, { "docid": "1c0316f22c6db917fa4719767b5326a9", "score": "0.6204041", "text": "def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end", "title": "" }, { "docid": "5d229ea224b1dfa7ac9ce6808ca63fc4", "score": "0.62017816", "text": "def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end", "title": "" }, { "docid": "6992c0833b982296b329ec1d8c7289de", "score": "0.6201711", "text": "def update(attributes = {})\n self.attributes = attributes\n _update\n end", "title": "" }, { "docid": "2beb42793217599eea1dac4b91640e41", "score": "0.6196084", "text": "def update_attributes\n server_update_data.each_pair do |key, value|\n instance_variable_set(\"@#{key}\", value)\n end\n end", "title": "" }, { "docid": "67f76e6622d1021031437ad609613c63", "score": "0.6192824", "text": "def update(obj)\n obj.each_pair do |key, value|\n send(\"#{key}=\", value)\n end\n self\n end", "title": "" }, { "docid": "30aa07725af2114280d6e8f916ab079f", "score": "0.6183338", "text": "def update!\n\t\t\tconstruct!(self, &@update)\n\t\t\t@update = nil\n\t\t\t\n\t\t\treturn self\n\t\tend", "title": "" }, { "docid": "f1f71f298690a3bd1f5832b15038d8bb", "score": "0.6174291", "text": "def updated_properties\n @updated_properties ||= ActiveSupport::HashWithIndifferentAccess.new\n end", "title": "" }, { "docid": "e1f766468b11768b786daa133483b157", "score": "0.61730784", "text": "def update\n raise NotImplementedError\n end", "title": "" }, { "docid": "ed1b58af16fd466e308ffc9229115e36", "score": "0.6145399", "text": "def update_attributes(params)\n raise(RHapi::AttributeError, \"The params must be a hash.\") unless params.is_a?(Hash)\n params.each do |name, value|\n self.properties.send(name.to_s + '=', value)\n end\n save # only call API once rather than repeatedly saving with update_attribute calls\n end", "title": "" }, { "docid": "ed1b58af16fd466e308ffc9229115e36", "score": "0.6145399", "text": "def update_attributes(params)\n raise(RHapi::AttributeError, \"The params must be a hash.\") unless params.is_a?(Hash)\n params.each do |name, value|\n self.properties.send(name.to_s + '=', value)\n end\n save # only call API once rather than repeatedly saving with update_attribute calls\n end", "title": "" }, { "docid": "147d62c4df79ff1ca86cbd477112bf7f", "score": "0.61445665", "text": "def update\n end", "title": "" }, { "docid": "147d62c4df79ff1ca86cbd477112bf7f", "score": "0.61445665", "text": "def update\n end", "title": "" }, { "docid": "147d62c4df79ff1ca86cbd477112bf7f", "score": "0.61445665", "text": "def update\n end", "title": "" }, { "docid": "7f11aed7030229ef429116ccba78c00f", "score": "0.61400205", "text": "def update_properties\n # t_init = 0, t_mod = 0, t_formula = 0, t_formula_mod = 0, t_post_init = 0\n # t_update_properties = Benchmark.measure do\n # Reset values for everything except formulas\n # t_init = Benchmark.measure do\n character_properties.reject { |p| p.is_a?(CharacterFormula) }.each do |p|\n p.init(self)\n end\n # end\n\n # Apply modifiers to attributes, skills and resistances (formulas later)\n mods = []\n # t_mod = Benchmark.measure do\n mods << race.property_modifiers if race\n mods << birthsign.property_modifiers if birthsign\n mods.flatten!\n mods.reject { |m| m.property.is_a?(Formula) }.each(&method(:apply_modifier))\n # end\n\n # Now start to process formulas\n # t_formula = Benchmark.measure do\n character_properties.select { |p| p.is_a?(CharacterFormula) }.each do |f|\n f.init(self)\n end\n # end\n\n # Apply modifiers to formulas\n # t_formula_mod = Benchmark.measure do\n mods.select { |m| m.property.is_a?(Formula) }.each(&method(:apply_modifier))\n # end\n\n # t_post_init = Benchmark.measure do\n character_properties.each do |prop|\n prop.post_init(self)\n end\n # end\n # end\n\n # logger.warn(\"## Init: #{(t_init.real*1000).to_i}ms\")\n # logger.warn(\"## Mofifiers: #{(t_mod.real*1000).to_i}ms\")\n # logger.warn(\"## Formula: #{(t_formula.real*1000).to_i}ms\")\n # logger.warn(\"## Formula Modifiers: #{(t_formula_mod.real*1000).to_i}ms\")\n # logger.warn(\"## Post Init: #{(t_post_init.real*1000).to_i}ms\")\n # logger.warn(\"### Update Properties: #{(t_update_properties.real*1000).to_i}ms\")\n end", "title": "" }, { "docid": "22a21a1959eeb926dfe475d8878239d7", "score": "0.6127356", "text": "def update\n connection.put(singleton_path(prefix_options), encode, self.class.headers).tap do |response|\n load_attributes_from_response(response)\n end\n end", "title": "" } ]
19b3a7e85ba3be2ccf206cfec3862ed5
Lets build in some color coding!
[ { "docid": "f3273b68953c9475592bbe8d377030fb", "score": "0.0", "text": "def red?\n failed? || deleting?\n end", "title": "" } ]
[ { "docid": "05897485e5c451786eb318c28eea977f", "score": "0.7950037", "text": "def color(color); end", "title": "" }, { "docid": "7f4eed0546c70579d913027c65a40641", "score": "0.78301007", "text": "def colorized?; end", "title": "" }, { "docid": "bb677b2240eeca2bf40fefef10d691ca", "score": "0.7690726", "text": "def colorize!(color_code) \"#{COLORS[color_code]}#{self.to_s}\\e[0m\" ; end", "title": "" }, { "docid": "ed418e69990ff95121622fc7043284ef", "score": "0.7609369", "text": "def get_color_code\n\t\t{ r: @term_hex[0], g: @term_hex[1], b: @term_hex[2], alpha: @term_hex[-1] }\n\tend", "title": "" }, { "docid": "a7ce1a15d78a511afcb88ff0a17de5a0", "score": "0.7553864", "text": "def hsla_color; end", "title": "" }, { "docid": "51a47d96af0565224e181f18ec51b018", "score": "0.7553336", "text": "def red\n colorize(31)\n end", "title": "" }, { "docid": "23e5cd4e752ab0b290a8aea2b390e814", "score": "0.75179434", "text": "def bg_red; use_code(41) end", "title": "" }, { "docid": "9e33df8ac7bb23f5af345909cdc7a46f", "score": "0.7495757", "text": "def colorize(text, color_code); \"\\e[#{color_code}m#{text}\\e[0m\"; end", "title": "" }, { "docid": "7e16b7310d090c383b367c8244e5657e", "score": "0.7425411", "text": "def green\n colorize(32)\n end", "title": "" }, { "docid": "610bf738f767bf842913cdc35de1152f", "score": "0.7392347", "text": "def colors; end", "title": "" }, { "docid": "ab9ebbf22d129223fd7b33686e842e31", "score": "0.72676516", "text": "def scan_for_colors; end", "title": "" }, { "docid": "4185b1810e3e32e50553d9dce5627e3b", "score": "0.72472405", "text": "def code\n index = 16 +\n RGB.to_ansi_domain(@red) * 36 +\n RGB.to_ansi_domain(@green) * 6 +\n RGB.to_ansi_domain(@blue)\n\n \"#{@ground_code};5;#{index}\"\n end", "title": "" }, { "docid": "22f9a851a13942db7de012c810cba9c9", "score": "0.72311634", "text": "def color\n case (@code.to_i / 100)\n when 2\n color = :green\n when 3\n color = :yellow\n when 4, 5\n color = :red\n else\n color = :blue\n end\n color\n end", "title": "" }, { "docid": "1a51407ea02673df9f677c4768ca5b10", "score": "0.71906507", "text": "def color; end", "title": "" }, { "docid": "1a51407ea02673df9f677c4768ca5b10", "score": "0.71906507", "text": "def color; end", "title": "" }, { "docid": "1a51407ea02673df9f677c4768ca5b10", "score": "0.71906507", "text": "def color; end", "title": "" }, { "docid": "7e07e7147b1f1ba6a91bd7638727f2ca", "score": "0.7152385", "text": "def red(text)\n colorize(text, 31)\nend", "title": "" }, { "docid": "55c8dff90f94d1cac97b428d660dbc9c", "score": "0.71278554", "text": "def color(code, str, partial = T.unsafe(nil)); end", "title": "" }, { "docid": "59b90e82d7aa7de05d969b410d8c9f60", "score": "0.7126811", "text": "def purple\n colorize(35)\n end", "title": "" }, { "docid": "50a8f4f850e3abf11f1c1df13520c431", "score": "0.71081483", "text": "def colorize!; @colors = true; end", "title": "" }, { "docid": "b3e3ce05e55a55b8ba67390202b8ec09", "score": "0.7095158", "text": "def bash_color_codes(string)\n string.gsub(\"\\e[0m\", '</span>').\n gsub(\"\\e[31m\", '<span class=\"color31\">').\n gsub(\"\\e[32m\", '<span class=\"color32\">').\n gsub(\"\\e[33m\", '<span class=\"color33\">').\n gsub(\"\\e[34m\", '<span class=\"color34\">').\n gsub(\"\\e[35m\", '<span class=\"color35\">').\n gsub(\"\\e[36m\", '<span class=\"color36\">').\n gsub(\"\\e[37m\", '<span class=\"color37\">')\n end", "title": "" }, { "docid": "4ec4a967dfd46714acbb45ae6075ea7b", "score": "0.70766354", "text": "def rgb_color; end", "title": "" }, { "docid": "c2ec7ee35ff8ee88a6fb994ad3742f48", "score": "0.7058925", "text": "def yellow\n colorize(33)\n end", "title": "" }, { "docid": "340f1c96e031223685e284929b231661", "score": "0.7057847", "text": "def color_codes\n {\n :black => 0, :light_black => 60,\n :red => 1, :light_red => 61,\n :green => 2, :light_green => 62,\n :yellow => 3, :light_yellow => 63,\n :blue => 4, :light_blue => 64,\n :magenta => 5, :light_magenta => 65,\n :cyan => 6, :light_cyan => 66,\n :white => 7, :light_white => 67,\n :default => 9\n }\n end", "title": "" }, { "docid": "488d58fdad890b118bc49d7551436a93", "score": "0.7046722", "text": "def color_code(val)\n if val.is_a? String\n code = val\n val = code.hex\n val = -1 if val == 0 && code != '00'\n elsif val.is_a? Fixnum\n code = val\n val = val.to_i\n code = '%02x' % val\n else\n return nil\n end\n\n if (0..255).cover? val\n code\n else\n nil\n end\n end", "title": "" }, { "docid": "2bedfaf2c4157d410cca484dc5fb90f1", "score": "0.7037359", "text": "def encode_color color\n\t\tcase color.downcase\n\t\twhen 'red', 'r' then Mastermind::COLORS[:red]\n\t\twhen 'green', 'g' then Mastermind::COLORS[:green]\n\t\twhen 'yellow', 'y' then Mastermind::COLORS[:yellow]\n\t\twhen 'blue', 'b' then Mastermind::COLORS[:blue]\n\t\twhen 'magenta', 'm' then Mastermind::COLORS[:magenta]\n\t\twhen 'cyan', 'c' then Mastermind::COLORS[:cyan]\n\t\telse nil\n\t\tend\n\tend", "title": "" }, { "docid": "458697e2dc78f15363f4acc85b4e6bbf", "score": "0.7022609", "text": "def green(text)\n colorize(text, 32)\nend", "title": "" }, { "docid": "e97f774e7fcffd83abbb371303393ab5", "score": "0.70191497", "text": "def red\n colorize(:red)\nend", "title": "" }, { "docid": "c7cc5555615f738c1bc20637bf0bc88c", "score": "0.6997183", "text": "def getColor(colorname)\n# @color = { \"white\" => assignColor256(\"white\",255,255,255),\n# \"black\" => assignColor256(\"black\",0,0,0),\n# \"orange\" => assignColor256(\"orange\",255,0,0),\n# \"red\" => assignColor256(\"red\",0,255,0),\n# \"blue\" => assignColor256(\"blue\",0,0,255),\n# \"grey\" => assignColor256(\"grey\",120,120,120),\n# } ;\n col = @color[colorname] ;\n if(col.nil?) then\n f = File::new(RGBFILE) ;\n rval = -1 ; gval = -1 ; bval = -1 ;\n while(entry = f.gets)\n\tentry.strip! ;\n\trstr,gstr,bstr,name = entry.split ;\n\tif(name == colorname) then\n\t rval = rstr.to_i * 256 ;\n\t gval = gstr.to_i * 256 ;\n\t bval = bstr.to_i * 256 ;\n\t break ;\n\tend\n end\n if(rval < 0) then\n\tif(colorname =~ /^\\#([0-9a-fA-F][0-9a-fA-F])([0-9a-fA-F][0-9a-fA-F])([0-9a-fA-F][0-9a-fA-F])$/) then\n\t rstr = $1 ; gstr = $2 ; bstr = $3 ;\n\t rval = rstr.hex * 256 ; \n\t gval = gstr.hex * 256 ; \n\t bval = bstr.hex * 256 ; \n\telse\n\t $stderr << \"unknown color name:\" << colorname << \"\\n\" ;\n\tend\n end\n col = assignColor(colorname,rval,gval,bval) ;\n end\n return col ;\n end", "title": "" }, { "docid": "a2b5c84ffe376d64b53992d823b3a8a7", "score": "0.69729483", "text": "def colorize(text, color_code)\n \"\\e[#{color_code}m#{text}\\e[0m\"\nend", "title": "" }, { "docid": "d49cf5e759640a337b360ca2e8f356d9", "score": "0.69721675", "text": "def rgb_code(red, green, blue, background = T.unsafe(nil)); end", "title": "" }, { "docid": "d49cf5e759640a337b360ca2e8f356d9", "score": "0.69721675", "text": "def rgb_code(red, green, blue, background = T.unsafe(nil)); end", "title": "" }, { "docid": "ffc5db7bb8774752035391c41638a25a", "score": "0.6970355", "text": "def color(*values); end", "title": "" }, { "docid": "ffc5db7bb8774752035391c41638a25a", "score": "0.6970355", "text": "def color(*values); end", "title": "" }, { "docid": "3dfb1c0efa88fdaecff522ea710b171e", "score": "0.6970221", "text": "def getColor(c)\n if c == \"r\" then return :red\n elsif c == \"b\" then return :blue\n elsif c == \"g\" then return :green\n elsif c == \"y\" then return :yellow\n elsif c == \"c\" then return :cyan\n elsif c == \"m\" then return :magenta\n end\nend", "title": "" }, { "docid": "26204ec8208a4de9928c5b06f47508dc", "score": "0.6948756", "text": "def scolora(str)\n str.to_s.\n gsub(/\\e\\[1;33m/,''). # colori 16\n gsub(/\\e\\[0m/,''). # colori 64k\n gsub(/\\e\\[38;\\d+;\\d+m/,'') # end color\nend", "title": "" }, { "docid": "3862085044ddc180c7b89eda2edbb8aa", "score": "0.6948061", "text": "def display_color_index\n require_color_echo_get\n\n CE.rainbow\n cnt = 134\n @padding = \" \" * 2\n\n header = \"OK, Let me check color index list... :)\"\n mes = CE.rainbow.get(@padding + \"-\" * cnt) + $/\n mes += @padding + \" \" * ((cnt - header.size)/2) + CE.rainbow.get(header) + $/\n mes += CE.rainbow.get(@padding + \"-\" * cnt) + $/\n\n mes += @padding\n 256.times do |i|\n num = i + 1\n mes += CE.fg(\"index#{num}\".intern).get(\"index#{num}\" + \" \" * (4 - num.to_s.size))\n mes += CE.bg(\"index#{num}\".intern).get(\" \" * 5)\n mes += \" \" * 3\n\n if num % 8 == 0\n mes += $/ * 2\n mes += @padding if num != 256\n end\n end\n print mes \n\n exit 0\nend", "title": "" }, { "docid": "d29c3c5edca1113deff72e069b334fe5", "score": "0.6937994", "text": "def interpret(num) \n case num\n when 0\n \"red\"\n when 1\n \"blue\"\n when 2\n \"green\"\n when 3\n \"yellow\"\n when 4\n \"black\"\n when 5\n \"white\" \n end\n end", "title": "" }, { "docid": "7df7aa28d53f34b09b5b0365c0c98980", "score": "0.6908392", "text": "def colorize(text, color_code)\n \"#{color_code}#{text}\\e[0m\"\nend", "title": "" }, { "docid": "f78a02a6d35be2e795bff3857060414c", "score": "0.6902371", "text": "def colorize(text, color_code)\n \"\\e[#{color_code}m#{text}\\e[0m\"\nend", "title": "" }, { "docid": "f78a02a6d35be2e795bff3857060414c", "score": "0.6902371", "text": "def colorize(text, color_code)\n \"\\e[#{color_code}m#{text}\\e[0m\"\nend", "title": "" }, { "docid": "f78a02a6d35be2e795bff3857060414c", "score": "0.6902371", "text": "def colorize(text, color_code)\n \"\\e[#{color_code}m#{text}\\e[0m\"\nend", "title": "" }, { "docid": "a9a220b604943eb374d5a4cb9f035e8e", "score": "0.68913376", "text": "def bg_dark_grey; use_code(100) end", "title": "" }, { "docid": "8d542773579d9ca131e8959b89a92472", "score": "0.6888312", "text": "def translate_num_to_color(num)\n case num\n when 1\n \"black\"\n when 2\n \"white\"\n when 3\n \"red\"\n when 4\n \"green\"\n end\n end", "title": "" }, { "docid": "b294466984695721d645e14da5daae7c", "score": "0.68544394", "text": "def generate_color_scheme\n if values_bits[Constants::V_Use_of_colors]<=2.5 #No colors \n if values_bits[Constants::V_Type_of_BG]<4.5 and @image_colors[0].get_lightness > Constants::Min_lightness#image as bg\n scheme = 'dark'\n elsif values_bits[Constants::V_Type_of_BG]<4.5 and @image_colors[0].get_lightness < Constants::Min_lightness\n scheme = 'light'\n elsif values_bits[Constants::V_Darkness]<=4.5#Light\n scheme = 'dark'\n elsif values_bits[Constants::V_Darkness]>=4.5#Dark\n scheme = 'light'\n end\n \n if scheme == 'dark'\n @colors[0]=Colour.new(255,255,255)\n @colors[1]=Colour.new\n @colors[2]=Colour.new\n @colors[3]=Colour.new\n @colors[4]=Colour.new(40,40,40)\n @colors[5]=Colour.new(55,55,55)\n @colors[6]=Colour.new(70,70,70)\n @colors[7]=Colour.new\n elsif scheme == 'light'\n @colors[0]=Colour.new\n @colors[1]=Colour.new(255,255,255)\n @colors[2]=Colour.new(255,255,255)\n @colors[3]=Colour.new(255,255,255)\n @colors[4]=Colour.new(240,240,240)\n @colors[5]=Colour.new(235,235,235)\n @colors[6]=Colour.new(230,230,230)\n @colors[7]=Colour.new(255,255,255)\n end\n \n else #Colors\n #Main color (colors[1] - colors[3])\n if values_bits[Constants::V_Main_color]<=2 #Complementary main pic\n @colors[1] = @image_colors[1].get_complementary\n elsif values_bits[Constants::V_Main_color]>2 and values_bits[Constants::V_Main_color]<=5 #Contrast main pic\n @colors[1] = @image_colors[1].get_contrasted\n elsif values_bits[Constants::V_Main_color]>5 and values_bits[Constants::V_Main_color]<=8 #main_pic\n @colors[1] = @image_colors[1]\n else #random\n @colors[1] = Colour.new.get_random_color()\n end\n @colors[2] = colors[1].get_lighter\n @colors[3] = colors[1].get_darker\n \n #Accent colors (colors[4] - colors[6])\n if values_bits[Constants::V_Accent_colors]<=2 #secondary\n accent_colors = @image_colors[2].get_analogous\n @colors[4]=@image_colors[2]\n 2.times do |n|\n @colors[n+5] = accent_colors[n]\n end\n elsif values_bits[Constants::V_Accent_colors]>2 and values_bits[Constants::V_Accent_colors]<=4.5 #triadic\n accent_colors = colors[1].get_triadic\n 3.times do |n|\n @colors[n+4] = accent_colors[n]\n end\n elsif values_bits[Constants::V_Accent_colors]>4.5 and values_bits[Constants::V_Accent_colors]<=8 #analogous\n accent_colors = colors[1].get_analogous\n 3.times do |n|\n @colors[n+4] = accent_colors[n]\n end\n else #complementary\n @colors[4] = colors[1].get_complementary\n accent_colors = colors[4].get_analogous\n 2.times do |n|\n @colors[n+5] = accent_colors[n]\n end\n end\n \n #Background color (colors[0])\n if values_bits[Constants::V_BG_color]<7 #Plain background\n if values_bits[Constants::V_Darkness]>4.5 #Dark design \n @colors[0]=colors[1].get_dark\n else #Light design\n @colors[0]=colors[1].get_pale\n end\n else\n @colors[0]=Colour.new\n end\n \n #Text color (colors[7])\n if values_bits[Constants::V_Type_of_BG]>=4.5 #Contrast with plain background\n if values_bits[Constants::V_Darkness]<4.5 #Light bg\n @colors[7]=Colour.new\n else #Dark bg\n @colors[7]=Colour.new(255,255,255)\n end\n else #Contrast with picture as background\n if @image_colors[0].get_lightness > Constants::Min_lightness\n @colors[7]=Colour.new\n else\n @colors[7]=Colour.new(255,255,255)\n end\n end\n end\n \n @background = @colors[0]\n end", "title": "" }, { "docid": "37dd0514766f2fe16335d603801444a2", "score": "0.68496114", "text": "def to_color color\n \"\\x1b[#{COLOR_CODE[color]}m#{to_s}\\x1b[m\"\n end", "title": "" }, { "docid": "da55472418f42f74bfae8dcb7d5c1e98", "score": "0.68422246", "text": "def colour(name, text)\n if Pry.color\n str = Pry::Helpers::Text.send(name, text)\n unless str.start_with?(\"\\001\")\n str = \"\\001#{Pry::Helpers::Text.send name, '{text}'}\\002\".sub '{text}', \"\\002#{text}\\001\"\n end\n str\n else\n text\n end\nend", "title": "" }, { "docid": "11460e0fb15e474e494da5debac8ce60", "score": "0.6828137", "text": "def convert_code\n @code.map{ |num| translate_num_to_color(num) }\n end", "title": "" }, { "docid": "459b554a525c62c5ac5a05d9da5128fb", "score": "0.68226033", "text": "def colorize(color_code)\n \"\\e[#{color_code}m#{self}\\e[0m\"\n end", "title": "" }, { "docid": "459b554a525c62c5ac5a05d9da5128fb", "score": "0.68226033", "text": "def colorize(color_code)\n \"\\e[#{color_code}m#{self}\\e[0m\"\n end", "title": "" }, { "docid": "7b4e9133fcf7f302c76cbc0d9e22c947", "score": "0.68041736", "text": "def blue(text)\n colorize(text, 34)\nend", "title": "" }, { "docid": "d156accb29d72f98a5aa0bd1ecdb9787", "score": "0.67846245", "text": "def output_color(text, color=text.to_i)\r\n # Color matches: 1 - Black; 2 - White; 3 - Red; 4 - Yellow; 5 - Green; 6 - Blue; 7 - Gold\r\n colors = { 1 => 30, 2 => 36, 3 => 31, 4 => 33, 5 => 35, 6 => 34, 7 => 220 }\r\n # \\e[47m Is for the grey foreground \\e[{color} is for picking the color and \\e[0m is for resetting the terminal.\r\n \"\\e[1m\\e[47m\\e[#{colors[color]}m#{text}\\e[0m\\e[22m\"\r\n end", "title": "" }, { "docid": "05cde7b5585932443e29dc577bfa88c3", "score": "0.67819244", "text": "def colorize(color_code)\n \"\\e[#{color_code};40m#{self}\\e[0m\"\n end", "title": "" }, { "docid": "8a546d3e8f258891047555eb4d3885cf", "score": "0.67719555", "text": "def colour_for(char)\n return '' if char.colour == @colour\n\n @colour = char.colour\n @colour.to_s\n end", "title": "" }, { "docid": "a98a9668c8d55e0764817b5248c8b28e", "score": "0.67715776", "text": "def auxiliary_colour\n @cr[0xe] >> 4\n end", "title": "" }, { "docid": "262346afe58e0a7aaee42eaec14e8634", "score": "0.676894", "text": "def color_methods; end", "title": "" }, { "docid": "2a3d56de2e74f1b8b49dbc5e394b186b", "score": "0.6765832", "text": "def to_c\n\t\t\tif color == \"white\"\n\t\t\t\t\"\\u26aa\"\n\t\t\telsif color == \"red\"\n\t\t\t\t\"\\u26d4\"\n\t\t\telsif color == \"black\"\n\t\t\t\t\"\\u26ab\"\n\t\t\tend\n\t\tend", "title": "" }, { "docid": "dc3cfd0b9f9f4f4595ca842a9b4a2696", "score": "0.67576164", "text": "def colorize(text, color_code); \"#{color_code}#{text}\\033[0m\"; end", "title": "" }, { "docid": "36e47ff25a7f005d88138e14afb53878", "score": "0.6748657", "text": "def rainbow\n (0..256).each{ |color| \n print Paint[' ',48,5,color] # print empty bg color field\n }\n puts\n end", "title": "" }, { "docid": "0fbd245b208905d715054429b56bf626", "score": "0.6724963", "text": "def rainbow; end", "title": "" }, { "docid": "ad7ebc51e1735dd19298982132f378ca", "score": "0.67243415", "text": "def format_color(name, text)\n if Pry.color\n \"\\001#{Pry::Helpers::Text.send name, '{text}'}\\002\".sub '{text}', \"\\002#{text}\\001\"\n else\n text\n end\nend", "title": "" }, { "docid": "9f2101dbccf93c019de5ca7d104bec8c", "score": "0.6721673", "text": "def add_color\n if !color\n self.color = %w(\n #000000 #0000FF #00FF00 #FF0000 #FFFF00 #9900CC\n #CC0066 #00FFFF #FF00FF #C0C0C0 #00008B #FFD700\n #FFA500 #FF1493 #FF00FF #F0FFFF #EE82EE #D2691E\n #C0C0C0 #A52A2A #9ACD32 #9400D3 #8B008B #8B0000\n #87CEEB #808080 #800080 #008B8B #006400\n ).sample\n end\n end", "title": "" }, { "docid": "4f49349a1978a39d9b846dd0c70ea916", "score": "0.67161226", "text": "def pikapika\n puts \"▕▔╲┊┊┊┊┊┊┊╱▔▏┊┊┊\".colorize(:yellow)\n puts \"┊╲╱╲┊┊┊┊┊╱╲╱┊┊┊┊\".colorize(:yellow)\n puts \"┊┊╲┈╲▂▂▂╱┈╱┊┊┊╱╲\".colorize(:yellow)\n puts \"┊┊╱┈┈┈┈┈┈┈╲┊┊╱┈┈╲\".colorize(:yellow)\n puts \"┊┊▏▕▆▍▂▕▆▍▕┊╱┈┈┈╱\".colorize(:yellow)\n puts \"┊▕╭╮┈┳┻┳┈╭╮▏╲┈┈╱\".colorize(:yellow)\n puts \"┊┊╲╯┈╰━╯┈╰╱┊╱┈┈╲\".colorize(:yellow)\n puts \"┊┊╱┈┈┈┈┈┈┈╲┊╲┈┈┈╲\".colorize(:yellow)\n puts \"┊▕╲┈▕┈┈┈▏┈╱▏┊╱┈╱\".colorize(:yellow)\n puts \"┊▕┈▔▔┈┈┈▔▔┈▏╱┈╱┊\".colorize(:yellow)\n puts \"┊▕┈┈┈┈┈┈┈┈▕▔┈╱┊┊\".colorize(:yellow)\n puts \"┈┈╲┈┈┈┈┈┈┈╱▔▔┈┈┈\".colorize(:yellow)\n puts \"┈┈▕▂╱▔▔▔╲▂▏┈┈┈┈┈\".colorize(:yellow)\n #art from: http://textart4u.blogspot.com/2012/04/pikachu-text-art-ascii-art.html\nend", "title": "" }, { "docid": "c9809e1530d741bcb4047c4ab2467176", "score": "0.67140496", "text": "def colorize(* colors)\n buff = []\n colors.each{|color| buff << color_code(color)}\n buff << self << color_code(:off)\n buff.join\n end", "title": "" }, { "docid": "1a1ddb0f1c0c30c6ad369c046852dd57", "score": "0.6711941", "text": "def color(color_code = nil) # :nodoc:\n if color_code.respond_to?(:to_int) && color_code.respond_to?(:+)\n # the default color if arg is outside range,\n if color_code < 0 || 63 < color_code\n 0x7FFF\n # or an index < 8 mapped into the correct range,\n elsif color_code < 8\n (color_code + 8).to_i\n # or an integer in the valid range\n else\n color_code.to_i\n end\n elsif color_code.respond_to?(:to_sym)\n color_code = color_code.downcase.to_sym if color_code.respond_to?(:to_str)\n COLORS[color_code] || 0x7FFF\n else\n 0x7FFF\n end\n end", "title": "" }, { "docid": "12fe595ea3394c353b4d8f44b658a30b", "score": "0.6711721", "text": "def colors(warm, cool)\n puts \"#{warm} is a contrast color to #{cool}\"\nend", "title": "" }, { "docid": "95110c222f0d24d454daf7b60a40337d", "score": "0.6702821", "text": "def white\n colorize(37)\n end", "title": "" }, { "docid": "2ba28bf4293d9f363a06da98df7afde8", "score": "0.67003584", "text": "def red(str)\n \"\\e[31m#{str}\\e[0m\"\nend", "title": "" }, { "docid": "2ba28bf4293d9f363a06da98df7afde8", "score": "0.67003584", "text": "def red(str)\n \"\\e[31m#{str}\\e[0m\"\nend", "title": "" }, { "docid": "2ba28bf4293d9f363a06da98df7afde8", "score": "0.67003584", "text": "def red(str)\n \"\\e[31m#{str}\\e[0m\"\nend", "title": "" }, { "docid": "2ba28bf4293d9f363a06da98df7afde8", "score": "0.67003584", "text": "def red(str)\n \"\\e[31m#{str}\\e[0m\"\nend", "title": "" }, { "docid": "2ba28bf4293d9f363a06da98df7afde8", "score": "0.67003584", "text": "def red(str)\n \"\\e[31m#{str}\\e[0m\"\nend", "title": "" }, { "docid": "ada7533b5418f3c800cbf7d8129a98f0", "score": "0.669725", "text": "def colour(name, text)\n if Pry.color\n \"\\001#{Pry::Helpers::Text.send name, '{text}'}\\002\".sub '{text}', \"\\002#{text}\\001\"\n else\n text\n end\nend", "title": "" }, { "docid": "1e1c1538dcf5d0dc00d6e944cff05542", "score": "0.6685961", "text": "def r; self.color.r end", "title": "" }, { "docid": "43c6fa522593dbd796552a1ad76ae50c", "score": "0.66848457", "text": "def strip_color_codes(text); end", "title": "" }, { "docid": "b53df4370d4c05b56931e69c50a84535", "score": "0.6677242", "text": "def background_color(color); end", "title": "" }, { "docid": "3369a63514d7c331f876b1128686a1b5", "score": "0.6668459", "text": "def color(color_code)\n colors = color_code.scan(/\\d+/)\n\n # Extended set foreground x-term color\n if colors[0] == \"38\" && colors[1] == \"5\"\n return @fg_color = \"term-fgx#{colors[2]}\"\n end\n\n # Extended set background x-term color\n if colors[0] == \"48\" && colors[1] == \"5\"\n return @bg_color = \"term-bgx#{colors[2]}\"\n end\n\n # If multiple colors are defined, i.e. \\e[30;42m\\e then loop through each\n # one, and assign it to @fg_color or @bg_color\n colors.each do |cc|\n c_integer = cc.to_i\n\n # Reset all styles\n if c_integer == 0\n @fg_color = nil\n @bg_color = nil\n @other_colors = []\n\n # Primary (default) font\n elsif c_integer == 10\n # no-op\n\n # Turn off bold / Normal color or intensity (21 & 22 essentially do the same thing)\n elsif c_integer == 21 || c_integer == 22\n @other_colors.delete(\"term-fg1\")\n @other_colors.delete(\"term-fg2\")\n\n # Turn off italic\n elsif c_integer == 23\n @other_colors.delete(\"term-fg3\")\n\n # Turn off underline\n elsif c_integer == 24\n @other_colors.delete(\"term-fg4\")\n\n # Turn off crossed-out\n elsif c_integer == 29\n @other_colors.delete(\"term-fg9\")\n\n # Reset foreground color only\n elsif c_integer == 39\n @fg_color = nil\n\n # Reset background color only\n elsif c_integer == 49\n @bg_color = nil\n\n # 30–37, then it's a foreground color\n elsif c_integer >= 30 && c_integer <= 37\n @fg_color = \"term-fg#{cc}\"\n\n # 40–47, then it's a background color.\n elsif c_integer >= 40 && c_integer <= 47\n @bg_color = \"term-bg#{cc}\"\n\n # 90-97 is like the regular fg color, but high intensity\n elsif c_integer >= 90 && c_integer <= 97\n @fg_color = \"term-fgi#{cc}\"\n\n # 100-107 is like the regular bg color, but high intensity\n elsif c_integer >= 100 && c_integer <= 107\n @fg_color = \"term-bgi#{cc}\"\n\n # 1-9 random other styles\n elsif c_integer >= 1 && c_integer <= 9\n @other_colors << \"term-fg#{cc}\"\n end\n end\n end", "title": "" }, { "docid": "242a01644d9abe65aeb954c3fdcc23c7", "score": "0.6663227", "text": "def color_map\n {\n 'high_risk_ice_check_in' => '#800080',\n 'friend_in_detention' => '#e83737',\n }\n end", "title": "" }, { "docid": "5de9ba601c3c5b240be34c33940ed529", "score": "0.66624075", "text": "def back_color1\n Color.new(0, 0, 0, 192)\n end", "title": "" }, { "docid": "5de9ba601c3c5b240be34c33940ed529", "score": "0.66624075", "text": "def back_color1\n Color.new(0, 0, 0, 192)\n end", "title": "" }, { "docid": "edfcf94924cbe23330ff7e5582c8ebf8", "score": "0.66588604", "text": "def cyan; if @options[:colors]; \"\\e[1;36m\" else \"\" end end", "title": "" }, { "docid": "751baa2c5f169036d675e466210baa75", "score": "0.66510195", "text": "def color_for_string(string)\n @color_hash[string] ||= (Digest::MD5.hexdigest(string)[0..8].to_i(16) % 6) + 31\n end", "title": "" }, { "docid": "9b115ca1847e4891f6d9f3cade10eba6", "score": "0.6646064", "text": "def colors\n return\n end", "title": "" }, { "docid": "d48280eb08f0b099727d43679ac99601", "score": "0.6642337", "text": "def binary\n r, g, b, a = self.to_a\n sum = r + g + b\n return (sum < 382)? self.new_extended_color([0,0,0,a]) : self.new_extended_color([255,255,255,a])\n end", "title": "" }, { "docid": "2c4f64ecbfe02f4231b765892bec1815", "score": "0.66397196", "text": "def color_from_symbol(match, symbol); end", "title": "" }, { "docid": "a06607fc82008aa51142c0d0b72ce36c", "score": "0.66357183", "text": "def colors() = @colors ||= %i[blue green purple magenta cyan yellow red]", "title": "" }, { "docid": "7b876bedb023a52ceebc53bd0bfaa05a", "score": "0.6634557", "text": "def possible_colors\n %w(R G B Y)\n end", "title": "" }, { "docid": "865de5881bd2f28f4613aa3b7723c6ec", "score": "0.6628898", "text": "def rgb_style(string)\n pastel = Pastel.new\n styled_rgb = pastel.red(\"#{string[0]}\") + pastel.green(\"#{string[1]}\") + pastel.blue(\"#{string[2]}\")\n return styled_rgb\nend", "title": "" }, { "docid": "5c207401da5bbcb2f717624d77178b39", "score": "0.6625415", "text": "def color\n @color ||= COLORS[label.length%COLORS.length].to_sym\n end", "title": "" }, { "docid": "6a543a9396c10d224cb4b077865604cc", "score": "0.6623046", "text": "def hex_color(args = T.unsafe(nil)); end", "title": "" }, { "docid": "7541035d4fc4b18e16df8a4bdffbcf5b", "score": "0.66142803", "text": "def colorize(text, color = :default, bg_color = :default)\n colors = {\n :default => \"38\",\n :black => \"30\",\n :red => \"31\",\n :green => \"32\",\n :brown => \"33\",\n :blue => \"34\",\n :purple => \"35\",\n :cyan => \"36\",\n :gray => \"37\",\n :dark_gray => \"1;30\",\n :light_red => \"1;31\",\n :light_green => \"1;32\",\n :yellow => \"1;33\",\n :light_blue => \"1;34\",\n :light_purple => \"1;35\",\n :light_cyan => \"1;36\",\n :white => \"1;37\"\n }\n\n bg_colors = {\n :default => \"0\",\n :black => \"40\",\n :red => \"41\",\n :green => \"42\",\n :brown => \"43\",\n :blue => \"44\",\n :purple => \"45\",\n :cyan => \"46\",\n :gray => \"47\",\n :dark_gray => \"100\",\n :light_red => \"101\",\n :light_green => \"102\",\n :yellow => \"103\",\n :light_blue => \"104\",\n :light_purple => \"105\",\n :light_cyan => \"106\",\n :white => \"107\"\n }\n\n color_code = colors[color]\n bg_color_code = bg_colors[bg_color]\n return \"\\033[#{bg_color_code};#{color_code}m#{text}\\033[0m\"\nend", "title": "" }, { "docid": "fe75eb0fea2c0f175c0e54f0b9d3e5ae", "score": "0.6613049", "text": "def dopp_colour(name)\n dopp = SHA1.hexdigest(name)\n\tr = (128 + (dopp[0..1].hex)/2).to_s(16)\n\tg = (128 + (dopp[2..3].hex)/2).to_s(16)\n\tb = (128 + (dopp[4..5].hex)/2).to_s(16)\n return [r,g,b].join()\nend", "title": "" }, { "docid": "f311938c87432ecd680116f54e2894cd", "score": "0.6611649", "text": "def colorize(string, code)\n \"\\e[#{code}m#{string}\\e[0m\"\n end", "title": "" }, { "docid": "fd2159cfabd84fcec40081a2d5a23f3f", "score": "0.6597637", "text": "def color(text, color_code)\n \"#{color_code}#{text}\\e[0m\"\n end", "title": "" }, { "docid": "4f5cf16417b11fa7413dc8249e78ed83", "score": "0.6594824", "text": "def colorize txt, fg, bg, flags\n fgc = (fg.nil? || Color === fg ) ? fg : Color.parse(fg)\n bgc = (bg.nil? || Color === bg) ? bg : Color.parse(bg)\n esc = []\n esc << '01' if flags[:b]\n esc << '03' if flags[:i]\n esc << '04' if flags[:u]\n esc << '07' if flags[:r]\n esc << \"38;05;#{fgc.xterm256}\" if fgc\n esc << \"48;05;#{bgc.xterm256}\" if bgc\n \n esc.empty? ? txt : \"\\e[#{esc.join(';')}m#{txt}\\e[0m\" \n end", "title": "" }, { "docid": "655b41b347bb7a17990fe12799777ffa", "score": "0.6592464", "text": "def crisis_color\n return Color.new(255, 255, 64)\n end", "title": "" }, { "docid": "150bb85eb0889f04aea6011cee7efae8", "score": "0.65909606", "text": "def full_color_code(color)\n matched = color.match(REGEX_COLOR_CODE)\n raise ArgumentError, 'Ex: #222' if matched.nil?\n case matched[:color].length\n when 3; matched[:color] * 2\n when 6; matched[:color]\n else\n raise ArgumentError, \"Wrong color code, ex: #333 | #333333\"\n end\n end", "title": "" }, { "docid": "3fdf898ae907124a99796073d33c075d", "score": "0.6590013", "text": "def to_color(letter)\n case letter\n when \"r\"\n return :red\n when \"g\"\n return :green\n when \"b\"\n return :blue\n when \"c\"\n return :cyan\n when \"m\"\n return :magenta\n when \"y\"\n return :yellow\n else\n return letter\n end\nend", "title": "" }, { "docid": "76b02030c5e4810e3fb1905031681d58", "score": "0.6587795", "text": "def colored\n reparse\n parsed_colors[:string].apply_colors(parsed_colors[:colors])\n end", "title": "" }, { "docid": "517096bc5214b2fee5b76aee68b2d1cf", "score": "0.6581268", "text": "def colorize *args\n $terminal.color(*args)\nend", "title": "" }, { "docid": "84bb69b6465c6851b04419d7c2dbfbde", "score": "0.6576663", "text": "def colorize(text, color_code)\n \"\\e[0;#{color_code}m#{text}\"\nend", "title": "" } ]
c2e6e9a5a4e2a21d3249163a13d28ad0
DELETE /nested/pages/1 DELETE /nested/pages/1.json
[ { "docid": "4c516461d7637468f25c1aacf9607edf", "score": "0.8047365", "text": "def destroy\n @nested_page = Nested::Page.find(params[:id])\n @nested_page.destroy\n\n respond_to do |format|\n format.html { redirect_to nested_pages_url }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "f4879da218898dc53d5f7882d2f0ce15", "score": "0.7163484", "text": "def delete_page(id)\n @client.raw('delete', \"/content/pages/#{id}\")\n end", "title": "" }, { "docid": "52ceec00bbf9e533e07d35969e4fe5c8", "score": "0.7041004", "text": "def destroy\n @page = Page.find(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_pages_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "82932402b84caa9cd0076d22b7a5d49a", "score": "0.7017146", "text": "def destroy\n @structure_page = Structure::Page.find(params[:id])\n @structure_page.destroy\n\n respond_to do |format|\n format.html { redirect_to structure_pages_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "60d02cbee2a184b7b565e9b66d14e681", "score": "0.6955036", "text": "def destroy\n @page = Page.find(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to pages_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "60d02cbee2a184b7b565e9b66d14e681", "score": "0.6955036", "text": "def destroy\n @page = Page.find(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to pages_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "60d02cbee2a184b7b565e9b66d14e681", "score": "0.6955036", "text": "def destroy\n @page = Page.find(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to pages_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "e517ca6e22b176fa9d7a9d750974987b", "score": "0.69384205", "text": "def destroy\n @page = Page.find(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to pages_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e517ca6e22b176fa9d7a9d750974987b", "score": "0.69384205", "text": "def destroy\n @page = Page.find(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to pages_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e517ca6e22b176fa9d7a9d750974987b", "score": "0.69384205", "text": "def destroy\n @page = Page.find(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to pages_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e517ca6e22b176fa9d7a9d750974987b", "score": "0.69384205", "text": "def destroy\n @page = Page.find(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to pages_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e517ca6e22b176fa9d7a9d750974987b", "score": "0.69384205", "text": "def destroy\n @page = Page.find(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to pages_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e517ca6e22b176fa9d7a9d750974987b", "score": "0.69384205", "text": "def destroy\n @page = Page.find(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to pages_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e517ca6e22b176fa9d7a9d750974987b", "score": "0.69384205", "text": "def destroy\n @page = Page.find(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to pages_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e517ca6e22b176fa9d7a9d750974987b", "score": "0.69384205", "text": "def destroy\n @page = Page.find(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to pages_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2c7fa7814afc37bdba7831dcee8059b4", "score": "0.6896141", "text": "def destroy\n @page_hierarchy.destroy\n respond_to do |format|\n format.html { redirect_to page_hierarchies_url, notice: 'Page hierarchy was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4f9f93894a3f9485206cd5b155522009", "score": "0.6890004", "text": "def destroy\n @page = Page.friendly.find(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_pages_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f883c4a06daf92134a239166802ae82e", "score": "0.68830264", "text": "def destroy\r\n @page = Page.find(params[:id])\r\n @page.destroy\r\n File.delete(\"#{Rails.public_path}/#{@page.project_id}/#{@page.page_name}.html\")\r\n respond_to do |format|\r\n format.html { redirect_to pages_url }\r\n format.json { head :no_content }\r\n end\r\n end", "title": "" }, { "docid": "2030f4fbfaa1230d372b4b561e3bd3ce", "score": "0.6867536", "text": "def destroy\n @page.destroy\n respond_to do |format|\n format.html { redirect_to pages_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2030f4fbfaa1230d372b4b561e3bd3ce", "score": "0.6867536", "text": "def destroy\n @page.destroy\n respond_to do |format|\n format.html { redirect_to pages_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2030f4fbfaa1230d372b4b561e3bd3ce", "score": "0.6867536", "text": "def destroy\n @page.destroy\n respond_to do |format|\n format.html { redirect_to pages_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2030f4fbfaa1230d372b4b561e3bd3ce", "score": "0.6867536", "text": "def destroy\n @page.destroy\n respond_to do |format|\n format.html { redirect_to pages_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "687bbcdf0a6f6ad6b690abe9d7741f71", "score": "0.68652904", "text": "def destroy\n @page = Page.find(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.json { head :no_content }\n format.xml { head :no_content }\n end\n end", "title": "" }, { "docid": "6fd6e92c4da0474c412fcae2d3dc8226", "score": "0.68397635", "text": "def destroy\n @sub_page = SubPage.find(params[:id])\n @sub_page.destroy\n\n respond_to do |format|\n format.html { redirect_to(sub_pages_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "117a2e4c05c65f691faf89d2f3ae630b", "score": "0.6829493", "text": "def destroy\n @page.destroy\n respond_to do |format|\n format.html { redirect_to root_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2ea813b82cc0ad02f27da3febccbd421", "score": "0.6824089", "text": "def destroy\n @page = Page.find_by_slug(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to root_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "fc960e121c91d340520e5dcfedb001aa", "score": "0.6816904", "text": "def destroy\n @page = @site.pages.find(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to(@parent_page ? admin_site_page_children_url(@site, @parent_page) : admin_site_pages_url(@site)) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "04705ba7227e6ff0ac3c90494640b2ac", "score": "0.6812705", "text": "def destroy\n @page.destroy\n respond_to do |format|\n format.json { render :json => @page }\n format.xml { render :xml => @page }\n end\n end", "title": "" }, { "docid": "e4d17512f7477f17a63ebc9f7820edcf", "score": "0.6787317", "text": "def destroy\n @page = current_site.pages.find(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to edit_site_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a6d04b2e8617b1ef815d634ebaca6bb9", "score": "0.67573196", "text": "def destroy\n @page.destroy\n respond_to do |format|\n format.html { redirect_to admin_pages_url, notice: 'Страница успешно удалена!' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d1744f8884ac21887820b1217fa8d5a6", "score": "0.6740578", "text": "def destroy\n Page.find(params[:id]).destroy\n redirect_to pages_path\n end", "title": "" }, { "docid": "69b396eb239d48980ce62d746d4540da", "score": "0.67296046", "text": "def destroy\n\n # find the page with with\n @page = Page.find(params[:id])\n\n # calling class method of PagePart model to delete page parts of a page\n PagePart.delete_page_parts(@page)\n\n #destroy the page\n @page.destroy\n\n #sends in data in different format to index action\n respond_to do |format|\n\n format.html { redirect_to admin_pages_url }\n format.json { head :no_content }\n\n end # end respond_to block\n\n end", "title": "" }, { "docid": "82ec189bdce2de5d528b27e0ec732a11", "score": "0.671674", "text": "def delete; rest_delete(link('self')); end", "title": "" }, { "docid": "82ec189bdce2de5d528b27e0ec732a11", "score": "0.671674", "text": "def delete; rest_delete(link('self')); end", "title": "" }, { "docid": "6d5e97422a487d73e2f728678ba7e92c", "score": "0.6714909", "text": "def destroy\n @admin_page = Page.find(params[:id])\n @admin_page.destroy\n\n respond_to do |format|\n format.html { redirect_to(pages_url) }\n end\n end", "title": "" }, { "docid": "5af236095a1b12b536af90514511cfad", "score": "0.670353", "text": "def destroy\n @page = Page.find(params[:id])\n @page.destroy\n respond_with(@page, :status => :deleted, :location => pages_path)\n end", "title": "" }, { "docid": "a95d2233fc0dab6427f47e8a221900d0", "score": "0.6701848", "text": "def destroy\n @page = Page.find(params[:id])\n @page.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "b708f768f686fedd7435c11a1005ce47", "score": "0.6680382", "text": "def destroy\n @test_page = TestPage.find(params[:id])\n @test_page.destroy\n\n respond_to do |format|\n format.html { redirect_to test_pages_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "791d9ec74b503b42c2fa0d8973030086", "score": "0.6671267", "text": "def destroy\n @mypage = Mypage.find(params[:id])\n @mypage.destroy\n\n respond_to do |format|\n format.html { redirect_to mypages_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8f92df76b0a6cdb212db531941e984ee", "score": "0.66635585", "text": "def destroy \n # finds and delete page \n Page.find(params[:id]).destroy\n # take us back to all pages \n redirect_to pages_path\n end", "title": "" }, { "docid": "0e9767a7f7aef4264fe9ff7a4aabe69f", "score": "0.6661136", "text": "def destroy\n @page = Page.find(params[:id])\n @page.destroy\n respond_with(@page)\n end", "title": "" }, { "docid": "f55e7ee38a3d8a0abfcb1c50f793e330", "score": "0.6653138", "text": "def destroy\n @page = Page.find(params[:id])\n @page.destroy\n redirct_to root_path\n end", "title": "" }, { "docid": "de69c4aacf8c374d47097f5af4aaa061", "score": "0.66514164", "text": "def destroy\n @page.destroy\n respond_to do |format|\n format.html { redirect_to pages_url, :notice => \"Successfully deleted page. #{undo_link}\" }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2517c0623f4f559457e64a6877c46367", "score": "0.6647132", "text": "def destroy\n @oasis_page = OasisPage.find(params[:id])\n @oasis_page.destroy\n\n respond_to do |format|\n format.html { redirect_to oasis_pages_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "851d494b346a69c50f3d56f18c538ab8", "score": "0.6616766", "text": "def destroy\n @page_page.destroy\n respond_to do |format|\n format.html { redirect_to page_pages_url, notice: 'Page page was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7044002c0c414733a6bc7cf5807aab3f", "score": "0.66081715", "text": "def destroy\n @page = @user.pages.find_by_permalink(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to(pages_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "e6a0d6347869295022288becf7981947", "score": "0.66038656", "text": "def destroy\n @pageable = polymorphic_parent\n @page = polymorphic_parent.pages.find(params[:id])\n authorize! :destroy, @page\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to cooperative.person_pages_path(current_user) }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "df78043ac61061d3f2797c2d08742ce0", "score": "0.6603744", "text": "def destroy\n @page = current_cms.pages.find(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to(big_cms_pages_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fc64c3ef88da0d6182fd144ae09a40f4", "score": "0.6595747", "text": "def destroy\n @page = Page.find(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_pages_path }\n end\n end", "title": "" }, { "docid": "70c66a5819c1aceae9266ca2115d4b63", "score": "0.65931094", "text": "def destroy\n @page.destroy\n respond_to do |format|\n format.html { redirect_to pages_path(page: params[:page], type: params[:type]) }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a645d6876c355bac67be3acbbf8b4cc4", "score": "0.6593065", "text": "def destroy\n @admined_page1 = AdminedPage1.find(params[:id])\n @admined_page1.destroy\n\n respond_to do |format|\n format.html { redirect_to admined_page1s_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "37a7ab4a98f05fc3801266fd83ab35f5", "score": "0.6577772", "text": "def destroy\n @page.destroy\n respond_to do |format|\n format.html { redirect_to all_pages_path(:magazine_id=>@page.magazine_id), notice: 'Page was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "cb1073cee1de45ba4318729fe29e88cb", "score": "0.65706575", "text": "def destroy\n @page.destroy\n respond_to do |format|\n format.html { redirect_to pages_url, notice: 'Page was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "cb1073cee1de45ba4318729fe29e88cb", "score": "0.65706575", "text": "def destroy\n @page.destroy\n respond_to do |format|\n format.html { redirect_to pages_url, notice: 'Page was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "cb1073cee1de45ba4318729fe29e88cb", "score": "0.65706575", "text": "def destroy\n @page.destroy\n respond_to do |format|\n format.html { redirect_to pages_url, notice: 'Page was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "cb1073cee1de45ba4318729fe29e88cb", "score": "0.65706575", "text": "def destroy\n @page.destroy\n respond_to do |format|\n format.html { redirect_to pages_url, notice: 'Page was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "cb1073cee1de45ba4318729fe29e88cb", "score": "0.65706575", "text": "def destroy\n @page.destroy\n respond_to do |format|\n format.html { redirect_to pages_url, notice: 'Page was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "cb1073cee1de45ba4318729fe29e88cb", "score": "0.65706575", "text": "def destroy\n @page.destroy\n respond_to do |format|\n format.html { redirect_to pages_url, notice: 'Page was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "cb1073cee1de45ba4318729fe29e88cb", "score": "0.65706575", "text": "def destroy\n @page.destroy\n respond_to do |format|\n format.html { redirect_to pages_url, notice: 'Page was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "cb1073cee1de45ba4318729fe29e88cb", "score": "0.65706575", "text": "def destroy\n @page.destroy\n respond_to do |format|\n format.html { redirect_to pages_url, notice: 'Page was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "931bcfdac6939621e551be05c72460b4", "score": "0.6569499", "text": "def destroy\n @tree.destroy\n respond_to do |format|\n format.html { redirect_to trees_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "931bcfdac6939621e551be05c72460b4", "score": "0.6569499", "text": "def destroy\n @tree.destroy\n respond_to do |format|\n format.html { redirect_to trees_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "3590b74374a77c63f74fa9ca272a059a", "score": "0.6568856", "text": "def destroy\n @page = @chapter.pages.find_by_number(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to manga_chapter_url(@manga, @chapter) }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8ba2a856681ab2cb0132d411645e7ddb", "score": "0.65650177", "text": "def destroy\n @page = Page.find(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to(pages_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "8ba2a856681ab2cb0132d411645e7ddb", "score": "0.65650177", "text": "def destroy\n @page = Page.find(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to(pages_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "8ba2a856681ab2cb0132d411645e7ddb", "score": "0.65650177", "text": "def destroy\n @page = Page.find(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to(pages_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "8ba2a856681ab2cb0132d411645e7ddb", "score": "0.65650177", "text": "def destroy\n @page = Page.find(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to(pages_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "8ba2a856681ab2cb0132d411645e7ddb", "score": "0.65650177", "text": "def destroy\n @page = Page.find(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to(pages_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "8ba2a856681ab2cb0132d411645e7ddb", "score": "0.65650177", "text": "def destroy\n @page = Page.find(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to(pages_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "8ba2a856681ab2cb0132d411645e7ddb", "score": "0.65650177", "text": "def destroy\n @page = Page.find(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to(pages_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "8ba2a856681ab2cb0132d411645e7ddb", "score": "0.65650177", "text": "def destroy\n @page = Page.find(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to(pages_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "92e72407d4dc84dd3b220541d5009953", "score": "0.653189", "text": "def destroy\n @page = current_site.pages.find_by_permalink(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to pages_url }\n format.json { head :no_content }\n format.js\n end\n end", "title": "" }, { "docid": "a17807b644daf9bab250c8687b31e336", "score": "0.65269834", "text": "def destroy\n @admin_page.destroy\n respond_to do |format|\n format.html { redirect_to admin_pages_url, notice: 'Page was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "806f9286b4e56d8efa653abe61f51083", "score": "0.65168166", "text": "def destroy\n @section = Section.find(params[:id])\n @page = @section.page\n @section.destroy\n\n respond_to do |format|\n format.html { redirect_to @page, :notice => 'Section was successfully deleted.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8c102618d9458ad769be450e6c18f238", "score": "0.65107757", "text": "def destroy\n @page_template = PageTemplate.find(params[:id])\n @page_template.destroy\n\n respond_to do |format|\n format.html { redirect_to page_templates_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "aaf71154ed055390d100d306092b04f9", "score": "0.6492497", "text": "def destroy\n authorize! :destroy, @page\n @page.destroy\n respond_to do |format|\n format.html { redirect_to request.referer || pages_url, notice: 'Page was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c0b48cfd102772b6da9d6e3a0957828c", "score": "0.6486709", "text": "def destroy\n @page = Page.find(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to(page_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "23eeef22d37e2e61126239963b5cc899", "score": "0.648265", "text": "def destroy\n @page = Page.find_by_slug(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to(pages_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "bc20a7771ed7ac635d71d7cfe054c7f4", "score": "0.64741784", "text": "def destroy\n @document_page = DocumentPage.find(params[:id])\n @document_page.destroy\n\n respond_to do |format|\n format.html { redirect_to document_pages_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "bbbafc6d6af787010ada6ce15638f351", "score": "0.646883", "text": "def destroy\n @static_page = StaticPage.find(params[:id])\n @static_page.destroy\n\n respond_to do |format|\n format.html { redirect_to static_pages_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "4e5981dab3bd601930891e07602972c1", "score": "0.6468484", "text": "def destroy\n @page_type = PageType.find(params[:id])\n @page_type.destroy\n\n respond_to do |format|\n format.html { redirect_to page_types_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a29122cb6e3bc6cab191f93b7904ff0e", "score": "0.6464057", "text": "def destroy\n @pages_article = PagesArticle.find(params[:id])\n @pages_article.destroy\n\n respond_to do |format|\n format.html { redirect_to pages_articles_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8a68cbcf34869b1fdab1d65c531646e9", "score": "0.64627635", "text": "def destroy\n @static_page = StaticPage.find(params[:id])\n @static_page.destroy\n\n respond_to do |format|\n format.html { redirect_to static_pages_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8a68cbcf34869b1fdab1d65c531646e9", "score": "0.64627635", "text": "def destroy\n @static_page = StaticPage.find(params[:id])\n @static_page.destroy\n\n respond_to do |format|\n format.html { redirect_to static_pages_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a802c033a00c76b63cfe0a9c435c9e4c", "score": "0.64610827", "text": "def destroy\n @page = Page.find(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fe24f09d0bddeabddf6d6264fe779342", "score": "0.64610034", "text": "def destroy\n @page.destroy\n #Cache bust pages and individual page. With pagination we would only bust the cache on the paginated \"pages\" key.\n Rails.cache.delete(\"pages\")\n Rails.cache.delete(\"page-#{@page.id}\")\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "04812345a428dad2e15b5336ab5bc2e3", "score": "0.6450751", "text": "def destroy\n @tree = Tree.find(params[:id])\n @tree.destroy\n\n respond_to do |format|\n format.html { redirect_to trees_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8efbfaa76a200e42436910c82d9a57d4", "score": "0.6447695", "text": "def destroy\n @page.delete\n @message = {message: 'Page deleted'}\n respond_with(@message)\n end", "title": "" }, { "docid": "b857bac2baf9fc647949d7865ec230ae", "score": "0.6442737", "text": "def destroy\n @page.destroy\n respond_to do |format|\n format.html { redirect_to(admin_pages_url) }\n format.xml { head :ok }\n end\n website.add_log(user: current_user, action: \"Deleted page: #{@page.title}\")\n end", "title": "" }, { "docid": "689d5a07a403c4b765ba178e4aff08a3", "score": "0.64294136", "text": "def delete\n client.delete(\"/#{id}\")\n end", "title": "" }, { "docid": "9e45823e858ff3acb2fa4bd06a155e36", "score": "0.64208806", "text": "def destroy\n @main_page.destroy\n respond_to do |format|\n format.html { redirect_to main_pages_url, notice: 'Main page was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "3fa28b39caa6d5a1c7ab2db4f3690a21", "score": "0.6407418", "text": "def destroy\n @page.destroy\n\n respond_to do |wants|\n wants.html { redirect_to(admin_pages_url) }\n wants.xml { head :ok }\n end\n end", "title": "" }, { "docid": "7ddbcd302b5b01afd998f05d0e839fac", "score": "0.64044493", "text": "def destroy\n @child.destroy\n respond_to do |format|\n format.html { redirect_to children_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "390e12b36a193dc3709a82e9d0c66d55", "score": "0.63991845", "text": "def destroy\n @path = Path.find(params[:id])\n @path.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "bcbb050850f68e949ef8774ae141d293", "score": "0.63987905", "text": "def destroy\n @info_page = InfoPage.find(params[:id])\n @info_page.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_info_pages_path }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "fe305d294d7fcedc969c23a4617c644e", "score": "0.6397144", "text": "def delete_page(page)\n transaction \"delete `#{page.title}'\" do\n store.delete(page.title + '.md')\n end\n end", "title": "" }, { "docid": "76d67d6400b75ba7cd235179c715cc95", "score": "0.6395047", "text": "def destroy\n @page = Page.find(params[:id])\n @page.destroy\n respond_with(@page)\n end", "title": "" }, { "docid": "d9b2eed51b8694a36c9eebb6fcbc89ca", "score": "0.63926405", "text": "def destroy\n @page_trail.destroy\n respond_to do |format|\n format.html { redirect_to page_trails_url, notice: 'Page trail was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2d737dbbc6fa43aeb408fcba52f5058e", "score": "0.6380506", "text": "def destroy\n @inner_page = Embeddable::InnerPage.find(params[:id])\n respond_to do |format|\n format.html { redirect_to(inner_pages_url) }\n format.xml { head :ok }\n format.js\n end\n\n # TODO: We should move this logic into the model!\n @inner_page.page_elements.each do |pe|\n pe.destroy\n end\n @inner_page.destroy\n end", "title": "" }, { "docid": "5240a978543c392b68a435835ed2246e", "score": "0.6379273", "text": "def destroy\n @pagecontent = @page.pagecontents.find(params[:id])\n @pagecontent.destroy\n\n respond_to do |format|\n format.html { redirect_to(page_pagecontents_path(@page)) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "e7bbc9ab4372108efa7798ba64b1d17f", "score": "0.637538", "text": "def delete(path)\n root.delete(path)\n end", "title": "" } ]
f696e72899687905424f06e6ce21b8e5
GET /programme2013s GET /programme2013s.json
[ { "docid": "90154f646bc5b695aa627be173dc08fb", "score": "0.59581846", "text": "def index\n @programme2013s = Programme2013.where(\"date >= ?\", Date.today)\n @title = Time.now.year\n end", "title": "" } ]
[ { "docid": "3b0d7a0474272ee30bf08f2d96e6481c", "score": "0.7032636", "text": "def index\n @program = Program.all\n render json: {program: @program}\n end", "title": "" }, { "docid": "3da5e43634b2d8e498bd6ba28b7ea533", "score": "0.6848338", "text": "def index\n @programs = Program.order(\"name\").all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @programs }\n end\n end", "title": "" }, { "docid": "e48087f6837b11b0713f85da510f78f3", "score": "0.6639096", "text": "def index\n @programs = current_codabra.programs.all\n\n respond_with(@programs)\n end", "title": "" }, { "docid": "8a078f378949b688a1a32d9041fe6daa", "score": "0.6576959", "text": "def draft_prospects(year, **options) = get(\"/draft/#{year}/prospects\", **options)", "title": "" }, { "docid": "0ba1091e8f3dc10ea5b0a291572867a5", "score": "0.64386004", "text": "def program_search\n @programs = Program.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @program }\n end\n end", "title": "" }, { "docid": "4057af06f1e081cf6fbaffb9ae352871", "score": "0.64363843", "text": "def show\n @program = Program.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @program }\n end\n end", "title": "" }, { "docid": "4057af06f1e081cf6fbaffb9ae352871", "score": "0.64363843", "text": "def show\n @program = Program.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @program }\n end\n end", "title": "" }, { "docid": "4057af06f1e081cf6fbaffb9ae352871", "score": "0.64363843", "text": "def show\n @program = Program.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @program }\n end\n end", "title": "" }, { "docid": "4057af06f1e081cf6fbaffb9ae352871", "score": "0.64363843", "text": "def show\n @program = Program.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @program }\n end\n end", "title": "" }, { "docid": "a1583346ab87ad285bcd47f02e8b4f0f", "score": "0.6430018", "text": "def index\n\t\t@activities = Activity.find_by_programs\n\n\t\trespond_to do |format|\n\t\t\tformat.html # index.html.erb\n\t\t\tformat.json { render json: @activities }\n\t\tend\n\tend", "title": "" }, { "docid": "12d1d2426729840636ea7314abf5a92d", "score": "0.6407913", "text": "def show\n @programme = Programme.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @programme }\n end\n end", "title": "" }, { "docid": "293796fa8885732939310d444cb7815e", "score": "0.6407026", "text": "def show\n @program = Program.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @program }\n end\n end", "title": "" }, { "docid": "1c47946dc140bb146739d3abf8c4c993", "score": "0.63834167", "text": "def index\n @programmers = Programmer.all\n render json: @programmers\n end", "title": "" }, { "docid": "9e1cb89e51256f22a45e3fc74459c1a8", "score": "0.63700235", "text": "def index\n \n @programs = Program.all\n \n if params[:region]\n @programs = @programs.where(:region_id => Region.find_by_name(params[:region]))\n end\n \n if params[:sport]\n @programs = @programs.where(:sport_id => Sport.find_by_name(params[:sport]))\n end\n \n if params[:channel]\n @programs = @programs.where(:channel_id => Channel.find_by_name(params[:channel]))\n end\n \n @title = \"Programs | Sport on Television in Australia\"\n @breadcrumb = \"Programs\"\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @programs }\n end\n end", "title": "" }, { "docid": "ab38f45ad01b4b9cd27df4a89d9973fb", "score": "0.6341779", "text": "def program_index\n @sections = Section.where(program_id: params[:program_id])\n render \"api/sections/_index\"\n end", "title": "" }, { "docid": "fef46d48d2a4db3c83436cbfe9977510", "score": "0.6329256", "text": "def index\n day = params[:day]\n @singleVenue = Venue.count == 1\n \n PublishedProgrammeItem.uncached do\n conditions = getConditions(params)\n \n @programmeItems = PublishedProgramItemsService.getPublishedProgramItems day\n end\n \n @result = render_to_string( template: 'planner_konopas/program/_index.json.jbuilder', locals: { programmeItems: @programmeItems})\n if FeatureService.has? 'konopas'\n render js: \"var program = \" + @result #, :content_type => 'application/json'\n else\n render js: \"var program = []\"\n end\n end", "title": "" }, { "docid": "e3a614809a120de5dc8b90a12d5c5b08", "score": "0.630389", "text": "def index\n @programs = Program.all\n\n respond_to do |format|\n format.html # index.html.erb\n end\n end", "title": "" }, { "docid": "10306c067225b13ce3b1dad355f39e15", "score": "0.6297681", "text": "def index\n @production_years = ProductionYear.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @production_years }\n end\n end", "title": "" }, { "docid": "091c8df5e5ad8342d648171e39099300", "score": "0.6283658", "text": "def index\n @programme_types = ProgrammeType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @programme_types }\n end\n end", "title": "" }, { "docid": "b2f7f650f147c6032af8ffb351b7a1d4", "score": "0.62815785", "text": "def index\n @episodes = @program.episodes\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @episodes }\n end\n end", "title": "" }, { "docid": "a5fafae53a19481dac71d5503bcc77e0", "score": "0.6250523", "text": "def index\n @standings = Standing.order(:year)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @standings }\n end\n end", "title": "" }, { "docid": "f2ba841079f32ee0eb4299e95a4c5ac4", "score": "0.6237415", "text": "def index\n @priority_programs = PriorityProgram.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @priority_programs }\n end\n end", "title": "" }, { "docid": "84b6cb0b8e554e68fae1d83b275dd688", "score": "0.6217034", "text": "def index\n @live_programs = LiveProgram.all\n end", "title": "" }, { "docid": "eb639e85accd68f2d9ea1f66f739cad3", "score": "0.6208397", "text": "def index\n @programs = Program.all\n @programs = @programs.sort_by &:name\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @programs }\n end\n end", "title": "" }, { "docid": "679f318477e9b55b1101ae0b0580c835", "score": "0.62052315", "text": "def index\n @years = Year.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @years }\n end\n end", "title": "" }, { "docid": "536322ff5a255f55ea2089786d3f1114", "score": "0.6201975", "text": "def index\n @programations = Programation.all\n end", "title": "" }, { "docid": "e235e15efd1499a0ac7aa4295fbe541f", "score": "0.6170139", "text": "def index\n @programs = Program.all\n end", "title": "" }, { "docid": "e235e15efd1499a0ac7aa4295fbe541f", "score": "0.6170139", "text": "def index\n @programs = Program.all\n end", "title": "" }, { "docid": "e235e15efd1499a0ac7aa4295fbe541f", "score": "0.6170139", "text": "def index\n @programs = Program.all\n end", "title": "" }, { "docid": "e235e15efd1499a0ac7aa4295fbe541f", "score": "0.6170139", "text": "def index\n @programs = Program.all\n end", "title": "" }, { "docid": "e235e15efd1499a0ac7aa4295fbe541f", "score": "0.6170139", "text": "def index\n @programs = Program.all\n end", "title": "" }, { "docid": "e235e15efd1499a0ac7aa4295fbe541f", "score": "0.6170139", "text": "def index\n @programs = Program.all\n end", "title": "" }, { "docid": "e235e15efd1499a0ac7aa4295fbe541f", "score": "0.6170139", "text": "def index\n @programs = Program.all\n end", "title": "" }, { "docid": "45d376396e87995f5f0495a7875f9e64", "score": "0.61119217", "text": "def index\n @programme_requests = ProgrammeRequest.all\n end", "title": "" }, { "docid": "7a79770aa26ca2c83c3deb686f183b52", "score": "0.610607", "text": "def index\n # Restituisce tutti i corsi di studio del degree e dell'anno indicati\n @courses = @degree.courses.year(params[:year])\n\n render json: @courses\n end", "title": "" }, { "docid": "a9cf4ef5db2604247187e28c3cf3be65", "score": "0.6098427", "text": "def index\n @live_programs = LiveProgram.order('started_at DESC').page(params[:page]).per(30)\n end", "title": "" }, { "docid": "2dc239608873f01ad694981284159d62", "score": "0.60871935", "text": "def index\n @programs = Program.all\n @upcoming_progs = Program.upcoming\n @in_progress = Program.current\n end", "title": "" }, { "docid": "d69098e1b8ccda9e6d749e9c211f7f87", "score": "0.60760385", "text": "def index\n\n @response = HTTParty.get(\"http://www.sfu.ca/bin/wcm/course-outlines?2016/spring/cmpt/307/d100\")\n @http_party_json = JSON.parse(@response.body)\n @result = @response.body\n pp @http_party_json_year\n respond_to do |format|\n format.json {render :json => JSON.parse(@result)}\n format.html # index.html.erb\n end\nend", "title": "" }, { "docid": "da49975ba6495eab4ac0018afc989a1b", "score": "0.60754406", "text": "def index\n # @yearly_detail_years = YearlyDetailYear.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @yearly_detail_years }\n end\n end", "title": "" }, { "docid": "2aba877a7321a29b8be7a4918d85e1a2", "score": "0.60718143", "text": "def index\n @games = @game_week.games\n render json: @games\n end", "title": "" }, { "docid": "7990f667f698002e9cb176ba3043f6ba", "score": "0.60611033", "text": "def show\n @programa = Programa.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @programa }\n end\n end", "title": "" }, { "docid": "9a7ee2daa26cd4274b42a667f54a7444", "score": "0.6060332", "text": "def index\n @programs = Program.where(published: true)\n end", "title": "" }, { "docid": "21ab89f5cb7183145b29013ae2d23497", "score": "0.60509896", "text": "def index\n @projects = Project.all\n @projects_by_year = @projects.group_by(&:year)\n @year = params[:year] || @projects_by_year.keys.sort.last\n @projects = @projects_by_year[@year.to_i]\n @directions = @projects.map(&:direction)\n @programme = params[:programme]\n @directions_by_programme = @directions.group_by { |x| x.project.author.programme }\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @directions }\n format.xls { send_data Direction.to_xls, content_type: 'application/vnd.ms-excel' }\n end\n end", "title": "" }, { "docid": "718ccd0f7a02f27c5747ac671f30a2b6", "score": "0.6046591", "text": "def index\n @projects = Project.all\n @projects_by_year = @projects.group_by(&:year)\n @year = params[:year] || @projects_by_year.keys.sort.last\n @projects = @projects_by_year[@year.to_i]\n @authors = @projects.map(&:author).uniq\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @authors }\n end\n end", "title": "" }, { "docid": "8d7ea830088192e8bd569838014ff7e3", "score": "0.6024495", "text": "def index\n @applications = Application.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @applications }\n end\n end", "title": "" }, { "docid": "b5fb632f3b8c02263c739aeff9be9192", "score": "0.60109264", "text": "def show\n @user_program = UserProgram.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user_program }\n end\n end", "title": "" }, { "docid": "395044b6dbb34bc00f143ddb1d650907", "score": "0.60069484", "text": "def index\n @games = @match.games\n render json: @games, root: false\n end", "title": "" }, { "docid": "788f67781cfe3c09b183847b82fbff5b", "score": "0.6004056", "text": "def show\n @raw_program = RawProgram.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @raw_program }\n end\n end", "title": "" }, { "docid": "be0f491a5509b83ed048c493b1828187", "score": "0.6000941", "text": "def show\n @program = Program.find(params[:id])\n\n respond_with(@program)\n end", "title": "" }, { "docid": "13ad88dc9ea3ecb48733cf08cd9d547c", "score": "0.5993325", "text": "def index\n @workshop = Workshop.find_by_year(params[:workshop_id]) \n @courses = Course.scheduled.in_workshop(@workshop)\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @courses }\n end\n end", "title": "" }, { "docid": "6379638e957514df29efd4372e4a43b8", "score": "0.59871596", "text": "def index\n @competitions = Competition.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @competitions }\n end\n end", "title": "" }, { "docid": "6379638e957514df29efd4372e4a43b8", "score": "0.59871596", "text": "def index\n @competitions = Competition.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @competitions }\n end\n end", "title": "" }, { "docid": "ecd23d2642259ccb51ab9e519a60d88e", "score": "0.5980411", "text": "def index\n @periods = @organism.periods\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @periods }\n end\n end", "title": "" }, { "docid": "791de1c2f39095c7d99474310a41c242", "score": "0.59756434", "text": "def index\n @programs = Program.where(upcoming: true)\n @programs_upcomings = Program.where(upcoming: true)\n @program_all = Program.all.order('created_at DESC')\n end", "title": "" }, { "docid": "20bc6b2f842c4a3456d70752762aad89", "score": "0.5975629", "text": "def index\n if request.format == :json\n @model_years = ModelYear.all\n else\n @model_years = ModelYear.paginate(page: params[:page])\n end\n \n respond_to do |format|\n format.html\n format.json { render json: @model_years }\n end\n end", "title": "" }, { "docid": "4f0f090b43beeeef3f70106613622704", "score": "0.5943792", "text": "def show\n program_id = params[ :id ].to_i\n @program = Program.find( program_id )\n\n agency_related = create_graph_nodes( @program, 'public_agency_id',\n PublicAgency, 1 )\n last_id = Graph.id_node( agency_related[ 0 ].last[ 'id' ] )\n\n company_related = create_graph_nodes( @program, 'company_id',\n Company, last_id )\n company_related[ 0 ].delete_at( 0 )\n\n program_related = agency_related + company_related\n @data_program = program_related.to_json\n end", "title": "" }, { "docid": "9e19f8979b8737a90d2b6fd33c4defe8", "score": "0.5943424", "text": "def show\n @program = Program.find(params[:id])\n\n @title = \"Program: \" + @program.full_title + \" | Sport on Television in Australia\"\n @breadcrumb = \"Program: \"+ @program.full_title\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @program }\n end\n end", "title": "" }, { "docid": "363ea27b69cc5ca228c5baeebccc9d7f", "score": "0.5926687", "text": "def index\n @programmes = Programme.all\n end", "title": "" }, { "docid": "363ea27b69cc5ca228c5baeebccc9d7f", "score": "0.5926687", "text": "def index\n @programmes = Programme.all\n end", "title": "" }, { "docid": "b746f19bd5f8d4435dc852f6891eb342", "score": "0.5905586", "text": "def index\n @programas = Programa.all\n end", "title": "" }, { "docid": "b746f19bd5f8d4435dc852f6891eb342", "score": "0.5905586", "text": "def index\n @programas = Programa.all\n end", "title": "" }, { "docid": "0b6f6459373c3f3f2cdf4b6d9a50a45f", "score": "0.590161", "text": "def index\n @sponsors = Program.order('lower(program_name)').to_a\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @sponsors }\n end\n end", "title": "" }, { "docid": "4cf967fff42848b6c5265a7c71bf2838", "score": "0.5895025", "text": "def show\n @programset = Programset.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @programset }\n end\n end", "title": "" }, { "docid": "e77dbba8272d9967f91fe66f7f103c36", "score": "0.58945626", "text": "def show\n @programmer = Programmer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @programmer }\n end\n end", "title": "" }, { "docid": "f70e2bb359a7c18b12a578d196748d9b", "score": "0.589201", "text": "def index\n @apps = Application.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @apps }\n end\n end", "title": "" }, { "docid": "f24f50fdc0d89fafb6964f6b15c17d2c", "score": "0.5885274", "text": "def new\n @program = Program.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @program }\n end\n end", "title": "" }, { "docid": "f24f50fdc0d89fafb6964f6b15c17d2c", "score": "0.5885274", "text": "def new\n @program = Program.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @program }\n end\n end", "title": "" }, { "docid": "f24f50fdc0d89fafb6964f6b15c17d2c", "score": "0.5885274", "text": "def new\n @program = Program.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @program }\n end\n end", "title": "" }, { "docid": "d13359a6abf2ee12dd7d0abcc3213b02", "score": "0.58766377", "text": "def sympols_index_action\n response = Unirest.get(\"http://localhost:3000/sympols\")\n sympols = response.body\n puts JSON.pretty_generate(sympols)\n end", "title": "" }, { "docid": "b41659cb11a16d3ad42138a1f8c16740", "score": "0.58712614", "text": "def index\n @vip_programmers = Vip::Programmer.all.order(:name)\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render xml: @vip_programmer }\n format.json { render json: @vip_programmer }\n end\n end", "title": "" }, { "docid": "6e5ea799350dcf40b3bb3ed2268c786d", "score": "0.5870301", "text": "def show\n @program_manifest = ProgramManifest.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @program_manifest }\n end\n end", "title": "" }, { "docid": "96036da77dcfe101ccf7f0b750bf8225", "score": "0.58668184", "text": "def show\n @aq_program = AqProgram.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @aq_program }\n end\n end", "title": "" }, { "docid": "07adda0951182f3d332a003924e2dceb", "score": "0.5865307", "text": "def index\n @study_programs = StudyProgram.all\n end", "title": "" }, { "docid": "4291b5fc77fd5a9c314aae2e5eec398c", "score": "0.58508426", "text": "def show\n year = Year.find(params[:year])\n if year.present?\n render json: year.months\n else\n render json: { message: \"Year #{params[:year]} was not found\" }, status: :not_found\n end\n end", "title": "" }, { "docid": "aeeaeb7c38407de10815087d5c8b679c", "score": "0.58421504", "text": "def new\n @program = Program.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @program }\n end\n end", "title": "" }, { "docid": "e19bb6ef6bbe1e5889fd6aadef4d1caf", "score": "0.5820552", "text": "def index\n @projekts = Projekt.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projekts }\n end\n end", "title": "" }, { "docid": "6367531c9622904e7aa8a5b2a6d47dbc", "score": "0.5812699", "text": "def get_program_details! program\n response = @http.get \"/tvtid-app-backend/channels/#{program.channel_id}/programs/#{program.id}\", HTTP_REQUEST_HEADERS\n\n if response.code == '200'\n program.parse_json! MultiJson.load(response.body)\n end\n\n program\n end", "title": "" }, { "docid": "da799cfe31ecf5c2ffb939f8c1a88747", "score": "0.5809049", "text": "def index\n @clients_applications = ClientsApplication.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @clients_applications }\n end\n end", "title": "" }, { "docid": "ed2041fa9aa4c27ff8c2b3eb6df3118b", "score": "0.5804686", "text": "def index\n @programacions = Programacion.all\n end", "title": "" }, { "docid": "92b0a2b5f7ee3c3b774712474251dede", "score": "0.5800011", "text": "def index\n @payouts = Payout.order(:year)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @payouts }\n end\n end", "title": "" }, { "docid": "f716f883df8e3439bf6f449c9e8e37e1", "score": "0.5797914", "text": "def index\n @programs = Program.all\n @program = Program.new\n end", "title": "" }, { "docid": "872d12fe9e81747ddb454d602913243e", "score": "0.5797688", "text": "def index\n @registrations = Registration.where(year: 1)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @registrations }\n end\n end", "title": "" }, { "docid": "fd88a2245ad619bb7740cfc430408c01", "score": "0.5793147", "text": "def new\n @programme = Programme.new\n gon.programmes = Programme.all\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @programme }\n end\n end", "title": "" }, { "docid": "b6947a4807a0faa56a7b630ac2ccdd84", "score": "0.57917863", "text": "def index\n if request.format == :json\n @model_year_services = ModelYearService.includes(:service)\n else\n @model_year_services = ModelYearService.paginate(page: params[:page]).\n order(model_year_service_update_requests_count: :desc).\n includes(:service)\n end\n\n respond_to do |format|\n format.html\n format.json { render json: @model_year_services }\n end\n end", "title": "" }, { "docid": "b49a9213c2fcfbaf78c0ef75757e30ee", "score": "0.5787955", "text": "def index\n @games = Game.all\n render json: @games\n end", "title": "" }, { "docid": "b49a9213c2fcfbaf78c0ef75757e30ee", "score": "0.5787955", "text": "def index\n @games = Game.all\n render json: @games\n end", "title": "" }, { "docid": "6add403963bed4591875dd1f22e9524a", "score": "0.5781037", "text": "def my_loyalty_programs\n if @user\n @user_programs = @user.loyalty_programs\n if params[:q]\n @user_programs = @user.loyalty_programs.order(\"#{params[:q]} desc\")\n end\n render json: {\n success: true,\n programs: @user_programs.as_json({\n only: [:id, :name, :color_palette, :used_counter],\n methods: [:image_url, :icon_url],\n })\n }\n else\n render json: {\n success: false,\n message: \"Ooops! invalid access token\"\n }\n end\n end", "title": "" }, { "docid": "902554d85013ffc6f4d1cdcd1aaee099", "score": "0.57768255", "text": "def index\n @games = Game.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @games }\n end\n end", "title": "" }, { "docid": "902554d85013ffc6f4d1cdcd1aaee099", "score": "0.57768255", "text": "def index\n @games = Game.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @games }\n end\n end", "title": "" }, { "docid": "902554d85013ffc6f4d1cdcd1aaee099", "score": "0.57768255", "text": "def index\n @games = Game.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @games }\n end\n end", "title": "" }, { "docid": "902554d85013ffc6f4d1cdcd1aaee099", "score": "0.57768255", "text": "def index\n @games = Game.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @games }\n end\n end", "title": "" }, { "docid": "5068a0ca27ae23b1d06258f1bf2f195a", "score": "0.57755244", "text": "def index\n @games = Game.all\n render json: @games, status: 200\n end", "title": "" }, { "docid": "3e1bf5caec88aa41573b5189bc384a21", "score": "0.5771256", "text": "def index\n @programs = Program.all\n \n if params[:region]\n @programs = @programs.where(region_id: Region.find_by_name(params[:region]))\n end\n \n if params[:sport]\n @programs = @programs.where(sport_id: Sport.find_by_name(params[:sport]))\n end\n \n if params[:channel]\n @programs = @programs.where(channel_id: Channel.find_by_name(params[:channel]))\n end\n \n @title = \"Programs | Sport on Television in Australia\"\n @breadcrumb = \"Programs\"\n \n end", "title": "" }, { "docid": "52fadd4dd86cf0bb83307d8898c70fe9", "score": "0.57683754", "text": "def index\n @parroquia = Parroquia.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @parroquia }\n end\n end", "title": "" }, { "docid": "5e51bbef784614dcd442eae4c20c6351", "score": "0.57680637", "text": "def index\n # @yearly_detail_courses = YearlyDetailCourse.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @yearly_detail_courses }\n end\n end", "title": "" }, { "docid": "561a5d0728ccd54f1ab1a0f8cb75dd72", "score": "0.57653207", "text": "def index\n @timeperiods = Timeperiod.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @timeperiods }\n end\n end", "title": "" }, { "docid": "66332aa5f77cd377a39c47fbf22949fa", "score": "0.57631487", "text": "def index\n @apps = App.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @apps }\n end\n end", "title": "" }, { "docid": "db657a524efc9f631f1eccea93db6bfd", "score": "0.5754927", "text": "def index\n schedules = Schedule.all\n render json: schedules, status: 200\n\n ################# API PULL CODE #############################\n\n # @uri = HTTParty.get\"http://api.sportsdatallc.org/nba-t3/games/2014/REG/schedule.xml?api_key=3jdhu8c22zst6mn3p6fajnze\"\n\n # @length = @uri['league']['season_schedule']['games']['game'].length\n \n # for @i in 0...@length \n \n # @home = @uri['league']['season_schedule']['games']['game'][@i]['home_team']\n # @away = @uri['league']['season_schedule']['games']['game'][@i]['away_team']\n # @fulldate = @uri['league']['season_schedule']['games']['game'][@i]['scheduled']\n\n # # fulldate_array = fulldate.split('T')\n # # @date = fulldate_array[0]\n # # @time = fulldate_array[1].split('+')[0]\n\n # Schedule.create(home_team_id: @home, away_team_id: @away, game_date: @fulldate)\n # end\n # @teams = @uri['league']['season_schedule']['games']['game']\n end", "title": "" }, { "docid": "9ca21721a2e0ef3dfe8393cef77f579b", "score": "0.5754167", "text": "def index\n @related_programs = RelatedProgram.all\n end", "title": "" }, { "docid": "e68f64afb472e9144af70dc214e432c5", "score": "0.5753721", "text": "def index\n @sequents = Sequent.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @sequents }\n end\n end", "title": "" } ]
56c96f7b4fd50190ee6eee1be1e11eb8
Gets the rebootRequired property value. When TRUE indicates reboot is required, when FALSE indicates when TRUE indicates reboot is not required. Defaults to setting on client device.
[ { "docid": "c9dff835a0eddf2e9fd202cde3a24272", "score": "0.76311415", "text": "def reboot_required\n return @reboot_required\n end", "title": "" } ]
[ { "docid": "6adfd56616836402b51a27e159a66893", "score": "0.7528213", "text": "def reboot_required=(value)\n @reboot_required = value\n end", "title": "" }, { "docid": "8c75b67b2e5deb970ed6c7b8f0582169", "score": "0.6894624", "text": "def requires_reboot\n return @requires_reboot\n end", "title": "" }, { "docid": "7c5542ddf7a19f1f9b47cf9f80209e60", "score": "0.68714756", "text": "def requires_reboot=(value)\n @requires_reboot = value\n end", "title": "" }, { "docid": "b18fdfbf1df86de3c04d7df824554440", "score": "0.6124224", "text": "def reboot_suggested\n reboot_suggested? ? 1 : 0\n end", "title": "" }, { "docid": "bf79b2a2745c695abe73859f669e0e64", "score": "0.6047046", "text": "def reboot_requested?\n node.run_state[:reboot_requested] == true\n end", "title": "" }, { "docid": "110870bff2732e0499802c7fb7e06b40", "score": "0.60249", "text": "def reboot_requested?\n reboot_info.size > 0\n end", "title": "" }, { "docid": "f3c6746d86480af819e8cf480497b6a2", "score": "0.5867736", "text": "def reboot_required(family, release, reboot)\n # Do the easy stuff first\n if ['always', 'patched'].include?(reboot)\n true\n elsif reboot == 'never'\n false\n elsif family == 'RedHat' && File.file?('/usr/bin/needs-restarting') && reboot == 'smart'\n response = ''\n if release.to_i > 6\n _output, _stderr, status = Open3.capture3('/usr/bin/needs-restarting -r')\n response = if status != 0\n true\n else\n false\n end\n elsif release.to_i == 6\n # If needs restart returns processes on RHEL6, consider that the node\n # needs a reboot\n output, stderr, _status = Open3.capture3('/usr/bin/needs-restarting')\n response = if output.empty? && stderr.empty?\n false\n else\n true\n end\n else\n # Needs-restart doesn't exist before RHEL6\n response = true\n end\n response\n elsif family == 'Redhat'\n false\n elsif family == 'Debian' && File.file?('/var/run/reboot-required') && reboot == 'smart'\n true\n elsif family == 'Suse' && File.file?('/var/run/reboot-required') && reboot == 'smart'\n true\n elsif family == 'windows' && reboot == 'smart' && pending_reboot_win == true\n true\n else\n false\n end\nend", "title": "" }, { "docid": "68fe161827111e74a04da9d5823f0f5c", "score": "0.5552837", "text": "def reboot=(value)\n @reboot = value\n end", "title": "" }, { "docid": "f6ca42f45c775b1c6c0ebeb28a159573", "score": "0.5419522", "text": "def maintenance_reason_required\n @maintenance_reason_required\n end", "title": "" }, { "docid": "dfac01970e461118de03635ef9ee75bb", "score": "0.54166836", "text": "def device_compliance_required\n return @device_compliance_required\n end", "title": "" }, { "docid": "d31259581349df8ccedcc6de67cde446", "score": "0.53794044", "text": "def is_required\n return @is_required\n end", "title": "" }, { "docid": "d31259581349df8ccedcc6de67cde446", "score": "0.53794044", "text": "def is_required\n return @is_required\n end", "title": "" }, { "docid": "640e5400dc99328f7561c245461d544e", "score": "0.53401303", "text": "def is_reminder_on\n return @is_reminder_on\n end", "title": "" }, { "docid": "c9161885a1a96d5ea16cf46272d9d7a8", "score": "0.53222793", "text": "def provision_group_required\n @attributes[:provision_group_required]\n end", "title": "" }, { "docid": "45a4277400bc809461a3778e40d0e728", "score": "0.5244658", "text": "def maintenance_reason_required=(value)\n @maintenance_reason_required = value\n end", "title": "" }, { "docid": "3c9977dba1cabdad3c5d2d91b669936e", "score": "0.5236927", "text": "def device_compliance_required=(value)\n @device_compliance_required = value\n end", "title": "" }, { "docid": "c1a8fe3ed136e4e8d664f8bfed8f3152", "score": "0.5226772", "text": "def required\n return @required\n end", "title": "" }, { "docid": "a1911c506a5cb96a959e98863c6a71a0", "score": "0.51960945", "text": "def request_reboot\n @do_reboot = true\n end", "title": "" }, { "docid": "4f53bb35cd6c36ece523fbd49bbc6cae", "score": "0.5171186", "text": "def restart_required?\n response = @client.api_get_request(\n \"/updateCenter\",\n \"tree=restartRequiredForCompletion\"\n )\n response[\"restartRequiredForCompletion\"] ||\n !list_installed(:deleted => true).empty?\n end", "title": "" }, { "docid": "aeee8a4af57ae8a66462d4b395328df0", "score": "0.51627535", "text": "def reminders_enabled\n return @reminders_enabled\n end", "title": "" }, { "docid": "0170fcfc6c5fb5addf7f3d8c605ae62b", "score": "0.51149493", "text": "def set_NoReboot(value)\n set_input(\"NoReboot\", value)\n end", "title": "" }, { "docid": "801fc2d819e3ada2d07018692585fa20", "score": "0.51049125", "text": "def is_rebooting?()\n reboot_detect_script = VagrantWindows.load_script('reboot_detect.ps1')\n @machine.communicate.execute(reboot_detect_script, :error_check => false) != 0\n end", "title": "" }, { "docid": "96f1b7617040763a4a4d513c113d7ed6", "score": "0.50932556", "text": "def reminder_notifications_enabled\n return @reminder_notifications_enabled\n end", "title": "" }, { "docid": "15a55d8bd60c7ca2fe4fd2e7a8572d36", "score": "0.5090414", "text": "def required\n @attributes[:required]\n end", "title": "" }, { "docid": "6407c3eb5e9949a02af3906035e2e9b7", "score": "0.4968302", "text": "def is_required=(value)\n @is_required = value\n end", "title": "" }, { "docid": "6407c3eb5e9949a02af3906035e2e9b7", "score": "0.4968302", "text": "def is_required=(value)\n @is_required = value\n end", "title": "" }, { "docid": "790e01504873321f50c8ffff35f54cf0", "score": "0.4899264", "text": "def pin_required\n return @pin_required\n end", "title": "" }, { "docid": "223a803711d65836f6ea48f71fb72fc2", "score": "0.48855802", "text": "def is_reminder_on=(value)\n @is_reminder_on = value\n end", "title": "" }, { "docid": "106b948fe3c50d709843f272a3acae92", "score": "0.48614094", "text": "def required\n @required\n end", "title": "" }, { "docid": "0dfe15ebeeb09eb674155b1dce333115", "score": "0.4819827", "text": "def required?\n (@required == true)\n end", "title": "" }, { "docid": "b43e704ba43d64b6e36570e1599f3221", "score": "0.4817947", "text": "def pending_restart_device_count\n return @pending_restart_device_count\n end", "title": "" }, { "docid": "de38e64fbd58078d298422d2d578a49a", "score": "0.48172933", "text": "def is_approval_required\n return @is_approval_required\n end", "title": "" }, { "docid": "b6ecd1ae60e1134a732305496b4e920a", "score": "0.481065", "text": "def required_flags\n flags.select(&:required)\n end", "title": "" }, { "docid": "ec178fdb43deb64092a07c074041fba0", "score": "0.4805084", "text": "def required?\n return @options[:required]\n end", "title": "" }, { "docid": "eb08f23484e2755819fb2a90576fa399", "score": "0.47860813", "text": "def minimum_required_patch_version\n return @minimum_required_patch_version\n end", "title": "" }, { "docid": "4fb795c08af73258622beb89338b0541", "score": "0.47815657", "text": "def is_registration_required=(value)\n @is_registration_required = value\n end", "title": "" }, { "docid": "ee0b5ad89678f72dc9343ab2d0f57f57", "score": "0.47766927", "text": "def is_required\n return @payload.get_path(\"required\"){false}\n end", "title": "" }, { "docid": "ee0b5ad89678f72dc9343ab2d0f57f57", "score": "0.47766927", "text": "def is_required\n return @payload.get_path(\"required\"){false}\n end", "title": "" }, { "docid": "0b73f03d516e308f330c920b8e481469", "score": "0.47577718", "text": "def required?\n @required\n end", "title": "" }, { "docid": "0b73f03d516e308f330c920b8e481469", "score": "0.47577718", "text": "def required?\n @required\n end", "title": "" }, { "docid": "0b73f03d516e308f330c920b8e481469", "score": "0.47577718", "text": "def required?\n @required\n end", "title": "" }, { "docid": "0b73f03d516e308f330c920b8e481469", "score": "0.47577718", "text": "def required?\n @required\n end", "title": "" }, { "docid": "a5b73f109109b817e31cee9b8e259677", "score": "0.4721805", "text": "def required?\n @required\n end", "title": "" }, { "docid": "a5b73f109109b817e31cee9b8e259677", "score": "0.4721805", "text": "def required?\n @required\n end", "title": "" }, { "docid": "666ad6b3ac1f25fd9e0e0581e0b6a067", "score": "0.47193658", "text": "def clarify_reboot(reboot_action)\n case reboot_action\n when :immediate\n :reboot_now\n when :delayed\n :request_reboot\n else\n reboot_action\n end\n end", "title": "" }, { "docid": "fac63276c3371051a70584fb08f0f5eb", "score": "0.4708785", "text": "def pmi_required?\n down_payment.to_f / property_value.to_f < 0.2\n end", "title": "" }, { "docid": "ba6ab2467b26020b63b28310dc953157", "score": "0.470056", "text": "def required?\n @required\n end", "title": "" }, { "docid": "ba6ab2467b26020b63b28310dc953157", "score": "0.470056", "text": "def required?\n @required\n end", "title": "" }, { "docid": "ba6ab2467b26020b63b28310dc953157", "score": "0.470056", "text": "def required?\n @required\n end", "title": "" }, { "docid": "8891d0996d8e4fd929bd6f197c971959", "score": "0.4697766", "text": "def clarify_reboot(reboot_action)\n case reboot_action\n when :immediate\n :reboot_now\n when :delayed\n :request_reboot\n else\n reboot_action\n end\n end", "title": "" }, { "docid": "89c22dd409d06c12fec2519c6001a623", "score": "0.46886262", "text": "def auto_restart_notification_dismissal=(value)\n @auto_restart_notification_dismissal = value\n end", "title": "" }, { "docid": "bd8ddca40f866368a642585063643259", "score": "0.4686375", "text": "def required?\n !! self[ :required ]\n end", "title": "" }, { "docid": "2a01dbf75fd4db9e53956270acbde2c4", "score": "0.46845096", "text": "def required?\n @options[:required] && !has_default?\n end", "title": "" }, { "docid": "08659db01157d56c98068daeede92f5f", "score": "0.46825352", "text": "def is_approval_required=(value)\n @is_approval_required = value\n end", "title": "" }, { "docid": "becb7f47efb0d8a2105fafad128b4384", "score": "0.46760476", "text": "def required?\n !!resolve_option(@required)\n end", "title": "" }, { "docid": "633b4e9c9a34d32fc143d10e73987b94", "score": "0.46739414", "text": "def set_required(boolean)\n\t\tself.preferences ||= Hash.new\n\t\tself.preferences[:required] = boolean\n\tend", "title": "" }, { "docid": "90125bcbae18967012a403bce034b33b", "score": "0.46705258", "text": "def bootable=(value)\n @bootable = value\n end", "title": "" }, { "docid": "90125bcbae18967012a403bce034b33b", "score": "0.46705258", "text": "def bootable=(value)\n @bootable = value\n end", "title": "" }, { "docid": "90125bcbae18967012a403bce034b33b", "score": "0.46702296", "text": "def bootable=(value)\n @bootable = value\n end", "title": "" }, { "docid": "6b23324df472117d3a9e05f4a21171b0", "score": "0.46697426", "text": "def getreadyforredemption()\r\n return getvalue(SVTags::READY_FOR_REDEMPTION)\r\n end", "title": "" }, { "docid": "3ef350a713197e048ba553ac6df5c793", "score": "0.46635276", "text": "def security_device_required\n return @security_device_required\n end", "title": "" }, { "docid": "0ae69f11e6b505959f7c0378fdcf9f34", "score": "0.4663195", "text": "def auto_restart_notification_dismissal\n return @auto_restart_notification_dismissal\n end", "title": "" }, { "docid": "21762075f66c250b17b679450b84f151", "score": "0.46563697", "text": "def mandatory\n get_mandatory_attribute :mandatory\n end", "title": "" }, { "docid": "9796bf53397f5cd8330afb88b9729260", "score": "0.46523672", "text": "def required?\n options.fetch(:required)\n end", "title": "" }, { "docid": "4bf4acac8fa04141fef4a2bf4d29fd52", "score": "0.46517023", "text": "def required=(value)\n @required = value\n end", "title": "" }, { "docid": "14b3906563e9fe8423f61aae8a5e699b", "score": "0.46446836", "text": "def postpone_reboot_until_after_deadline\n return @postpone_reboot_until_after_deadline\n end", "title": "" }, { "docid": "7e9652ebb7914d6b032e94a4eadec724", "score": "0.4635677", "text": "def pending_reboot_win\n # detect if a pending reboot is needed on windows\n # inputs: none\n # outputs: true or false based on whether a reboot is needed\n\n require 'base64'\n\n # multi-line string which is the PowerShell scriptblock to look up whether or not a pending reboot is needed\n # may want to convert this to ruby in the future\n # note all the escaped characters if attempting to edit this script block\n # \" (double quote) is \"\\ (double quote backslash)\n # \\ (backslash) is \\\\ (double backslash)\n pending_reboot_win_cmd = %{\n $ErrorActionPreference=\\\"stop\\\"\n $rebootPending = $false\n if (Get-ChildItem \\\"HKLM:\\\\Software\\\\Microsoft\\\\Windows\\\\CurrentVersion\\\\Component Based Servicing\\\\RebootPending\\\" -EA Ignore) { $rebootPending = $true }\n if (Get-Item \\\"HKLM:\\\\SOFTWARE\\\\Microsoft\\\\Windows\\\\CurrentVersion\\\\WindowsUpdate\\\\Auto Update\\\\RebootRequired\\\" -EA Ignore) { $rebootPending = $true }\n if (Get-ItemProperty \\\"HKLM:\\\\SYSTEM\\\\CurrentControlSet\\\\Control\\\\Session Manager\\\" -Name PendingFileRenameOperations -EA Ignore) { $rebootPending = $true }\n try {\n $util = [wmiclass]\\\"\\\\\\\\.\\\\root\\\\ccm\\\\clientsdk:CCM_ClientUtilities\\\"\n $status = $util.DetermineIfRebootPending()\n if (($null -ne $status) -and $status.RebootPending) {\n $rebootPending = $true\n }\n }\n catch {}\n $rebootPending\n }\n\n # encode to base64 as this is the easist way to pass a readable multi-line scriptblock to PowerShell externally\n encoded_cmd = Base64.strict_encode64(pending_reboot_win_cmd.encode('utf-16le'))\n\n # execute it and capture the result. this will return true or false in a string\n pending_reboot_stdout, _stderr, _status = Open3.capture3(\"powershell -NonInteractive -EncodedCommand #{encoded_cmd}\")\n\n # return result\n if pending_reboot_stdout.split(\"\\n\").first.chomp == 'True'\n true\n else\n false\n end\nend", "title": "" }, { "docid": "ae8e4bb8d8b9d1b9f13ca9af275af2ba", "score": "0.46343106", "text": "def required?\n @required ||= !!options[:required]\n end", "title": "" }, { "docid": "7f75e7aba21f8c1454bd68dcd568f2d2", "score": "0.46255246", "text": "def minimum_required_patch_version=(value)\n @minimum_required_patch_version = value\n end", "title": "" }, { "docid": "089d0df9fc3a0bf9879d306ab9dcc2be", "score": "0.4619555", "text": "def cdw_flag_prefix\n # Some releases don't have a product hence the try is needed\n self.product.try(:cdw_flag_prefix)\n end", "title": "" }, { "docid": "993b13ddbb68e08eca645847342d0eae", "score": "0.46164322", "text": "def required=(value)\n @required = value\n end", "title": "" }, { "docid": "b7e93c223bfa75cd500b5baee3348886", "score": "0.46147612", "text": "def pin_required=(value)\n @pin_required = value\n end", "title": "" }, { "docid": "a68110ec853eaa1dbc4f4156957e107a", "score": "0.46116266", "text": "def reminders_enabled=(value)\n @reminders_enabled = value\n end", "title": "" }, { "docid": "d6ed894e1139338f1e7ebd332d232647", "score": "0.45921782", "text": "def required?\n if @required.nil?\n !(omittable? || nillable?)\n else\n @required\n end\n end", "title": "" }, { "docid": "65e5dfd536e29f70eb9a8b54647c75ca", "score": "0.45881033", "text": "def isrequired\n # TODO: determine if the \"required\" functionality is needed; does not appear to be used in Puppet\n @required = true\n nil\n end", "title": "" }, { "docid": "103f637af06ab5145d4ae149671e5d42", "score": "0.45808297", "text": "def get_cli_forced\n if ENV.include?(\"force\") && ENV['force']\n return true\n else\n return false\n end\n end", "title": "" }, { "docid": "103f637af06ab5145d4ae149671e5d42", "score": "0.45808297", "text": "def get_cli_forced\n if ENV.include?(\"force\") && ENV['force']\n return true\n else\n return false\n end\n end", "title": "" }, { "docid": "2667aaf26a38b4aeff4881773c47acae", "score": "0.45737824", "text": "def power_status\n get_device_info[:power_status]\n end", "title": "" }, { "docid": "ee8050e3577e122c8f9bb1872415b7b8", "score": "0.4570141", "text": "def required(bool)\n raise InvalidBooleanError unless [true,false].include? bool\n @attributes[:required] = bool\n end", "title": "" }, { "docid": "a44334675d1fe1a154178d99f1122e58", "score": "0.4566204", "text": "def is_registration_required\n return @is_registration_required\n end", "title": "" }, { "docid": "ebbf4649cddb7af39d3128dbcc332265", "score": "0.4557068", "text": "def required?\n !!@required\n end", "title": "" }, { "docid": "e402ddb66a782a1ab97f61ea5d99182b", "score": "0.45462397", "text": "def required?\n @options[:required] ? true : false\n end", "title": "" }, { "docid": "4057e8af61e8ed917e661b72c38062fe", "score": "0.4545365", "text": "def should_install_chef?\n @force || !@machine.guest.capability(:chef_installed, @product, @version)\n end", "title": "" }, { "docid": "958a9a31495c2a672e00c7e3aa5e237d", "score": "0.4544343", "text": "def reboot!( opts = {} ) \r\n got = @ndev.rpc.request_reboot \r\n got.xpath('request-reboot-status').text.strip\r\n end", "title": "" }, { "docid": "22764e974fdb969a79e1a60c6b51ba46", "score": "0.45401475", "text": "def required(value = true)\n @option.required = value\n end", "title": "" }, { "docid": "a30f4aaf89f2e77c87bbbf9e38627e5f", "score": "0.45390245", "text": "def required?\n\t\treturn required\n\tend", "title": "" }, { "docid": "c9b8f7b6dbe97ea10a9110454a184346", "score": "0.45370543", "text": "def required?\n !!@required\n end", "title": "" }, { "docid": "5d992c9436ad02823ba94606fdfe5d89", "score": "0.45361623", "text": "def is_delivery_receipt_requested\n return @is_delivery_receipt_requested\n end", "title": "" }, { "docid": "a3bc734b5535cbe85dc828f2794578d4", "score": "0.45348093", "text": "def powered_on?\n @vm.summary.runtime.powerState == 'poweredOn'\n end", "title": "" }, { "docid": "31c722188b097340ad123207df02d345", "score": "0.453137", "text": "def restart_requested?\n :restart_requested == run_status\n end", "title": "" }, { "docid": "140ae8b6f29282624345f187a82ee0a1", "score": "0.45245552", "text": "def reminder_notifications_enabled=(value)\n @reminder_notifications_enabled = value\n end", "title": "" }, { "docid": "84d6eb4f894ea7214a80ff1c86ad1833", "score": "0.45117223", "text": "def required(value = (not_set = true))\n return @required if not_set\n @required = value\n end", "title": "" }, { "docid": "e03a7c2c8345c5aa6c88e91d29a8e59b", "score": "0.45056474", "text": "def required?\n if options[:required].respond_to?(:to_proc)\n environment.instance_eval(&options[:required])\n else\n !!options[:required]\n end\n end", "title": "" }, { "docid": "2f79273a643899724d4e0df189566b3f", "score": "0.45039728", "text": "def required?(property_name)\n self.class.properties[property_name].fetch(:required, false)\n end", "title": "" }, { "docid": "a7df8d6002efd2bb1f348c3390047a72", "score": "0.45020154", "text": "def secure_boot_enabled\n return @secure_boot_enabled\n end", "title": "" }, { "docid": "e3be8a47d3cc8ee2796bc552ec6e4543", "score": "0.44891557", "text": "def value_required?\n self.form_config_id.blank? ? false : FormConfig.find(self.form_config_id).required\n end", "title": "" }, { "docid": "1b37d37ab8be1eba748fb991e5faf7d7", "score": "0.44842613", "text": "def password_required\n return @password_required\n end", "title": "" }, { "docid": "1b37d37ab8be1eba748fb991e5faf7d7", "score": "0.44842613", "text": "def password_required\n return @password_required\n end", "title": "" }, { "docid": "1b37d37ab8be1eba748fb991e5faf7d7", "score": "0.44842613", "text": "def password_required\n return @password_required\n end", "title": "" }, { "docid": "1b37d37ab8be1eba748fb991e5faf7d7", "score": "0.44842613", "text": "def password_required\n return @password_required\n end", "title": "" } ]
af8659545e3ceb98c3bef19b01c50b0c
Returns a debug string on inspecting the static file. Includes only the relative path of the object.
[ { "docid": "529f42a93501adc6b61f50123ee1d0fd", "score": "0.6580968", "text": "def inspect\n \"#<#{self.class} @relative_path=#{relative_path.inspect}>\"\n end", "title": "" } ]
[ { "docid": "0bb71c9d432cbc81357450a23388c3ce", "score": "0.68113786", "text": "def inspect; \"#{relative}\"; end", "title": "" }, { "docid": "51c0c9d1d1dfb628b16fc67e4737242c", "score": "0.670726", "text": "def inspect\n \"#<#{self.class} #{relative_path}>\"\n end", "title": "" }, { "docid": "91a810cc1d6e709075bef48c66939684", "score": "0.6567283", "text": "def inspect\n \"#<#{self.class.name}:#{absolute_path}>\"\n end", "title": "" }, { "docid": "e1ac1795e0cbf184f96917060ffd15f2", "score": "0.6325427", "text": "def static_path\n prefix = TaliaCore::CONFIG['static_data_prefix']\n return unless(prefix)\n prefix = N::LOCAL + prefix unless(prefix =~ /:\\/\\//)\n \"#{prefix}/#{class_name}/#{(\"00\" + self.id.to_s)[-3..-1]}/#{self.id}\"\n end", "title": "" }, { "docid": "e1ac1795e0cbf184f96917060ffd15f2", "score": "0.6325427", "text": "def static_path\n prefix = TaliaCore::CONFIG['static_data_prefix']\n return unless(prefix)\n prefix = N::LOCAL + prefix unless(prefix =~ /:\\/\\//)\n \"#{prefix}/#{class_name}/#{(\"00\" + self.id.to_s)[-3..-1]}/#{self.id}\"\n end", "title": "" }, { "docid": "1bb1913738d1a94070ea1e83a6b4dec1", "score": "0.6302842", "text": "def static_path\n (@dir || settings.static_path).chomp('/')\n end", "title": "" }, { "docid": "c90c2d3da19066454cccfe39268e5ca0", "score": "0.62947446", "text": "def path_static\n Pathname.new(LOADPATH + \"/webri/generators/#{template}/static\")\n #path + '#{template}/static'\n end", "title": "" }, { "docid": "73c5dc1d4de07808f44bc41fe7cf465c", "score": "0.6241623", "text": "def inspect\n \"#<Path #{@path}>\"\n end", "title": "" }, { "docid": "7a01d81ae0b212820bd3185b0f9dc083", "score": "0.6125988", "text": "def inspect\n \"<#{self.class} @path=#{@path}>\"\n end", "title": "" }, { "docid": "fbc730cb708c81772f0a94deebeef5e2", "score": "0.61153334", "text": "def url()\n Configuring.get(\"static_repository\") + self.filename()\n end", "title": "" }, { "docid": "72ae6b6b14443044a8ae2cf79e50616a", "score": "0.6099759", "text": "def lookup_debug_asset(path, options = T.unsafe(nil)); end", "title": "" }, { "docid": "d7c63ec54979920198c8c07c71f79c20", "score": "0.60477275", "text": "def _path_to_s\n \"#{_relative_path}:#{lineno}->#{(parent ? \"#{parent._path_to_s}\" : \"\\n\")}\"\n end", "title": "" }, { "docid": "3651cc674b6fd5c924078a5324aab01e", "score": "0.6030446", "text": "def get_debug_string\n string = \"2DTexture(#{@file_name})\"\n return string\n end", "title": "" }, { "docid": "e605472343b9f552280503126f06fb8b", "score": "0.60069716", "text": "def debug_filename\n @debug_filename ||= ENV['THERMITE_DEBUG_FILENAME']\n end", "title": "" }, { "docid": "79b0e06999993837dfa493fa0bc78e20", "score": "0.5997329", "text": "def path\n @object.path.to_s\n end", "title": "" }, { "docid": "1941377e0b3bdfe7550663920b7df1ef", "score": "0.5981668", "text": "def path\n File.join(@site.source, @name)\n end", "title": "" }, { "docid": "f3a2140bfaa327438c028e3e21b9e284", "score": "0.59530145", "text": "def inspect\n \"#<#{self.class}: #{@cwd}>\".encode('external')\n end", "title": "" }, { "docid": "48189633011e0dc09fbcacf29bf9fbb4", "score": "0.5948605", "text": "def inspect\n \"#<#{self.class}:#{object_id} #{const_name} #{require_paths.inspect}>\"\n end", "title": "" }, { "docid": "649c5e60bd032304247b8ab727ba8eda", "score": "0.5948578", "text": "def inspect\n \"\\#<#{self.class.name} path='#{path}'>\"\n end", "title": "" }, { "docid": "8d8eca6568bcb6a9a42d4bec414f7ccf", "score": "0.5920128", "text": "def inspect\n if self.class.name\n super\n else\n info = \"<AudioGlue::Template\"\n info << \"(path=#{path.inspect})\" if path\n\n instance_variables.each do |var|\n info << \" #{var}=\"\n info << instance_variable_get(var).inspect\n end\n\n info << \">\"\n end\n end", "title": "" }, { "docid": "ca091ef0823d0aa88464410727087dcd", "score": "0.5851996", "text": "def path\n object.path\n end", "title": "" }, { "docid": "c52d3d7dbd048cd429d8119dca67a993", "score": "0.583747", "text": "def legacy_debug_path(path, debug)\n if debug && !using_sprockets4?\n \"#{path}?body=1\"\n else\n path\n end\n end", "title": "" }, { "docid": "eaa6a3ce847fd590a36b68f47672aede", "score": "0.57937384", "text": "def to_s\n if @file_not_found\n SodaLogger.warning(\"Include #{@name}.js wasn't found on #{Dir.pwd}\")\n \"#{Indentation.get}// File #{@name} not found\"\n else\n @data.map { |x| \"#{Indentation.get}#{x}\" }.join\n end\n end", "title": "" }, { "docid": "8b9a79ca0281c6eca045271714e14738", "score": "0.5770795", "text": "def __FILE__\n self.path\n end", "title": "" }, { "docid": "ebf578c89fb18cee5c43107588912900", "score": "0.5758079", "text": "def static_path(dir=nil)\n @static_path = dir if dir\n (@static_path || settings.static_path).chomp('/')\n end", "title": "" }, { "docid": "6e068ac13f96036b860e132aab25e035", "score": "0.5717679", "text": "def debug_string\n \"#{ast_string} line=#{line}\"\n end", "title": "" }, { "docid": "efbbfca3081c34e44a235a69dd5244b1", "score": "0.5715801", "text": "def public_path\n stats['publicPath'].gsub(/\\/$/, '')\n end", "title": "" }, { "docid": "d5ff44511abfd3478204296cbb71d419", "score": "0.5714361", "text": "def local_path\n self.source.local_path(true)\n end", "title": "" }, { "docid": "82de9f1f3e843ebea1589957c43baef5", "score": "0.5692526", "text": "def local_path\n self.__source.local_path(true)\n end", "title": "" }, { "docid": "1363c1a7601d7b0da74963b93a9a3a91", "score": "0.5670493", "text": "def static_attributes_source\n attributes_source[:static] || ''\n end", "title": "" }, { "docid": "de198219687f27728b71617d73ba34b1", "score": "0.56681687", "text": "def relative_file_name; end", "title": "" }, { "docid": "8a0530fb5b4984e6c538de6767dde267", "score": "0.56665874", "text": "def path\n @source_path\n end", "title": "" }, { "docid": "b616e77d7a1f52dc0d10a7ae8d67c3ab", "score": "0.56284237", "text": "def to_s\n \":files, \\'#{integration.base_relative_path(@root)}\\', ...\"\n end", "title": "" }, { "docid": "a96488da51900826c9c97f77ebbc7a43", "score": "0.5596021", "text": "def to_s\n \"#{self.class.location_key}: '#{File.expand_path(path)}'\"\n end", "title": "" }, { "docid": "7591afe29f0ab0a9dc5e45719e9ffb35", "score": "0.5589445", "text": "def to_s\n \":class_inlines, \\'#{integration.base_relative_path(@root)}\\', ...\"\n end", "title": "" }, { "docid": "eb15b51d05fbd939cfdeb3829f2367a6", "score": "0.55854046", "text": "def source_path\n root.join(self[\"source_path\"])\n end", "title": "" }, { "docid": "b9e6a1fb008d805727c467558d5d5193", "score": "0.5582059", "text": "def serialized_path(object)\n return object if object.is_a?(String)\n\n if object.is_a?(CodeObjects::ExtraFileObject)\n fspath = ['file.' + object.name + (extension.empty? ? '' : \".#{extension}\")]\n else\n objname = object != YARD::Registry.root ? mapped_name(object) : \"top-level-namespace\"\n objname += '_' + object.scope.to_s[0, 1] if object.is_a?(CodeObjects::MethodObject)\n fspath = [objname + (extension.empty? ? '' : \".#{extension}\")]\n if object.namespace && object.namespace.path != \"\"\n fspath.unshift(*object.namespace.path.split(CodeObjects::NSEP))\n end\n end\n\n File.join(encode_path_components(*fspath))\n end", "title": "" }, { "docid": "0ccb654ae318171e84bb349478ee7672", "score": "0.5579766", "text": "def static_build_path\n if settings.sync_script\n tmpdir\n else\n static_path\n end\n end", "title": "" }, { "docid": "6db0f0062217be62b08d2994c978276b", "score": "0.55788904", "text": "def asset path\n path = path.gsub STATIC_PATH_CLEANER, \"\"\n\n filepath = File.expand_path(File.join(public_dir, path))\n return filepath if File.file? filepath\n\n filepath = File.expand_path(File.join(Gin::PUBLIC_DIR, path))\n return filepath if File.file? filepath\n end", "title": "" }, { "docid": "61bb6db97769259064b3d10fb8753f84", "score": "0.55744034", "text": "def path\n location = root? ? \"Object(#{parent.object_id})\" : parent.link.path\n \"#{location}.#{local_path}\"\n end", "title": "" }, { "docid": "9a524ff6127c87ab3fe49a17e4380b68", "score": "0.5568838", "text": "def full_file_path\n Rails.env.production? ? self.url : self.path\n end", "title": "" }, { "docid": "09b5a06bce441da8521b132d0e3e1158", "score": "0.55665004", "text": "def inspect\n \"#{ verb } #{ helper } #{ path }\"\n end", "title": "" }, { "docid": "57eaea23568065cec575e0ede2e047dd", "score": "0.55663383", "text": "def inspect #:nodoc:\n \"#<%s:0x%x roots=%s, files=%d>\" % [self.class.name, object_id, roots.map { |r| r.name.inspect }.join(\", \"), files.length]\n end", "title": "" }, { "docid": "e3ba37c7b3d2df96489d7450ead3fabd", "score": "0.5547957", "text": "def realpath\n template.src_folder/path\n end", "title": "" }, { "docid": "80ac7513890ac61b05f0b4eaefe2c0e8", "score": "0.5538343", "text": "def legacy_debug_path(path, debug); end", "title": "" }, { "docid": "d4bc14bb5bfc243e9ae66438a00df644", "score": "0.5513815", "text": "def file\n Pathname(object.file)\n end", "title": "" }, { "docid": "670816e28aa2c0fcc725897a7e12ffff", "score": "0.5513652", "text": "def to_s\n path\n end", "title": "" }, { "docid": "e6650432f8b31ff1b3c09aa637fdf499", "score": "0.55046", "text": "def to_s\r\n path\r\n end", "title": "" }, { "docid": "1e07bb9b0319c9a35472005a492d7843", "score": "0.55035233", "text": "def inspect\n to_obj ? to_obj.inspect : \"P(#{path})\"\n end", "title": "" }, { "docid": "9976a0c9a353b0103f6ff472e22c30e8", "score": "0.5497128", "text": "def relative_dir\n File.join(self.asset_dir, instance_dir)\n end", "title": "" }, { "docid": "aea27f51d14e814e518924cee38b8939", "score": "0.5495059", "text": "def inspect\n\t\t\t\"%-20s %s\" % [self.class.name.split(\"::\")[-2..-1]*(\"/\"), to_s]\n\t\tend", "title": "" }, { "docid": "079b3ce78f22a01c4841383adb9f3bca", "score": "0.5490576", "text": "def static_content_path(file, snippet)\n File.expand_path(\n File.join(\n File.dirname(file), '..', '..', '..', 'shared', 'snippet', snippet\n )\n )\n end", "title": "" }, { "docid": "b5e6682c10d1929e9b447d3cc9a11885", "score": "0.5484469", "text": "def to_s\n object_path.to_s\n end", "title": "" }, { "docid": "56bf19dbfd3862c9f52bb6d8d561ef2f", "score": "0.54842865", "text": "def source_path; end", "title": "" }, { "docid": "56bf19dbfd3862c9f52bb6d8d561ef2f", "score": "0.54842865", "text": "def source_path; end", "title": "" }, { "docid": "239f666345e75b92b6fee534954fa403", "score": "0.5481106", "text": "def __source_path\n File.join(__source_root, @file)\n end", "title": "" }, { "docid": "b25a31bc4fcd52b0f07fe4b979187353", "score": "0.54784346", "text": "def fs_path\n scope_name = @instance_options[:scope_name]\n\n ([root_name] + object.ancestors(scope_name).map(&:name).reverse).compact.join(\" / \")\n end", "title": "" }, { "docid": "5ce9f3d15806ea4c24704d736b157904", "score": "0.5469244", "text": "def inspect\n \"#{pathname}#{zuper_name}\"\n end", "title": "" }, { "docid": "ebda9cda3c9e681480763045e6e924dd", "score": "0.54678255", "text": "def static_url(path)\n Doozer::Configs.static_url(path)\n end", "title": "" }, { "docid": "78ab7d9b8001b59f3cfc6cae39d24562", "score": "0.5465589", "text": "def path\n source.local_path\n end", "title": "" }, { "docid": "31433ce4f64ee876d87e937350f56bad", "score": "0.5465137", "text": "def relative_path\n self.source_file ? self.source_file.sub(app.source_dir, '') : nil\n end", "title": "" }, { "docid": "2f97c17320f7732a2bb6f3ba53216206", "score": "0.5460246", "text": "def to_s\n path\n end", "title": "" }, { "docid": "2f97c17320f7732a2bb6f3ba53216206", "score": "0.5460246", "text": "def to_s\n path\n end", "title": "" }, { "docid": "2f97c17320f7732a2bb6f3ba53216206", "score": "0.5460246", "text": "def to_s\n path\n end", "title": "" }, { "docid": "7fabe9a631b980470ff9fd30809054dd", "score": "0.54587346", "text": "def relative_path(options = {})\n File.join(self.site.layout_dir(options), sanitize_filename(self.name))\n end", "title": "" }, { "docid": "f8e4f42519ac7338a535717088c8004c", "score": "0.54463136", "text": "def inspect\n \"#{shrine_class.inspect}::Attachment\"\n end", "title": "" }, { "docid": "1785fc7e151aba379d91aa4f179d99b1", "score": "0.5443196", "text": "def path\n (public_path + sitemaps_path + filename).to_s\n end", "title": "" }, { "docid": "f92ecc134aeff47b79c605e8f48c7ea9", "score": "0.5443178", "text": "def to_s\n %(#{path} (#{self.class}))\n end", "title": "" }, { "docid": "9cf7a0d3d3399397388a9c6944bbdf54", "score": "0.54416424", "text": "def / obj\n File.join(self, obj.to_s)\n end", "title": "" }, { "docid": "d90f070fa7bad81e8094d5f12b01d510", "score": "0.5439241", "text": "def debug(object)\n begin\n Marshal::dump(object)\n \"<pre class='debug_dump'>#{object.to_yaml.gsub(\" \", \"&nbsp; \")}</pre>\"\n rescue TypeError => ex\n # Object couldn't be dumped, perhaps because of singleton \n # methods, this is the fallback.\n \"<code class='debug_dump'>#{object.inspect}</code>\"\n end\n end", "title": "" }, { "docid": "61affc0118c080d45f52e5588db917ed", "score": "0.5438172", "text": "def inspect\n \"#<#{self.class.name}:0x#{object_id} bucket=\\\"#{@bucket}\\\" file=\\\"#{@file_path}\\\">\"\n end", "title": "" }, { "docid": "0f5b7963a3f843f5c567e1b46b8f99ac", "score": "0.5437651", "text": "def path\n relative_path\n end", "title": "" }, { "docid": "8fc632d971a14b3cf68a171978beabe4", "score": "0.5418183", "text": "def path\n File.expand_path(file).sub(/(#{@env.paths.join('|')})\\//, '')\n end", "title": "" }, { "docid": "9e783b06b3f97fe657cb9dcb0ae66ea9", "score": "0.541557", "text": "def public_static_path(path, options = nil)\n root_path(options) + path\n end", "title": "" }, { "docid": "19df400ab8a4e82e5086205a11fa6f24", "score": "0.54152733", "text": "def relative_path\n @relative_path ||= path.sub(/\\A#{@site.source}/, '')\n end", "title": "" }, { "docid": "a7403acbda5ca1d31d76d530c9899fb2", "score": "0.5410053", "text": "def inspect\n \"#{shrine_class.inspect}::Attachment\"\n end", "title": "" }, { "docid": "dd8649157e38c69e989e8c6f0bd1d4a9", "score": "0.5408686", "text": "def full_path\n File.join(base_dir, instance.attachment_path)\n end", "title": "" }, { "docid": "57a8246885396ea67b053685aa892a67", "score": "0.54085124", "text": "def to_s\n path\n end", "title": "" }, { "docid": "3a7efda89617000b01c9d621dd531eb5", "score": "0.5407887", "text": "def public_file\n public_path.to_s\n end", "title": "" }, { "docid": "1d5fe002ce89b82f91fbaf8b29121878", "score": "0.5406714", "text": "def source_path\n \"#{template_path}/#{source_filename}\"\n end", "title": "" }, { "docid": "51a0cdaed078100b96c4375b6ce3a441", "score": "0.5405181", "text": "def to_s\n path\n end", "title": "" }, { "docid": "dc23a81c30261d0ef5532e03837d6538", "score": "0.54031116", "text": "def to_s ; path ; end", "title": "" }, { "docid": "42b3cbafdd2e6351d26e2bf572d80091", "score": "0.5402504", "text": "def name\n\t\tif object_class == Rails.application.config.asset_base_class_name\n\t\t\t\"inventory_path(:id => '#{object_key}')\"\n\t\telse\n\t\t\t\"#{object_class.underscore}_path(:id => '#{object_key}')\"\n\t\tend\n\n\tend", "title": "" }, { "docid": "80951e6e67dd21681421d60c16c042eb", "score": "0.5402027", "text": "def inspect\n \"#<#{self.class.name}:#{object_id} @url_template=#{@url_template.inspect}>\"\n end", "title": "" }, { "docid": "80951e6e67dd21681421d60c16c042eb", "score": "0.5402027", "text": "def inspect\n \"#<#{self.class.name}:#{object_id} @url_template=#{@url_template.inspect}>\"\n end", "title": "" }, { "docid": "7f2e9a48226d4f2b53920aae9c2a8a47", "score": "0.5396784", "text": "def static_output_dir\n File.join(output_folder, 'static')\n end", "title": "" }, { "docid": "00f24bb589710a18a800cddcdfef67cb", "score": "0.5387691", "text": "def url\n return \"/\" + Pathname.new(self.path).relative_path_from(Pathname.new(File.join(Merb.root, 'public'))).to_s\n end", "title": "" }, { "docid": "72b21f24ba4e119907ec92eab8afba90", "score": "0.538699", "text": "def path\n self.asset.path\n end", "title": "" }, { "docid": "879fbb46896c918e59ca397d85f6eee5", "score": "0.5385563", "text": "def file\n ::Asset.mode == 'development' ? @path : %{#{file? ? @name : 'application'}-#{@key}.#{@type}}\n end", "title": "" }, { "docid": "cad74bde36bd7383cce64665dd2c87b2", "score": "0.5381378", "text": "def inspect\n\t\tnodemap = if $DEBUG\n\t\t\t\t\", node_tree: %p\" % [ self.node_tree.map(&:as_comment_body) ]\n\t\t\telse\n\t\t\t\t''\n\t\t\tend\n\n\t\treturn \"#<%s:%08x (loaded from %s) attributes: %p, options: %p%s>\" % [\n\t\t\tself.class.name,\n\t\t\tself.object_id / 2,\n\t\t\tself.source_file ? self.source_file : \"memory\",\n\t\t\tself.attributes.keys,\n\t\t\tself.options,\n\t\t\tnodemap\n\t\t]\n\tend", "title": "" }, { "docid": "515e422b47c47efb49a83e86d89313fc", "score": "0.53737503", "text": "def static_template_file?; end", "title": "" }, { "docid": "7ee9384c45fb90b238e48bdc3576701f", "score": "0.53702027", "text": "def path\n (public_path + sitemaps_path + filename).expand_path.to_s\n end", "title": "" }, { "docid": "5420a5654db094ee9195bad7d2822264", "score": "0.53612524", "text": "def generate_static\n from = Dir[(path_static + '**').to_s]\n dest = path_output.to_s\n show_from = path_static.to_s.sub(PATH.to_s+'/', '')\n debug_msg \"Copying #{show_from}/** to #{path_output_relative}:\"\n fileutils.cp_r from, dest, :preserve => true\n end", "title": "" }, { "docid": "324948678e376cc081abcb8659dc7da2", "score": "0.53583306", "text": "def generate_static\n from = Dir[(path_static + '**').to_s]\n dest = path_output.to_s\n show_from = path_static.to_s.sub(PATH.to_s+'/', '')\n debug_msg \"Copying #{show_from}/** to #{path_output_relative}/:\"\n fileutils.cp_r from, dest, :preserve => true\n end", "title": "" }, { "docid": "7a60d08ed579eda9356034bd1feb2663", "score": "0.53573734", "text": "def full_path_info\n \"#{env[SCRIPT_NAME]}#{env[PATH_INFO]}\"\n end", "title": "" }, { "docid": "5d3bf4e468ca7ba09b3381e322c75074", "score": "0.5357233", "text": "def path\n @path.to_s\n end", "title": "" }, { "docid": "ec5d4849126a6d632471fb7c2c00e297", "score": "0.53560203", "text": "def path\n requires :raw\n @raw[:fission].path\n end", "title": "" }, { "docid": "4ded075cb6eb4344b9a06f121abd1eb7", "score": "0.5346681", "text": "def serialized_path(object)\n return object if object.is_a?(String)\n return File.join(object.path.split('::')) + (@extension.empty? ? '' : \".#{@extension}\")\n end", "title": "" }, { "docid": "bf48d758585387cc5f13461d2fb08815", "score": "0.53424287", "text": "def full_filename\n self.__source.source_filename\n end", "title": "" }, { "docid": "dd8040cee4062c48bec9ce8f52c48846", "score": "0.5342131", "text": "def digested_source_path(type, digested_source)\n #hackzor\n settings.pipeline.asset_compiler.send(\"#{type.to_s}_output_path\", digested_source)\n rescue\n ''\n end", "title": "" } ]
4b68b736c02b1e79a0353f64555a09db
builds an address for the given url
[ { "docid": "f3b6e3ce6b427392455ccf4ddaa94500", "score": "0.80925494", "text": "def build_address url\n if url.type == 'external'\n \"#{url.protocol}://#{url.address}:#{url.port}#{url.path}\"\n elsif url.type == 'bridge'\n address = bridge_address_for url.address, url.port\n \"#{url.protocol}://#{address}#{url.path}\"\n elsif url.type == 'public'\n address = public_address_for url.address, url.port\n \"#{url.protocol}://#{address}#{url.path}\"\n end\n end", "title": "" } ]
[ { "docid": "dd6650cc756ec66757f6587f6e7622d3", "score": "0.71583366", "text": "def generate_geo_url(address)\n call_address = Addressable::URI.new(\n :scheme => \"https\",\n :host => \"maps.googleapis.com\",\n :path => \"maps/api/geocode/json\",\n :query_values => {:address => address,\n :sensor => 'false'}\n ).to_s\nend", "title": "" }, { "docid": "aa063f8dc95a994aa9a8594a5402c366", "score": "0.69967836", "text": "def generate_url\n params = prune_address.map { |key, value| add(key, value) }\n params = params.join.tr('\\=', ':').chop\n\n if ([1, 5] & [@level]).any?\n street = hash_to_query('address' => @street) + '&'\n end\n\n params << \"&key=#{@api_key}\" unless @api_key.empty?\n\n language = \"&language=#{@language}\" if LANGUAGES.include? @language\n\n \"#{URL}#{street}components=#{params}#{language}\"\n end", "title": "" }, { "docid": "a9c7ab6640dba9919ddbd53d2dd2987f", "score": "0.69753754", "text": "def address_to_url\n @result = URI.escape(self.address.gsub(/\\'/, '') ) + \",\" + self.postal_code.to_s + \",\" + self.city + ',FR'\n end", "title": "" }, { "docid": "d6f145773a93046f17b0689fbf829097", "score": "0.6933016", "text": "def construct_url(url)\r\n @url.construct_url(url)\r\n end", "title": "" }, { "docid": "2a2238832aae0b7538dba6ed29a89e4f", "score": "0.6784417", "text": "def get_address(url)\n url = URI.decode(url)\n loc = url.split('loc:+')\n return nil if loc.length == 1\n loc_str = loc[1]\n loc_str.split('+').join(' ')\n end", "title": "" }, { "docid": "d5db3f29e66f734d54721bcdcbcd8615", "score": "0.66703814", "text": "def build_url(url)\n # Step one tells me that the uri does have a http or a https to use\n one = url.slice(/(https|http)/)\n if one.nil?\n request_response = \"http://\"\n uri_split = url.split(\".\")\n else\n request_response = url.split(\"//\")[0] + \"//\"\n uri_split = url.split(\"//\")[1].split(\".\")\n end\n \n # Step two and three check for the .com and www at the begging. The count is to make sure that is it missing something and not just taking the place of a sub domain.\n if uri_split.count <= 2\n two = url.slice(/(com|gov|org|net)/)\n three = url.slice(/(www)/)\n # don't add if the thing is there\n if three.nil?\n uri_split.unshift(\"www\")\n end\n if two.nil?\n uri_split << \"com\"\n end\n end\n \n \n path_seperator = uri_split[uri_split.length - 1].split(/\\//)\n if path_seperator && path_seperator.length <= 1\n uri_split[uri_split.length - 1] = path_seperator\n end\n \n \n \n string = uri_split.map{ |split| split }.join(\".\").to_s\n # I can't figure this part out but it sucks\n path_thing = string.split(/\\//) \n unless url.blank?\n url = request_response + string\n end\n end", "title": "" }, { "docid": "2725233b8be3b4d3134284afa59111fe", "score": "0.65683526", "text": "def build_usps_api_url address_hash\n # For god knows what reason, the address1 is supposed to be for\n # apartment numbers and stuff. And address2 is used for street\n # addresses. Seems opposite to me? Maybe I've just been wrong\n # all this time.\n url = %Q(/#{API_URL}?API=Verify&XML=<AddressValidateRequest USERID=\"#{USPS_ID}\">)\n url << %Q(<Address ID=\"0\">)\n url << %Q(<Address1>#{address_hash[\"address2\"]}</Address1>)\n url << %Q(<Address2>#{address_hash[\"address1\"]}</Address2>)\n url << %Q(<City>#{address_hash[\"city\"]}</City>)\n url << %Q(<State>#{address_hash[\"state\"]}</State>)\n url << %Q(<Zip5>#{address_hash[\"zip\"]}</Zip5>)\n url << %Q(<Zip4></Zip4>)\n url << %Q(</Address></AddressValidateRequest>)\n\n URI.escape(SITE + url)\n end", "title": "" }, { "docid": "8bd86ec176c5895e822fb3648f13152a", "score": "0.6541655", "text": "def get_addressable_uri(api, params)\n output_type = \"json\"\n Addressable::URI.new(\n :scheme => \"https\",\n :host => \"maps.googleapis.com\",\n :path => \"/maps/api/#{api}/#{output_type}\",\n :query_values => params\n ).to_s\n\nend", "title": "" }, { "docid": "2dd080e724183930ab17360bc4748c9b", "score": "0.64962053", "text": "def build\n \"#{url}#{urn}\"\n end", "title": "" }, { "docid": "a821d786a87a3ab89982d6b5dda20feb", "score": "0.6458965", "text": "def build_address(venue)\n vname = venue['name']\n add1 = venue['address_1']\n add2 = venue['address_2']\n city = venue['city']\n address = [add1, add2].reject { |i| i.nil? }.join ', '\n unless city.nil?\n address = \"#{address}, #{city}\"\n end\n unless vname.nil?\n address = \"#{vname} - #{address}\"\n end\n\n gmap = \"#{add1} #{add2} #{city}\".squeeze(' ').gsub(/[\\s]/, '+')\n glink = \"<a class=\\\"event-map\\\" href=\\\"https://www.google.com/maps/search/#{gmap}\\\">Map</a>\"\n\n [address, glink]\nend", "title": "" }, { "docid": "c24594000f2b79d06ae15947242a049d", "score": "0.6428771", "text": "def build_uri(url)\n URI.parse(\"#{endpoint}/#{api_version}#{url}\")\n end", "title": "" }, { "docid": "386deda7bb0be4a49ff54189a87a1254", "score": "0.64132243", "text": "def build_url_with_port_for(parsed_url); end", "title": "" }, { "docid": "bcd07223c7ce0aa89cd04b21c782502f", "score": "0.63814926", "text": "def generate_places_url(coordinates)\n call_address = Addressable::URI.new(\n :scheme => \"https\",\n :host => \"maps.googleapis.com\",\n :path => \"maps/api/place/nearbysearch/json\",\n :query_values => {\n :location => coordinates,\n :rankby => \"distance\",\n :types => \"food\",\n :keyword => \"ice cream\",\n :sensor => 'false',\n :key => \"AIzaSyD2JOxpVx-nJo8W4k1IaZj--D2XtECZ7Ng\"}\n ).to_s\nend", "title": "" }, { "docid": "234d639b2bc73e7561e6f9fc136599d1", "score": "0.62864923", "text": "def built_url\n\tmy_uri = URI(\"http://www.gov.gov\")\n\tif page\n\tmy_uri.path = \"/\" + page.page_path\n\telse\n\tputs\"nope\"\n\n\tend\n\tmy_uri.query = URI.encode_www_form({utm_source: self.campaign_source, utm_medium: self.campaign_medium, utm_campaign: self.campaign_medium})\n\tmy_uri.to_s\nend", "title": "" }, { "docid": "5c97996092ec2bcda2dc762058734a86", "score": "0.62837934", "text": "def build_url(host)\n host.protocol + host.url\n end", "title": "" }, { "docid": "29384fe814f76ee59af2ca7205dc4ba2", "score": "0.62609464", "text": "def build_uri(base_uri, url)\n url =~ %r{^https?\\://} ? URI(url) : URI.join(base_uri, url)\n end", "title": "" }, { "docid": "45aed8d1502eb2a7b33815234329b4dc", "score": "0.622263", "text": "def build_address(params)\n if params[:zip]\n \"#{params[:street_address].strip}, #{params[:city].strip}, #{params[:state].strip}, #{params[:zip].strip}\"\n else\n \"#{params[:street_address].strip}, #{params[:city].strip}, #{params[:state].strip}\"\n end\n end", "title": "" }, { "docid": "e89d6e3307ffada204d53f68d50277a4", "score": "0.6201404", "text": "def url()\n @address.url\n end", "title": "" }, { "docid": "c1a11702fa6e277bb99c59a5da755a46", "score": "0.61504143", "text": "def get_map_url\n @address = get_address\n @map_url = \"https://maps.googleapis.com/maps/api/staticmap?markers=color:red%7Clabel:C%7C#{@address}&zoom=13&size=300x300&sensor=false\" \n end", "title": "" }, { "docid": "9e225f67260049a01f1459feefacf07c", "score": "0.61300933", "text": "def build_url( url, args = {} )\n dup.set( args ).extend_url( url )\n end", "title": "" }, { "docid": "76b3a6c59f15cede931a6bca357890b1", "score": "0.61263996", "text": "def address\n super || build_address\n end", "title": "" }, { "docid": "76b3a6c59f15cede931a6bca357890b1", "score": "0.61263996", "text": "def address\n super || build_address\n end", "title": "" }, { "docid": "049238d4f18a0e6ddf441c04c7139e95", "score": "0.6091839", "text": "def create\n @web_address = WebAddress.new(web_address_params)\n # Take the full address and shorten it\n @web_address.short_address = get_shortened_url\n\n respond_to do |format|\n if @web_address.save\n format.html { redirect_to @web_address, notice: 'Web address was successfully created.' }\n format.json { render :index, status: :created, location: @web_address }\n else\n format.html { render :new }\n format.json { render json: @web_address.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b6ca97dc5ef4ff6a1241b98b19a8d4b1", "score": "0.6089919", "text": "def build_address(b, type)\n address_lines = send(\"#{type}_streets\").to_s.split(/(?:\\s*\\n\\s*)+/m, 3)\n \n b.Address do\n b.AddressLine1 address_lines[0] if address_lines[0]\n b.AddressLine2 address_lines[1] if address_lines[1]\n b.AddressLine3 address_lines[2] if address_lines[2]\n b.City send(\"#{type}_city\") if send(\"#{type}_city\")\n b.StateProvinceCode send(\"#{type}_state\") if send(\"#{type}_state\")\n b.PostalCode send(\"#{type}_postal_code\") if send(\"#{type}_postal_code\")\n b.CountryCode send(\"#{type}_country\") if send(\"#{type}_country\")\n b.ResidentialAddressIndicator attribute_names.include?(\"#{type}_residential\") && send(\"#{type}_residential\")\n end\n end", "title": "" }, { "docid": "b6ca97dc5ef4ff6a1241b98b19a8d4b1", "score": "0.608954", "text": "def build_address(b, type)\n address_lines = send(\"#{type}_streets\").to_s.split(/(?:\\s*\\n\\s*)+/m, 3)\n \n b.Address do\n b.AddressLine1 address_lines[0] if address_lines[0]\n b.AddressLine2 address_lines[1] if address_lines[1]\n b.AddressLine3 address_lines[2] if address_lines[2]\n b.City send(\"#{type}_city\") if send(\"#{type}_city\")\n b.StateProvinceCode send(\"#{type}_state\") if send(\"#{type}_state\")\n b.PostalCode send(\"#{type}_postal_code\") if send(\"#{type}_postal_code\")\n b.CountryCode send(\"#{type}_country\") if send(\"#{type}_country\")\n b.ResidentialAddressIndicator attribute_names.include?(\"#{type}_residential\") && send(\"#{type}_residential\")\n end\n end", "title": "" }, { "docid": "7242dbb628664c5c35b770c643d8728e", "score": "0.608809", "text": "def build_address(b, type)\n b.Address do\n send(\"#{type}_streets\").split(\"\\n\").each { |l| b.StreetLines l } if send(\"#{type}_streets\")\n b.City send(\"#{type}_city\") if send(\"#{type}_city\")\n b.StateOrProvinceCode state_code(send(\"#{type}_state\")) if send(\"#{type}_state\")\n b.PostalCode send(\"#{type}_postal_code\") if send(\"#{type}_postal_code\")\n b.CountryCode country_code(send(\"#{type}_country\")) if send(\"#{type}_country\")\n b.Residential send(\"#{type}_residential\")\n end\n end", "title": "" }, { "docid": "df0ca9dea1bc9cd30ac60a9fd219116b", "score": "0.6087015", "text": "def construct_request address\n params=\n if use_google?\n { :address => address, :region => \"CO\", :sensor => false }\n else\n email.merge :q => address, :format => \"json\", :countrycodes => \"CO\"\n end\n query_params = params.map {|k,v| \"#{k.to_s}=#{v.to_s.gsub(' ', '+')}\" }.join(\"&\")\n URI.escape \"#{path}?#{query_params}\"\nend", "title": "" }, { "docid": "5c0457e99c6e5ac98189817639265154", "score": "0.6086782", "text": "def create(url)\n if /^http/.match(url)\n route = get_path() \n\n @@urls.store(route, url)\n @base_url.concat(route)\n end\n end", "title": "" }, { "docid": "f1e7fca0702edf2325e35da37da033ad", "score": "0.6071228", "text": "def build_url(host)\n host.protocol + host.url\n end", "title": "" }, { "docid": "1525036d1312ab5ebaa33ee454f6c27c", "score": "0.6070056", "text": "def get_geocode_url(address)\n \"http://maps.googleapis.com/maps/api/geocode/json?address=\" +\n address + \"&sensor=true\"\n end", "title": "" }, { "docid": "445d7d0440d1c6f2fe2f8d7b247c4538", "score": "0.6064913", "text": "def maps_url\n if self.street_address_1 != nil\n \"https://www.google.com/maps/place/\" + \"#{space_for_plus_sub(self.street_address_1)}\" + \"+#{self.city}\" + \"+#{self.state}\" + \"+#{self.zip_code}\"\n end\n end", "title": "" }, { "docid": "aea4bd4b5fe9c9f4a08f779b38e0578d", "score": "0.60637975", "text": "def build_address(b, type)\n b.Address do\n send(\"#{type}_streets\").each do |street|\n b.StreetLines street\n end\n b.City send(\"#{type}_city\") if send(\"#{type}_city\")\n b.StateOrProvinceCode state_code(send(\"#{type}_state\")) if send(\"#{type}_state\")\n b.PostalCode send(\"#{type}_postal_code\") if send(\"#{type}_postal_code\")\n b.CountryCode country_code(send(\"#{type}_country\")) if send(\"#{type}_country\")\n b.Residential send(\"#{type}_residential\")\n end\n end", "title": "" }, { "docid": "85814bd3c616561f4682f848028caef9", "score": "0.6060856", "text": "def construct_url( uri )\n\t\turl = @request.construct_url( uri )\n\n\t\t# If the request came through a proxy, rewrite the url's host to match\n\t\t# the hostname the proxy is forwarding for.\n\t\tif (( host = self.proxied_host ))\n\t\t\turiobj = URI.parse( url )\n\t\t\turiobj.host = host\n\t\t\turl = uriobj.to_s\n\t\tend\n\n\t\treturn url\n\tend", "title": "" }, { "docid": "eac6ba5ff73c3037fa546228a1a1ca75", "score": "0.605821", "text": "def query_url(query, reverse = false)\n params = {\n 'auth-token' => Geocoder::Configuration.api_key\n }.merge(query)\n \"#{protocol}://api.qualifiedaddress.com/street-address/?\" + hash_to_query(params)\n end", "title": "" }, { "docid": "c7f9981127a06b270281ff6dbe22509f", "score": "0.6051098", "text": "def make_address(street, city, state, zip)\nend", "title": "" }, { "docid": "cae85d5978b2c913b6ce1dd298b45b7a", "score": "0.6024904", "text": "def to_absurl(input)\n\n # url + baseurl << input\n input = \"#{get_url}#{get_baseurl}#{input}\"\n end", "title": "" }, { "docid": "20ed6e7415411f46a8aaebebd63df728", "score": "0.60178524", "text": "def expand_url(url)\n uri = URI(url)\n resolver = Resolv::DNS.new()\n\n # if host is relative, append the service discovery name\n host = uri.host.count('.') > 0 ? uri.host : \"#{uri.host}.#{ENV[\"_SERVICE_DISCOVERY_NAME\"]}\"\n\n # lookup the SRV record and use if found\n begin\n srv = resolver.getresource(host, Resolv::DNS::Resource::IN::SRV)\n uri.host = srv.target.to_s\n uri.port = srv.port.to_s\n logger.info \"uri port is #{uri.port}\"\n if uri.port == 0\n uri.port = 80\n logger.info \"uri port is now #{uri.port}\"\n end\n rescue => e\n logger.error e.message\n logger.error e.backtrace.join(\"\\n\")\n end\n\n logger.info \"expanded #{url} to #{uri}\"\n uri\n end", "title": "" }, { "docid": "20ed6e7415411f46a8aaebebd63df728", "score": "0.60178524", "text": "def expand_url(url)\n uri = URI(url)\n resolver = Resolv::DNS.new()\n\n # if host is relative, append the service discovery name\n host = uri.host.count('.') > 0 ? uri.host : \"#{uri.host}.#{ENV[\"_SERVICE_DISCOVERY_NAME\"]}\"\n\n # lookup the SRV record and use if found\n begin\n srv = resolver.getresource(host, Resolv::DNS::Resource::IN::SRV)\n uri.host = srv.target.to_s\n uri.port = srv.port.to_s\n logger.info \"uri port is #{uri.port}\"\n if uri.port == 0\n uri.port = 80\n logger.info \"uri port is now #{uri.port}\"\n end\n rescue => e\n logger.error e.message\n logger.error e.backtrace.join(\"\\n\")\n end\n\n logger.info \"expanded #{url} to #{uri}\"\n uri\n end", "title": "" }, { "docid": "5ab3ba0431b35e8f0dfc6b7d28b5fa23", "score": "0.6003979", "text": "def create_address(application_id, params={})\n validate_address_parameters(params)\n\n result = @tropo_client.post(\"applications/#{application_id.to_s}/addresses\", params)\n result[:address] = get_element(result.href)\n result\n end", "title": "" }, { "docid": "5f98345bf6ec1081aab4438c41617b83", "score": "0.59740114", "text": "def generate_url(url, params = {})\n uri = URI(url)\n\n res = \"#{uri.scheme}://#{uri.host}\"\n res += \":#{uri.port}\" if (uri.port and uri.port != 80 and uri.port != 443)\n res += \"#{uri.path}\" if uri.path\n res += \"#{uri.fragment}\" if uri.fragment\n res += \"?#{params.to_query}\"\n\n return res\n end", "title": "" }, { "docid": "8fc61604a100c179633a2e06e2cadd6c", "score": "0.5968627", "text": "def create_absolute_url url\n # Append the base URL (scheme+host) if the provided URL is relative\n URI.parse(URI.encode url).host.nil? ? \"#{URI.parse(@url).scheme}://#{URI.parse(@url).host}#{url}\" : url\n end", "title": "" }, { "docid": "e64318d5f308f5e6373511d61a59927c", "score": "0.59597087", "text": "def full_address\n addr = String.new\n addr << \"#{street1}\"\n # yes, handling commas was a pain - I tried about 10 other ways before settling on this.\n # Fortunately, google maps is insanely smart and can take just about anything.\n # But this is also used by the RSS reader, so it needs to work well.\n addr << (addr == \"\" ? \"#{street2}\" : \", #{street2}\")\n addr << (addr == \"\" ? \"#{city}\" : \", #{city}\")\n addr << (addr == \"\" ? \"#{state}\" : \", #{state}\")\n addr << (addr == \"\" ? \"#{zip}\" : \" #{zip}\")\n return addr\n end", "title": "" }, { "docid": "ada3f4eea659bedc335f4d8baa761908", "score": "0.59571505", "text": "def create_internet_address(params)\n update_internet_address(0, params)\n end", "title": "" }, { "docid": "7c397072f93d4f56bbd975e430c44f84", "score": "0.5955213", "text": "def build_url(url='', params={}, string_query='')\n queries = [string_query, hash_to_params(params)]\n queries.delete_if{|i| i.to_s.empty?}\n url += \"?#{queries.join('&')}\" unless queries.empty?\n url\n end", "title": "" }, { "docid": "9a75f9c2c2e9c0c78b7ef54937bfd415", "score": "0.5953727", "text": "def build_uri(value1,value12,value13, type)\n case type\n when \"business\"\n built_uri = @find_business_uri + \"name=#{value1}&city=#{value12}&state=#{value13}\"\n when \"phone\"\n built_uri = @find_phone_uri + \"phone=#{value1}\"\n when \"person\"\n built_uri = @find_person_uri + \"first_name=#{value1}&last_name=#{value12}&address=#{value13}\"\n when \"location\"\n built_uri = @find_location_uri + \"street_line_1=#{value1}&city=#{value12}\"\n end\n built_uri = built_uri + \"&api_key=\" + @api_key\n return URI.escape(built_uri)\n end", "title": "" }, { "docid": "2b04c1a4496c8ebc82ba0b593d0be5b9", "score": "0.59494865", "text": "def make_address(street, city, state, zip)\n\t\"You live at #{street}, in the beautiful city of #{city}, #{state}. Your zip is #{zip}.\"\nend", "title": "" }, { "docid": "8f8a4a33bf2c14998bbf387d68bf02cc", "score": "0.59436053", "text": "def full_url(input)\n expand_url(input, site_url)\n end", "title": "" }, { "docid": "fa1c6043d01dda565ae6c2007b525b4e", "score": "0.5935823", "text": "def make_address(street, city, state, zip)\n\treturn \"You live at #{street}, in the beautiful city of #{city}, #{state}. Your zip is #{zip}.\"\nend", "title": "" }, { "docid": "a5e0e82340a1426a4e6824f864a5a2f0", "score": "0.5930807", "text": "def build_uri(uri); end", "title": "" }, { "docid": "e34a2faf14801194504829c3595f592a", "score": "0.5930257", "text": "def build_url\n BuildQuery.build(options, base_url)\n end", "title": "" }, { "docid": "ae93559f33401e0d4174719e59f8a20e", "score": "0.59290165", "text": "def build_url_with_port_for(parsed_url)\n url = ''\n\n url += parsed_url.scheme ? \"#{parsed_url.scheme}://\" : ''\n url += parsed_url.userinfo ? \"#{parsed_url.userinfo}@\" : ''\n url += parsed_url.host ? \"#{parsed_url.host}:#{parsed_url.port}\" : ''\n url += parsed_url.path\n url += parsed_url.query ? \"?#{parsed_url.query}\" : ''\n url += parsed_url.fragment ? \"##{parsed_url.fragment}\" : ''\n\n url\n end", "title": "" }, { "docid": "29fa17c3c7abc86aa523cbab10b1b247", "score": "0.5921868", "text": "def resolve_address(address)\n @base_address + address\n end", "title": "" }, { "docid": "478f816fa09b22a261a09c16caf0f31f", "score": "0.5915303", "text": "def build_aeon_request_url\n # hash for params required for aeon extracted from @request\n callnum = id_to_callnum\n site = site_lookup\n specialrequest = note_to_specialrequest\n sublocation = locations_to_sublocation\n title = title_with_hierarchy\n volume = containers_to_volume\n\n params = {\n callnum: callnum,\n site: site,\n title: title,\n }\n params[:specialrequest] = specialrequest unless specialrequest.empty?\n params[:sublocation] = sublocation unless sublocation.empty?\n params[:volume] = volume unless volume.empty?\n\n AppConfig[:aspace_aeon_requests_params_transform].each do |param, transform|\n params[param] = transform.call(params[param]) if params.has_key?(param)\n end\n\n URI::HTTPS.build(host: @endpoint, path: '/OpenURL', query: URI.encode_www_form(params))\n end", "title": "" }, { "docid": "f6ae7b47b918cc7ff67b6bf8cefd5395", "score": "0.5904156", "text": "def google_maps_url\n \"http://maps.google.com/?q=#{address}\"\n end", "title": "" }, { "docid": "f55ab1d85f2efef490593316d2a691fa", "score": "0.5899276", "text": "def make_address(params = {})\n country = ::Klarna::API.id_for(:country, params[:country])\n phone = params[:telno].to_s.gsub(/[\\W\\s\\t]/, '')\n cell_phone = params[:cellno].to_s.gsub(/[\\W\\s\\t]/, '')\n {\n :fname => params[:fname],\n :lname => params[:lname],\n :careof => params[:careof],\n :street => params[:street],\n :house_number => params[:house_number].to_s, #AT/DE/NL only\n :postno => params[:postno],\n :city => params[:city],\n :country => country,\n :telno => phone,\n :cellno => cell_phone,\n :email => params[:email]\n }.with_indifferent_access\n end", "title": "" }, { "docid": "ddf60040452bf6e4d88e64df6eb6768e", "score": "0.5883997", "text": "def compose_url(url, path = '/')\n abort \"Invalid URL: #{url}\" unless validate_url(url)\n\n query = {}\n query['email'] = options['email'] if options['email']\n query['api_key'] = options['key'] if options['key']\n\n uri = URI(url)\n uri.path = path\n uri.query = URI.encode_www_form(query) unless query.empty?\n uri.to_s\n end", "title": "" }, { "docid": "52f2151a00f13a1158388c80b1f19c80", "score": "0.5879348", "text": "def build_url(url, params = nil)\n url += '?' + Util::Helpers.http_build_query(params) unless params.nil?\n\n url\n end", "title": "" }, { "docid": "749ecb80788da3538eabfe0060df0d28", "score": "0.58786565", "text": "def make_url\n made_url = nil\n if has_url_dynvar?\n made_url = @url\n else\n protocol, resource = @config.base_url_and_port.split('://')\n resource = resource + '/' + @url unless @url.blank?\n if is_get? && has_params?\n params = self.content_string.to_s.gsub('%2B', '+')\n resource = resource + '?' + params\n end\n made_url = protocol + '://' + resource.gsub(/\\/+/, '/')\n end\n made_url\n end", "title": "" }, { "docid": "0add6a7df9988297524d82824d2ef608", "score": "0.58545595", "text": "def build_call_url(word)\r\n\t\t\tURI.parse(URI.escape(base_url + word))\r\n\t\tend", "title": "" }, { "docid": "91b4c2ab6e6602215a977210ca5f8916", "score": "0.5834937", "text": "def build_uri\n # puts [build_url, build_params].join('?')\n URI.parse([build_url, build_params].join('?'))\n end", "title": "" }, { "docid": "4f329e3c3e5b3087f779adc4eb75aaca", "score": "0.5829381", "text": "def compose_url(url, path = '/search')\n abort \"Invalid URL: #{url}\" unless validate_url(url)\n\n query = {}\n query['api_key'] = options['key'] if options['key']\n query['q'] = options['query'] if options['query']\n\n uri = URI(url)\n uri.path = path\n uri.query = URI.encode_www_form(query)\n uri.to_s\n end", "title": "" }, { "docid": "8ca0e5d7d112755c5a9f71687d6e0899", "score": "0.5821058", "text": "def join_url(url)\n if @base_url =~ /gosugamers\\.net/ && url !~ /gosugamers\\.net/\n \"http://www.gosugamers.net/dota/#{url}\"\n else\n url\n end\n end", "title": "" }, { "docid": "f558d7c2ef3f29b5e7cf16bbc96403e1", "score": "0.5798703", "text": "def make_address(street, city, state, zip)\n \"You live at #{street}, in the beautiful city of #{city}, #{state}. \" +\n \"Your zip is #{zip}.\"\nend", "title": "" }, { "docid": "994bba27c6ae343f022b32797ec928ba", "score": "0.57951105", "text": "def build_url(location, *args)\n url = File.join(base_url, 'providers', provider, 'locations', location)\n url = File.join(url, *args) unless args.empty?\n url << \"?api-version=#{@api_version}\"\n end", "title": "" }, { "docid": "878806944601b442809657b6b54d7753", "score": "0.57895756", "text": "def to_url_param\n CGI.escape([ address_1, city, state, postal, country ].select { |l| !l.empty? }.join(',') )\n end", "title": "" }, { "docid": "2b9481787efb307c6c963ee252e48b60", "score": "0.5787412", "text": "def url_create(state_code, city_name)\r\n final_url = @web_url + self.url_suffix_create(state_code, city_name)\r\n puts final_url\r\n final_url\r\n end", "title": "" }, { "docid": "23f944b470d08a3af246a322427a31cc", "score": "0.5770457", "text": "def make_address(street, city, state, zip)\n\tstreet= '633 Folsom St.'\n\tcity= 'San Francisco'\n\tstate= 'CA'\n\tzip= '94107'\n\tp \"You live at \"+ street +\", in the beautiful city of \"+ city +\", \"+ state +\". Your zip is \"+zip+\".\"\nend", "title": "" }, { "docid": "3b7caaa503b72e3841a44dd2bd57572a", "score": "0.57637787", "text": "def generate_address\n city_name = @geo_query.city.present? ? @geo_query.city : NOT_LISTED\n district_name = @geo_query.district.present? ? @geo_query.district : NOT_LISTED\n region = Region.find_or_create_by(name: @geo_query.region)\n city = region.cities.find_or_create_by(name: city_name)\n district = city.districts.find_or_create_by(name: district_name)\n location = district.locations.find_or_create_by(latitude: @latitude,\n longitude: @longitude)\n if location.present?\n set_address location\n true\n else\n false\n end\n end", "title": "" }, { "docid": "889c985c7bb17a79b97c4a02df07fd35", "score": "0.57623523", "text": "def build_url(url, params = nil)\n params = {} if !params\n params['api_key'] = BaseService.api_key\n url += '?' + Util::Helpers.http_build_query(params)\n end", "title": "" }, { "docid": "7256e663e78a46ca7b1c47a027bc8509", "score": "0.5750961", "text": "def parse_address\n if self.street && self.city && self.state\n self.street.to_s + \"%2C\" + self.city.to_s + \"%2C\" + self.state.to_s\n end\n end", "title": "" }, { "docid": "beb2485955d04ca92f30ebe153438ffc", "score": "0.5727357", "text": "def complete_url(url)\n unless url[/^https?:\\/\\//]\n url = 'http://' + url\n end\n return url\n end", "title": "" }, { "docid": "5b0f58cbf257953cda4b498ecacd855b", "score": "0.5724053", "text": "def append_url(url)\n click_link \"Add New\"\n\n fill_in \"shortener[main_domain]\", with: Faker::Internet.url(url)\n click_button \"Create Shortener\"\n end", "title": "" }, { "docid": "c892fec11e622fa9a4b27a2f26e8ce78", "score": "0.57212204", "text": "def full_address\n \"#{address} #{house_number} #{house_number_extension}, #{zipcode} #{city} #{country}\"\n end", "title": "" }, { "docid": "1b3517d2bf973939c5563d1dbed2d495", "score": "0.57198715", "text": "def make_address(street, city, state, zip)\n \"You live at \" + street + \", \" + \"in the beautiful city of \" + city + \", \" + state + \". \" + \"Your zip is \" + zip + '.'\nend", "title": "" }, { "docid": "a96d16944abfe4f5b5ae006e70db33ea", "score": "0.5701542", "text": "def create url\n function = ''\n \n post_data = {}\n post_data[:url] = url\n\n request(@resource, function, nil, 'post', post_data)\n end", "title": "" }, { "docid": "a68f8d5c46ca989792595221510cfd71", "score": "0.56996614", "text": "def build_city_uri(city_path)\n \"http://#{city_path}.craigslist.org\"\n end", "title": "" }, { "docid": "ccf9741e9782af1b1623ed2b33d60803", "score": "0.56983244", "text": "def address\n build_entity(@address, Fields::ADDRESS_ENTITY_DESCRIPTION) unless @address.nil?\n end", "title": "" }, { "docid": "55c920608142ea3a2c1ddf05b6748873", "score": "0.56954485", "text": "def address(str)\n Address.new(str)\nend", "title": "" }, { "docid": "01fad85a5f29d71c3275c39ee8c56488", "score": "0.5687253", "text": "def address\n lstreet = \"#{street1}#{street2}\".blank? ? \"\" : \"#{street1}#{street2},\"\n\tlcity = \"#{city}\".blank? ? \"\" : \"#{city},\"\n\t\n lstreet+lcity+ (\"#{province}\".blank? ? \"\":\"#{province},\") + \"#{postal_code}\"\n end", "title": "" }, { "docid": "2e94b750cff4ee44771186c8663bdad5", "score": "0.56870395", "text": "def geo_address\n \"#{street1}#{street2}, #{city}, #{province}, CA, #{postal_code}\".gsub(/&/, 'and')+\"&components=country:CA\" \n end", "title": "" }, { "docid": "f5abcb11d6d5e1a3e164669be5db86e7", "score": "0.5685268", "text": "def build_url\n url = \"http://ws.geonames.org/findNearbyWikipediaJSON?\"\n url += \"lat=#{@lat}\"\n url += \"&lng=#{@long}\"\n url += \"&radius=#{@radius}\"\n url += \"&lang=en\"\n return url\n end", "title": "" }, { "docid": "bb526f2b55144170abea04b5f3ea250d", "score": "0.56794626", "text": "def make_address(street, city, state, zip)\n \"You live at #{street} in the beautiful city of #{city}, #{state}. Your zip is #{zip}.\"\nend", "title": "" }, { "docid": "81ee14233ddd7c35f986f61e8f365b9f", "score": "0.5678215", "text": "def build_url_hash; end", "title": "" }, { "docid": "030de2c2ba1d09b264659661672d449f", "score": "0.5676048", "text": "def format_url(url = nil)\n return \"\" if url.nil?\n return url if url.start_with?(\"http\")\n url.insert(0, \"http://\")\n end", "title": "" }, { "docid": "3b0ba7ce6239df5696eb24ec97a48ace", "score": "0.5672325", "text": "def create\n @address = @addressable.address.new(params[:address])\n end", "title": "" }, { "docid": "58257218bfa4609f20307acc91b56892", "score": "0.56709284", "text": "def construct_url(params)\r\n\t\t@url = \"http://api.indeed.com/ads/apisearch?publisher=#{api_key}&format=json\"\r\n\t\t@options[:q] = params[\"query\"]\r\n\t\t@options[:userip] = params[\"userip\"]\r\n\t\t@options[:useragent] = params[\"useragent\"]\r\n\t\t@options[:l] = params[\"location\"]\r\n\t\t@url << concat_struct_to_url\r\n\tend", "title": "" }, { "docid": "ac3bb30af861648683cabee33dac4553", "score": "0.56698847", "text": "def expand_url(url, params)\n params ||= {}\n template = url.respond_to?(:expand) ? url : Addressable::Template.new(url)\n if template.variables.empty? && !params.empty?\n # the URI isn't templated so just append the query parameters\n non_templated_url = Addressable::URI.parse(url)\n existing_query_values = non_templated_url.query_values(Hash) || {}\n non_templated_url.query_values = existing_query_values.merge(params)\n return non_templated_url.to_s\n end\n\n template.expand(params || {}).to_s\n end", "title": "" }, { "docid": "71788908d988f37adc10fdbcbc49bb84", "score": "0.5669433", "text": "def add_address(post, address, prefix = '') \n unless address.blank? or address.values.blank?\n post[prefix+\"street\"] = address[:address1].to_s\n post[prefix+\"city\"] = address[:city].to_s\n post[prefix+\"state\"] = address[:state].blank? ? 'n/a' : address[:state]\n post[prefix+\"country\"] = address[:country].to_s\n post[prefix+\"zip\"] = address[:zip].to_s.sub(/\\s+/,'')\n end \n end", "title": "" }, { "docid": "ec5f1d645cb1a7979e72561081edeefe", "score": "0.5655631", "text": "def extract_url_from(full_web_address)\n uri = URI.parse(full_web_address.strip)\n uri.scheme + \"://\" + uri.host\n end", "title": "" }, { "docid": "837316d4d009d740025f316d4b930c35", "score": "0.56546676", "text": "def shorten(url)\n request = Net::HTTP::Post.new(\"/create\")\n request.set_form_data(:url => url)\n response = http(GIT_IO_URL, request)\n case response.code\n when \"200\"\n URI.join(GIT_IO_URL, response.body).to_s\n when \"201\"\n response['Location']\n else\n url\n end\n end", "title": "" }, { "docid": "837316d4d009d740025f316d4b930c35", "score": "0.56546676", "text": "def shorten(url)\n request = Net::HTTP::Post.new(\"/create\")\n request.set_form_data(:url => url)\n response = http(GIT_IO_URL, request)\n case response.code\n when \"200\"\n URI.join(GIT_IO_URL, response.body).to_s\n when \"201\"\n response['Location']\n else\n url\n end\n end", "title": "" }, { "docid": "837316d4d009d740025f316d4b930c35", "score": "0.56546676", "text": "def shorten(url)\n request = Net::HTTP::Post.new(\"/create\")\n request.set_form_data(:url => url)\n response = http(GIT_IO_URL, request)\n case response.code\n when \"200\"\n URI.join(GIT_IO_URL, response.body).to_s\n when \"201\"\n response['Location']\n else\n url\n end\n end", "title": "" }, { "docid": "420b663f8200a47a6eb439289661c9d2", "score": "0.56521785", "text": "def create_uri(url_string)\n return URI.parse(URI.escape(url_string))\n end", "title": "" }, { "docid": "d8379e26292bc40acd9d4b76ae0757c6", "score": "0.5641573", "text": "def build_address(geo_loc)\n @addr_ln1 = geo_loc[:AddrLn1]\n @addr_ln2 = geo_loc[:AddrLn2]\n @addr_ln3 = geo_loc[:AddrLn3]\n @town = geo_loc[:Town]\n @county = geo_loc[:County]\n @post_code = geo_loc[:PostCode]\n @country = geo_loc[:Country]\n end", "title": "" }, { "docid": "657e61f4d5f1278e5fe0febfd43ee1b7", "score": "0.5641566", "text": "def create_address(address, opts = {})\n data, _status_code, _headers = create_address_with_http_info(address, opts)\n data\n end", "title": "" }, { "docid": "f951df2b8ad34a071fcfcbf88cdf150a", "score": "0.56385475", "text": "def build_url(project_url, build_number)\n \"#{project_url}/#{build_number}/api/json\"\n end", "title": "" }, { "docid": "7fd5c916f679eddce76ce62ed429cd6f", "score": "0.56341124", "text": "def find_or_build_address(*args)\n options = {}\n attributes = []\n # if first argument, it determines the type => :kind\n args.each do |argument|\n case argument.class.name\n when /Symbol/, /String/\n attributes << argument\n when /Hash/\n options.merge!( argument )\n end\n end\n kind = attributes.first\n unless address = find_address(kind, :conditions => options)\n if :has_one == acts_as_addressable_options[:association_type]\n if acts_as_addressable_options[:attributes].empty?\n address = self.build_address(options)\n else\n address = self.send(\"build_#{kind}_address\", options)\n end\n else\n if acts_as_addressable_options[:attributes].empty?\n address = self.addresses.build(options)\n else\n address = self.send(\"#{kind}_addresses\").build(options)\n end\n end\n end\n address\n end", "title": "" }, { "docid": "7fd5c916f679eddce76ce62ed429cd6f", "score": "0.56341124", "text": "def find_or_build_address(*args)\n options = {}\n attributes = []\n # if first argument, it determines the type => :kind\n args.each do |argument|\n case argument.class.name\n when /Symbol/, /String/\n attributes << argument\n when /Hash/\n options.merge!( argument )\n end\n end\n kind = attributes.first\n unless address = find_address(kind, :conditions => options)\n if :has_one == acts_as_addressable_options[:association_type]\n if acts_as_addressable_options[:attributes].empty?\n address = self.build_address(options)\n else\n address = self.send(\"build_#{kind}_address\", options)\n end\n else\n if acts_as_addressable_options[:attributes].empty?\n address = self.addresses.build(options)\n else\n address = self.send(\"#{kind}_addresses\").build(options)\n end\n end\n end\n address\n end", "title": "" }, { "docid": "0934e4645e052e18137d253ef8a33a22", "score": "0.56277037", "text": "def prepare_address(address_from_form)\n #delete http:// and www\t\n \ttemp_string = address_from_form.sub(\"https://\", \"\").sub(\"http://\", \"\").sub(\"www.\", \"\")\n #check if there is a slash in the end\n \tif temp_string.last == '/' or temp_string.last == '\\\\'\n \t string = temp_string.sub(temp_string.last, \"\") #delete slash (last char)\t\n \telse #there was no slash in the end so return temp_string\n \t string = temp_string\t\n \tend\n \treturn string\n end", "title": "" }, { "docid": "ace8b02aba5dfb06ab697ac82b03146c", "score": "0.5624985", "text": "def get_full_url(url)\r\n full_url = @base_url + url\r\n return URI(URI.encode(full_url))\r\n end", "title": "" } ]
6937c581003521037ae52201b45a61ba
Delete a subsubproject DELETE /projects/:project_id/subprojects/:subproject_id/subsubprojects/:id
[ { "docid": "3704ab3520e4accdbd141421946758e0", "score": "0.83022964", "text": "def destroy\n @subsubproject = Subsubproject.find(params[:id])\n projectid = @subsubproject.subproject.project.id\n subprojectid = @subsubproject.subproject.id\n @subsubproject.destroy\n redirect_to project_subproject_path(:project_id => projectid,\n :id => subprojectid), :notice => 'Version wurde gelöscht.'\n end", "title": "" } ]
[ { "docid": "f63cfe941aac3aa77d04e4c5e117eddb", "score": "0.758617", "text": "def destroy\n @sub_project.destroy\n respond_to do |format|\n format.html { redirect_to project_path(@project), notice: 'Sub project was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "1e74e45789e346cf1af7b0d2666e425b", "score": "0.7335922", "text": "def destroy\n @sub_project = SubProject.find(params[:id])\n @sub_project.destroy\n session[:return_to] = request.referer\n respond_to do |format|\n format.html { redirect_to session[:return_to]}\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e3bda426fdde38375abf41089b22ce5a", "score": "0.70424694", "text": "def destroy\n @subtask = Subtask.find(params[:id])\n @subtask.destroy\n\n respond_to do |format|\n format.html { redirect_to project_task_path(@project,@task) , notice: \"subtask deleted\" }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "280d71c9ddf51643f57d658ea8b3fe3c", "score": "0.70169306", "text": "def destroy\n @subtask = @task.subtasks.find(params[:id])\n @subtask.destroy\n\n respond_to do |format|\n format.html { redirect_to [@task], notice: 'Subtask was successfully deleted.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "77996c71e8341dd9f03eb04d30041896", "score": "0.6979416", "text": "def delete_subtask\n @status = Status.find(params[:status_id])\n @subtask=SubTask.find(params[:sub_task_id])\n @subtask.destroy\n end", "title": "" }, { "docid": "fae4fbefd69853e1cf1991f650d7431f", "score": "0.69116443", "text": "def destroy\n @iosignal = Iosignal.find(params[:id])\n @subsubproject = @iosignal.grobengineering.subsubproject\n @subproject = @subsubproject.subproject\n @project = @subproject.project\n\n @iosignal.destroy\n redirect_to project_subproject_subsubproject_iosignals_path(@project.id, @subproject.id, @subsubproject.id), :notice => 'Eintrag wurde gelöscht.'\n end", "title": "" }, { "docid": "805a6fe19b45c0d68952da697a358b29", "score": "0.685691", "text": "def destroy\n @project = Project.find(params[:id])\n respond_to do |format|\n if (Project.is_hierarchical? && @project.children.empty?) || !Project.is_hierarchical?\n @project.destroy\n format.html { redirect_to(projects_path) }\n format.xml { head :ok }\n else\n flash.now[:error]=\"Unable to delete project with children\"\n format.html { redirect_to(@project) }\n format.xml { render :xml=>@project.errors, :status=>:unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "01041bb721f7a2fdc1c79aa0506326fd", "score": "0.6782427", "text": "def destroy\n @subpost = Subpost.find(params[:id])\n @subpost.destroy\n\n respond_to do |format|\n format.html { redirect_to subposts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d65c78f840e72dfc7fc67db2788cd9a6", "score": "0.67272586", "text": "def delete_project(project_id)\n delete \"projects/#{project_id}\"\n end", "title": "" }, { "docid": "deaecc62b871f25fda515558e50fe5f1", "score": "0.6722263", "text": "def destroy\n bad_request(\"Missing project key\") unless params[:id].present?\n \n project = Project.by_key(params[:id])\n bad_request(\"Not valid project\") unless project\n access_denied unless is_admin?(project)\n bad_request(\"Not valid project\") unless java_facade.getResourceTypeBooleanProperty(project.qualifier, 'deletable')\n \n Project.delete_resource_tree(project)\n render_success(\"Project deleted\")\n end", "title": "" }, { "docid": "966ce26fc9ab8c602a4080ab3790e68e", "score": "0.6685", "text": "def delete_project\n Task.where(:project_id => params['project_id']).each do |delete|\n delete.destroy\n end\n Project.find(params['project_id']).destroy\n render json: {success: true}\n end", "title": "" }, { "docid": "a96b2e6913ab9f4e93ab7cf2e29572fe", "score": "0.6659602", "text": "def destroy\n Sub.find(params[:id]).destroy\n redirect_to subs_path\n end", "title": "" }, { "docid": "feb22ac3d195722bbee007873d875ae8", "score": "0.66440636", "text": "def delete_project(id)\n send(:delete, \"projects/#{id}\")\n end", "title": "" }, { "docid": "21491798fd3591d978055df0bbca890c", "score": "0.6597337", "text": "def delete\n @project_id = params['project_id']\n @admin_id = params[:admin_id].to_i\n\n Project.find_by_id(@project_id.to_i).destroy\n redirect_to(:controller => 'project', :action => 'all', :admin_id => @admin_id)\n end", "title": "" }, { "docid": "70312effd3c07ce4db71a6a41be459ee", "score": "0.6558052", "text": "def delete_subaccount(subaccount_id)\n base_url = rave_object.base_url\n\n payload = {\n \"seckey\" => rave_object.secret_key.dup,\n \"id\" => subaccount_id\n }\n\n payload = payload.to_json\n\n response = post_request(\"#{base_url}#{BASE_ENDPOINTS::SUBACCOUNT_ENDPOINT}/delete\", payload)\n return handle_subaccount_response(response)\n end", "title": "" }, { "docid": "113663a85629207040355d78027a5b07", "score": "0.65568966", "text": "def destroy\n @task = Task.find_by_id(params[:task_id])\n @sub_task.destroy\n respond_to do |format|\n format.html { redirect_to @task, notice: 'Sub task was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c4a4243b145ccf1c615220a8ee41eb46", "score": "0.65193313", "text": "def deleteProject( poid )\n\n # parameter TypeCheck\n #BIMserverAPI::TypeCheck::Long( poid )\n\n # BIMserver request\n request( { poid: poid } )\n end", "title": "" }, { "docid": "7b3dd4b4ca192e000fc2758474de4718", "score": "0.6510025", "text": "def destroy\n @history = History.find(params[:id])\n @history.destroy\n redirect_to project_subproject_path(@history.subproject.project.id, @history.subproject.id), :notice => 'History wurde gelöscht.'\n end", "title": "" }, { "docid": "493eccbb97e04a553b7fe4a2f5c5406e", "score": "0.65066445", "text": "def delete project_id\n service.delete_project project_id\n true\n end", "title": "" }, { "docid": "d9e51553a75e3d835a761f6bf4a82b0b", "score": "0.6489016", "text": "def project_delete(id)\n path = sprintf(\"/api/v2/projects/%s\", id)\n data_hash = {}\n post_body = nil\n \n reqHelper = PhraseApp::ParamsHelpers::BodyTypeHelper.new(data_hash, post_body)\n rc, err = PhraseApp.send_request(@credentials, \"DELETE\", path, reqHelper.ctype, reqHelper.body, 204)\n if err != nil\n return nil, err\n end\n \n return err\n end", "title": "" }, { "docid": "e593e8388cf6f9cc2a7104506418340d", "score": "0.6462235", "text": "def destroy\n @subtask = Subtask.find(params[:id])\n @subtask.destroy\n\n respond_to do |format|\n #format.html { redirect_to boards_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f380bb9a2126d92580b8701427dbd571", "score": "0.64618236", "text": "def delete_project_in_portfolio\n project_in_portfolio = ProjectInPortfolio.where(\"portfolio_id = #{params[:portfolio_id]} and project_id = #{params[:project_id]}\")[0]\n ProjectInPortfolio.destroy(project_in_portfolio.id)\n end", "title": "" }, { "docid": "896688ec873d905f8b83a2b113a96912", "score": "0.6456492", "text": "def delete\n # check if the project belongs to the organization before deleting it\n project = Project.find(params[:delete_project_id], session[:organization][:cartodb_id])\n if project # yay! the project belongs to the org, so we can delete it\n Project.destroy(params[:delete_project_id])\n else\n flash[:notice] = \"You can't delete the selected project\"\n end\n redirect_to '/dashboard'\n end", "title": "" }, { "docid": "e891c48da205b9d70461a671826c0a15", "score": "0.64460886", "text": "def destroy\n \n @user = User.find(session[:user_id]) \n\n @project = @user.projects.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to(projects_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "19dc12c278b0a75e98e05208e0acc2a8", "score": "0.6442848", "text": "def project_delete(project_id)\n params = {\n :id => project_id,\n }\n call_method('Project.Delete', params)\n end", "title": "" }, { "docid": "0e547921ae3675663baf14cbeb2a354c", "score": "0.6439416", "text": "def destroy\n @subtask = Subtask.find(params[:id])\n @subtask.destroy\n\n respond_to do |format|\n format.html { redirect_to main_app.citizen_path(params[:citizen_id]) }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "82c766f24b4d4e88819754eaf9ed0810", "score": "0.6439366", "text": "def destroy\n ClassProject.find(params[:id]).delete\n redirect_to class_projects_path\n end", "title": "" }, { "docid": "d26f5fe483bb69856bf7ef7782d2c6b9", "score": "0.64371574", "text": "def destroy\n @sub_request = SubRequest.find(params[:id])\n @sub_request.destroy\n\n respond_to do |format|\n format.html { redirect_to sub_requests_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "c407d8ba511ceba3f37385fec60bdccf", "score": "0.64265877", "text": "def destroy\n @project = self.current_uzytkownik.projects.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to(uzytkownik_projects_path(self.current_uzytkownik)) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "c37e4a4266e7ee395418131a470f1923", "score": "0.64260757", "text": "def delete\n @project = Project.find(:first, :conditions => {:id => params[:project_id], :user_id => @current_user.id})\n\n # Delete collection from eXist database\n adapter = ExistAdapter.new(@project.id)\n adapter.delete_collection(@project.id)\n\n # Delete folder in directory\n project_path = Rails.root.join(\"public\", \"projects\", @project.id.to_s).to_s\n\n FileUtils.rm_rf(project_path) if File.exists?(project_path)\n\n # Delete project from database\n @project.delete()\n\n render :status => 200, :text => \"Project deleted\"\n end", "title": "" }, { "docid": "ce10449f9ce0fd62fdc6ce11492b8372", "score": "0.64256567", "text": "def destroy\n @root = \"projects\"\n \n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "5d2070278a8b9f3eafcc0f332ab25e21", "score": "0.6419234", "text": "def destroy\n @project_stage_sub_stage.destroy\n respond_to do |format|\n format.html { redirect_to project_stage_sub_stages_url, notice: 'Sub stage was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "1d215b64968c7e0d096685ec4ae16641", "score": "0.64161175", "text": "def destroy\n @subproceso = Subproceso.find(params[:id])\n @subproceso.destroy\n\n respond_to do |format|\n format.html { redirect_to(subprocesos_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "e5554d1f34e583be631ec2cec8c74bdd", "score": "0.6410711", "text": "def destroy\n @mainproject.destroy\n respond_to do |format|\n format.html { redirect_to mainprojects_url, notice: 'El proyecto ha sido borrado satisfactoriamente.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0e78ca289eecb105780aaac28eb60e30", "score": "0.64104974", "text": "def destroy\n @subpage = Subpage.find(params[:id])\n @subpage.destroy\n\n respond_to do |format|\n format.html { redirect_to(subpages_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "6f176f7257b3778c02195fa43b63efdd", "score": "0.6407826", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n \n redirect_to dashboard_path\n end", "title": "" }, { "docid": "75b5f2f858d76dd536dbf867039fdd31", "score": "0.64055276", "text": "def delete_project(api, cookie, tg, project)\n option_hash = { accept: :json, cookies: cookie }\n events_result = api[\"task_groups/#{tg['id']}/projects/#{project['id']}/events\"].get option_hash\n if events_result && !events_result.empty?\n events = JSON.parse(events_result)\n $logger.info \"Project #{project['designation']} has #{events.count} events\"\n events.each do |event|\n res = api[\"task_groups/#{tg['id']}/projects/#{project['id']}/events/#{event['id']}\"].delete option_hash unless $dryrun\n end\n end\n res = api[\"task_groups/#{tg['id']}/projects/#{project['id']}\"].delete option_hash unless $dryrun\n twit = 14\nend", "title": "" }, { "docid": "2bc0abdd8f227d9dfdb05dcacb8c226f", "score": "0.64045656", "text": "def destroy\n @subcategory = Subcategory.find(params[:id])\n @subcategory.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_subcategories_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "974ace4b1096f5e4f6ac622ec768fcbe", "score": "0.64043003", "text": "def destroy\n @subgroup = Subgroup.find(params[:id])\n @subgroup.destroy\n\n respond_to do |format|\n format.html { redirect_to subgroups_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e3c874fa045dc2b225d53c7b54259bd3", "score": "0.6387878", "text": "def destroy\n # find the project by id\n Project.destroy(params[:id])\n\n render json: {\n message: 'ok'\n }\n\n\n # deleted_project.destroy\n\n # redirect_back(fallback_location: root_path)\n end", "title": "" }, { "docid": "335026ae15589da2fb8a9f6b444c29ef", "score": "0.63857484", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "46f0c12e2f06a700f0bcc43e53725598", "score": "0.63803583", "text": "def destroy\n @project = current_user.projects.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_projects_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "c18b330ba473df0bcf08056ae35bf3d4", "score": "0.6375611", "text": "def destroy\n @sub_topic = SubTopic.find(params[:id])\n @sub_topic.destroy\n\n respond_to do |format|\n format.html { redirect_to sub_topics_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "cbb2f32702c29dd7a5d8e7f3b59dc1ae", "score": "0.6371646", "text": "def destroy\n @subadmin = Subadmin.find(params[:id])\n @subadmin.destroy\n\n respond_to do |format|\n format.html { redirect_to subadmins_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "ec389a74463015b9f9a5f6dc1a83cf0a", "score": "0.6365394", "text": "def destroy\n @grobengineering = Grobengineering.find(params[:id])\n @grobengineering.destroy\n redirect_to project_subproject_subsubproject_grobengineerings_path(@grobengineering.subsubproject.subproject.project.id, @grobengineering.subsubproject.subproject.id, @grobengineering.subsubproject.id), :notice => 'Eintrag wurde gelöscht.'\n end", "title": "" }, { "docid": "b88b7a379b8cf1f111766797683c0b6f", "score": "0.6363228", "text": "def destroy\n # @model = Model.find(params[:id]).destroy\n @sub.destroy\n redirect_to subs_path\n end", "title": "" }, { "docid": "0ddadbf7371f33397ab54ac2892d6972", "score": "0.6362075", "text": "def destroy_project id\n delete_request \"projects/#{id}\"\n true\n end", "title": "" }, { "docid": "5257cb23106fe582c9e18aa98b4cee83", "score": "0.6360456", "text": "def deleteProject(projectId)\r\n\t\t\t\tresponse = ZohoHTTPClient.delete(getProjectUrl(projectId),getQueryMap)\r\n\t\t\t\treturn $projectParser.getResult(response)\r\n\t\t\tend", "title": "" }, { "docid": "cd18a2f4694d79db8d60436702b552ad", "score": "0.6353818", "text": "def destroy\n @project = Project.find(params[:project_id])\n @project.destroy\n redirect_to project_path(params[:course_id])\n end", "title": "" }, { "docid": "e7480543b7a06846538e9e3d9c4e70ab", "score": "0.6352151", "text": "def destroy\n @project = Project.find_by_permalink(params[:project_id])\n @project_membership = ProjectMembership.find(params[:id])\n @project_membership.destroy\n\n respond_to do |format|\n format.html { redirect_to @project }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "fd17251b5eb1aa4f5b054bc1b2af8f6d", "score": "0.63507354", "text": "def destroy\n #@user = current_user\n @project = Project.find(params[:id])\n #@project = @user.projects.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to root_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e8c168059c8892acc78d7a9ea8a629e7", "score": "0.6347377", "text": "def destroy\n @sub_path.destroy\n respond_to do |format|\n format.html { redirect_to sub_paths_url, notice: 'Sub path was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "51e078050c235bdad5fd0e87cd074bfb", "score": "0.6343891", "text": "def destroy\n @seab_sub_topic = SeabSubTopic.find(params[:id])\n @seab_sub_topic.destroy\n\n respond_to do |format|\n format.html { redirect_to seab_sub_topics_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8b865855704020915b18557cb9f51fa0", "score": "0.63373715", "text": "def destroy\n @admin_project = Admin::Project.find(params[:id])\n @admin_project.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_projects_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "9e62bfe8e594de1e22d3343854e1aa51", "score": "0.63353217", "text": "def remove_project\n membership = ProjectMember.find_by(project_id: params[:id], user_id: session[:user_id])\n project = Project.find_by(id: params[:id])\n if membership.destroy\n # Deletes project if there are no members left\n if project.members.length == 0\n project.destroy\n end\n redirect_to '/projects'\n end\n end", "title": "" }, { "docid": "55b4e0be80f6f94f30bd2aed5c92d5aa", "score": "0.63350785", "text": "def destroy\n @project = Project.where(\"id = ?\",params[:id])\n @project.destroy\n redirect_to(projects_url)\n end", "title": "" }, { "docid": "af755a6f201e80b5c78b3bace4a3e642", "score": "0.6329984", "text": "def destroy\n @side_project = SideProject.find(params[:id])\n @side_project.destroy\n\n respond_to do |format|\n format.html { redirect_to side_projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4fe6621bf1f2db7c339577437fc490fc", "score": "0.6325377", "text": "def delete_project(project_id)\n options = {:body => {:project_id => project_id\n }}\n self.class.delete(\"/projects/#{project_id}\", options)\n end", "title": "" }, { "docid": "acae97f828f2c2967632d58de6669411", "score": "0.6321326", "text": "def destroy\n @project = Project.find(params[:id])\n # If project has describe then cannot delete!\n @describe = Describe.find_by_project_id(params[:id])\n if @describe\n render :json => {:failure => true}\n else\n @project.destroy\n render :json => {:success => true}\n end\n \n end", "title": "" }, { "docid": "afaaf60371f864342866bcbdaa74d82c", "score": "0.6310209", "text": "def destroy\n session[:project_id] = nil if session[:project_id]==@project.id\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a6e3abc3d29ade98b74d1220fa0c9331", "score": "0.6308105", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n redirect_to '/administrator/projects'\n end", "title": "" }, { "docid": "3c2539804f8673066a49d8ff2ff4eb54", "score": "0.629329", "text": "def destroy\n @subcategory = Category.subcategories.get(params[:id])\n @subcategory.destroy\n \n redirect_to admin_category_url\n end", "title": "" }, { "docid": "6d26e2aa881f83800589d73eb250b1b6", "score": "0.62737113", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_projects_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "5f968c74720823a91b5b8e1839e1ecae", "score": "0.62733847", "text": "def destroy\n @subconsultant = Subconsultant.find(params[:id])\n @subconsultant.destroy\n\n respond_to do |format|\n format.html { redirect_to subconsultants_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "eb9d0f21a4d21058373a3aa3eb0d9521", "score": "0.6272942", "text": "def destroy\n @subitem = Subitem.find(params[:id])\n @subitem.destroy\n\n respond_to do |format|\n format.html { redirect_to subitems_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c990588e89cea955f41f63b1de1daec4", "score": "0.62720895", "text": "def destroy\n standard_destroy(Project, params[:id])\n end", "title": "" }, { "docid": "daeda788dd04b2378c2cf06fe20f9594", "score": "0.62711966", "text": "def destroy\n @session = Session.find(params[:id])\n if (access)\n subtask_id = @session.subtask_id\n @session.destroy\n subtask = Subtask.find(subtask_id)\n respond_to do |format|\n format.html { redirect_to edit_subtask_path(subtask) }\n format.json { head :ok }\n end\n end\n end", "title": "" }, { "docid": "eff879deceec5da58902084fd85e82b3", "score": "0.6269449", "text": "def destroy\n @sub_section = SubSection.find(params[:id])\n @sub_section.destroy\n\n respond_to do |format|\n format.html { redirect_to sub_sections_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "eff879deceec5da58902084fd85e82b3", "score": "0.6269449", "text": "def destroy\n @sub_section = SubSection.find(params[:id])\n @sub_section.destroy\n\n respond_to do |format|\n format.html { redirect_to sub_sections_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "bba8c029bf2e1d07896213c7cf47d8b0", "score": "0.6269082", "text": "def destroy\n @subtopic = Subtopic.find(params[:id])\n @subtopic.destroy\n\n respond_to do |format|\n format.html { redirect_to(subtopics_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "dc08e1a504fed187a115558cce049ee5", "score": "0.62677467", "text": "def destroy\n @subsubcategory.destroy\n respond_to do |format|\n format.html { redirect_to subsubcategories_url, notice: 'Subsubcategory was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e5343a3ad15d7068f091d805c293ebbf", "score": "0.62602335", "text": "def destroy\n @subcategory = JobSubcategory.find(params[:id])\n @subcategory.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_job_subcategory_url }\n end\n end", "title": "" }, { "docid": "c730619a7991376885d16cbd7b34af50", "score": "0.6259888", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n render json: {success: \"ok\"}\n\n end", "title": "" }, { "docid": "df1101db19cc8d47f0cdb04435ba72c2", "score": "0.6254106", "text": "def destroy\n \n @sub_grupo.destroy\n redirect_to \"/sub_grupos?grupo_id=\"+@sub_grupo.grupo_id.to_s\n \n end", "title": "" }, { "docid": "fa8e493c4806616aad00a5c22581f2c3", "score": "0.623944", "text": "def destroy\n @title = \"Уничтожение проекта\"\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a8df7f1375a12faae4a8b0f412d27cb8", "score": "0.62374043", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n redirect_to user_path(current_user), notice: 'Project was successfully deleted.'\n end", "title": "" }, { "docid": "e68f8c05507921dd1e8521c12c40fbbd", "score": "0.6237285", "text": "def destroy\n @suborder = Suborder.find(params[:id])\n @suborder.destroy\n\n respond_to do |format|\n format.html { redirect_to(suborders_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "593b9e0a35c67d725942f6a7bb3572c5", "score": "0.6234875", "text": "def delete_subaccount\n subaccount = ProfileId.find(params[:id])\n raise \"No such subaccount\" if subaccount.nil?\n emailaccount = subaccount.emailaccount\n subaccount.destroy\n respond_to do |format|\n format.html { redirect_to(emailaccount_path(emailaccount), :notice => \"Deleted ProfileId\") }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "aefbafae6d2dbcadb00be1af8dac3eaf", "score": "0.6231916", "text": "def destroy\n @project = current_user.projects.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4a8b76eab91add014d4cebb1f84f3011", "score": "0.623171", "text": "def destroy\n @web_project = WebProject.find(params[:id])\n @web_project.destroy\n\n respond_to do |format|\n format.html { redirect_to web_projects_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "0ae49a6e24b9bdae48e76ef0b765d33f", "score": "0.6230712", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n redirect_to projects_path\n end", "title": "" }, { "docid": "785dadcfe56f3a5e14d2219c7629e748", "score": "0.62270886", "text": "def destroy\n @project=Project.find(params[:id])\n @stories=Story.where(project_id: @project.id)\n if current_user.admin?\n @project.destroy\n end\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f7ccf28e159ce0181f735d4fa8bc6c2b", "score": "0.62259394", "text": "def deleteprojects(id)\n @projects = Project.find_all_by_user_id(id)\n @projects.each do |project|\n project.destroy\n project.sfiles.each do |file|\n file.destroy\n end\n project.jobs.each do |job|\n job.destroy\n end\n end\n end", "title": "" }, { "docid": "b1853b80b72ce0717a21467d139c1b53", "score": "0.6222608", "text": "def destroy\n @pro_concrete_sub.destroy\n respond_to do |format|\n format.html { redirect_to pro_concrete_subs_url, notice: 'Pro concrete sub was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "372ed85e8f050a49acfb6d4a1d79ba73", "score": "0.6221665", "text": "def destroy\n @project = Project.find(params[:project_id])\n @project.project_fundings.find(params[:id]).delete\n\n respond_to do |format|\n format.html { redirect_to(project_fundings_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "806d6e1e49f37dd88b20d61304b481e8", "score": "0.62212646", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n flash.now[:success] = \"Project was sucessfully deleted.\"\n redirect_to projects_url\n end", "title": "" }, { "docid": "c0e7a898b6f0da1e02b90373f96313e9", "score": "0.6215941", "text": "def destroy\n @subclase = Subclase.find(params[:id])\n @subclase.destroy\n\n respond_to do |format|\n format.html { redirect_to subclases_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8e8c61df2e804db524f6fc07c6a323f6", "score": "0.6212503", "text": "def delete_project(id, options = T.unsafe(nil)); end", "title": "" }, { "docid": "ab4ef2e8c5c266cf46b967e7bb9d2149", "score": "0.6212049", "text": "def destroy\n @project = Project.find(params[:id]) if params[:id].present?\n @project.destroy\n log_admin(\"AdminLog: Projekt destroyed\")\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e60a8bfdc8484c99a3257a3fd5e26453", "score": "0.62046975", "text": "def destroy\n @subapp = Subapp.find(params[:id])\n @subapp.destroy\n\n respond_to do |format|\n format.html { redirect_to(subapps_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "30e8870ecd4342094ff22d6d14ea2318", "score": "0.6201358", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n redirect_to projects_path, :notice => 'Project deleted'\n end", "title": "" }, { "docid": "f75e39df6ff0f92d23c70305b2b81a37", "score": "0.6198984", "text": "def destroy\n @project.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "67c9dcd570fcf2a6e9658e57f77730b3", "score": "0.61936235", "text": "def destroy\n @sub_section = SubSection.find(params[:id])\n @sub_section.destroy\n\n respond_to do |format|\n format.html { redirect_to(sub_sections_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "8cfa171df9f767239f08807b72b03d51", "score": "0.6191344", "text": "def destroy\n @subprogram.destroy\n respond_to do |format|\n format.html { redirect_to subprograms_url, notice: 'El subprograma ha sido eliminado.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4f5b83ec0487d871a9b85faee869f419", "score": "0.61839503", "text": "def delete_all\n projectid = params[:project_id]\n subprojectid = params[:subproject_id]\n subsubprojectid = params[:subsubproject_id]\n Grobengineering.where(:subsubproject_id => subsubprojectid).delete_all\n redirect_to project_subproject_subsubproject_grobengineerings_path(projectid, subprojectid, subsubprojectid),\n :notice => 'Einträge erfolgreich gelöscht'\n end", "title": "" }, { "docid": "587ccf5744e036cbae7e4136b3ed18a8", "score": "0.6183459", "text": "def destroy\n @subtask.destroy\n respond_to do |format|\n format.html { redirect_to '/work_breakdown_structures/'+Task.find_by(id: @subtask.task_id).wbs_id.to_s+'/edit', notice: 'Teilaufgabe wurde erfolgreich gelöscht' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "97831d38d3f8e0cbae8259e240267f99", "score": "0.61834586", "text": "def destroy\n @project = Project.find(params[:id])\n @experiments = Experiment.where(\"project_id = :project_id\", {:project_id => @project.id})\n @experiments.delete_all\n @project.destroy\n\n redirect_to(projects_url) \n end", "title": "" }, { "docid": "13983c753aa08bfb53b7ca05edf91551", "score": "0.61831874", "text": "def destroy\n @project = Project.find_by_slug(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to(projects_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "f94f5218c36466b26c738798976810cb", "score": "0.6179659", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to mrta_projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "22f624ca095350d42ec6cd862e562bdd", "score": "0.61748046", "text": "def destroy\n @project = Project.find(params[:id])\n if @project.destroy\n flash[:notice] = \"Trabalho apagado\"\t\t\t\n else\t\t\t\t\t\t\t\t\t\t\t\n flash[:error] = \"Houve um problema ao apagar o trabalho\"\t\n end\t\t\t\t\t\t\t\t\t\t\t\t\n redirect_to projects_path\n end", "title": "" } ]
39746295c05f1785e70248451a797667
Choose a suitable renderer for this page and request.
[ { "docid": "40e0e3eae2d254b85db6b5417061f42d", "score": "0.8033412", "text": "def renderer_for(page)\n (\n Scrapple.renderer(params['renderer']) ||\n Scrapple.renderer(page['renderer']) ||\n Scrapple.renderer(Scrapple.config[\"default_renderers\"][page.type]) ||\n Scrapple.renderer(Scrapple.config[\"fallback_renderer\"])\n )\n end", "title": "" } ]
[ { "docid": "18a61a8ea291a5ed9127fed6116b8a76", "score": "0.68011075", "text": "def renderer(type = :basic, options = {})\n @renderer ||= Renderer.select(type).new(self, options)\n end", "title": "" }, { "docid": "05c3537fb66f41ed1f2807562fbd364a", "score": "0.67653406", "text": "def default_renderer=(renderer)\n @default_renderer = renderer.is_a?(Class) ? renderer.new : renderer\n end", "title": "" }, { "docid": "4123f55960a309377748128a8c7d8563", "score": "0.66864544", "text": "def renderer_class\n return @renderer_class unless @renderer_class.nil?\n if not meta.renderer.nil? \n renderer = Regexp.new(\"(:|^)\" + Regexp.escape(meta.renderer) + \"$\", :ignorecase)\n @renderer_class = Tilt.mappings.values.flatten.select{ |obj| renderer.match(obj.name) }.first\n @renderer_class = Object.const_get(\"Tilt\").const_get(meta.renderer) if @renderer_class.nil?\n else\n @renderer_class = Tilt[engine_name]\n end\n raise \"Template engine not found: #{meta.renderer || engine_name}\" if @renderer_class.nil?\n @renderer_class\n end", "title": "" }, { "docid": "ba29c6f947df684dec5fd5b30e98a6ff", "score": "0.6663307", "text": "def renderer #:nodoc:\n @renderer ||= ActionView::Renderer.new(lookup_context)\n end", "title": "" }, { "docid": "372faa3a17b196d992542c1b9c0caad4", "score": "0.66149324", "text": "def renderer(key)\n renderers[key] || @renderer || Renderer\n end", "title": "" }, { "docid": "56afd6b8ce5572da1fe28c5586b5e103", "score": "0.660196", "text": "def renderer_instance(options)\n return renderer.new(options) unless options[:renderer]\n\n if options[:renderer].is_a?(Symbol)\n registered_renderer = SimpleNavigation.registered_renderers[options[:renderer]]\n registered_renderer.new(options)\n else\n options[:renderer].new(options)\n end\n end", "title": "" }, { "docid": "077593018e96fcfa2a5af909cc259f8f", "score": "0.6599217", "text": "def set_renderer\n @renderer = Renderer.find(params[:id])\n end", "title": "" }, { "docid": "077593018e96fcfa2a5af909cc259f8f", "score": "0.6599217", "text": "def set_renderer\n @renderer = Renderer.find(params[:id])\n end", "title": "" }, { "docid": "077593018e96fcfa2a5af909cc259f8f", "score": "0.6599217", "text": "def set_renderer\n @renderer = Renderer.find(params[:id])\n end", "title": "" }, { "docid": "b35c1ad0e26542038d5302459ddc601a", "score": "0.6585389", "text": "def renderer(name)\n @renderers[name]\n end", "title": "" }, { "docid": "5eb106f7ec0fc8fbdb91725bf16edb58", "score": "0.65825206", "text": "def renderer(engine = nil)\n if engine\n @renderer = engine\n else\n @renderer || nil\n end\n end", "title": "" }, { "docid": "5eb106f7ec0fc8fbdb91725bf16edb58", "score": "0.65825206", "text": "def renderer(engine = nil)\n if engine\n @renderer = engine\n else\n @renderer || nil\n end\n end", "title": "" }, { "docid": "439e5588b8d0e187424a9d19dce9f532", "score": "0.656577", "text": "def renderer(*renderer)\n options[:renderers] = renderer\n end", "title": "" }, { "docid": "1354350d123a7c4a43ea031406931912", "score": "0.6536759", "text": "def renderer(name, *args)\n if r = renderers.find{|triple| triple[0] == name}\n r[2].new(*args)\n else\n raise \"No renderer registered for #{name}\"\n end\n end", "title": "" }, { "docid": "74372802f75499bdcdeba694a4da3a29", "score": "0.6526279", "text": "def renderer_for(snip)\n if snip\n renderer_name = snip.render_as || snip.extension\n renderer_name = nil if renderer_name == ''\n else\n renderer_name = nil\n end\n if renderer_name\n find_renderer(renderer_name)\n else\n config.default_renderer\n end\n end", "title": "" }, { "docid": "c858ab41080c47b9e47341f0405bb589", "score": "0.6474183", "text": "def renderer r\n @renderer = r\n end", "title": "" }, { "docid": "68c5e73d3fa4c3ea6ecc5d6f8af1fc74", "score": "0.6343931", "text": "def renderer\n @renderer ||= Renderer.new(self.class.template)\n end", "title": "" }, { "docid": "5a0e400c1d14c459d46066b3bd23c670", "score": "0.6336042", "text": "def generate_renderer\n return options.delete(:renderer) if options.key?(:renderer)\n\n covert_options_to_aliases!\n\n # Pick a renderer\n renderer = MiddlemanRedcarpetHTML\n\n if options.delete(:smartypants)\n # Support SmartyPants\n renderer = Class.new(renderer) do\n include ::Redcarpet::Render::SmartyPants\n end\n end\n\n # Renderer Options\n possible_render_opts = [:filter_html, :no_images, :no_links, :no_styles, :safe_links_only, :with_toc_data, :hard_wrap, :xhtml, :prettify, :link_attributes]\n\n render_options = possible_render_opts.each_with_object({}) do |opt, sum|\n sum[opt] = options.delete(opt) if options.key?(opt)\n end\n\n renderer.new(render_options)\n end", "title": "" }, { "docid": "7298dafe7aa968599f1b9773b1b33933", "score": "0.6320793", "text": "def set_browser_reader_renderer\n @browser_reader_renderer = BrowserReaderRenderer.find(params[:id])\n end", "title": "" }, { "docid": "57fea8d77ad2cd6c0f1e743c72f94a1f", "score": "0.6288875", "text": "def renderer(path) ; Views.renderer_for(path) ; end", "title": "" }, { "docid": "64f3c07dcf797b81432f3cb8ee13f355", "score": "0.6276568", "text": "def renderer_for(snip)\n if snip && snip.render_as && !snip.render_as.empty?\n Vanilla::Renderers.const_get(snip.render_as)\n elsif snip && snip.extension && !snip.extension.empty?\n Vanilla::Renderers.const_get(renderer_for_extension(snip.extension))\n else\n default_renderer\n end\n end", "title": "" }, { "docid": "44454666329629a0a40e3d3bdceac4a3", "score": "0.62164605", "text": "def converter(renderer)\n result = nil\n renderer_config = read_config[renderer.to_s]\n result = render_type(renderer_config) if renderer_config\n result ||= DefaultConverter.new(nil)\n result\n end", "title": "" }, { "docid": "e5f38a6ef165aa1d1e435c273fb539b5", "score": "0.6141973", "text": "def use_renderers(*args); end", "title": "" }, { "docid": "a01a5a0e5ea6e52b3a8f15591234d905", "score": "0.6104383", "text": "def select(type)\n RENDERER_MAPPER[type || :basic]\n end", "title": "" }, { "docid": "8ac9538fddf7a004652d7c886c0a539c", "score": "0.60831904", "text": "def renderer_class\n Wee::DefaultRenderer\n end", "title": "" }, { "docid": "0163eda4052d57e845f53f8a9bca1ffa", "score": "0.60719323", "text": "def dc_render(renderer, opts={})\n return dc_render_design_part(renderer[:part]) if renderer.class == Hash\n# \n opts[:edit_mode] = session[:edit_mode] \n opts[:editparams] = {}\n opts = @options.merge(opts) # merge options with parameters passed on site, page, design ...\n opts.symbolize_keys! # this makes lots of things easier\n# Create renderer object\n klass = renderer.to_s.downcase\n klass += '_renderer' unless klass.match('_renderer') #\n obj = Kernel.const_get(klass.classify, Class.new).new(self, opts) rescue nil\n# \n if obj\n html = obj.render_html\n @css << obj.render_css.to_s\n html.nil? ? '' : html.html_safe # nil can happened \n else\n \"Class #{klass} not defined!\"\n end\nend", "title": "" }, { "docid": "944c2eef405b5efffe60cb2ab541f6fb", "score": "0.60368824", "text": "def renderer(name, *args)\n if r = registered.find{|triple| triple.first == name}\n r.last.new(*args)\n else\n raise \"No renderer registered for #{name}\"\n end\n end", "title": "" }, { "docid": "021d3a79cf3c958e9d1466683711cfa4", "score": "0.6034704", "text": "def choose_renderer(format)\r\n case format\r\n when :csv\r\n Datatables::Renderers::Csv.new\r\n else\r\n # Default to JSON\r\n Datatables::Renderers::Json.new\r\n end\r\n end", "title": "" }, { "docid": "c751d5c1cb73b7d4e5bb68901a935420", "score": "0.5993459", "text": "def renderer_for(snip)\n return Renderers::Base unless snip.render_as && !snip.render_as.empty?\n Vanilla::Renderers.const_get(snip.render_as)\n end", "title": "" }, { "docid": "17442aee49a74a80aa3993bec2c27a2d", "score": "0.59668803", "text": "def has_renderer?; end", "title": "" }, { "docid": "992859ab3161131072ace80261d084fd", "score": "0.59635687", "text": "def render( renderer = nil )\n Webby.deprecated \"render\", \"it is being replaced by the Renderer#render() method\"\n renderer ||= ::Webby::Renderer.new(self)\n renderer._render_page\n end", "title": "" }, { "docid": "a2e4cb7556b8170c912a6522ec842f98", "score": "0.59634185", "text": "def dc_render(renderer, opts={})\n return dc_render_design_part(renderer[:part]) if renderer.class == Hash\n\n opts[:edit_mode] = session[:edit_mode] \n opts[:editparams] = {}\n \n opts = @options.merge(opts) # merge options with parameters passed on site, page, design ...\n opts.symbolize_keys! # this makes lots of things easier\n # Create renderer object\n klass = renderer.to_s.downcase\n klass += '_renderer' unless klass.match('_renderer') #\n obj = Kernel.const_get(klass.classify, Class.new).new(self, opts) rescue nil\n\n if obj\n html = obj.render_html\n @css << obj.render_css.to_s\n html.nil? ? '' : html.html_safe # nil can happened \n else\n I18n.t 'drgcms.no_class', class: klass\n end\nend", "title": "" }, { "docid": "3cb65d83a956cb5f77bf54c2165893f9", "score": "0.5926643", "text": "def view_renderer # :nodoc:\n # Lifespan: Per controller\n @_view_renderer ||= ActionView::Renderer.new(lookup_context)\n end", "title": "" }, { "docid": "138b03ce444c8dce3920c9e78b328853", "score": "0.59262186", "text": "def default_renderer\n @default_renderer ||= Ariane::Render::HTMLList.new\n end", "title": "" }, { "docid": "922da2a4295286fffb3d08225c3a3077", "score": "0.58793455", "text": "def renderer; end", "title": "" }, { "docid": "922da2a4295286fffb3d08225c3a3077", "score": "0.58793455", "text": "def renderer; end", "title": "" }, { "docid": "d918bf49841c0f95e5db146a40ae0e78", "score": "0.58697045", "text": "def renderer\n # view = if controller.response.template\n # controller.response.template\n # else\n View.new controller, master_helper_module\n # end\n \n # view.extend Extensions::View\n end", "title": "" }, { "docid": "4be141f119fd21a94b1ba02fe843d5a2", "score": "0.5843249", "text": "def page=(page)\n return if @page == page\n\n @page = page\n @available_renderers =\n available_renderers.map_value do |_key, (value, render_options)|\n new_render = value.class.new(page)\n disconnect(value, SIGNAL(\"updated()\"))\n connect(new_render, SIGNAL(\"updated()\"),\n self, SIGNAL(\"updated()\"))\n [new_render, render_options]\n end\n end", "title": "" }, { "docid": "5ef7b281cb94434f7563055d751a350d", "score": "0.5818925", "text": "def renderer\n HtmlRenderer.new(self)\n end", "title": "" }, { "docid": "5ef7b281cb94434f7563055d751a350d", "score": "0.5818925", "text": "def renderer\n HtmlRenderer.new(self)\n end", "title": "" }, { "docid": "5ef7b281cb94434f7563055d751a350d", "score": "0.5818925", "text": "def renderer\n HtmlRenderer.new(self)\n end", "title": "" }, { "docid": "5ef7b281cb94434f7563055d751a350d", "score": "0.5818925", "text": "def renderer\n HtmlRenderer.new(self)\n end", "title": "" }, { "docid": "248ac7bed6eb4636b2d1829f7bbcf947", "score": "0.57968473", "text": "def try_render(object, detour_name=nil, responder)\n engine = responder.derive_engine_name_from_format\n begin \n if engine == :to\n if mime_type(:json) == preferred_type.to_s \n if responder.jsend? && object.respond_to?(:attributes)\n return {:status => response.status, :data => object.attributes}.to_json\n else\n return object.to_json if object.respond_to?(:to_json)\n end\n end\n\n if mime_type(:xml) == preferred_type.to_s\n return object.to_xml if object.respond_to?(:to_xml)\n end\n else\n render responder.view_name, responder.render_options\n end\n rescue Exception => e\n raise ::Scorched::Responders::ResponderError, e.message\n end\n end", "title": "" }, { "docid": "48b4cd937e4d1dbea848bd9224f4cc11", "score": "0.57781607", "text": "def renderer\n @renderers = Renderer.all\n end", "title": "" }, { "docid": "ec3ddd4d8366f9c04cccdf69ad6ea679", "score": "0.57401216", "text": "def default_render\n @renderit_template ||= RenderIt.get_template_name(request)\n template_path = default_template_name + '_' + @renderit_template\n if view_paths.find_template(template_path, default_template_format)\n render template_path\n end\n rescue ActionView::MissingTemplate => e\n render default_template_name\n end", "title": "" }, { "docid": "5c1ac90950ad15573f2ae0dc2e8aa544", "score": "0.5733526", "text": "def renderer\n # wouldn't @parent.renderer work here? I believe so\n document.renderer\n end", "title": "" }, { "docid": "8660c20ee5a54ef18117073590a95f45", "score": "0.5725087", "text": "def renderer\n Asciidoctor.debug \"Section#renderer: Looking for my renderer up in #{@parent}\"\n @parent.renderer\n end", "title": "" }, { "docid": "ab82852accf68f7fb6b762862df8720f", "score": "0.57224655", "text": "def render renderer, options\n # options.format! view\n renderer.instance_variable_set(:@_content_type, options.format || :html)\n path_store.cached options do\n path = template_path renderer, options\n options.file = path\n renderer.send :render, path.to_s, options.to_render_options\n end\n end", "title": "" }, { "docid": "417f1ea34b13e971fded0f5117dea65f", "score": "0.5713318", "text": "def render! renderer\n raise NotImplementedError\n end", "title": "" }, { "docid": "e2281064ae8e52749f6de4867c014687", "score": "0.57050043", "text": "def default_render; end", "title": "" }, { "docid": "991e712d64a87b07d26b2118dd90d25f", "score": "0.5683529", "text": "def renderer\n @document.renderer\n end", "title": "" }, { "docid": "991e712d64a87b07d26b2118dd90d25f", "score": "0.5683529", "text": "def renderer\n @document.renderer\n end", "title": "" }, { "docid": "991e712d64a87b07d26b2118dd90d25f", "score": "0.5683529", "text": "def renderer\n @document.renderer\n end", "title": "" }, { "docid": "991e712d64a87b07d26b2118dd90d25f", "score": "0.5683529", "text": "def renderer\n @document.renderer\n end", "title": "" }, { "docid": "3041deecaca8121aa8ad2ddab35dc84f", "score": "0.5667938", "text": "def find_renderer_class(name)\n @cache ||= { translated_facet: TranslatedFacetRenderer,\n translated_doi: TranslatedDoiRenderer,\n faceted: CurationConcerns::Renderers::FacetedAttributeRenderer,\n date: CurationConcerns::Renderers::DateAttributeRenderer,\n linked: CurationConcerns::Renderers::LinkedAttributeRenderer,\n external_link: CurationConcerns::Renderers::ExternalLinkAttributeRenderer }\n return @cache[name] if @cache.include?(name)\n\n @cache[name] = super\n end", "title": "" }, { "docid": "4d2e722ba07aa4655b80c3a144c07d67", "score": "0.56478965", "text": "def default_render(*args)\n if matestack_page_class = default_render_matestack_page_class\n render matestack: matestack_page_class\n else\n super\n end\n end", "title": "" }, { "docid": "1ca265e0ad34a06c10fcd85a52a2e8ac", "score": "0.56395227", "text": "def renderers\n instance.options[:renderers]\n end", "title": "" }, { "docid": "926e36ba07afd666fe0e57152774d39e", "score": "0.56135863", "text": "def renderer\n View.new context, self._helpers\n end", "title": "" }, { "docid": "ba7540edb6f668354f5377c779df9436", "score": "0.5605068", "text": "def render\n Argyle.activate\n\n @renderer.render(current_page)\n end", "title": "" }, { "docid": "7035ebd7e58833fa69f65ba951f51bc1", "score": "0.56022304", "text": "def set_format\n debug_message \"request.format is #{request.format.to_sym} (#{request.format.to_s}).\" unless request.format.nil?\n if request.format and request.format.html? or client_user_agent.html? or client_user_agent.msie?\n unless params_format?\n mime_type = client_user_agent\n params[:format] = mime_type.to_sym\n request.format = mime_type.to_sym\n request.path_parameters = request.path_parameters.merge(:format => params[:format].to_s)\n else\n mime_type = Dynamime::Type.lookup_by_extension params[:format]\n end\n end\n\n begin\n debug_message \"using '#{mime_type.to_sym}' (#{mime_type.to_s}) for rendering.\"\n rescue\n debug_message \"requested MIME type '#{request.format}' was not found!\"\n end\n end", "title": "" }, { "docid": "5bfe4ca29ce89091ce3b56dd5e34534c", "score": "0.5592154", "text": "def by_mime_type(mime_type, *args)\n if r = registered.find{|_,_,c| c.mime_type == mime_type}\n r.last.new(*args)\n else\n raise UnsupportedMimeTypeError, \"No renderer for `#{mime_type}`\"\n end\n end", "title": "" }, { "docid": "dcc982c864814c523db0d6a8ca8857e9", "score": "0.5576715", "text": "def renderer\n @renderer ||= Redcarpet::Render::HTML.new(filter_html: true, hard_wrap: true)\n end", "title": "" }, { "docid": "c7accdd828afc5aae1705e6788cd3b10", "score": "0.5569726", "text": "def renderer_instances\n [SlideshareRenderer, YoutubeRenderer, MarkdownRenderer, NotebookRenderer, TextRenderer, PdfRenderer, ImageRenderer, BlankRenderer]\n end", "title": "" }, { "docid": "90ba279db33b89aa3ec360608abea476", "score": "0.55587924", "text": "def renderer_cached?; end", "title": "" }, { "docid": "9f2bb46081e18b5b5daeff3f02621e26", "score": "0.5555855", "text": "def renderer_classes\n self.class.classes_from(namespace).select { |cand| renderer? cand }\n end", "title": "" }, { "docid": "14fc2362c140142a29375d091247cc78", "score": "0.5530556", "text": "def renderer?(candidate)\n begin\n renderer_with_methods! candidate\n renderer_with_formats! candidate\n rescue Occi::Core::Errors::RendererError => ex\n logger.debug \"Renderer validation failed with #{ex.message}\"\n return false\n end\n\n candidate.renderer?\n end", "title": "" }, { "docid": "80e4dd5706a60d9ba0b1a3304f4c21ff", "score": "0.5528425", "text": "def has_renderer?\n Renderers::RENDERERS.include?(format)\n end", "title": "" }, { "docid": "82ebc76f0a0f6c6731c627eda91f2bb7", "score": "0.5512843", "text": "def renderer\n Mediator::Renderer.new self\n end", "title": "" }, { "docid": "0a769fc4d342ea0149c29754f22a37d8", "score": "0.55069464", "text": "def rendering\n renderings.first || Rendering.new\n end", "title": "" }, { "docid": "c5a988fa7d4d7feb62be1f49e165069d", "score": "0.54893124", "text": "def renderer\n @renderer ||= Renalware::API::UKRDC::PatientsController.renderer\n end", "title": "" }, { "docid": "c40394b95a82328c0b90cfbc41f32bfe", "score": "0.5488751", "text": "def renderer(sym)\n @vr_renderer[sym]\n end", "title": "" }, { "docid": "d8aba712e183e317d4b4a6305f292e70", "score": "0.54838014", "text": "def select_render action=nil\n # defaults to current action, though another may be specified, even a full path\n \"#{action || @action}_\"+\n case\n when injector?\n \"injector\"\n when dialog?\n \"modal\"\n else\n \"page\"\n end\n end", "title": "" }, { "docid": "1faea99f17c93f6b288133b0d2f7a4b1", "score": "0.5464051", "text": "def render(*args)\n options = args.extract_options!\n renderer_class = options[:renderer] || Crumby::Renderer.default_renderer\n raise ArgumentError if not renderer_class.class == Class or not renderer_class.ancestors.include? Crumby::Renderer::Base\n view = args.first\n renderer_class.new(self, view, options).render\n end", "title": "" }, { "docid": "3f8d4e40e2d58e0954b2a77a1bb7425e", "score": "0.5451313", "text": "def render(renderer)\n renderer.inheritance(@from, @to)\n end", "title": "" }, { "docid": "2166fd787f058b555b0ac46c49fe3851", "score": "0.5437001", "text": "def renderers\n @_memoized_render_types ||= begin\n Suite::Renderers.default_renderers\n end\n end", "title": "" }, { "docid": "d5f69ac16bd1753e7f8b8c522bf0719d", "score": "0.5419419", "text": "def render(renderer=nil)\n renderer ||= Ariane.default_renderer\n renderer = renderer.new if renderer.is_a?(Class)\n renderer.render(crumbs)\n end", "title": "" }, { "docid": "52cab21db34ecb4d54a29666b08bcc7c", "score": "0.5412301", "text": "def renderer\n # If we don't set this up, Ruby will get confused and possibly\n # crash when calling variables, methods, or name that may be the\n # same.\n scope = self\n\n # Create a class that can handle all of our \n Class.new(Tilt::PlainTemplate).tap do |klass|\n # Setup the pipeline as a class variable so that\n # the render call can get to it.\n klass.define_singleton_method :pipeline do\n scope.pipeline\n end\n\n # Now setup the renderer to use the pipeline.\n klass.class_eval do\n # Render everything from the pipeline, ja.\n def evaluate(scope, locals, &block)\n result = self.class.pipeline.call(data)\n result[:output].to_s\n end\n end\n end\n end", "title": "" }, { "docid": "fda3ef1394f42918c2e020056b5a5560", "score": "0.54122233", "text": "def render(options = {}, extra_options = {}, &block)\n\t\t\tcase options\n\t\t\twhen Hash\n\t\t\t if options[:page]\n\t\t\t\trender_page options[:page], options\n\t\t\t elsif options[:partial] # Only partials can take blocks\n\t\t\t\trender_partial options[:partial], options, &block\n\t\t\t end\n\t\t\t# `options` param is the name of the page view\n\t\t\twhen String\n\t\t\t render_page options, extra_options\n\t\t\telse\n\t\t\t raise ArgumentError 'options parameter must be a Hash or String'\\\n\t\t\t\t' You passed a(n)' + options.class.name + '.'\n\t\t\tend\n\t\t end", "title": "" }, { "docid": "350af36e861d074dffd8d429a49e711a", "score": "0.53823626", "text": "def default_render\n if @default_response\n @default_response.call(options)\n elsif !get? && has_errors?\n controller.render({ status: error_status }.merge!(options))\n else\n controller.render(options)\n end\n end", "title": "" }, { "docid": "d3a8618456b28167edaafc3357840ad4", "score": "0.5381102", "text": "def renderer\n @parent.renderer\n end", "title": "" }, { "docid": "d3a8618456b28167edaafc3357840ad4", "score": "0.5381102", "text": "def renderer\n @parent.renderer\n end", "title": "" }, { "docid": "afbcba3277664a29381508e17f16ba91", "score": "0.5365571", "text": "def default_render\n @default_response.call\n end", "title": "" }, { "docid": "72b7b18a8472444945ade5e64f34b564", "score": "0.5358258", "text": "def render\n if renderer.respond_to?(:render_tab)\n renderer.render_tab(self, get_or_call(name), get_or_call(options), tab_render_options)\n else\n renderer.render(get_or_call(name), get_or_call(options), tab_render_options)\n end\n end", "title": "" }, { "docid": "a04c77e37e6b566fda336c4b8dceb20f", "score": "0.5348515", "text": "def initialize(page = nil)\n super()\n @page = page\n @available_renderers = Hash.new\n end", "title": "" }, { "docid": "a00b2230021c187cfbc4a4bd674cdaca", "score": "0.5347842", "text": "def render name = nil, opts = {}\n return if response.body?\n\n # respond with not found\n # * if format provided /foo.png\n # * and error not triggered\n # error.not_found('%s document Not Found' % nav.format.to_s.upcase) if nav.format && !$!\n\n if name.class == Hash\n opts.merge! name\n else\n opts[:template] = name\n end\n\n opts = opts.to_hwia :text, :plain, :html, :json, :javascript, :cache, :template, :layout, :render_to_string, :data, :status, :ttl, :content_type\n\n opts.layout ||= false if @lux.layout == false\n\n # set response status and content_type\n response.status opts.status if opts.status\n response.content_type = opts.content_type if opts.content_type\n\n # match rails nameing\n opts.text = opts.plain if opts.plain\n\n # copy value from render_cache\n opts.cache = @lux.render_cache if @lux.render_cache\n\n # we do not want to cache pages that have flashes in response\n opts.cache = nil if response.flash.present?\n\n page = if opts.cache\n return if etag opts.cache\n\n add_info = true\n data = Lux.cache.fetch opts.cache, ttl: 3600 do\n add_info = false\n render_resolve(opts)\n end\n\n if add_info && data\n response.header['x-lux-cache'] = 'render-cache'\n data += '<!-- from page cache -->' if data =~ %r{</html>\\s*$}\n end\n\n data\n else\n render_resolve(opts)\n end\n\n if opts.render_to_string\n page\n else\n response.body page\n throw :done\n end\n end", "title": "" }, { "docid": "d37a0262421b18554507d996937fafe2", "score": "0.5334378", "text": "def each_renderer\n renderers.each(&Proc.new)\n end", "title": "" }, { "docid": "1bf3fb886b34d9ff5916a9005bee8d6f", "score": "0.5323614", "text": "def render(options={})\n self.renderer.new(options).render(self)\n end", "title": "" }, { "docid": "29ed50a190af915373366141535f68d0", "score": "0.5307566", "text": "def create(type)\n case type\n when :text\n TextReportRenderer.new(@report)\n when :json\n JsonReportRenderer.new(@report, true)\n when :html\n HtmlReportRenderer.new(@report)\n when :xml\n XmlReportRenderer.new(@report)\n else\n raise \"Unknown report renderer type #{type}\"\n end\n end", "title": "" }, { "docid": "cefcead16ad6f817146be9a580450637", "score": "0.53037864", "text": "def create_renderer tag_name \n renderer_class_name = renderer_name(tag_name)\n factory.create(renderer_class_name)\n end", "title": "" }, { "docid": "dc17b50665edbb760fad708fb31298a3", "score": "0.52988917", "text": "def render( options = {} )\n renderer = create_renderer \n renderer.render( options )\n end", "title": "" }, { "docid": "07774c30007815b2b2555df04fd22af5", "score": "0.527858", "text": "def set_render_format\n @render_format = @app.clusters.first.job_config[:adapter] unless @app.clusters.empty?\n end", "title": "" }, { "docid": "00a04e2c05c035e117708a8fe248fc18", "score": "0.5277839", "text": "def renderer_for_ext(ext, &block)\n @_tmpl ||= case ext.to_s\n when \"erb\"\n Tilt::ErubiTemplate.new(component_template_path,\n outvar: \"@_erbout\",\n bufval: \"Bridgetown::OutputBuffer.new\",\n engine_class: Bridgetown::ERBEngine,\n &block)\n when \"serb\"\n Tilt::SerbeaTemplate.new(component_template_path, &block)\n when \"slim\" # requires bridgetown-slim\n Slim::Template.new(component_template_path, &block)\n when \"haml\" # requires bridgetown-haml\n Tilt::HamlTemplate.new(component_template_path, &block)\n else\n raise NameError\n end\n rescue NameError, LoadError\n raise \"No component rendering engine could be found for .#{ext} templates\"\n end", "title": "" }, { "docid": "53b033770a95ca9ca20d982db690a975", "score": "0.5237288", "text": "def choose_method\n # renders static page\n end", "title": "" }, { "docid": "5b4b71088e5a1a0edf92611c11664b64", "score": "0.52369916", "text": "def render_from_request_path(path)\n if view_path = view_path_from_request_path(request.path_info)\n ext = File.extname(view_path)\n if engine = ENGINES_BY_EXT[ext]\n view_basename = view_path.gsub(/#{ext}\\Z/,'')\n send(engine, view_basename.to_sym)\n else\n halt(500, \"Unkwnown rendering engine for #{view_path}\")\n end\n else\n halt 404, erb(:'404')\n end\n end", "title": "" }, { "docid": "6f604825493d2abe44cdd4c089c2855e", "score": "0.52331233", "text": "def getRenderEngineByName( name )\n\n # parameter TypeCheck\n #BIMserverAPI::TypeCheck::String( name )\n\n # BIMserver request\n request( { name: name } )\n end", "title": "" }, { "docid": "342fd2355530eb9e6f261c638c866fdd", "score": "0.5227966", "text": "def render(options = {})\n renderer_instance(options).render(self)\n end", "title": "" }, { "docid": "342fd2355530eb9e6f261c638c866fdd", "score": "0.5227966", "text": "def render(options = {})\n renderer_instance(options).render(self)\n end", "title": "" }, { "docid": "587dc76ecc59f5749035ba98dc62f10c", "score": "0.52246237", "text": "def on_render( &block )\n @renderer = block\n end", "title": "" }, { "docid": "f740ab18e8c45ca55a53bd3279388b1c", "score": "0.521356", "text": "def show\n @renderer = Renderer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @renderer }\n end\n end", "title": "" }, { "docid": "e0e3d88badb5e3593b392911df77f0c5", "score": "0.5199203", "text": "def render(*args, &block)\n super(*args, &block)\n\n options = _normalize_render(*args, &block)\n\n self.content_type ||= Mime[lookup_context.rendered_format].to_s\n self.response_body = ::Tilt.new(\"app/views/#{options[:prefixes].first}/#{options[:template]}.html.erb\").render(:foo => \"bar\")\n end", "title": "" } ]
6ecbf26c11da2e2d455d7ddf2c114f3a
Gets a post based on URL
[ { "docid": "ad899a6ccb519c3f398657ead2fea699", "score": "0.7154241", "text": "def get_post(url)\r\n begin\r\n # Check if this url comes from this blog\r\n if URI(url).host =~ /#{URI(url).host}/\r\n Anemone.crawl(url) do |anemone|\r\n anemone.on_every_page do |page|\r\n save_page(page)\r\n return true # one page only\r\n end\r\n end\r\n else\r\n logger.error \"URI does not match (#{URI(url).host} == #{URI(url).host})\"\r\n end\r\n rescue Exception => e\r\n logger.info e.message\r\n logger.info e.backtrace.join(\"\\n\")\r\n end\r\n end", "title": "" } ]
[ { "docid": "0f06b162a1be143298da71f79db4f1db", "score": "0.7687038", "text": "def post_from_url(params_url)\n post = nil\n post_path = params_url\n if params_url.include? \"://\"\n post_path = params_url.split(\"://\",2).last.split(\"/\",2).last\n end\n if post_path.include? \"posts/\"\n post_id = post_path.split(\"posts/\",2).last\n begin\n post = @token.user.posts.find(post_id)\n rescue\n post = nil\n end\n end\n if post.nil?\n raise MicrpubError.new(\"not found\",\"No post found at url: #{params_url}\",404)\n end\n return post\n end", "title": "" }, { "docid": "ac7fe7fa801017b32f869ae859ededb5", "score": "0.7207645", "text": "def read\n @postres = params[:url]\n @postres = Postre.where(url: @postres)\n end", "title": "" }, { "docid": "1740ecc059cbe62f59e7718e6666aa07", "score": "0.71172243", "text": "def get_post(parameters={})\n if @post_url\n hash,url = request(@post_url, parameters)\n if @post_url.include? 'question'\n Questions.new hash, url \n elsif @post_url.include? 'answer'\n Answers.new hash, url\n end\n else\n nil\n end\n end", "title": "" }, { "docid": "d342507debbfe04917d2ffa13957e8d0", "score": "0.6808495", "text": "def retrieve_post(url=\"\")\n pdebug \"Getting post from #{url}'\"\n page_text = %x( #{@curl_cmd} '#{url}' )\n initial_page = Nokogiri::HTML(page_text)\n# initial_page = Nokogiri::HTML(open(url))\n page = make_urls_absolute(initial_page)\n\n post_id = url[/postID=(\\d+)/, 1]\n title = page.css(\"header.boxHeadline.marginTop.wbbThread.labeledHeadline > h1\").text.gsub!(/[\\r\\n\\t]/, '')\n contents = page.css(\"li#post#{post_id}.marginTop article div section.messageContent div div.messageBody div div.messageText\").to_s.gsub!(/[\\t]/, '')\n date = page.css(\"li#post#{post_id}.marginTop article div section.messageContent div header div p time\")[0].values[0]\n # Massage out the T and GMT offset.\n date.gsub!(/T/, ' ').gsub!(/\\+\\d+:00$/, '')\n\n return [ title, contents, date ]\nend", "title": "" }, { "docid": "240b2740f81d7dbd665edfd317f801cc", "score": "0.6761669", "text": "def get_post(url)\n fuzzy_filename = url.split('/').last\n client = Octokit::Client.new(access_token: ENV['GITHUB_ACCESS_TOKEN'])\n code = client.search_code(\"filename:#{fuzzy_filename} repo:#{settings.sites[@site]['github_repo']}\")\n # This is an ugly hack because webmock doesn't play nice - https://github.com/bblimke/webmock/issues/449\n code = JSON.parse(code, symbolize_names: true) if ENV['RACK_ENV'] == 'test'\n # Error if we can't find the post\n error('invalid_request', 'The post with the requested URL was not found') if (code[:total_count]).zero?\n\n content = client.contents(settings.sites[@site]['github_repo'], path: code[:items][0][:path]) if code[:total_count] == 1\n decoded_content = Base64.decode64(content[:content]).force_encoding('UTF-8').encode unless content.nil?\n\n jekyll_post(decoded_content)\n end", "title": "" }, { "docid": "804ef1339ccf5e029f17a4567315fd6c", "score": "0.6631988", "text": "def get_post(source, post)\n\t\tposts = WordPress.query_load_json(source, \"posts/#{post}\", params = nil)\n\tend", "title": "" }, { "docid": "cbcc036203d5892795c438263dfd1505", "score": "0.65428555", "text": "def find_by_url(url)\n begin\n u = URI.parse(url)\n rescue URI::InvalidURIError\n return nil\n end\n\n u.path.match(%r{\\A/(\\d+)}) do |match|\n Post.published.find_by_id(match[1])\n end\n end", "title": "" }, { "docid": "7ebdaf20a371040f627688910b57e09f", "score": "0.6390286", "text": "def get_post(post_id)\n get_posts(nil, :post_id => post_id)\n end", "title": "" }, { "docid": "f42f530e1f23f9f30028f6c76d5d483f", "score": "0.6321299", "text": "def obj_by_url(url)\n begin\n u = URI.parse(url)\n rescue URI::InvalidURIError\n return nil\n end\n\n if match = CONTENT_MATCHES.find { |k,_| u.path =~ k }\n # build the obj_key\n key = match[1].constantize.obj_key($~[1])\n article = Outpost.obj_by_key(key)\n article && article.published? ? article : nil\n else\n nil\n end\n end", "title": "" }, { "docid": "0c4f26810295b1ac0903e85a9d553329", "score": "0.6307534", "text": "def api_response\n if post_id_from_url.present?\n params = { tags: \"id:#{post_id_from_url}\" }\n elsif post_md5_from_url.present?\n params = { tags: \"md5:#{post_md5_from_url}\" }\n else\n return {}\n end\n\n response = http.cache(1.minute).get(\"https://#{site_name}/post.json\", params: params)\n post = response.parse.first&.with_indifferent_access\n post || {}\n end", "title": "" }, { "docid": "76308ac57fb8027d690c39aaaf89a5f8", "score": "0.6304413", "text": "def get(url); end", "title": "" }, { "docid": "134bb58574f5678044a5f08be1382eaf", "score": "0.6289107", "text": "def get_post\n @post = Post.find(params[:id])\n end", "title": "" }, { "docid": "0dfe1028779bd6da27090bf5539a8e75", "score": "0.628461", "text": "def get_post\n @post = Post.find(params[:post_id])\n end", "title": "" }, { "docid": "80211b671a2e5877c97870fc941f0837", "score": "0.62828124", "text": "def getPost(postid)\n return @client.call('metaWeblog.getPost', postid, @username, @password)[0]\n end", "title": "" }, { "docid": "1270a8059fb255402f23dfeafe9ffdfd", "score": "0.62552756", "text": "def get_post(postid)\n options = { :url => @opt.url, :method => \"metaWeblog.getPost\", \n :options => [postid, @opt.username, @opt.password] }\n \n struct = call_xmlrpc options\n doc = PresserDoc.new struct[\"title\"], struct[\"link\"], struct[\"description\"]\n doc.categories = struct[\"categories\"]\n doc.postid = struct[\"postid\"]\n doc.post_status = struct[\"post_status\"]\n doc\n end", "title": "" }, { "docid": "ced32d7a6feddee8b46c6082b5490955", "score": "0.6248724", "text": "def get url\n _get(to_uri(url)).body\n rescue\n nil\n end", "title": "" }, { "docid": "461c9e89a1212631323e38586fb4cbbd", "score": "0.6229953", "text": "def scrape_full_post(post_url)\n CraigScrape::Posting.new post_url\n end", "title": "" }, { "docid": "ef51cae2ce35c6093738a8570b51e23a", "score": "0.622799", "text": "def instantiate_post(input)\n begin\n raise NoURLError if input == \"\"\n @post = Scraper.get_post_info(input)\n rescue NoURLError\n puts \"No URL specified.\"\n exit\n rescue Errno::ENOENT\n puts \"No such URL.\"\n exit\n end\n end", "title": "" }, { "docid": "11b11e72a4b13d7e610d495a7febf554", "score": "0.6179548", "text": "def get_post\n @post ||= Post.find(params[:id])\n end", "title": "" }, { "docid": "4c5a3d2653ddc5e7e38ba4e87542ecba", "score": "0.61572737", "text": "def get(url)\n client.cache(1.minute).parsed_get(url)&.dig(\"body\") || {}\n end", "title": "" }, { "docid": "331fc131bad668256f6034e82db54f8c", "score": "0.6139263", "text": "def get_post_by_permalink(permalink)\n @posts.find_one({'permalink' => permalink})\n end", "title": "" }, { "docid": "588626a964e36975aa7ca2a09394d4a0", "score": "0.6085624", "text": "def set_post\n @post = Post.find_by(url: params[:url])\n end", "title": "" }, { "docid": "41fb399ea7ede8ed6e962af148d228b8", "score": "0.6078979", "text": "def get\n client.get(url)\n end", "title": "" }, { "docid": "ebd0376e8c5fad745d076ac21cbd142a", "score": "0.5997786", "text": "def get_post_from_result(page)\n error_message = page_error_message(page)\n if error_message =~ /You cannot make another post so soon after your last/\n raise Impostor::ThrottledError.new(\"too many posts in too short amount of time, #{error_message}\")\n elsif !error_message.empty?\n raise Impostor::PostError.new(error_message)\n end\n\n begin\n kv = page.links.collect{ |l| l.uri }.compact.\n collect{ |l| l.query }.compact.\n collect{ |q| q.split('&')}.flatten.\n detect { |p| p =~ /^p=/ }\n raise StandardError.new(\"Message did not post.\") if kv.nil?\n postid = URI.unescape(kv).split('#').first.split('=').last.to_i\n raise StandardError.new(\"Message did not post.\") if postid.zero?\n postid\n rescue StandardError => err\n raise Impostor::PostError.new(err)\n end\n end", "title": "" }, { "docid": "0709332e96bfcbd7ab5893e78d3b3097", "score": "0.59668374", "text": "def post(id)\n Post.find_by_id(id)\n end", "title": "" }, { "docid": "99490d83319995a0e5d5e55940234a08", "score": "0.59603816", "text": "def post(slug_id)\n\t\treturn self.posts.where(:slug => slug_id).first\n\tend", "title": "" }, { "docid": "79e044f0f7f898f14da515b0a5d6e4bc", "score": "0.59476876", "text": "def post\n Post.find(params[:id])\n end", "title": "" }, { "docid": "68e714c2545e5492c89b89a81a50bbcd", "score": "0.5941868", "text": "def show\n @post = Post.find(params[:id]) # Is url yra gaunamas id\n end", "title": "" }, { "docid": "bdc4aeedd2388efaf120b5c46f61a659", "score": "0.59371364", "text": "def get(url)\n request :get, url\n end", "title": "" }, { "docid": "4e0a8d82291762cf1246bdc227d18d43", "score": "0.5891507", "text": "def get_page_by_post(path, args = nil)\n begin\n req = prepare_post_request(path, args)\n fetch_page req\n rescue Net::HTTPFatalError\n close\n raise PhaMiner::Exceptions::HttpConnectionException, $!\n end\n end", "title": "" }, { "docid": "d9c4c07ed623170a1b0205b3891311fb", "score": "0.58801055", "text": "def pget(url)\n put(url)\n get(url)\n end", "title": "" }, { "docid": "3521854ea0a309d1b57bf1385498e47c", "score": "0.58795434", "text": "def post\n @post ||= Post.friendly.find params[:post_id]\n end", "title": "" }, { "docid": "9be3d3791f33f45b08632830a0a06f58", "score": "0.585652", "text": "def get(url)\n connection.get do |req|\n req.url(url)\n end\n end", "title": "" }, { "docid": "d87cdff96cf54de26a704270ab6839f8", "score": "0.5845986", "text": "def post(id:)\n Post.find(id)\n end", "title": "" }, { "docid": "bbd9a4ec42d82447d9fa8df75de97439", "score": "0.5844875", "text": "def find_from_url(url)\n # If the url contains the word '_view' it means it will return objects as an array,\n # how ever if it doesn't it means the user is getting an ID-based url like /properties/abcd\n # which will only return a single object\n if url =~ /_view/\n instantiate_collection(connection.get(url))\n else\n begin\n instantiate_object(connection.get(url))\n rescue ResourceNotFound\n nil\n end\n end\n end", "title": "" }, { "docid": "9796f8f05d723893298366226ca6e65a", "score": "0.5837092", "text": "def get(params = {})\n params[:dt] = params[:dt].to_date.to_s if params.is_a? Time\n params[:meta] = params[:meta] ? 'yes' : 'no' if params.has_key?(:meta)\n options = create_params(params)\n posts = self.class.get('/posts/get', options)['posts']['post']\n posts = [] if posts.nil?\n posts = [posts] if posts.class != Array\n posts.map { |p| Post.new(Util.symbolize_keys(p)) }\n end", "title": "" }, { "docid": "7ea16b42a4c6c11e80a34b8422bad785", "score": "0.58279866", "text": "def get_post_from_result(page)\n error = page.body =~ /Message Not Posted/\n if error\n\n # throttled\n throttled = \"You have exceeded the number of posts permitted in the time span\"\n too_many = page.body =~ /#{throttled}/\n raise Impostor::ThrottledError.new(throttled) if too_many\n\n # general error\n raise Impostor::PostError.new(\"There was an error making the post\")\n end\n\n kv = page.links.collect{ |l| l.uri }.compact.\n collect{ |l| l.query }.compact.\n collect{ |q| q.split('&')}.flatten.\n detect{|kv| kv =~ /^PID=/ }\n postid = URI.unescape(kv).split('#').first.split('=').last.to_i\n raise Impostor::PostError.new(\"Message did not post.\") if postid.zero?\n postid\n end", "title": "" }, { "docid": "49162c3b25f4675de8e522f7a1577600", "score": "0.58239526", "text": "def get(url)\n return self.make_request(:get, url)\n end", "title": "" }, { "docid": "fe85ffbd3c1a6aa69a74ad08535d845f", "score": "0.5810727", "text": "def get_feed(uri)\n uri = URI.parse(uri)\n Net::HTTP.start(uri.host, uri.port) do |http|\n return http.get(uri.path, @headers)\n end\n end", "title": "" }, { "docid": "3c8f4600800ccf91f365a57dbc4d2273", "score": "0.5804592", "text": "def posts\n #Telling the method to get posts.json\n self.class.get('/posts.json')\n end", "title": "" }, { "docid": "3c8f4600800ccf91f365a57dbc4d2273", "score": "0.5804592", "text": "def posts\n #Telling the method to get posts.json\n self.class.get('/posts.json')\n end", "title": "" }, { "docid": "c99a1a13e366bfcb65294f663375bc40", "score": "0.58017534", "text": "def get_post(url, properties = [])\n path = file_path(url)\n content = client.contents(github_repo, path: path)\n decoded_content = Base64.decode64(content[:content]).force_encoding(\"UTF-8\").encode if content\n data = jekyll_post(decoded_content)\n data[:url] = url\n return data if properties.empty?\n\n data.delete(:type)\n data[:properties].delete_if { |key, _| !properties.include? key.to_s }\n\n data\n end", "title": "" }, { "docid": "2912833ad2a304b2c59099ca512571f0", "score": "0.57966405", "text": "def post(id:)\n Post.find(id)\n end", "title": "" }, { "docid": "2912833ad2a304b2c59099ca512571f0", "score": "0.57966405", "text": "def post(id:)\n Post.find(id)\n end", "title": "" }, { "docid": "59a162455f9734413228f6b04fa81576", "score": "0.57792044", "text": "def url\n Config.site['url'].chomp('/') + PostController.r(:/, name).to_s\n end", "title": "" }, { "docid": "694236845e7cdea5c1e14d0dbf7dbac7", "score": "0.57765037", "text": "def post(id)\n entries.find_by_id(id)\n end", "title": "" }, { "docid": "06aa87177bb8c315d5a9ce20af9f3254", "score": "0.5764541", "text": "def show\n @url = UrlPost.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @url }\n end\n end", "title": "" }, { "docid": "a35af6405c253db7fc5240e9e776b06c", "score": "0.57422334", "text": "def post_id_from_params(url)\n uri = RequestHelper.parse_url(url)\n parts = uri.path.split('/')\n id = parts.last\n id = parts[parts.size - 2] if id == 'posts'\n mapping = {\n 'photo.php' => 'fbid',\n 'photo' => 'fbid',\n 'permalink.php' => 'story_fbid',\n 'story.php' => 'story_fbid',\n 'set' => 'set',\n 'photos' => 'album_id'\n }\n params = parse_uri(uri)\n return if params.empty? \n return unless mapping.keys.include?(id) && params.keys.include?(mapping[id])\n \n # Get relevant info from a.12345 or 12345:0\n slug = params[mapping[id]].first\n slug[/(\\d+)/, 1]\n end", "title": "" }, { "docid": "fdc82fadfe25f85e4dce912cd1ca0724", "score": "0.5736669", "text": "def get_reddit_feed\n\trequest = HTTPI::Request.new\n\trequest.url = \"http://www.reddit.com/.json\"\n\tHTTPI.get(request).body\nend", "title": "" }, { "docid": "fdc82fadfe25f85e4dce912cd1ca0724", "score": "0.5736669", "text": "def get_reddit_feed\n\trequest = HTTPI::Request.new\n\trequest.url = \"http://www.reddit.com/.json\"\n\tHTTPI.get(request).body\nend", "title": "" }, { "docid": "de5da3be1208344d536aba9d9cfa6249", "score": "0.5735526", "text": "def show\n if (params[:id] != nil)\n @post = Post.find(params[:id])\n else\n @post = Post.where(\"url = '#{params[:url]}'\").first\n end\n\n if (@post === nil)\n # TODO: this isn't the correct way to 404\n raise ActionController::RoutingError.new('Not Found')\n end\n\n page_title @post.title\n toc_renderer = Redcarpet::Render::HTML_TOC.new()\n renderer = Redcarpet::Render::HTML.new(:with_toc_data => true, :autolink => true, :space_after_headers => true)\n md_toc = Redcarpet::Markdown.new(toc_renderer)\n md = Redcarpet::Markdown.new(renderer)\n @toc = md_toc.render(@post.content)\n @content = md.render(@post.content)\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end", "title": "" }, { "docid": "fc058e461cbad610df6d4e6244c67615", "score": "0.5734356", "text": "def get(url)\n @subject.get(url)\n end", "title": "" }, { "docid": "90444a3372db8fe30f73e279892bc660", "score": "0.5732273", "text": "def find_by_url(url)\n response = client.get(endpoint(\"by_url\"), :url => url)\n\n if response.success?\n new(response.body)\n else\n nil\n end\n end", "title": "" }, { "docid": "194dbe8522092f49c43fb8342b5c127d", "score": "0.57229304", "text": "def permalink_get(permalink)\n @data = Utils::Request.get(\"patterns/#{permalink}.json\", :pattern)\n self\n end", "title": "" }, { "docid": "b4de31a577a80e7f1ef910275432a03b", "score": "0.5711208", "text": "def get_post_comment(parameters={})\n if @post_comment_url\n hash,url = request(@post_comment_url, parameters) \n Comments.new hash, url\n else\n nil\n end\n end", "title": "" }, { "docid": "8748c6666fcfb7d2c5928eb32f58ebeb", "score": "0.568844", "text": "def show\n canonical_url(\"/posts/#{params[:id]}\")\n @post = Rails.cache.fetch(\"public_post_#{params[:id]}\", :expires_in => 60.minutes) do\n Post.find(params[:id])\n end\n\n respond_with(@post)\n end", "title": "" }, { "docid": "f1840c6586230755c570368c8ba7cf1b", "score": "0.5687126", "text": "def post\n if @post = @site.posts.published().where(:slug=>params[:id]).first() || Post.published().where(:id=>params[:id]).first()\n @page_title = @post.name\n\n respond_to do |fmt|\n fmt.html\n fmt.text if @post.markdown?\n end\n else\n raise ActiveRecord::RecordNotFound.new\n end\n end", "title": "" }, { "docid": "eb8c89b3e43350ba823d6fc5430dcfcc", "score": "0.568448", "text": "def get(url)\n resp = client.get(url)\n resp\n end", "title": "" }, { "docid": "c884d3048f42b4b1b768c271940bbed7", "score": "0.568105", "text": "def show\n post_id = params[:id]\n render json: V1::Post.get_a_post(post_id)\n end", "title": "" }, { "docid": "fa2bebd2415454cd3ff27803a1a15b13", "score": "0.5680433", "text": "def post(id, options = {})\n get \"posts/#{id}\", options\n end", "title": "" }, { "docid": "1625d9b494921428054537515df68ddd", "score": "0.56771517", "text": "def read\n Seaweed::HTTP.get url\n end", "title": "" }, { "docid": "93ea7e3917f5c7576febd76ee3351aa4", "score": "0.56733364", "text": "def tumblr_post(blogname)\n hash = $client.posts blogname, :filter => 'text'\n return hash[\"posts\"]\nend", "title": "" }, { "docid": "1f3f1e15c398569743c5fedd41f20240", "score": "0.56580245", "text": "def get(url)\n @client.get(url)\n end", "title": "" }, { "docid": "453f5baf8983f0cba7f3dda3b0fe76a5", "score": "0.56460845", "text": "def get_from_web(url)\r\n Curl::Easy.perform( sanitize_url(url) ).body_str\r\n end", "title": "" }, { "docid": "1ddaf9e59ab829c8a9d6371f9ae87888", "score": "0.56436557", "text": "def post\n @post ||= Post[post_id]\n end", "title": "" }, { "docid": "9ae8795358f48968beb93ccf69d775f0", "score": "0.5640275", "text": "def get(url)\n\tself.fetch(url, method: \"GET\")\nend", "title": "" }, { "docid": "39ce1e84f0ab4a6014c9439d5dca3db4", "score": "0.5632168", "text": "def post\n Net::HTTP.get_response(@uri)\n end", "title": "" }, { "docid": "297ac504551e40d4d3b099857336cd72", "score": "0.56262267", "text": "def get(url)\n @client.get(url)\n end", "title": "" }, { "docid": "b8b3079272eab11b5c08c79841f441da", "score": "0.5611564", "text": "def get(url)\n req = create_req(url)\n Bixby.client.sign_http_request(req)\n res = HTTPI.get(req)\n if res.error? then\n raise \"error\" # TODO\n end\n\n data = MultiJson.load(res.body)\n if data.kind_of? Array then\n return data.map{ |d| self.new(d) }\n else\n return self.new(data)\n end\n end", "title": "" }, { "docid": "4b1fe6dcd4ecb4c72c76b940f7237b09", "score": "0.5610856", "text": "def get_post_revision(parameters={})\n if @post_revision_url\n hash,url = request(@post_revision_url, parameters) \n Revisions.new hash, url\n else\n nil\n end\n end", "title": "" }, { "docid": "651725ac5ce4bd981014d6f963548891", "score": "0.56106323", "text": "def posts_get_by_date(parameters = {})\n parameters.merge!(:meta => 'yes')\n response = posts(\"get\", parameters)\n Post.import_from_xml(response.body)\n end", "title": "" }, { "docid": "a5a8fa2dabaf4bab93b08ab62a6707af", "score": "0.5607324", "text": "def get(url)\n\n request(url, 'GET', '')\n\n end", "title": "" }, { "docid": "a5a8fa2dabaf4bab93b08ab62a6707af", "score": "0.5607324", "text": "def get(url)\n\n request(url, 'GET', '')\n\n end", "title": "" }, { "docid": "fb208f14695578e50aa9bc2e399abdaa", "score": "0.55907714", "text": "def find_post\n\t\t\t@post = Post.find(params[:id])\n\t\tend", "title": "" }, { "docid": "00bb115c8f7c7c4050093e902ed8fb73", "score": "0.5580238", "text": "def url\n \"http://%s/post/%d\" % [self.blog.canonical_alias, self.id]\n end", "title": "" }, { "docid": "3c74ba32575273973b44c01533fcba77", "score": "0.55767983", "text": "def fetch_post_content_url(post_id)\n uri = URI.join(LGTM_URL, POST_CONTENT_PATH, post_id)\n response = process_request(uri)\n\n parse_redirect_location(response)\n end", "title": "" }, { "docid": "277ddb7540f64a2da253ab183194730b", "score": "0.5575124", "text": "def find_post\n @post = Post.find_by_permalink(params[:id])\n @page_title = @post.title\n end", "title": "" }, { "docid": "ff081a68e945f32b377b5ab5a6e57d22", "score": "0.55661434", "text": "def find_post\n\t\t@post = Post.find(params[:id])\n\tend", "title": "" }, { "docid": "39e252a618850d8316b7efa944f0b724", "score": "0.5560847", "text": "def get_post_by_title(title, ref)\n result = nil\n result = get_all_posts_in_pr.find { |x| x.title == title } if ref\n result = get_all_posts.find { |x| x.title == title } if !ref\n result.images.each { |x| PostImageManager.instance.add_downloaded_image(x) } if result\n result\n end", "title": "" }, { "docid": "fcd86a9b4f79bc06b5347d9c4d83b037", "score": "0.5549271", "text": "def get_urlposts(url)\n begin\n extract_entries urlposts_xml_http(url)\n rescue SocketError\n extract_entries urlposts_xml_file(url)\n end\n end", "title": "" }, { "docid": "39f426aadbbcb1e8ea77d25a3026307b", "score": "0.55482996", "text": "def existing_post\n post = Post.find(params[:id])\n end", "title": "" }, { "docid": "7c94849e97fcc4034f2c72e9e5b64085", "score": "0.55478996", "text": "def get_content url\n @connection.adapter.get(url.full_url).body\n end", "title": "" }, { "docid": "a56385bbf754597269a572f7e04cc882", "score": "0.55435354", "text": "def post(id)\n REDIS.hgetall(\"post:#{id}\") #gets all information for the given id\n end", "title": "" }, { "docid": "faa7372f34dd9b2334c358c2468c5630", "score": "0.5542091", "text": "def show\n if params[:canvas]\n @post = Post.new(:canvas_html => params[:canvas])\n elsif params[:url]\n @post = Post.find_by_url(params[:url], :conditions => 'status != \"inactive\"')\n else \n @post = Post.find(params[:id])\n end\n \n \n if !@post\n if params[:url]\n @post = Post.find_by_url(params[:url]) \n end\n end\t \n \t \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @post }\n end\n end", "title": "" }, { "docid": "d2088d21d7c262b1ba6bf722231d1619", "score": "0.55417365", "text": "def find_post(board, title, cookie = nil)\n get_board(board, cookie).each do |post|\n if post[\"title\"] == title\n return post\n end\n end\n return false\n end", "title": "" }, { "docid": "a8a072668af591112d1e58c940f41856", "score": "0.5540713", "text": "def find_post\n\t\t@post = Post.find(params[:post_id])\n\tend", "title": "" }, { "docid": "a8a072668af591112d1e58c940f41856", "score": "0.5540713", "text": "def find_post\n\t\t@post = Post.find(params[:post_id])\n\tend", "title": "" }, { "docid": "71fde87308db01140a96e197ae5d65aa", "score": "0.5535939", "text": "def post\n return false unless post_id\n post = Post.get_from_cache(post_id)\n post ||= Comment.get_from_cache(post_id)\n post ||= Post.find({:id => post_id})\n post ||= Comment.find({:id => post_id})\n end", "title": "" }, { "docid": "8417a6eec17fd6919a56f8b7f17b811c", "score": "0.55338424", "text": "def get(page = 1)\n paged = files[limit(page)]\n\n paged ? paged.map { |p| Post.new(p) } : []\n end", "title": "" }, { "docid": "f03450e6cef8830f9bf8cb6e6b380989", "score": "0.5525492", "text": "def get\n http = EM::HttpRequest.new(url).get\n Response.new(http)\n end", "title": "" }, { "docid": "1aee3252d98321fa07ad4282b19fa5e1", "score": "0.55165875", "text": "def post_url\n info = self.post_id.split('_')\n \"http://facebook.com/#{info[0]}/posts/#{info[1]}\"\n end", "title": "" }, { "docid": "7df15b341cce08a7182ccfab980f7c87", "score": "0.55121374", "text": "def find(url)\n Page.where(url: url).order(updated_at: :desc).limit(1).first\n end", "title": "" }, { "docid": "1fd5cad587f78357d220b98d677bec5f", "score": "0.55120844", "text": "def get_post(blog_id, id:, post_format: 'npf', **args)\n get_body(\"v2/blog/#{full_blog_id(blog_id)}/posts/#{id}\", post_format: post_format, **args)\n end", "title": "" }, { "docid": "ed816a7c8582d7caaf42eb5247920d9a", "score": "0.55068237", "text": "def url\n @urls.first\n end", "title": "" }, { "docid": "e62723b705a7ee5ea316702de5298e9f", "score": "0.55044687", "text": "def get(url)\n parsed_url = parse_url(url)\n request = Net::HTTP::Get.new(parsed_url[:uri])\n set_body_and_headers(request, default_options)\n make_request(request, parsed_url)\n end", "title": "" }, { "docid": "548b1ef8d9fe31302dc55c96d7c57909", "score": "0.5499857", "text": "def posts(url)\n @db.transaction(true) do\n @db[url] || []\n end\n end", "title": "" }, { "docid": "a2a1d498eb7a9ae6959c8a59fe0ae37d", "score": "0.54991007", "text": "def get(url, params = {})\n params = params.inject({}){|memo,(k,v)| memo[k.to_s] = v; memo}\n preform(url, :get, params: params) do\n return connection.get(url, params)\n end\n end", "title": "" }, { "docid": "d2b78a70bc6cac5260568801e398d944", "score": "0.54984546", "text": "def find_post\n @post = Post.find(params[:post_id])\n end", "title": "" }, { "docid": "98089bda16fe41f6dd74f349a2c7cf3e", "score": "0.5493605", "text": "def get(url)\n open(url)\n end", "title": "" }, { "docid": "d4eaf53924d01e8e7dcdd647c5b31176", "score": "0.5488844", "text": "def build_post\n @post ||= Post.find(params.dig(:id) || element.dataset.dig(:post_id).to_i)\n end", "title": "" } ]
9cbed1e1abc3b3c2ba0a297a453900c6
Use the the array.map method to complete this test Map creates a new array containing the values returned by the block Docs:
[ { "docid": "4e1e233dd080937648347805bf79d87f", "score": "0.0", "text": "def test_create_a_new_array_which_contains_each_original_value_doubled\n skip \"Waiting to be implemented\"\n array = [1,6,3,9,1,1,2,3]\n new_array = array.map { | number| number * 3 } # Fix this so that numbers are doubled not trippled\n assert_equal([2, 12, 6, 18, 2, 2, 4, 6], new_array) \n end", "title": "" } ]
[ { "docid": "4f9628729bf8f2a8f17a460e4fef7cce", "score": "0.65515804", "text": "def map! &block\n # create a new array to store results of block applied to \n # each element\n new_array = []\n each { |x| new_array.push yield x }\n #update internal array with new elements\n @internal_arr.replace(new_array)\n return @internal_arr \n end", "title": "" }, { "docid": "347e6ea561e7035b32db57f48e0f62fb", "score": "0.65358037", "text": "def map(doc)\n end", "title": "" }, { "docid": "1eef1e24733579ebac664265a5227f0c", "score": "0.64273894", "text": "def test_map_still_behaves_normally_returning_array_of_arrays\n assert_equal([[\"FOO\", 2], [\"BAR\", 4]], { \"Foo\" => 1, \"Bar\" => 2 }.map { |p| [p[0].upcase, p[1] * 2] })\n end", "title": "" }, { "docid": "e4f1c5cd5cb25f5636988b4799d66724", "score": "0.63902384", "text": "def map; end", "title": "" }, { "docid": "8b24f7002af49e8a0566ca8d7c80778f", "score": "0.6281988", "text": "def map(&block)\n @map = block\n end", "title": "" }, { "docid": "8b24f7002af49e8a0566ca8d7c80778f", "score": "0.6281988", "text": "def map(&block)\n @map = block\n end", "title": "" }, { "docid": "344d8d950e97dafa81e01e385ef15922", "score": "0.6189067", "text": "def map\n\t\t\t\t@member_array.map {|x| yield x}\n\t\t\tend", "title": "" }, { "docid": "36302926a7c3826a9f4ba7172c528a84", "score": "0.61329424", "text": "def map\n end", "title": "" }, { "docid": "5e1d08cbfce901972103215c2d7d9bb4", "score": "0.6078271", "text": "def map &block\n # create a new array to return map applies block to \n # each element, but returns that in a new array\n new_array = []\n each { |x| new_array.push yield x } if block_given?\n return new_array\n end", "title": "" }, { "docid": "b846382ae4383a7305e95e7cc90f3b1c", "score": "0.60643196", "text": "def test_map\n up = @bb.map(&:upcase)\n\n assert_equal('1', up[0])\n assert_equal('BLOCK', up[2])\n assert_equal('BUZZ', up[4])\n assert_equal('BLOCKBUZZ', up[14])\n assert_equal(nil, up[15])\n end", "title": "" }, { "docid": "5b6e88e3314a5b8852f749df4ba717ae", "score": "0.60602194", "text": "def map(&block)\n to_a.map(&block)\n end", "title": "" }, { "docid": "1620f5fd2d5c2ba50da9a912d2c6af0c", "score": "0.6044881", "text": "def my_map(&block)\n i = 0\n range_array = self.to_a\n ary = []\n\n if block\n while i < range_array.length\n ary << (block.call(range_array[i]))\n i +=1\n end\n else\n while i < range_array.length\n ary << (yield range_array[i])\n i +=1\n end\n end\n ary\n end", "title": "" }, { "docid": "4fc8a874b692cab126b48bee187a1531", "score": "0.6033997", "text": "def my_map\r\n \tresult = Array.new\r\n \tif (self.is_a? Array) && block_given?\r\n \t self.length.times { |i| result << yield(self[i]) }\r\n \tend\r\n \tresult\r\n end", "title": "" }, { "docid": "3621596780f6d62356f10cafd8b27191", "score": "0.59961003", "text": "def map(_list = nil)\n #This is a stub, used for indexing\nend", "title": "" }, { "docid": "21f0e1b47900b5b8ef73226e1acae004", "score": "0.5977585", "text": "def map\n end", "title": "" }, { "docid": "21f0e1b47900b5b8ef73226e1acae004", "score": "0.5977585", "text": "def map\n end", "title": "" }, { "docid": "21f0e1b47900b5b8ef73226e1acae004", "score": "0.5977585", "text": "def map\n end", "title": "" }, { "docid": "8f873af2b252b77c5eaa139f83cee043", "score": "0.59539866", "text": "def map(&block)\n return dup.map!(&block)\n end", "title": "" }, { "docid": "2a39f1d906371da4f7be0bf7b3f7b936", "score": "0.59038496", "text": "def like_map(array)\n result = []\n array.each do |element|\n result << (yield element)\n end\n result\nend", "title": "" }, { "docid": "115a180f6dea37e0577a660998fe448f", "score": "0.58700883", "text": "def my_map\n new_array = []\n self.my_each do |item|\n new_array << yield(item)\n end\n new_array\n end", "title": "" }, { "docid": "dbc11d796b09424c158eaf56c263b241", "score": "0.5869871", "text": "def map &block\n self.class.from_a(enumerable_map &block)\n end", "title": "" }, { "docid": "b59e7a64b791a0ff03e5c73e1fabe917", "score": "0.58639354", "text": "def my_map \n new_array = []\n for i in self\n new_array << yield(i)\n end\n new_array\n end", "title": "" }, { "docid": "c7717fcff054b60e11512688f6f1d9a7", "score": "0.5851957", "text": "def map\n\n end", "title": "" }, { "docid": "f410a49ce6ed70fe19b2ee17ab605c4c", "score": "0.5846864", "text": "def map &block\n clone_with enumerable_map(&block)\n end", "title": "" }, { "docid": "56a1b1b6f71bfe1a13a936adde4429c1", "score": "0.5841311", "text": "def map(array) # yield is available, if a block is passed as an argument\n\tputs '1. starting with the map method'\n\tnew_array = []\n\n\t# element can have any name you want\n\tfor element in array\n\t\tputs '2. inside the for loop with element ' + element\n\n\t\t# let the block change the element\n\t\telement_with_changes = yield(element)\n\n\t\t# add the changed element to the array\n\t\tnew_array << element_with_changes\n\tend\n\n\tputs '4. almost leaving the map method'\n\n\t# return the new array with the modified elements\n\tnew_array\nend", "title": "" }, { "docid": "a3b9a27814a72d06c34b4d1bb9039951", "score": "0.5819297", "text": "def my_map(array, &block)\n result = []\n \n idx = 0\n\n while idx < array.size do\n result << yield(array[idx])\n idx += 1\n end\n\n result\nend", "title": "" }, { "docid": "99f176ee4831f65826d3fd4dba79b4b1", "score": "0.58158535", "text": "def map_block(arr, &block)\n new_arr = []\n arr.each { |a| new_arr << block.call(a) }\n new_arr\nend", "title": "" }, { "docid": "96aadac2a2d47af91de8d8f6e6b40ae0", "score": "0.58129305", "text": "def my_map\n new_array = [] # so we need to create an array\n each do |value| # then we call the each method on the object (generically)\n new_array << yield(value) # add the value from running yield \n end\n new_array\n end", "title": "" }, { "docid": "865d8e20ef127b5c82889841d6a323d3", "score": "0.5808687", "text": "def map_with_hit(&block)\n records.to_a.zip(results).map(&block)\n end", "title": "" }, { "docid": "dad478ae43dc59f37dc14c8bb0078db6", "score": "0.5802898", "text": "def my_map_2(&block)\n result = []\n each do |element|\n result << block.call(element)\n end\n result\n end", "title": "" }, { "docid": "c0de1a0642f233e374efb4adf31901c6", "score": "0.5790651", "text": "def map(arr)\n\t#empty array to store the result in \n result_array = []\n \t#each time does the value of x\n \teach do |x|\n \t#result of the array is yielded to x \n \t result.array << yield(x)\n end\nend", "title": "" }, { "docid": "88508c5d6c05f77475bbd22d6564f99a", "score": "0.5787351", "text": "def my_map(array)\n result = []\n array.length.times do |element|\n result << yield(array[element])\n end\n result\n end", "title": "" }, { "docid": "53ada7399e7cac49f698e3dae65c8d74", "score": "0.57856226", "text": "def my_map(&block)\n mapped_array = []\n my_each{|x| mapped_array << &block.call(x)}\n mapped_array\n end", "title": "" }, { "docid": "5aeda3497c3fac3be49b80028942a197", "score": "0.5778228", "text": "def map &block\n dup.map!(&block)\n end", "title": "" }, { "docid": "d7f676f93e19e432991331a35d158913", "score": "0.576779", "text": "def map\n table_name = @tables.keys.sample\n table = @tables[table_name]\n\n\n column = table.defs.to_a.sample\n while String == column[1]\n column = table.defs.to_a.sample\n end\n\n column_idx = table.defs.keys.index column[0]\n\n some_float = Float.randomize\n some_direction = %w{+ -}.sample\n\n got = table.data.map do |r|\n [some_float.send(some_direction, r[column_idx])]\n end\n\n assert_exec([\"rows\".k,\n [\"map\".k,\n [\"table\".k, table_name],\n [\"row-lambda\".k,\n [some_direction.k, some_float, column[0].k]]]],\n got)\n end", "title": "" }, { "docid": "a4ea13e6a9c138da3d1f43cd3ebf6a51", "score": "0.5764424", "text": "def map_with_hit(&block)\n results.zip(raw_response[HITS][HITS]).map(&block)\n end", "title": "" }, { "docid": "494b0a571d8cca8a4a322a570a3b0626", "score": "0.57593703", "text": "def map_hash\n block_array = []\n self.blocks.each do |block|\n block_array << {polyline: block.polyline, color: block.hex_color, content: block.content, center: [block.center[:lat], block.center[:lng]], adopted: block.adopted? }\n end\n block_array\n end", "title": "" }, { "docid": "cbfca6992864bf3b7399fcd6dd5ab8fb", "score": "0.5757535", "text": "def map(&block)\n items.map(&block)\n end", "title": "" }, { "docid": "ea22144bf5c137ab185df01aa5d9b9c9", "score": "0.5754106", "text": "def map(&block)\r\n result = [ ]\r\n \r\n self.each do |item|\r\n result << block.call(item)\r\n end\r\n \r\n return result\r\n end", "title": "" }, { "docid": "8fdb04bab53310579171588d254932b6", "score": "0.5745237", "text": "def my_map_with_block\n\t\tnew_array = []\n\t\treturn self unless block_given?\n\t\tself.my_each do |item| \n\t\t\tnew_array << yield(item)\n\t\tend\n\t\tnew_array\n\tend", "title": "" }, { "docid": "4f3ecacfc5ce243a1e0224e336d5efa3", "score": "0.5737879", "text": "def map_ &block\n check_pre(block_given?)\n self.reduce(Array.new) {|a,b| a << (yield b)}\n end", "title": "" }, { "docid": "843f4817826ad1b433e40b5e29987f6f", "score": "0.5733057", "text": "def proc_and_block_map &proc\n new_array = []\n for i in self\n new_array << yield(i)\n end\n new_array\n end", "title": "" }, { "docid": "3b7cfda7fb3906de507fa318be0a8d9c", "score": "0.57294166", "text": "def map\n [].tap do |arr|\n each do |data|\n arr << yield(data)\n end\n end\n end", "title": "" }, { "docid": "8d20464c0176aa4c542a50a44572c154", "score": "0.57264435", "text": "def unit_data(mapper, i)\n mapper[i].map{|field_index| @numbers[field_index] }\n end", "title": "" }, { "docid": "e73a742a2b25cd7f33e1e3ed0b334cd6", "score": "0.5717186", "text": "def map\n return to_enum :map unless block_given?\n return dup unless block_given?\n out = Array.new @total\n i = 0\n while i < @total\n out[i] = yield(at(i))\n i += 1\n end\n out\n end", "title": "" }, { "docid": "27f7815d4c9e1d8f12527cb96a0dca8b", "score": "0.57155514", "text": "def map(arr, &block)\n new_arr = Array.new\n arr.each { |element| new_arr << block.call(element) }\n new_arr\nend", "title": "" }, { "docid": "5db3e84e763794f908a72ab5c9d55c8c", "score": "0.5711944", "text": "def my_map\n new_array = []\n for i in self\n\n new_array << yield(i)\n\n end\n new_array\n end", "title": "" }, { "docid": "c77fc84939c98ce426275ba3dc5d8fda", "score": "0.5693611", "text": "def mappa_e_compatta(&block)\n self.map.with_index(&block).compact\n end", "title": "" }, { "docid": "6d17e6fe2ca415359d0b476e226fb5e5", "score": "0.56633085", "text": "def my_map(array)\n new_array = []\n \n array.each do |elem|\n new_array.push yield(elem)\n end\n \n new_array\nend", "title": "" }, { "docid": "7c01a551401da2b5727475e86754132d", "score": "0.56632704", "text": "def my_map\n new_array = []\n self.my_each { |value| new_array << yield(value) }\n new_array\n end", "title": "" }, { "docid": "d09b23c6154cf2aef38f3803ac2fac33", "score": "0.5648686", "text": "def my_own_map(array)\n ary = array\n ary.each do |elem|\n ary << yield(elem)\n end\n ary\n end", "title": "" }, { "docid": "feefa709dcf572fa16e94d569965c10a", "score": "0.56425035", "text": "def my_map\n\t\tresult = []\n\t\tif block_given?\n\t\t\tmy_each {|i| result << yield(i)}\n\t\t\tresult\n\t\telse\n\t\t\tself\n\t\tend\n\n\tend", "title": "" }, { "docid": "6cb844aff064cf3fd3c018b5fd5ad17e", "score": "0.564182", "text": "def map\n r = Bibliography.new\n @entries.each do |k, e|\n r << yield(e)\n end\n return r\n end", "title": "" }, { "docid": "6b42799bb591d5e6edfbc97009bbc8d9", "score": "0.56394976", "text": "def map(array)\n b = []\n array.each {|a| b << (yield a) }\n return b\nend", "title": "" }, { "docid": "0d3cf9e416fabd0926ef2a30dd0a84bb", "score": "0.5637263", "text": "def map()\n out = []\n each { |elem| out << yield(elem) }\n out\n end", "title": "" }, { "docid": "2eef2a52ae067a7b10d239ab2be8641b", "score": "0.56359845", "text": "def map(arr)\n # Create empty array result\n result = []\n \n # Call each iterator within map to iterate through array\n each(arr) do |x|\n # Push result from yield/callback (below) into result array *with syntactic sugar*\n result << yield(x)\n # Push result from yield/callback (below) into result array\n result.push(yield(x))\n end\n \n # Implicitly return result array\n result\nend", "title": "" }, { "docid": "2fa7809f23f7a6333f2a2bc76138e8a3", "score": "0.56336445", "text": "def return_dogs(dogs_array)\n dogs_array.map! do |dog|\n dog[:position] = 0\n p dog\n end\nend", "title": "" }, { "docid": "ca04e7e441e3125c69180b9b057025e9", "score": "0.5625028", "text": "def map\n \n # output a hash; empty by default\n Hash.new \n \n end", "title": "" }, { "docid": "c7139d0fa81393bfb24b28359cd41c01", "score": "0.5617404", "text": "def my_map(&map_proc)\n\n\n i = 0\n result = []\n while i < self.length do\n\n\n if block_given?\n result << yield(self[i])\n else\n result << map_proc.call(self[i])\n end\n i+=1\n\n end\n result\n\n end", "title": "" }, { "docid": "17bd9a3d8d1264cd2e900b958ff546b3", "score": "0.5611417", "text": "def map\n\t\tresults = []\n\t\t@books.each do |book|\n\t\t\tresults << yield(book)\n\t\tend\n\n\t\tresults\n\tend", "title": "" }, { "docid": "7f4ba896a0851aa872c1e6bb52907b46", "score": "0.5611216", "text": "def map!\n %s(puts \"Array#map! not implemented\")\n end", "title": "" }, { "docid": "d8682c15643e73c3ce9ee9ab079a57c6", "score": "0.5608214", "text": "def my_map(&block)\n new_array = []\n unless block.nil?\n self.my_each do |x|\n new_array << block.call(x)\n end\n else\n self.my_each do |x|\n new_array << yield(x)\n end\n end\n return new_array\n end", "title": "" }, { "docid": "c43a624b6a8ae19443d46f1bf0aa2d2c", "score": "0.56021696", "text": "def map(array)\n array_new = []\n for x in array\n array_new << yield(x)\n end\n return array_new\nend", "title": "" }, { "docid": "c43a624b6a8ae19443d46f1bf0aa2d2c", "score": "0.56021696", "text": "def map(array)\n array_new = []\n for x in array\n array_new << yield(x)\n end\n return array_new\nend", "title": "" }, { "docid": "5fc7f3fe2b341d721bd3d66cb23038da", "score": "0.5600138", "text": "def my_map(block)\n\t\ti = 0\n\t\tuntil i == self.length\n\t\t\tself[i] = block.call(self[i])\n\t\t\ti += 1\n\t\tend\n\t\tself\n\tend", "title": "" }, { "docid": "cf5138fbc7b9fc3f09995f13c61dc9fb", "score": "0.55999434", "text": "def map(&block)\n map_with_index {|x, _| block.call x }\n end", "title": "" }, { "docid": "2fa9b1ff66f396467a0fbef1022144d5", "score": "0.5595635", "text": "def maps(arr)\n arr.map { |i| 2 * i }\nend", "title": "" }, { "docid": "e3eb0c19e2ecb5b949c9b22dc6d74c57", "score": "0.5595371", "text": "def my_map\n \treturn self unless block_given?\n \toutput = []\n \toutput = self.my_each {|x| yield(x)}\n \treturn output\n end", "title": "" }, { "docid": "b13bad2a989a4cc7f4f8d28414a36618", "score": "0.5589575", "text": "def my_map(&proc)\n new_array = []\n self.my_each do |item|\n new_array << proc.call(item)\n end\n new_array\n end", "title": "" }, { "docid": "50a7f30669951568db197428415dc2d9", "score": "0.5587098", "text": "def map(&block)\n Function.new do |array|\n array.map(&block)\n end\n end", "title": "" }, { "docid": "44258690e635ec3c339cb352b1188788", "score": "0.5586087", "text": "def map(&block)\n list = dup\n list.map!(&block)\n list\n end", "title": "" }, { "docid": "4f8400cba7d895087b8c17b812d4f2c4", "score": "0.55823994", "text": "def my_map proc=nil\n result = []\n\n if block_given?\n for ele in self do\n result << yield(ele)\n end\n \n elsif proc\n result << proc.call(ele)\n end\n\n result.inspect\n end", "title": "" }, { "docid": "ab504fa306a93e8d5a021ba062d90fe8", "score": "0.5582293", "text": "def map_to_no_change(array)\r\n new_arr = array.map { |e| e }\r\n p new_arr\r\nend", "title": "" }, { "docid": "f40957d6644ea29ea25b1912d06c796e", "score": "0.55822253", "text": "def my_map\n\t\tcapture = []\n\t\t0.upto(self.length-1) do |index|\n\t\t\tcapture << yield(self[index])\n\t\tend\n\t\tcapture\n\tend", "title": "" }, { "docid": "1ff5cd7e768266f5215072df826ef723", "score": "0.558042", "text": "def my_map pr=nil\n new_a = []\n\n self.my_each do |element|\n unless block_given?\n new_a << pr.call(element)\n else\n new_a << yield(element)\n end\n end\n\n new_a\n end", "title": "" }, { "docid": "585b16fda31030772fe5a6b9c2e7e77c", "score": "0.5570166", "text": "def my_proc_map &proc_to_block\n new_array = []\n for i in self\n new_array << proc_to_block.call(i)\n end\n new_array\n end", "title": "" }, { "docid": "c4fe31f04fe5e4a880b55564675f4556", "score": "0.55554616", "text": "def map!(&block)\n replace(map(&block))\n end", "title": "" }, { "docid": "b9bd426cae54b9c84be6f4ae963f96f2", "score": "0.55525565", "text": "def double_array(array)\n# array = [4, 2, 5, 99, -4]\n double_array = array.map do |array|\n array * 2 \n end\n # p double_array\n return double_array\nend", "title": "" }, { "docid": "36633ed655acaac82e63a9f128c6d105", "score": "0.5550466", "text": "def test(b)\n p b.map { |num| num + 1 }\nend", "title": "" }, { "docid": "48f67634f91c0151ef3842095f0f9196", "score": "0.5544802", "text": "def map\n TS.new(@data.map { |v| yield *v })\n end", "title": "" }, { "docid": "d298927e6fec1987b49667bacbca7ac3", "score": "0.5542858", "text": "def mappa_e_appiattisci(&block)\n self.map.with_index(&block).flatten\n end", "title": "" }, { "docid": "cda8e21b4bbe503b085cc26962673ad4", "score": "0.5542116", "text": "def map(&block)\n @objects.map(&block)\n end", "title": "" }, { "docid": "8094fe7501e17d6ebe907c46b34887de", "score": "0.55391246", "text": "def map_to_no_change(source_array)\n source_array\nend", "title": "" }, { "docid": "8350f9a76217ad035698517699eaa1e5", "score": "0.5538221", "text": "def map(arr)\n new_arr = []\n arr.each do |elem|\n new_arr << yield(elem)\n end\n new_arr\nend", "title": "" }, { "docid": "1691c7fb756a3c394d7a6932d716598e", "score": "0.5535076", "text": "def map(&block)\n java_map(Fct.new block)\n end", "title": "" }, { "docid": "1691c7fb756a3c394d7a6932d716598e", "score": "0.5535076", "text": "def map(&block)\n java_map(Fct.new block)\n end", "title": "" }, { "docid": "bdd1ad6d9589107af51e2fcd44266e9e", "score": "0.5529907", "text": "def map(arr)\n new_arr = []\n for value in arr\n new_arr << yield(value)\n end\n new_arr\nend", "title": "" }, { "docid": "ee0ba2270c5405dc9431cf0600e44725", "score": "0.5529316", "text": "def my_map(array, &prc)\n newArr = []\n\n array.each { |ele| newArr << prc.call(ele) }\n\n return newArr\nend", "title": "" }, { "docid": "e0637dff37e6a4e670bbe06ab77cde83", "score": "0.552683", "text": "def my_map (*proc1)\n #returns a modified array, modified based on block or proc passed\n new_array = []\n self.my_each do |item|\n new_array << yield(item)\n end\n new_array\n end", "title": "" }, { "docid": "c24e8af2eccd220df78aa40e0ce93017", "score": "0.5526484", "text": "def map(arr)\n arr.each_with_object([]) { |elm, new_arr| new_arr << yield(elm) }\nend", "title": "" }, { "docid": "5a9b44537a288f625da0591cb1514007", "score": "0.551868", "text": "def our_map(array)\n result = [] # => []\n\n array.each do |element| # => [\"Martin\", \"chris\", \"Austen\", \"lisa\", \"ava\", \"Erik\", \"Alex\", \"Tony\"]\n result << yield(element) # => [\"a\"], [\"a\", \"a\"], [\"a\", \"a\", \"a\"], [\"a\", \"a\", \"a\", \"a\"], [\"a\", \"a\", \"a\", \"a\", \"a\"], [\"a\", \"a\", \"a\", \"a\", \"a\", \"a\"], [\"a\", \"a\", \"a\", \"a\", \"a\", \"a\", \"a\"], [\"a\", \"a\", \"a\", \"a\", \"a\", \"a\", \"a\", \"a\"]\n end # => [\"Martin\", \"chris\", \"Austen\", \"lisa\", \"ava\", \"Erik\", \"Alex\", \"Tony\"]\n\n result # => [\"a\", \"a\", \"a\", \"a\", \"a\", \"a\", \"a\", \"a\"]\nend", "title": "" }, { "docid": "346e2c92cde2df94f867a1d622a702c1", "score": "0.5513928", "text": "def map_to_square(array)\r\n new_arr = array.map { |e| e * e }\r\n p new_arr\r\nend", "title": "" }, { "docid": "352cdf39ebac6082ed5a2816b8585f17", "score": "0.5511322", "text": "def map(seq, block)\n result = []\n seq.each do |item|\n piece = block.run_with(item)\n result.push(piece)\n end\n result\nend", "title": "" }, { "docid": "9216ad33ad22061f747044e94ee1765e", "score": "0.5510651", "text": "def docs\n self.map { |i| i['doc'] }\n end", "title": "" }, { "docid": "ae60b4f8555cec66f59df253bd7cf0cf", "score": "0.55079573", "text": "def map(&block)\n all.map(&block)\n end", "title": "" }, { "docid": "81183c7ed51a8ce7e866dde61da1b28e", "score": "0.55037713", "text": "def map(&block)\n self\n end", "title": "" }, { "docid": "81183c7ed51a8ce7e866dde61da1b28e", "score": "0.55037713", "text": "def map(&block)\n self\n end", "title": "" }, { "docid": "02a430761074998145136b479c8a69c6", "score": "0.5502369", "text": "def map(&block)\n items.map { |x| block.call(x) }\n end", "title": "" }, { "docid": "faa087ff828e2c97455b98c1d906edc4", "score": "0.54956114", "text": "def map(map, &block)\n @mappings ||= []\n @mappings << [map, block]\n end", "title": "" }, { "docid": "33b423706dde50e441cd7b6b7aef9982", "score": "0.548773", "text": "def my_map \n if block_given?\n arr = []\n my_each { |element| arr << yield(element) }\n arr\n else\n self\n end\n end", "title": "" }, { "docid": "2ef21b66b71f68c2515d914341b9eacf", "score": "0.54803216", "text": "def my_map\n results = []\n my_each { |el| results << yield(el) }\n results\n end", "title": "" } ]
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "683fd2932e78ed9c39d5b878ff8e5193", "score": "0.0", "text": "def set_store\r\n @store = Store.find(params[:id])\r\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60339177", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.60135007", "text": "def on_setup_callbacks; end", "title": "" }, { "docid": "311e95e92009c313c8afd74317018994", "score": "0.59219855", "text": "def setup_actions\n domain = @apps.domain\n path_user = '/a/feeds/'+domain+'/user/2.0'\n path_nickname = '/a/feeds/'+domain+'/nickname/2.0'\n path_email_list = '/a/feeds/'+domain+'/emailList/2.0'\n path_group = '/a/feeds/group/2.0/'+domain\n\n @apps.register_action(:domain_login, {:method => 'POST', :path => '/accounts/ClientLogin' })\n @apps.register_action(:user_create, { :method => 'POST', :path => path_user })\n @apps.register_action(:user_retrieve, { :method => 'GET', :path => path_user+'/' })\n @apps.register_action(:user_retrieve_all, { :method => 'GET', :path => path_user })\n @apps.register_action(:user_update, { :method => 'PUT', :path => path_user +'/' })\n @apps.register_action(:user_delete, { :method => 'DELETE', :path => path_user +'/' })\n @apps.register_action(:nickname_create, { :method => 'POST', :path =>path_nickname })\n @apps.register_action(:nickname_retrieve, { :method => 'GET', :path =>path_nickname+'/' })\n @apps.register_action(:nickname_retrieve_all_for_user, { :method => 'GET', :path =>path_nickname+'?username=' })\n @apps.register_action(:nickname_retrieve_all_in_domain, { :method => 'GET', :path =>path_nickname })\n @apps.register_action(:nickname_delete, { :method => 'DELETE', :path =>path_nickname+'/' })\n @apps.register_action(:group_create, { :method => 'POST', :path => path_group })\n @apps.register_action(:group_update, { :method => 'PUT', :path => path_group })\n @apps.register_action(:group_retrieve, { :method => 'GET', :path => path_group })\n @apps.register_action(:group_delete, { :method => 'DELETE', :path => path_group })\n\n # special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n @apps.register_action(:next, {:method => 'GET', :path =>'' })\n end", "title": "" }, { "docid": "8315debee821f8bfc9718d31b654d2de", "score": "0.5913137", "text": "def initialize(*args)\n super\n @action = :setup\nend", "title": "" }, { "docid": "8315debee821f8bfc9718d31b654d2de", "score": "0.5913137", "text": "def initialize(*args)\n super\n @action = :setup\nend", "title": "" }, { "docid": "bfea4d21895187a799525503ef403d16", "score": "0.589884", "text": "def define_action_helpers\n super\n define_validation_hook if runs_validations_on_action?\n end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.5890051", "text": "def actions; end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.5890051", "text": "def actions; end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.5890051", "text": "def actions; end", "title": "" }, { "docid": "352de4abc4d2d9a1df203735ef5f0b86", "score": "0.5889191", "text": "def required_action\n # TODO: implement\n end", "title": "" }, { "docid": "8713cb2364ff3f2018b0d52ab32dbf37", "score": "0.58780754", "text": "def define_action_helpers\n if action == :save\n if super(:create_or_update)\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n else\n super\n end\n end", "title": "" }, { "docid": "a80b33627067efa06c6204bee0f5890e", "score": "0.5863248", "text": "def actions\n\n end", "title": "" }, { "docid": "930a930e57ae15f432a627a277647f2e", "score": "0.58094144", "text": "def setup_actions\n domain = @apps.domain\n path_base = '/a/feeds/emailsettings/2.0/'+domain+'/'\n\n @apps.register_action(:create_label, {:method => 'POST', :path => path_base })\n @apps.register_action(:create_filter, { :method => 'POST', :path => path_base })\n @apps.register_action(:create_send_as, { :method => 'POST', :path => path_base })\n @apps.register_action(:update_webclip, { :method => 'PUT', :path => path_base })\n @apps.register_action(:update_forward, { :method => 'PUT', :path => path_base })\n @apps.register_action(:set_pop, { :method => 'PUT', :path => path_base })\n @apps.register_action(:set_imap, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_vacation, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_signature, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_language, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_general, { :method => 'PUT', :path =>path_base })\n\n # special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n @apps.register_action(:next, {:method => 'GET', :path =>nil })\n end", "title": "" }, { "docid": "33ff963edc7c4c98d1b90e341e7c5d61", "score": "0.57375425", "text": "def setup\n common_setup\n end", "title": "" }, { "docid": "a5ca4679d7b3eab70d3386a5dbaf27e1", "score": "0.57285565", "text": "def perform_setup\n end", "title": "" }, { "docid": "ec7554018a9b404d942fc0a910ed95d9", "score": "0.57149214", "text": "def before_setup(&block)\n pre_setup_actions.unshift block\n end", "title": "" }, { "docid": "9c186951c13b270d232086de9c19c45b", "score": "0.5703237", "text": "def callbacks; end", "title": "" }, { "docid": "c85b0efcd2c46a181a229078d8efb4de", "score": "0.56900954", "text": "def custom_setup\n\n end", "title": "" }, { "docid": "100180fa74cf156333d506496717f587", "score": "0.56665677", "text": "def do_setup\n\t\tget_validation\n\t\tprocess_options\n\tend", "title": "" }, { "docid": "2198a9876a6ec535e7dcf0fd476b092f", "score": "0.5651118", "text": "def initial_action; end", "title": "" }, { "docid": "b9b75a9e2eab9d7629c38782c0f3b40b", "score": "0.5648135", "text": "def setup_intent; end", "title": "" }, { "docid": "471d64903a08e207b57689c9fbae0cf9", "score": "0.56357735", "text": "def setup_controllers &proc\n @global_setup = proc\n self\n end", "title": "" }, { "docid": "468d85305e6de5748477545f889925a7", "score": "0.5627078", "text": "def inner_action; end", "title": "" }, { "docid": "bb445e7cc46faa4197184b08218d1c6d", "score": "0.5608873", "text": "def pre_action\n # Override this if necessary.\n end", "title": "" }, { "docid": "432f1678bb85edabcf1f6d7150009703", "score": "0.5598699", "text": "def target_callbacks() = commands", "title": "" }, { "docid": "48804b0fa534b64e7885b90cf11bff31", "score": "0.5598419", "text": "def execute_callbacks; end", "title": "" }, { "docid": "5aab98e3f069a87e5ebe77b170eab5b9", "score": "0.5589822", "text": "def api_action!(*args)\n type = self.class.name.split(\"::\").last.downcase\n run_callbacks_for([\"before_#{type}\", :before], *args)\n result = nil\n begin\n result = yield if block_given?\n run_callbacks_for([\"after_#{type}\", :after], *args)\n result\n rescue => err\n run_callbacks_for([\"failed_#{type}\", :failed], *(args + [err]))\n raise\n end\n end", "title": "" }, { "docid": "9efbca664902d80a451ef6cff0334fe2", "score": "0.5558845", "text": "def global_callbacks; end", "title": "" }, { "docid": "9efbca664902d80a451ef6cff0334fe2", "score": "0.5558845", "text": "def global_callbacks; end", "title": "" }, { "docid": "482481e8cf2720193f1cdcf32ad1c31c", "score": "0.55084664", "text": "def required_keys(action)\n\n end", "title": "" }, { "docid": "353fd7d7cf28caafe16d2234bfbd3d16", "score": "0.5504379", "text": "def assign_default_callbacks(action_name, is_member=false)\n if ResourceController::DEFAULT_ACTIONS.include?(action_name)\n DefaultActions.send(action_name, self)\n elsif is_member\n send(action_name).build { load_object }\n send(action_name).wants.html\n send(action_name).wants.xml { render :xml => object }\n send(action_name).failure.flash \"Request failed\"\n send(action_name).failure.wants.html\n send(action_name).failure.wants.xml { render :xml => object.errors }\n else\n send(action_name).build { load_collection }\n send(action_name).wants.html\n send(action_name).wants.xml { render :xml => collection }\n send(action_name).failure.flash \"Request failed\"\n send(action_name).failure.wants.html\n send(action_name).failure.wants.xml { head 500 }\n end\n end", "title": "" }, { "docid": "dcf95c552669536111d95309d8f4aafd", "score": "0.5465574", "text": "def layout_actions\n \n end", "title": "" }, { "docid": "2f6ef0a1ebe74f4d79ef0fb81af59d40", "score": "0.5464707", "text": "def on_setup(&block); end", "title": "" }, { "docid": "8ab2a5ea108f779c746016b6f4a7c4a8", "score": "0.54471064", "text": "def testCase_001\n test_case_title # fw3_actions.rb\n setup # fw3_global_methods.rb\n \n get_page_url # fw3_actions.rb\n validate_page_title # fw3_actions.rb\n validate_page_link_set # fw3_actions.rb\n \n teardown # fw3_global_methods.rb\nend", "title": "" }, { "docid": "e3aadf41537d03bd18cf63a3653e05aa", "score": "0.54455084", "text": "def before(action)\n invoke_callbacks *options_for(action).before\n end", "title": "" }, { "docid": "6bd37bc223849096c6ea81aeb34c207e", "score": "0.5437386", "text": "def post_setup\n end", "title": "" }, { "docid": "07fd9aded4aa07cbbba2a60fda726efe", "score": "0.54160327", "text": "def testCase_001\n testTitle # fw2_actions.rb\n setup # fw2_global_methods.rb\n get_page_url # fw2_actions.rb\n validate_title # fw2_actions.rb\n teardown # fw2_global_methods.rb\nend", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.5411113", "text": "def action_methods; end", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.5411113", "text": "def action_methods; end", "title": "" }, { "docid": "9358208395c0869021020ae39071eccd", "score": "0.5397424", "text": "def post_setup; end", "title": "" }, { "docid": "cb5bad618fb39e01c8ba64257531d610", "score": "0.5392518", "text": "def define_model_action(methods,action,default_options={:validate => true})\n default_options.merge!(methods.extract_options!)\n actions = [action,\"#{action}!\".to_sym]\n actions.each do |a|\n define_method(a) do |opts = {}|\n rslt = nil\n options = default_options.merge(opts)\n options[:raise_exception] = a.to_s.match(/\\!$/)\n run_callbacks(action) do\n rslt = run_model_action(methods,options)\n end\n run_after_any\n rslt\n end\n end\n end", "title": "" }, { "docid": "c5904f93614d08afa38cc3f05f0d2365", "score": "0.5391541", "text": "def before_setup; end", "title": "" }, { "docid": "c5904f93614d08afa38cc3f05f0d2365", "score": "0.5391541", "text": "def before_setup; end", "title": "" }, { "docid": "a468b256a999961df3957e843fd9bdf4", "score": "0.5385411", "text": "def _setup\n setup_notification_categories\n setup_intelligent_segments\n end", "title": "" }, { "docid": "f099a8475f369ce73a38d665b6ee6877", "score": "0.53794575", "text": "def action_run\n end", "title": "" }, { "docid": "2c4e5a90aa8efaaa3ed953818a9b30d2", "score": "0.5357573", "text": "def execute(setup)\n @action.call(setup)\n end", "title": "" }, { "docid": "118932433a8cfef23bb8a921745d6d37", "score": "0.53487605", "text": "def register_action(action); end", "title": "" }, { "docid": "725216eb875e8fa116cd55eac7917421", "score": "0.5346655", "text": "def setup\n @controller.setup\n end", "title": "" }, { "docid": "39c39d6fe940796aadbeaef0ce1c360b", "score": "0.53448105", "text": "def setup_phase; end", "title": "" }, { "docid": "bd03e961c8be41f20d057972c496018c", "score": "0.5342072", "text": "def post_setup\n controller.each do |name,ctrl|\n ctrl.post_setup\n end\n end", "title": "" }, { "docid": "c6352e6eaf17cda8c9d2763f0fbfd99d", "score": "0.5341318", "text": "def initial_action=(_arg0); end", "title": "" }, { "docid": "207a668c9bce9906f5ec79b75b4d8ad7", "score": "0.53243506", "text": "def before_setup\n\n end", "title": "" }, { "docid": "669ee5153c4dc8ee81ff32c4cefdd088", "score": "0.53025913", "text": "def ensure_before_and_after; end", "title": "" }, { "docid": "c77ece7b01773fb7f9f9c0f1e8c70332", "score": "0.5283114", "text": "def setup!\n adding_handlers do\n check_arity\n apply_casting\n check_validation\n end\n end", "title": "" }, { "docid": "1e1e48767a7ac23eb33df770784fec61", "score": "0.5282289", "text": "def set_minimum_up_member_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end", "title": "" }, { "docid": "4ad1208a9b6d80ab0dd5dccf8157af63", "score": "0.52585614", "text": "def rails_controller_callbacks(&block)\n rails_controller_instance.run_callbacks(:process_action, &block)\n end", "title": "" }, { "docid": "63a9fc1fb0dc1a7d76ebb63a61ed24d7", "score": "0.52571374", "text": "def define_callbacks(*args)\n if abstract_class\n all_shards.each do |model|\n model.define_callbacks(*args)\n end\n end\n\n super\n end", "title": "" }, { "docid": "fc88422a7a885bac1df28883547362a7", "score": "0.52483684", "text": "def pre_setup_actions\n @@pre_setup_actions ||= []\n end", "title": "" }, { "docid": "8945e9135e140a6ae6db8d7c3490a645", "score": "0.5244467", "text": "def action_awareness\n if action_aware?\n if !@options.key?(:allow_nil)\n if @required\n @allow_nil = false\n else\n @allow_nil = true\n end\n end\n if as_action != \"create\"\n @required = false\n end\n end\n end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.52385926", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.52385926", "text": "def action; end", "title": "" }, { "docid": "7b3954deb2995cf68646c7333c15087b", "score": "0.5236853", "text": "def after_setup\n end", "title": "" }, { "docid": "1dddf3ac307b09142d0ad9ebc9c4dba9", "score": "0.52330637", "text": "def external_action\n raise NotImplementedError\n end", "title": "" }, { "docid": "5772d1543808c2752c186db7ce2c2ad5", "score": "0.52300817", "text": "def actions(state:)\n raise NotImplementedError\n end", "title": "" }, { "docid": "64a6d16e05dd7087024d5170f58dfeae", "score": "0.522413", "text": "def setup_actions(domain)\n\t\t\tpath_user = '/a/feeds/'+domain+'/user/2.0'\n\t\t\tpath_nickname = '/a/feeds/'+domain+'/nickname/2.0'\n\t\t\tpath_group = '/a/feeds/group/2.0/'+domain # path for Google groups\n\n\t\t\taction = Hash.new\n\t\t\taction[:domain_login] = {:method => 'POST', :path => '/accounts/ClientLogin' }\n\t\t\taction[:user_create] = { :method => 'POST', :path => path_user }\n\t\t\taction[:user_retrieve] = { :method => 'GET', :path => path_user+'/' }\n\t\t\taction[:user_retrieve_all] = { :method => 'GET', :path => path_user } \n\t\t\taction[:user_update] = { :method => 'PUT', :path => path_user +'/' }\n\t\t\taction[:user_rename] = { :method => 'PUT', :path => path_user +'/' }\n\t\t\taction[:user_delete] = { :method => 'DELETE', :path => path_user +'/' }\n\t\t\taction[:nickname_create] = { :method => 'POST', :path =>path_nickname }\n\t\t\taction[:nickname_retrieve] = { :method => 'GET', :path =>path_nickname+'/' }\n\t\t\taction[:nickname_retrieve_all_for_user] = { :method => 'GET', :path =>path_nickname+'?username=' }\n\t\t\taction[:nickname_retrieve_all_in_domain] = { :method => 'GET', :path =>path_nickname }\n\t\t\taction[:nickname_delete] = { :method => 'DELETE', :path =>path_nickname+'/' }\n\t\t\taction[:group_create] = { :method => 'POST', :path =>path_group }\n\t\t\taction[:group_update] = { :method => 'PUT', :path =>path_group+'/' }\n\t\t\taction[:group_delete] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:groups_retrieve] = { :method => 'GET', :path =>path_group+'?member=' }\n\t\t\taction[:all_groups_retrieve] = { :method => 'GET', :path =>path_group }\n\t\t\taction[:membership_add] = { :method => 'POST', :path =>path_group+'/' }\n\t\t\taction[:membership_remove] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:membership_confirm] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:all_members_retrieve] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:ownership_add] = { :method => 'POST', :path =>path_group+'/' }\n\t\t\taction[:ownership_remove] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:ownership_confirm] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:all_owners_retrieve] = { :method => 'GET', :path =>path_group+'/' }\n\t\n\t\t\t# special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n\t\t\taction[:next] = {:method => 'GET', :path =>nil }\n\t\t\treturn action \t\n\t\tend", "title": "" }, { "docid": "6350959a62aa797b89a21eacb3200e75", "score": "0.52226824", "text": "def before(action)\n invoke_callbacks *self.class.send(action).before\n end", "title": "" }, { "docid": "db0cb7d7727f626ba2dca5bc72cea5a6", "score": "0.521999", "text": "def process_params\n set_params_authable if process_params_authable?\n set_params_ownerable if process_params_ownerable?\n set_params_sub_action\n end", "title": "" }, { "docid": "8d7ed2ff3920c2016c75f4f9d8b5a870", "score": "0.5215832", "text": "def pick_action; end", "title": "" }, { "docid": "7bbfb366d2ee170c855b1d0141bfc2a3", "score": "0.5213786", "text": "def proceed_with(action, *arguments)\n self.class.decouplings.each do |decoupler|\n decoupler.run_on(self, action, *arguments)\n end\n end", "title": "" }, { "docid": "78ecc6a2dfbf08166a7a1360bc9c35ef", "score": "0.52100146", "text": "def define_action_helpers\n if action_hook\n @action_hook_defined = true\n define_action_hook\n end\n end", "title": "" }, { "docid": "2aba2d3187e01346918a6557230603c7", "score": "0.52085197", "text": "def ac_action(&blk)\n @action = blk\n end", "title": "" }, { "docid": "4c23552739b40c7886414af61210d31c", "score": "0.5203262", "text": "def execute_pre_setup_actions(test_instance,runner=nil)\n self.class.pre_setup_actions.each do |action|\n action.call test_instance\n end\n end", "title": "" }, { "docid": "691d5a5bcefbef8c08db61094691627c", "score": "0.5202406", "text": "def performed(action)\n end", "title": "" }, { "docid": "6a98e12d6f15af80f63556fcdd01e472", "score": "0.520174", "text": "def perform_setup\n ## Run global setup before example\n Alfred.configuration.setup.each do |setup|\n @request.perform_setup(&setup)\n end\n\n ## Run setup blocks for scenario\n setups.each { |setup| @request.perform_setup(&setup) }\n end", "title": "" }, { "docid": "d56f4ec734e3f3bc1ad913b36ff86130", "score": "0.5201504", "text": "def create_setup\n \n end", "title": "" }, { "docid": "ad33138fb4bd42d9785a8f84821bfd88", "score": "0.51963276", "text": "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "title": "" }, { "docid": "ad33138fb4bd42d9785a8f84821bfd88", "score": "0.51963276", "text": "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "title": "" }, { "docid": "7fca702f2da4dbdc9b39e5107a2ab87d", "score": "0.5191404", "text": "def add_transition_callbacks\n %w(before after).each {|type| owner_class.define_callbacks(\"#{type}_transition_#{attribute}\") }\n end", "title": "" }, { "docid": "063b82c93b47d702ef6bddadb6f0c76e", "score": "0.5178325", "text": "def setup(instance)\n action(:setup, instance)\n end", "title": "" }, { "docid": "9f1f73ee40d23f6b808bb3fbbf6af931", "score": "0.51765746", "text": "def setup( *args )\n\t\t\tself.class.setupMethods.each {|sblock|\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\tend", "title": "" }, { "docid": "b4f4e1d4dfd31919ab39aecccb9db1d0", "score": "0.51710224", "text": "def setup(resources) ; end", "title": "" }, { "docid": "b4f4e1d4dfd31919ab39aecccb9db1d0", "score": "0.51710224", "text": "def setup(resources) ; end", "title": "" }, { "docid": "b4f4e1d4dfd31919ab39aecccb9db1d0", "score": "0.51710224", "text": "def setup(resources) ; end", "title": "" }, { "docid": "7a0c9d839516dc9d0014e160b6e625a8", "score": "0.5162045", "text": "def setup(request)\n end", "title": "" }, { "docid": "e441ee807f2820bf3655ff2b7cf397fc", "score": "0.5150735", "text": "def after_setup; end", "title": "" }, { "docid": "1d375c9be726f822b2eb9e2a652f91f6", "score": "0.5143402", "text": "def before *actions, &proc\n actions = ['*'] if actions.size == 0\n actions.each { |a| @callbacks[:a][a] = proc }\n end", "title": "" }, { "docid": "c594a0d7b6ae00511d223b0533636c9c", "score": "0.51415485", "text": "def code_action_provider; end", "title": "" }, { "docid": "faddd70d9fef5c9cd1f0d4e673e408b9", "score": "0.51398855", "text": "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end", "title": "" }, { "docid": "2fcff037e3c18a5eb8d964f8f0a62ebe", "score": "0.51376045", "text": "def setup(params)\n end", "title": "" }, { "docid": "111fd47abd953b35a427ff0b098a800a", "score": "0.51318985", "text": "def setup\n make_notification_owner\n load_superusers\n admin_sets.each do |as|\n @logger.debug \"Attempting to make admin set for #{as}\"\n make_admin_set_from_config(as)\n end\n load_workflows\n everyone_can_deposit_everywhere\n give_superusers_superpowers\n end", "title": "" }, { "docid": "f2ac709e70364fce188bb24e414340ea", "score": "0.5115387", "text": "def setup_defaults\n add_help\n @handler = Cliqr::Util.forward_to_help_handler if @handler.nil? && help? && actions?\n @actions.each(&:setup_defaults)\n end", "title": "" }, { "docid": "3b4fb29fa45f95d436fd3a8987f12de7", "score": "0.5111866", "text": "def setup\n transition_to(:setup)\n end", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.5110294", "text": "def action\n end", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.5110294", "text": "def action\n end", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.5110294", "text": "def action\n end", "title": "" }, { "docid": "4c7a1503a86fb26f1e4b4111925949a2", "score": "0.5109771", "text": "def scaffold_setup_helper\n include ScaffoldingExtensions::Helper\n include ScaffoldingExtensions::MerbControllerHelper\n include ScaffoldingExtensions::PrototypeHelper\n include ScaffoldingExtensions::Controller\n include ScaffoldingExtensions::MerbController\n before :scaffold_check_nonidempotent_requests\n end", "title": "" }, { "docid": "63849e121dcfb8a1b963f040d0fe3c28", "score": "0.5107364", "text": "def perform_action(action, item)\n if action == :approve\n approve(item.fullid)\n elsif action == :remove\n remove(item.fullid)\n elsif action == :alert\n #perform_alert() check condition alert params and proceed\n else\n #something isn't cool, pass or error \n end\nend", "title": "" }, { "docid": "f04fd745d027fc758dac7a4ca6440871", "score": "0.5106081", "text": "def block_actions options ; end", "title": "" }, { "docid": "0d1c87e5cf08313c959963934383f5ae", "score": "0.51001656", "text": "def on_action(action)\n @action = action\n self\n end", "title": "" }, { "docid": "916d3c71d3a5db831a5910448835ad82", "score": "0.50964546", "text": "def do_action(action)\n case action\n when \"a\"\n @user_manager.create_user\n when \"b\"\n @user_manager.delete_user\n when \"c\"\n @user_manager.get_info\n when \"d\"\n @user_manager.list_all_users\n when \"quit\", \"exit\"\n bail\n end\n end", "title": "" }, { "docid": "076c761e1e84b581a65903c7c253aa62", "score": "0.5093199", "text": "def add_callbacks(base); end", "title": "" } ]
290f1de91245c76ef3833fd1000f589f
Define your play method below
[ { "docid": "5992d82a56fbcada960537cd94ca0735", "score": "0.0", "text": "def get_input(token)\n print \"Player #{token} select an unused cell: [1-9]: \"\n input = gets.strip\n puts \"\"\n return input\nend", "title": "" } ]
[ { "docid": "da113481795475a035aed999f253335e", "score": "0.90035415", "text": "def play\n end", "title": "" }, { "docid": "da113481795475a035aed999f253335e", "score": "0.90035415", "text": "def play\n end", "title": "" }, { "docid": "da113481795475a035aed999f253335e", "score": "0.90035415", "text": "def play\n end", "title": "" }, { "docid": "da113481795475a035aed999f253335e", "score": "0.90035415", "text": "def play\n end", "title": "" }, { "docid": "e298e56912f7bc0f615c3771c3acf5f7", "score": "0.80939275", "text": "def play_one\r\n\t\tend", "title": "" }, { "docid": "5020340da7adcc317bcf4c807ea4443a", "score": "0.79531", "text": "def playing?; end", "title": "" }, { "docid": "ce116fa803ffb6578b1513c1885b4e08", "score": "0.7901386", "text": "def play()\r\n\t\t\tcase type\r\n\t\t\t\twhen 1\r\n\t\t\t\t\tplay_one()\r\n\t\t\t\twhen 2\r\n\t\t\t\t\tplay_two()\r\n\t\t\t\twhen 3\r\n\t\t\t\t\tplay_three()\r\n\t\t\tend\r\n\t\tend", "title": "" }, { "docid": "5d420a44ae944dd55f162d8c5a5102de", "score": "0.78310406", "text": "def play_game\n \n end", "title": "" }, { "docid": "c122f587b6ac8813167c754c7b96daf4", "score": "0.7823476", "text": "def on_play; end", "title": "" }, { "docid": "b895609deac8241fbe9d2a3ae63c9729", "score": "0.7721754", "text": "def play\n self.game_setup\n end", "title": "" }, { "docid": "b895609deac8241fbe9d2a3ae63c9729", "score": "0.7721754", "text": "def play\n self.game_setup\n end", "title": "" }, { "docid": "50487b22b4aea143b3c9bc851dc60385", "score": "0.7671629", "text": "def play(looping=false); end", "title": "" }, { "docid": "1cc857c4d7b20267cbd7cc6d94c46c2a", "score": "0.7613333", "text": "def play(looping = false); end", "title": "" }, { "docid": "1aca870e874b366b4b240833e1342423", "score": "0.7549048", "text": "def play\n native :play\n end", "title": "" }, { "docid": "0854ccb6d6900b68f036bcdcaf648917", "score": "0.7503525", "text": "def play\n fetch('show.play')\n end", "title": "" }, { "docid": "036c84851dd730cef395281e364c3725", "score": "0.74657184", "text": "def play\n # Currently just puts a name later will want to play\n puts \"Playing: #{name}\"\n end", "title": "" }, { "docid": "6c1f20f06e0e22b3f9669df5bb65589b", "score": "0.7441826", "text": "def do_play(_)\n log(LOG_DEBUG, 'Function: do_play()')\n log(LOG_DEBUG, 'MPD request: play()')\n $mpd.play\nend", "title": "" }, { "docid": "8128c23a93746ef737f0b53b2b494e8d", "score": "0.7431603", "text": "def start\n GAME.play\n render_all\n end", "title": "" }, { "docid": "cf64cbaf98995dfd3b6cf175d9538b6d", "score": "0.7380925", "text": "def initialize\n setup\n play\n end", "title": "" }, { "docid": "9dfa8b4ae048266068f1904eb6bebf10", "score": "0.73691", "text": "def play_turn\n end", "title": "" }, { "docid": "226222a099560e1940b9d587fce0c546", "score": "0.7329405", "text": "def play(card)\n end", "title": "" }, { "docid": "3fffa244b31887e13807747a0a30d3ea", "score": "0.72900665", "text": "def play # new\n puts \"2\"\n end", "title": "" }, { "docid": "d6cca7e3889b421f2713a50f1af3255a", "score": "0.72763777", "text": "def play(&blk)\n start_playing\n blk.call\n ensure\n stop_playing\n end", "title": "" }, { "docid": "3d3fa40ded65a53f6314483964a6d4a4", "score": "0.72446334", "text": "def in_play!\n\t\t@in_play = true\n\t\tself\n\tend", "title": "" }, { "docid": "3167d59708f542e2281ae1a2bb493aba", "score": "0.7231522", "text": "def play\n self.take_bets\n self.deal\n self.turns\n self.collect\n end", "title": "" }, { "docid": "66efdaafc3e3ed4ab6b5a41646246be6", "score": "0.7224286", "text": "def onPlay(&block)\n set_proc(:onPlay, block)\n end", "title": "" }, { "docid": "65e67f07389b78023f9c7477449264bb", "score": "0.71988845", "text": "def play #this block of code should exeucate all the processs or methos until there's winner \n self.start\n self.showboard\n end", "title": "" }, { "docid": "588ce8c6b69fc7852d09bdd4feb9838a", "score": "0.71881187", "text": "def play(side, move)\n\t\traise \"Unimplemented play method\"\n\tend", "title": "" }, { "docid": "d4d4f774d9f6a84e9e57738b81e8a0f3", "score": "0.71745265", "text": "def play\n\t\tprint \"\\nHello world!!!!!!!!!!!!!!!!!!!!!!\\n\"\n\t\t@game = Game.get_game(params[:game_uuid])\n\t\t\n\tend", "title": "" }, { "docid": "909d770d6f7082f5f5a65784c16eed52", "score": "0.7153948", "text": "def play\n start\n sleep duration\n stop\n end", "title": "" }, { "docid": "30ebff693f6ff595c3949d1dee628c5f", "score": "0.7150296", "text": "def run\n music\n welcome\nend", "title": "" }, { "docid": "2326fbf328cf076e5be489f4d82ed2d2", "score": "0.710322", "text": "def play\n turns\n end", "title": "" }, { "docid": "cdc335471e199af72dc11656f06d0901", "score": "0.7094477", "text": "def play\n initialize\n new_game\n end", "title": "" }, { "docid": "52bf86af4cfa3d1289dafd906a396478", "score": "0.7082581", "text": "def play\n @played_time = Time.now\n end", "title": "" }, { "docid": "24e9df2b8b4c024db2cfb3058c34418e", "score": "0.70806307", "text": "def play(x, y)\n return @controller.play(@model, x, y)\n end", "title": "" }, { "docid": "ac202d8de04086387860ffc35190662d", "score": "0.70729333", "text": "def request_play(trick)\n # Override me\n raise 'Subclass of Player must override request_play.'\n end", "title": "" }, { "docid": "f4fea3e9fa6e18b0b89ecafce802222d", "score": "0.70708644", "text": "def new\r\n \tplay\r\n end", "title": "" }, { "docid": "f8c139901d07d051d43f39686edcc711", "score": "0.704206", "text": "def play_hand(player) \n end", "title": "" }, { "docid": "b8832460ea080fd4c450633b3bf4837e", "score": "0.703183", "text": "def onPlay(&block)\n set_event_proc(:onPlay, block)\n end", "title": "" }, { "docid": "3349d176d8642fa656a5f992a61cc05d", "score": "0.70295036", "text": "def play\n unless playing?\n play_or_pause\n end\n end", "title": "" }, { "docid": "9a355d8646e9c8b0bb6e4c03ac71c47c", "score": "0.6981729", "text": "def play\n\t\t@sound = Sound.find_by_id(params[:id]) || Sound.find_by_label(params[:id])\n\t\tresponse = @sound.delay_play if @sound \n\t\trender :nothing => true\n\tend", "title": "" }, { "docid": "c98f78d3748306b79a23fb236d505eed", "score": "0.6943693", "text": "def play\n @_itunes.play\n end", "title": "" }, { "docid": "43536e709d6236bb839158a01bbdf36b", "score": "0.69138014", "text": "def play(options={},&block)\n run_task(MPlayerTask.new(options,&block))\n end", "title": "" }, { "docid": "c8809b20a596c0b7e12bc99015e9bd07", "score": "0.6898812", "text": "def _main\n game = Game.new\n game.play\nend", "title": "" }, { "docid": "c1b1b4472e2169f1073fc7bb2e962e68", "score": "0.6897191", "text": "def play(cmd)\n play_game(cmd)\n end", "title": "" }, { "docid": "87dbe3330cbb3bb4b95ed04492a8c251", "score": "0.68810254", "text": "def you_are_a_master\n play \"https://www.khanacademy.org/sounds/end-of-task.ogg\"\n say \"You got five in a row! Way to go.\"\n\n redirect :replay_loop\nend", "title": "" }, { "docid": "029b975e9d5fddd50da85f716ee6ebcd", "score": "0.68769455", "text": "def play\n speed(rate: 1)\n end", "title": "" }, { "docid": "96370b3818f5589703e317183b38466f", "score": "0.6838718", "text": "def play\r\n\t\tnewgame\r\n\t\tnew_board\r\n\t\tturns\r\n\tend", "title": "" }, { "docid": "aadee9344e9889a64a871b37fe85fe91", "score": "0.683415", "text": "def play_sound options\n \n end", "title": "" }, { "docid": "79ef8308b85f5003a6ce479367ee040e", "score": "0.6825274", "text": "def start\n self.board.reset!\n self.play\n end", "title": "" }, { "docid": "8a8de86a7ce8765f419bba65fafb3424", "score": "0.68067294", "text": "def play!(space,player=nil)\n self.play(space,player)\n self.save\n end", "title": "" }, { "docid": "9593abeede6f577d598674c36a04ecf8", "score": "0.68012285", "text": "def play\n return if self.finished?\n self.update\n end", "title": "" }, { "docid": "9593abeede6f577d598674c36a04ecf8", "score": "0.68012285", "text": "def play\n return if self.finished?\n self.update\n end", "title": "" }, { "docid": "0fbb7e3600d25d31898cf7c21ddf8f9e", "score": "0.67853147", "text": "def play\n @song.map(&:play)\n end", "title": "" }, { "docid": "833f77753f9ae631358a4bffae2941f8", "score": "0.6784462", "text": "def play\n @game.process_actions\n @controls = (@player ? @player.determine_controls : Hash.new([]))\n @last_mod = @game.last_modified\n headers[\"Last-Modified\"] = @last_mod.httpdate\n\n setup_full_title\n\n render :action => :show\n @unloadFunc = nil\n end", "title": "" }, { "docid": "0f49ed694e75f0a6efc1c03b13b9845c", "score": "0.6784405", "text": "def play\n if adventure.start\n @last_events = adventure.last_events(2)\n @current_event = adventure.current_event\n else\n redirect_to adventures_url, notice: 'Adventure is not ready yet!'\n end\n end", "title": "" }, { "docid": "5d80cbe5a3e90c2c0005cb18be20a4f1", "score": "0.6782845", "text": "def player\n yield\nend", "title": "" }, { "docid": "30545b4c479b81642db1eba9ab6fa217", "score": "0.6779623", "text": "def player; end", "title": "" }, { "docid": "7b3b6e167a782cd723dc9277eaf92ab7", "score": "0.67577255", "text": "def play_game\n # WarAPI.play_turn()\n end", "title": "" }, { "docid": "aa0dc84ddd0b10be3f899b7d1500ea34", "score": "0.67484426", "text": "def play()\n @files.shuffle.each do |file|\n play_file(file)\n end\n end", "title": "" }, { "docid": "c2677659d094828b49d168874719a435", "score": "0.67481685", "text": "def autoplay!\r\n raise 'Not implemented.'\r\n end", "title": "" }, { "docid": "8e5f6b9e45f4005d98fef65b55153ac9", "score": "0.67444396", "text": "def play\n public_user\n render layout: \"game_layout\"\n end", "title": "" }, { "docid": "6465983cd87bbf48d7aed30b2519d92a", "score": "0.67262286", "text": "def update\n\t\t@game.play\n\tend", "title": "" }, { "docid": "9b1c01dc8461b4b8f7f6d1084799b168", "score": "0.67226255", "text": "def play!\n self.start_time = Time.now\n self.save!\n end", "title": "" }, { "docid": "67dc95e582a18161e6cfb86a0ec33a82", "score": "0.6722352", "text": "def start_play\n match.save!\n if match.play_match? :start_play\n match.play_match! :start_play\n end\n end", "title": "" }, { "docid": "4c8b42eb9206217fc42d6ed2e7ebbfaa", "score": "0.6685376", "text": "def play\n\t\tputs \"Es sind #{@player.size} Spieler in #{@title}\"\n\t\t@player.each do|player|\n\t\tputs player\t\n\tend\n\tend", "title": "" }, { "docid": "bc08c72d0dfbceb84b3bceb309a5f1f7", "score": "0.6683347", "text": "def play\n welcome\n case new_or_continue\n when :new\n @game = SuperTues::Board::Game.new\n @game.add_players *get_players\n pick_candidates\n init_game\n when :continue\n # @game = Game.load ........\n # load_game\n end\n \n game_loop\n \n end", "title": "" }, { "docid": "4cb8016fe91816e5429fb0d164c3b512", "score": "0.6679321", "text": "def play(vol=1, speed=1, looping=false); end", "title": "" }, { "docid": "14b3144308833914c5c7156a72a2ef11", "score": "0.66759026", "text": "def test_play_plays_sounds\n jb = JungleBeat.new\n jb.append(\"deep doo ditt\")\n jb.append(\"doot dee dah\")\n\n jb.play\n end", "title": "" }, { "docid": "76a09c1224f48f5eddd14f7c6968dcb0", "score": "0.6675895", "text": "def play!\n if /darwin/ =~ RUBY_PLATFORM\n command = \"afplay\"\n else\n command = \"mplayer\"\n end\n puts \"Playing....\"\n puts \"#{command} #{self.path}\"\n system command, path\n end", "title": "" }, { "docid": "d29c4b02faca61cfe4e6e2ddb78feef6", "score": "0.6669251", "text": "def start\n \"Play with <#{self.class.name}>\"\n end", "title": "" }, { "docid": "011e14857364754ead4a053bd9a03603", "score": "0.6662468", "text": "def play\n\tputs (\"Would you like to play? (y/n)\")\n end", "title": "" }, { "docid": "b913d27f2a1aed4fd30ada0168bd3454", "score": "0.66541636", "text": "def play\n question\n check_answer\n end", "title": "" }, { "docid": "8c8d1c4aa4fa4fbf1c47e97f6a4bfe09", "score": "0.66429985", "text": "def play_card\n raise 'TODO: implement me!' # TODO: implement this\n end", "title": "" }, { "docid": "2293846dc6233c62b1b12e4a0c47e931", "score": "0.66420925", "text": "def play\n get_game\n @game.start if @game.waiting_to_start?\n if update_field\n render :action => 'play'\n else\n redirect_to :action => 'archive'\n end\n end", "title": "" }, { "docid": "8c8d1c4aa4fa4fbf1c47e97f6a4bfe09", "score": "0.6641318", "text": "def play_card\n raise 'TODO: implement me!' # TODO: implement this\n end", "title": "" }, { "docid": "6c62fb6f1faad77b21007f011e4954e2", "score": "0.6625706", "text": "def replay\n\t\tsynchronized do\n\t\t\tplay_current\n\t\tend\n\tend", "title": "" }, { "docid": "36a4be5bc84b26f3aba54b9e2afa9b6d", "score": "0.6622035", "text": "def start \n @playing = true\n mode == :console ? play_console() : play_ai()\n end", "title": "" }, { "docid": "cbea66c091ba7a8d9c930c16dd641022", "score": "0.66173184", "text": "def play (file = nil)\n\t\tif file\n\t\t\tcontroller.send \"player-play #{File.real_path(File.expand_path(file))}\"\n\t\telse\n\t\t\tcontroller.send 'player-play'\n\t\tend\n\n\t\tself\n\tend", "title": "" }, { "docid": "4d5d9f9643655a24c9c9137861cc695d", "score": "0.66017807", "text": "def play\n puts \"Playing pattern #{name} at #{bpm}\"\n open! && play! && close!\n end", "title": "" }, { "docid": "7cecd2321cc7cd004bd3fba41e7149d3", "score": "0.65942156", "text": "def play \n @board.render\n fetch_value\n end", "title": "" }, { "docid": "7cecd2321cc7cd004bd3fba41e7149d3", "score": "0.65942156", "text": "def play \n @board.render\n fetch_value\n end", "title": "" }, { "docid": "5de9f1ff2bb989791d3f4631943a5c39", "score": "0.6592075", "text": "def play\r\n if is_a_bgm?\r\n Audio.bgm_play(@name, @volume, @pitch)\r\n elsif is_a_bgs?\r\n Audio.bgs_play(@name, @volume, @pitch)\r\n elsif is_a_me?\r\n Audio.me_play(@name, @volume, @pitch)\r\n elsif is_a_se?\r\n Audio.se_play(@name, @volume, @pitch)\r\n end\r\n end", "title": "" }, { "docid": "bc95a2b8e6a7972f47521c15b1b79c76", "score": "0.6591694", "text": "def play\n case params[:type]\n when 'B' # album\n # logger.info('Finding album')\n album = Album.find(params[:id])\n # logger.info('Playing album '+album.albumName)\n album.tracks.each {|trk| playTrack(trk)}\n # logger.info('Played album')\n when 'P'\n playlist = Playlist.find(params[:id])\n playlist.tracks.each {|trk| playTrack(trk)}\n else # track\n # logger.info('Finding track')\n track = Track.find(params[:id])\n # logger.info('Playing track '+track.trackName)\n playTrack(track)\n # logger.info('Played track')\n end\n ITCMonitor.start\n updateStatus\n end", "title": "" }, { "docid": "8f1eb1cf888dad7df2900b536e9c41ee", "score": "0.6584958", "text": "def start_game\n\n end", "title": "" }, { "docid": "3d30ba18cdaca127d35b944789167e75", "score": "0.65819323", "text": "def play()\n @player.play if @media_loaded == true\n end", "title": "" }, { "docid": "332342cc94d852dc4717502208015d1b", "score": "0.65812486", "text": "def play_game\n raise \"play_game must be overridden\"\n end", "title": "" }, { "docid": "78f8520bb243c38f6fffab3f9710466f", "score": "0.65721047", "text": "def play_sound(soundName)\r\n \t\texec(\"playback\", soundName)\r\n \tend", "title": "" }, { "docid": "c22f269050837777afdfd050221c5aff", "score": "0.65644157", "text": "def next_player!\n end", "title": "" }, { "docid": "71d172737a845c680ebb616304d44290", "score": "0.65621495", "text": "def run(player)\n puts \"Hello!\"\n end", "title": "" }, { "docid": "71d172737a845c680ebb616304d44290", "score": "0.65621495", "text": "def run(player)\n puts \"Hello!\"\n end", "title": "" }, { "docid": "8c831d27a7c11b3d285bd9a5f448fdb5", "score": "0.65616214", "text": "def start\n \t@current_song = self.songs().sample\n \tputs @current_song.play()\n end", "title": "" }, { "docid": "1a0cc0cb9b44952c4527c156748f7a21", "score": "0.65508544", "text": "def playback\n parent.playback\n end", "title": "" }, { "docid": "1d7b4767e44573f0acd1d98f1f669f80", "score": "0.6544405", "text": "def play_sound\n @collect_coin.play\n end", "title": "" }, { "docid": "4943ad623f4203d82d384a2f03be3395", "score": "0.65436405", "text": "def play command = Hash.new\n\t\tputs \"play 1\"\n\t\t#return if playing?\n\t\t#self.skip_check = true\n\t\tputs \"playing now\"\n\t\tif self.current_song.try :paused?\n\t\t\tputs \"its paused, so lets play\"\n operation = Proc.new do\n self.current_song.try :resume\n end\n callback = Proc.new do |obj|\n InterfaceController.instance.broadcast_message({:status => \"playing\", :play => next_play})\n end\n EM.defer operation, callback\n\t\telse\n\t\t\tputs \"pausing\"\n\t\t\tself.current_song.try :pause\n\t\t\t\n\t\t\tputs \"que next song\"\n\t\t\t\n\t\t\tque_next_play\n\t\t\t#self.\n\t\t\tputs \"lets start playing the next track\"\n\t\t\tif self.next_play && File.exists?(self.next_play.track.file_path) #file_path\n\t\t\t\t\n\t\t\t\tsample = Gosu::Sample.new next_play.track.file_path\n\t\t\t\t\n\t\t\t\tself.current_song = nil\n\t\t\t\tself.current_song = sample.play\n\t\t\t\tself.next_play.update(:played_at => Time.now)\n EM.next_tick {\n InterfaceController.instance.broadcast_message({:status => \"playing\", :play => next_play})\n }\n\t\t\tend\n\t\t\t\n\t\tend\n\t\t#self.skip_check = false\n\t\tsuper\n\t\t\n\t\tputs \"play 2\"\n\tend", "title": "" }, { "docid": "93e999bfc4148d04599bd5b1f716a9c4", "score": "0.65432894", "text": "def play_next\n send_command('PlayNext')\n end", "title": "" }, { "docid": "47b74b1437ce9502f4341c29210e2d62", "score": "0.65346366", "text": "def driver\n start = Game.new(\"Derek\", \"Hilary\")\n start.play_to_n # couldn't figure out a way to not have to call this in the driver method.\n start.play\n end", "title": "" }, { "docid": "5f38721366cf983e8c6e1be4fad81f83", "score": "0.6532203", "text": "def run\n create_game(num_players).play\n end_game\nend", "title": "" }, { "docid": "fea861b2d440089a2441a187893c45db", "score": "0.65252215", "text": "def play\n\t\twhile true\n\t\t\tplay_game\n\t\t\tbreak unless play_again?\n\t\tend\n\t\tputs \"Thanks for playing\"\t\n\tend", "title": "" }, { "docid": "b4508ea4af944eadd54ae08697f08750", "score": "0.6503722", "text": "def play\n @hungry = true\n end", "title": "" }, { "docid": "87d08e49ac0980b8fd4ef34c11f3a69c", "score": "0.6496192", "text": "def play\n DisplayController.play(current_player.name)\n pos = DisplayController.position\n if valid_move(pos)\n @board[pos - 1] = @current_player.id\n switch\n DisplayController.print_board(board)\n else\n DisplayController.play\n end\n end", "title": "" } ]
baf2403305fe323ce376aa3f1c2225a9
External calls todo Check|Register for ? point for named xml document type. todo Check|Register for version. todo Check|Register for document UTF type. Parses a complete element.
[ { "docid": "f6a46b393624c920062a534d40e52ba7", "score": "0.0", "text": "def parse\n\t\t#todo Check|Split for comment.\n\t\t\n\t\t# increment level of recursion for debugging\n\t\t@level += 1\n\t\t\n\t\t#todo check for closing identifier\n\t\twhile closing_element?\n\t\t\tdown_line\n\t\tend\n\t\t\n\t\t# Gets the namespace, if one exists.\n\t\ttmp_namespace = get_namespace\n\t\t\n\t\t#todo Check|Register identifier prefix.\n\t\ttmp_identifier = get_identifier\n\t\t\n\t\t# creates attribute list for this level of the stack.\n\t\tattributes = []\n\t\twhile attributes_exist?\n\t\t\t#todo Check|Register attribute prefix.\n\t\t\tattribute_prefix = get_attribute_prefix\n\t\t\t\n\t\t\t#todo Check|Register attribute identifier.\n\t\t\tattribute_identifier = get_attribute_identifier\n\t\t\t\n\t\t\t#todo Check|Register attribute field.\n\t\t\tattribute_field = get_attribute_field\n\t\t\t\n\t\t\tattributes.push Attribute.new(attribute_prefix, attribute_identifier, attribute_field)\n\t\tend\n\t\telement = Element.new(tmp_namespace, tmp_identifier, attributes)\n\t\t\n\t\t#check for children of the element, then recursively create them.\n\t\tif children_exist?\n\t\t\t# Find the openning of a element.\n\t\t\twhile children_exist?\n\t\t\t\telement.add(parse)\n\t\t\tend\n\t\tend\n\t\t#todo add element data\n\t\telement.data = get_element_data\n\t\treturn element\n\tend", "title": "" } ]
[ { "docid": "a3df793acbe006e54a6dee20d78d7b37", "score": "0.56291115", "text": "def parseElement(elem)\n throw \"No name attribute for: #{elem}\" if not elem.attributes.has_key?(\"name\")\n name = elem.attributes[\"name\"]\n throw \"Element #{name} has already been defined\" if @elements.has_key?(name)\n @elements[name]=Array.new\n subElem = elem.elements[\"xs:complexType\"]\n\n if not subElem then\n throw \"Unknown top level element #{name} as no subelem complexType or attribute type\" if not elem.attributes.has_key?(\"type\")\n print \"#{name} has type \", elem.attributes[\"type\"], \"\\n\" if @verbose\n throw \"Other unhandled elements for #{name}: #{elem}\" if elem.elements.size > 0\n return @elements[name].push(elem.attributes[\"type\"])\n #return cppCode(mapXMLToCpp(elem.attributes[\"type\"]), name)\n end\n\n subElem.elements.each(){|e|\n case e.name\n when \"attribute\"\n @elements[name].push(parseAttribute(e, name))\n #next\n when \"sequence\"\n\n #Sequence really requires parsing of contraints and for netconf is just\n #a navigation and encapsulation thing and cannot really generate any c++\n #structure. In fact this is true of most elements except interface\n #perhaps where it will matter.\n next if @skips.include?(name)\n parseSequence(e, name)\n when \"attributeGroup\"\n parseAttributeGroups(e, name)\n when \"choice\"\n puts \"Todo choice use by unused element #{name}\"\n when \"simpleContent\"\n parseSimpleContent(e, name)\n else\n throw \"Unknown complexType structure encountered: #{e.name} for #{name} element\"\n end\n }\n\n end", "title": "" }, { "docid": "3da9797f0863df64baa52679cfa6bdc8", "score": "0.54646224", "text": "def validation_hook_on_element(content_at_file, el, el_stack, errors, warnings)\n case el.type\n when :em\n validate_no_single_punctuation_or_whitespace_char_formatting(\n content_at_file, el, el_stack, errors, warnings\n )\n when :p\n validate_element_p(\n content_at_file, el, el_stack, errors, warnings\n )\n when :record_mark\n validate_element_record_mark(\n content_at_file, el, el_stack, errors, warnings\n )\n when :root\n validate_element_root(\n content_at_file, el, el_stack, errors, warnings\n )\n when :strong\n validate_no_single_punctuation_or_whitespace_char_formatting(\n content_at_file, el, el_stack, errors, warnings\n )\n when :text\n validate_element_text(\n content_at_file, el, el_stack, errors, warnings\n )\n end\n end", "title": "" }, { "docid": "d352d9d8bfab1a0416d8e080bb33521d", "score": "0.52833855", "text": "def validation_hook_during_parsing(kd_el, xml_node)\n case xml_node.name\n when 'ParagraphStyleRange'\n validate_presence_of_paragraph_style(kd_el, xml_node)\n when 'CharacterStyleRange'\n validate_presence_of_character_style(kd_el, xml_node)\n else\n puts \"Unknown name: #{ xml_node.name}\"\n end\n log_removal_of_element(kd_el, xml_node)\n end", "title": "" }, { "docid": "79fdff021d7fb5d525720f1d4430aaab", "score": "0.5256939", "text": "def generate_entry_point(context)\n\n puts \"# Parser for top level element +#{@name}+\"\n\n puts \"def self.#{XSD::PREFIX_PARSE_EL}#{@name}(src)\"\n puts \" root = src_to_dom src\"\n puts\n\n puts \" expecting_element '#{@name}', root\"\n\n if @type != nil\n # Defined by a named datatype\n puts \" #{XSD::PREFIX_PARSE_CT}#{@type}(root) # type\"\n\n elsif @ref != nil\n # Define by a reference to another element\n target = context.get_element(@ref)\n if ! target\n raise \"element reference unknown: #{@ref}\"\n end\n puts \" #{XSD::PREFIX_PARSE_CT}_REF_TO_#{target.name}(root) # ref\"\n\n elsif 1 == @complexType.length\n # Defined by an anonymous complexType\n puts \" #{XSD::PREFIX_PARSE_CT}#{@complexType[0].internal_name}(root)\"\n\n elsif 0 == @complexType.length\n # Element with no content model and no attributes\n puts \" parse_empty(root)\"\n\n else\n raise \"internal error\"\n end\n\n puts \"end\"\n puts\n end", "title": "" }, { "docid": "6e017fc341f5767a6956d15e1092bd79", "score": "0.5210106", "text": "def valid_xml_element(name, options={:level => :error})\n\t\t\t\tvalidate(\"Invalid XML element '#{name}'\", options) { name.to_s.match(/^([^[:punct:]0-9<>]|_)[^<>\"']*/) }\n\t\t\tend", "title": "" }, { "docid": "66caa0a7695707eb01ca158876d23d41", "score": "0.51671517", "text": "def follow(n, pointer)\n # We already checked that nodes have at most one of these in the XmlParser.\n if n.key?('ref')\n reference = n['ref']\n if reference[':']\n namespace, reference = reference.split(':', 2)\n end\n\n node = lookup(reference, n.name)\n\n visit(node, pointer)\n\n elsif n.key?('type')\n reference = n['type']\n if default_value_r208(pointer, reference)\n return\n end\n\n node = lookup(reference, 'complexType', 'simpleType')\n\n if node.name == 'complexType'\n case reference\n when 'cpv_set'\n # Always expand, as mapping differs.\n when 'empty'\n # Do nothing with empty elements.\n when 'val', 'val_range', 'country', 'nuts', 'no_works', 'supplies', 'non_published'\n # Do nothing with simple elements.\n when 'text_ft_single_line', 'text_ft_multi_lines', 'btx'\n # Hardcode common types to make sample smaller.\n paragraph = BuildNode.new('P')\n paragraph.contents << SecureRandom.hex(8)\n pointer.children << paragraph\n return\n else\n # This edge case avoids extra XPaths in F08.\n if basename == 'F08_2014' && reference == 'contact_contracting_body'\n reference = 'contact_buyer'\n end\n # Reference repeated types to make sample smaller. (Sample will be invalid.)\n if @types.key?(reference)\n add_node('comment', pointer, content: \"see #{@types[reference]}\")\n return\n end\n @types[reference] = n.attributes.fetch('name')\n end\n end\n visit(node, pointer)\n\n elsif n.key?('base')\n if n.name == 'extension'\n reference = n['base']\n if default_value_r208(pointer, reference)\n return\n end\n\n node = lookup(reference, 'complexType', 'simpleType')\n\n if node.name == 'complexType' && ['text_ft_multi_lines', 'btx'].include?(reference)\n # Hardcode common types to make sample smaller. Drops attributes. Only for CRITERIA_EVALUATION on F13.\n paragraph = BuildNode.new('P')\n paragraph.contents << SecureRandom.hex(8)\n pointer.children << paragraph\n return\n end\n visit(node, pointer)\n\n # Based on the analysis in `visit`, we can skip visiting `base` if within a `complexType`, but not if within a `simpleType`.\n elsif n.parent.name == 'simpleType'\n reference = n['base']\n if reference[':']\n namespace, reference = reference.split(':', 2)\n end\n\n if namespace != 'xs'\n node = lookup(reference, 'simpleType')\n\n visit(node, pointer)\n end\n end\n end\n\n n.element_children.each do |c|\n visit(c, pointer)\n end\n end", "title": "" }, { "docid": "9f1a1f148027eec76d47e814abc0a4cd", "score": "0.51411074", "text": "def get_xml_of_type( asdcp_type, file, errors, errors_status )\n begin\n xml = Nokogiri::XML( open file )\n rescue Exception => e\n @logger.info \"#{ file }: #{ e.message }\"\n return false, errors, errors_status\n end\n\n unless xml.errors.empty?\n xml.errors.each do |error|\n # expected errors from non-xml\n next if error.message =~ /Start tag expected/ or error.message =~ /Document is empty/\n errors << \"Syntax error: #{ file }: #{ error }\"\n errors_status = true\n @logger.info errors.last\n end\n return false, errors, errors_status\n end\n\n if xml.root\n case xml.root.node_name\n when asdcp_type\n return xml, errors, errors_status\n else\n return false, errors, errors_status\n end\n else\n return false, errors, errors_status\n end\nend", "title": "" }, { "docid": "222c9c185cddc1516da606ed58bbb3ce", "score": "0.5110728", "text": "def parse_value_rexml(value, ns_strs, language)\n # Fixme\n end", "title": "" }, { "docid": "6f5d4fc7bee47daf118f3620fc72e7f1", "score": "0.51094425", "text": "def xml_processor_helper(document)\n document.each_element do |element|\n if TAGS.include?(element.name)\n @@LANGS.each do |lang| \n temp_doc = create_document(\"<metadata name='#{element.name}' xml:lang='#{lang}'>#{TEXT}</metadata>\\n\")\n element.parent.add(temp_doc) unless element_exists(element.parent,element.name,lang) \n end\n end\n process_child(element)\n end\n document\nend", "title": "" }, { "docid": "8f7a67c885ab8183d1b0f7a0ec19cadb", "score": "0.5055552", "text": "def scan_in_api(file)\n require 'strscan'\n doc = StringScanner.new(file)\n $api = XMLElement.new\n parents = [$api]\n\n while not doc.eos?\n doc.scan(/</)\n if doc.scan(/\\/\\w+>/)\n parents.pop\n else\n name = doc.scan(/\\w+/)\n doc.scan(/\\s+/)\n values = {}\n while not (term = doc.scan(/[\\/>]/))\n key = doc.scan(/\\w+/)\n doc.scan(/='/)\n value = doc.scan(/[^']*/)\n doc.scan(/'\\s*/)\n values[key] = value\n end\n element = parents[-1].add_element(name, values)\n parents.push(element) if term == \">\"\n doc.scan(/>/) if term == \"/\"\n end\n end\n $api\nend", "title": "" }, { "docid": "6126a64814527a9c47f115c58c089b31", "score": "0.5045177", "text": "def handle anElement\r\n if anElement.kind_of? REXML::Text\r\n self.handleTextElement(anElement) \r\n elsif anElement.kind_of? REXML::Element\r\n self.handleElement anElement \r\n elsif anElement.kind_of? REXML::Instruction\r\n self.process_instruction anElement\r\n else\r\n return #ignore comments and processing instructions\r\n end\r\n end", "title": "" }, { "docid": "f4fead1e3bf6f4592c5a86e46418760d", "score": "0.5033484", "text": "def validation_hook_during_parsing(kd_el, xml_node)\n # override this method in validating subclass of self\n end", "title": "" }, { "docid": "50c58014b85a63a35b807979546b9f43", "score": "0.50233287", "text": "def parseSimpleType(elem, anonName=nil)\n valid = false\n if not elem.attributes.has_key?(\"name\") then\n throw \"anonName argument is nil\" if not anonName\n else\n name = elem.attributes[\"name\"]\n end\n\n restrictElem = elem.elements[\"xs:restriction\"]\n throw \"No restriction found for simpleType: #{elem}\" if not restrictElem\n case restrictElem.attributes[\"base\"]\n when \"xs:string\"\n #anonymous or not does not really indicate whether it is an enumerated type\n #refactor this too.\n if not elem.attributes.has_key?(\"name\") then\n enums=Array.new()\n throw \"No enumerations in simpleType #{elem}\" if not restrictElem.elements[\"xs:enumeration\"]\n\n elem.elements.each(\"xs:restriction/xs:enumeration\"){|e|\n throw \"Unknown SimpleType:enumeration construct #{e}\" if not e.attributes.has_key?(\"value\")\n enums.push(e.attributes[\"value\"])\n }\n if @verbose then\n print \"#{anonName} <= \"\n enums.each{|a|\n print a, \" \"\n }\n puts\n end\n #enum = \"#{anonName}<=\"\n enum = \"\"\n enums.each{|a|\n if enum == \"\" then\n enum = \"#{a}\"\n else\n enum = enum + \", \" + \"#{a}\"\n end\n }\n throw \"anonymous SimpleType #{anonName} already declared before as #{@types[anonName]} and now as #{enum}\" if @types.has_key?(anonName)\n @types[anonName]=enum\n return {anonName, anonName}\n else # has name attribute\n print(\"simpleType of \", elem.attributes[\"name\"], \"\\n\") if @verbose\n throw \"SimpleType #{name} already declared before as #{@types[name]} and now as #{name}\" if @types.has_key?(name)\n @types[name]=name\n return {name, name}\n #mapXMLToCpp(elem.attributes[\"name\"])\n end\n else\n @types[name]=restrictElem.attributes[\"base\"]\n return {name, @types[name]}\n end\n end", "title": "" }, { "docid": "9d2b5641e1aacb09ed97e8c44d8fa7e5", "score": "0.5007037", "text": "def find_free_xml(name)\n # checking\n name\n end", "title": "" }, { "docid": "476ed976ddd5f85a2a4e229fef3a2dab", "score": "0.49891862", "text": "def valid_isdoc?(body)\n schema = File.join(File.dirname(__FILE__), \"..\", \"schema\", \"czreg-all-1.0.xsd\")\n error_file = create_tmp_file(\"xmllint_error\")\n doc_file = command = nil\n doc_file = create_tmp_file(\"xmllint\", body)\n command = \"xmllint --schema #{schema} --noout #{doc_file} &> #{error_file}\"\n system(command)\n status = $?.exitstatus\n if status == 0\n return true\n else\n failure_doc = File.join(Dir::tmpdir, \"xmllint_last_response.xml\")\n FileUtils.cp doc_file, failure_doc\n raise (\"command='#{command}'. ISDOC document at '#{failure_doc}'. \" +\n IO.read(error_file))\n end\nend", "title": "" }, { "docid": "7cd0ea5181c2abbd5a70f7c122e0a677", "score": "0.4980806", "text": "def get_elements entry\n xml = entry.to_xml\n\n b = Atom::Entry.parse(xml)\n\n assert_equal(xml.to_s, b.to_s)\n\n base_check xml\n\n xml\n end", "title": "" }, { "docid": "ad0f91464c6cc60a7882f23ea064abbf", "score": "0.49567035", "text": "def parser_type(x)\n 'libxml'\n end", "title": "" }, { "docid": "226afdbb83dea4fac02bae53b5a1d3cb", "score": "0.49358574", "text": "def process_xml(string)\n xml_processor_helper(create_document(string))\nend", "title": "" }, { "docid": "1f238eb9069a7dddbfe1056deb20e9ca", "score": "0.49358526", "text": "def parse_el(el, parent_numbers = [])\n\n # get element subtype from $subtypes\n el_type = el.name\n binding.pry if el_type.nil?\n return nil if el_type.nil?\n\n begin\n num = el.children.first.attributes['value'].text\n rescue\n binding.pry\n end\n # binding.pry if num.nil? || num == \"\"\n return nil if num.nil?\n\n # not sure if this will still have previous elements on recurse\n # so if I add a paragraph_number once, will it still be there on recurse\n # parent numbers can't do path, unless it's an array\n\n if !parent_numbers.find_index{ |n| n.keys.first.to_s == \"#{el_type}_number\" }.nil?\n # binding.pry\n i = parent_numbers.find_index{ |n| n.keys.first.to_s == \"#{el_type}_number\" }\n parent_numbers[i] = { \"#{el_type}_number\": num } unless num.nil?\n # binding.pry\n else\n # binding.pry\n parent_numbers << { \"#{el_type}_number\": num } unless num.nil?\n # binding.pry\n end\n binding.pry if parent_numbers.size > 10\n\n # identifier is path supplied by uscode\n begin\n identifier = el.attributes['identifier']\n identifier = identifier.value unless identifier.nil?\n rescue\n binding.pry\n end\n\n # path is hierarchy of element types built from parent_numbers\n path = build_path_from_parent_numbers(parent_numbers)\n\n heading = el.css('heading').first\n heading = heading.text.strip unless heading.nil?\n\n # chapeaus will be in span in div\n chapeau = el.css('chapeau').first if el_type != 'section'\n chapeau = chapeau.text.strip unless chapeau.nil?\n\n continuation = el.css('continuation').first if el_type != 'section'\n continuation = continuation.text.strip unless continuation.nil?\n\n # need to verify at bottom most el, and if not chapeau\n el_text = el.css('content').first\n el_text = el_text.text.strip unless el_text.nil? || el_text == \"\"\n\n # create a new node of the subtype\n # klass = el_type.titleize.constantize\n n = Node.find_by(identifier: identifier, path: path, type: el_type, num: num, title_number: parent_numbers.first[:title_number])\n\n if !n.nil?\n puts \"Node already exists, skipping\".colorize(:red)\n return nil\n end\n\n klass = Node.new({\n type: el_type,\n num: num,\n parent_numbers: parent_numbers,\n identifier: identifier,\n path: path,\n heading: heading,\n chapeau: chapeau,\n continuation: continuation,\n text: el_text,\n title_number: parent_numbers.first[:title_number]\n })\n if klass.save!\n puts \"Node created #{path} at #{DateTime.now.in_time_zone(\"Eastern Time (US & Canada)\")} for Title #{parent_numbers.first[:title_number]}\".colorize(:green)\n end\n\n # add the subtype to a parent subtype\n # sections have no parents only children\n if el_type != 'section'\n parent = Node.find_by(path: get_base_path(parent_numbers)) # need up-one-level path\n parent.children << klass\n end\n\n el.children.each do |child|\n child_name = child.name\n next if child_name.nil? || child_name.blank?\n if $subtypes.any? { |t| child_name.include?(t) } # is the child a subtype?\n parse_el(child, parent_numbers.dup) # use .dup to remove a reference\n end\n end\n end", "title": "" }, { "docid": "182fb0e0fad32b8172206050e0c0f9c2", "score": "0.49326724", "text": "def add_xml_decl! #:nodoc:\n converted = @input.unpack(\"C*\").map do |c|\n if ASCII.include?(c) then\n c\n else\n case c\n when 168, 170, 233; ?e\n when 195; nil\n when 244; ?o\n else; ?_\n end\n end\n end\n\n @input = converted.pack(\"C*\")\n @input = \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\\n#{@input}\"\n end", "title": "" }, { "docid": "f62f257e932182c2774d5141c9d6181c", "score": "0.4922776", "text": "def read_raw_element(element, x, doc_element, indent, j)\n\n method_name = x.name.gsub(/[:-]/,'_').to_sym\n puts ('method_name: ' + method_name.inspect).debug if @debug\n\n if @xsl_methods.include? method_name then\n\n if method_name == :'xsl_apply_templates' then\n #doc_element = doc_element.elements.last\n end\n\n method(method_name).call(element, x, doc_element, indent, j)\n\n else\n\n previous_indent = indent\n la = x.name\n new_indent = indent + 1 if @indent == true\n\n new_element = x.clone\n\n new_element.attributes.each do |k,raw_v|\n\n v = raw_v.is_a?(Array) ? raw_v.join(' ') : raw_v\n\n puts 'v: ' + v.inspect if @debug\n\n if v[/{/] then\n\n v.gsub!(/(\\{[^\\}]+\\})/) do |x2|\n\n xpath = x2[/\\{([^\\}]+)\\}/,1]\n puts 'element.text(xpath): ' + element.text(xpath).inspect if @debug\n text = element.text(xpath).to_s.strip\n puts 'text: ' + text.inspect if @debug\n text ? text.clone : ''\n\n end\n\n puts '2. v: ' + v.inspect if @debug\n\n end\n end\n\n puts 'x.children.length: ' + x.children.length.inspect if @debug\n\n if x.children.length > 0 then\n\n indent_before(element, x, doc_element, new_indent, j) if @indent == true\n\n read_node(x, element, new_element, new_indent, j)\n doc_element.add new_element\n\n if @indent == true then\n if doc_element.children.last.children.any? \\\n {|x| x.is_a? Rexle::Element} then\n\n doc_element.children.last.add_text \"\\n\" + ' ' * (new_indent - 1)\n end\n end\n\n\n else\n\n indent_before(element, x, new_element, new_indent, j) if @indent == true\n\n val = @indent == true ? x.to_s : x.to_s\n #jr020219 doc_element.add val\n doc_element.add new_element\n\n end\n\n end\n #new_element\n #puts 'attributes: ' + new_element.attributes.inspect if @debug\n\n end", "title": "" }, { "docid": "d88d792bf6ad8a5524e044e10782639b", "score": "0.49150157", "text": "def element_exists(document,element_name,lang)\n xpath = REXML::XPath\n xpath.first(document, \"//metadata[@name='#{element_name}'][@xml:lang='#{lang}']\") != nil\nend", "title": "" }, { "docid": "3520e58a8107034ff214c86dc8243b44", "score": "0.49070686", "text": "def get_xml_of_type( asdcp_type, file )\n begin\n xml = Nokogiri::XML( open file )\n rescue Exception => e\n @logger.info \"#{ file }: #{ e.message }\"\n return FALSE\n end\n unless xml.errors.empty?\n xml.errors.each do |error|\n # expected errors from non-xml\n next if error.message =~ /Start tag expected/ or error.message =~ /Document is empty/\n @logger.info \"Syntax error: #{ file }: #{ error }\"\n end\n return FALSE\n end\n\n case xml.root.node_name\n when asdcp_type\n return xml\n else\n return FALSE\n end\nend", "title": "" }, { "docid": "e1993e2a54488936dfff3c95da07fc71", "score": "0.48847505", "text": "def on_start_element(element, attributes)\n\t\t\t\t\t@tag = element\n\t\t\t\t\t@vals[@tag] = \"\"\n\n\t\t\t\t\tif !@valid_elements.include?(element)\n\t\t\t\t\t\tputs \"New XML element detected: #{element}. Please report this at #{Risu::GITHUB}/issues/new or via email to #{Risu::EMAIL}\"\n\t\t\t\t\tend\n\n\t\t\t\t\tcase element\n\t\t\t\t\t\twhen \"Policy\"\n\t\t\t\t\t\t\t@policy = Risu::Models::Policy.create\n\t\t\t\t\t\t\t@policy.save\n\t\t\t\t\t\twhen \"preference\"\n\t\t\t\t\t\t\t@sp = @policy.server_preferences.create\n\t\t\t\t\t\t\t@sp.save\n\t\t\t\t\t\twhen \"item\"\n\t\t\t\t\t\t\t@item = @policy.plugins_preferences.create\n\t\t\t\t\t\t\t@item.save\n\t\t\t\t\t\twhen \"FamilyItem\"\n\t\t\t\t\t\t\t@family = @policy.family_selections.create\n\t\t\t\t\t\t\t@family.save\n\t\t\t\t\t\twhen \"PluginItem\"\n\t\t\t\t\t\t\t@plugin_selection = @policy.individual_plugin_selections.create\n\t\t\t\t\t\t\t@plugin_selection.save\n\t\t\t\t\t\twhen \"Report\"\n\t\t\t\t\t\t\t@report = @policy.reports.create\n\t\t\t\t\t\t\t@report.name = attributes[\"name\"]\n\t\t\t\t\t\t\t@report.save\n\t\t\t\t\t\twhen \"ReportHost\"\n\t\t\t\t\t\t\t@rh = @report.hosts.create\n\t\t\t\t\t\t\t@rh.name = attributes[\"name\"]\n\t\t\t\t\t\t\t@rh.save\n\t\t\t\t\t\twhen \"tag\"\n\t\t\t\t\t\t\t@attr = nil\n\t\t\t\t\t\t\t@hp = @rh.host_properties.create\n\n\t\t\t\t\t\t\tif attributes[\"name\"] =~ /[M|m][S|s]\\d{2,}-\\d{2,}/\n\t\t\t\t\t\t\t\t@attr = if attributes[\"name\"] =~ /[M|m][S|s]\\d{2,}-\\d{2,}/\n\t\t\t\t\t\t\t\t\t\t\tattributes[\"name\"]\n\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\tnil\n\t\t\t\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\t#Ugly as fuck. Really this needs to be rewritten. Fuck.\n\t\t\t\t\t\t\telsif attributes['name'] =~ /patch-summary-cve-num/ ||\n\t\t\t\t\t\t\t\tattributes['name'] =~ /patch-summary-cves/ ||\n\t\t\t\t\t\t\t\tattributes['name'] =~ /patch-summary-txt/ ||\n\t\t\t\t\t\t\t\tattributes['name'] =~ /cpe-\\d+/ ||\n\t\t\t\t\t\t\t\tattributes['name'] =~ /KB\\d+/\n\t\t\t\t\t\t\t\t@attr = if attributes[\"name\"] =~ /patch-summary-cve-num/ ||\n\t\t\t\t\t\t\t\tattributes['name'] =~ /patch-summary-cves/ ||\n\t\t\t\t\t\t\t\tattributes['name'] =~ /patch-summary-txt/ ||\n\t\t\t\t\t\t\t\tattributes['name'] =~ /cpe-\\d+/ ||\n\t\t\t\t\t\t\t\tattributes['name'] =~ /KB\\d+/\n\t\t\t\t\t\t\t\t\t\t\tattributes[\"name\"]\n\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\tnil\n\t\t\t\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t@attr = if @valid_host_properties.include?(attributes[\"name\"])\n\t\t\t\t\t\t\t\t\tattributes[\"name\"]\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\tnil\n\t\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\tend\n\n\t\t\t\t\t\t\t# implicit nil check?\n\t\t\t\t\t\t\tif attributes[\"name\"] !~ /(netstat-(?:established|listen)-(?:tcp|udp)\\d+-\\d+)/ && attributes[\"name\"] !~ /traceroute-hop-\\d+/\n\t\t\t\t\t\t\t\tputs \"New HostProperties attribute: #{attributes[\"name\"]}. Please report this at #{Risu::GITHUB}/issues/new or via email to #{Risu::EMAIL}\\n\" if @attr.nil?\n\t\t\t\t\t\t\tend\n\t\t\t\t\t\twhen \"ReportItem\"\n\t\t\t\t\t\t\t@vals = Hash.new # have to clear this out or everything has the same references\n\t\t\t\t\t\t\t@ri = @rh.items.create\n\t\t\t\t\t\t\tif attributes[\"pluginID\"] == \"0\"\n\t\t\t\t\t\t\t\t@plugin = Risu::Models::Plugin.find_or_create_by(:id => 1)\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t@plugin = Risu::Models::Plugin.find_or_create_by(:id => attributes[\"pluginID\"])\n\t\t\t\t\t\t\tend\n\n\t\t\t\t\t\t\t@ri.port = attributes[\"port\"]\n\t\t\t\t\t\t\t@ri.svc_name = attributes[\"svc_name\"]\n\t\t\t\t\t\t\t@ri.protocol = attributes[\"protocol\"]\n\t\t\t\t\t\t\t@ri.severity = attributes[\"severity\"]\n\n\t\t\t\t\t\t\t@ri.plugin_id = @plugin.id\n\t\t\t\t\t\t\t@plugin.plugin_name = attributes[\"pluginName\"]\n\t\t\t\t\t\t\t@plugin.family_name = attributes[\"pluginFamily\"]\n\t\t\t\t\t\t\t@plugin.save\n\t\t\t\t\t\t\t@ri.save\n\t\t\t\t\t\twhen \"attachment\"\n\t\t\t\t\t\t\t@attachment = @ri.attachments.create\n\t\t\t\t\t\t\t@attachment.name = attributes['name']\n\t\t\t\t\t\t\t@attachment.type = attributes['type']\n\t\t\t\t\t\t\t@attachment.save\n\t\t\t\t\tend\n\t\t\t\tend", "title": "" }, { "docid": "f86f9fa0c046e0027621ff9402956c98", "score": "0.48658884", "text": "def test_parse_valid_xml_returns_hash\n name = \"A name\"\n type = \"A type\"\n xml = \"<data><name>#{name}</name><type>#{type}</type></data>\"\n parser = ChainReactor::Parsers::XmlSimpleParser.new get_logger\n cause = parser.parse(xml,[],false)\n assert_equal name, cause['name'].first\n assert_equal type, cause['type'].first\n end", "title": "" }, { "docid": "576fe7fb10149f52a267fbc2271d7fbb", "score": "0.48249948", "text": "def from_xml_method_content(element_name,as_name,as_type,options)\n # value = \"#{options[:from_xml_xml_param]}.child(\\\"#{element_name}\\\").valueOf()\" \n value = \"#{options[:from_xml_xml_param]}.#{element_name}\" \n template = <<-EOT \n #{options[:from_xml_return_var]}.#{as_name} = #{cast_xml_value(as_type,value)} \n EOT\n if(as_type == :date)\n template = \"if(!StringUtils.isBlank(#{value}))\\n#{template}\"\n end\n template\n end", "title": "" }, { "docid": "bc547bc5928eb4ef8ac8948a3d5cfa00", "score": "0.48160124", "text": "def parse_xml\n\n raise \"parse_xml method has not been implemented in this class\"\n \n end", "title": "" }, { "docid": "efec9c4c47e52f8a52c9d42839e2bb27", "score": "0.47993338", "text": "def parse_xml xml\n result = XmlSimple.xml_in(xml, {'ForceArray' => false})\n result = result['result'] if result['result']\n result\n end", "title": "" }, { "docid": "9962cad45766a11ce9711abd039dfcca", "score": "0.47862932", "text": "def resolveTypeBranch(typeName, arrayComp = nil)\n # puts \"typeName is #{typeName}: #{arrayComp}\"\n\n if not arrayComp then\n search = typeName\n else\n search = arrayComp\n end\n\n if cppType?(search) then\n return @genClasses[@filename] += (@@indent + cppCode(mapXMLToCpp(search), \"_\" + @elemName) + \"\\n\")\n end\n\n found = false\n if @types.has_key?(search) then\n found = true\n value = @types[search]\n case value.class.name\n when \"Array\"\n value.each{|a|\n @elemName = a.keys[0]\n ## condition true means it has to be a resolvable simple type\n if a.keys[0] == a.values[0] then\n puts \"key=>value match? #{a.keys[0]} and #{a.values[0]}\"\n if not cppType?(search) then\n #One more search\n puts \"One more search\"\n resolveTypeBranch(a.values[0])\n else\n return @genClasses[@filename] += (@@indent + cppCode(mapXMLToCpp(a.values[0]), \"_\" + @elemName) + \"\\n\")\n end\n else\n resolveTypeBranch(a.keys[0], a.values[0])\n end\n }\n when \"String\"\n puts \"typeName = #{typeName} arrayComp #{arrayComp} @elemName #{@elemName} value #{value}\"\n resolveTypeBranch(value)\n else\n end #end case\n end #end types.has_key\n\n if not found then\n if cppType?(search) then\n return @genClasses[@filename] += (@@indent + cppCode(mapXMLToCpp(search), \"_\" + @elemName) + \"\\n\")\n else\n throw \"Failed to resolve xmlType #{search} for element/attribute #{@elemName}\"\n end\n end\n end", "title": "" }, { "docid": "d3aad01e97412f4d1f79652ad15c1e82", "score": "0.4769089", "text": "def get_tasks_from_xml( doc )\r\n\r\n # Extract details of every task into a flat array\r\n tasks = []\r\n\r\n logger.error \"DEBUG: BEGIN get_tasks_from_xml\"\r\n\r\n tracker_alias = Setting.plugin_redmine_loader['tracker_alias'].force_encoding \"UTF-8\"\r\n tracker_field_id = nil;\r\n #FIXME Надо проверить как оно работает\r\n doc.each_element( \"Project/ExtendedAttributes/ExtendedAttribute[Alias='#{tracker_alias}']/FieldID\") do | ext_attr |\r\n tracker_field_id = ext_attr.text.to_i;\r\n end\r\n\r\n doc.each_element( 'Project/Tasks/Task' ) do | task |\r\n begin\r\n logger.error \"Project/Tasks/Task found\"\r\n struct = OpenStruct.new\r\n struct.level = task.get_elements( 'OutlineLevel' )[0].text.to_i if task.get_elements('OutlineLevel')[0]\r\n struct.outlinenumber = task.get_elements('OutlineNumber')[0].text.strip if task.get_elements('OutlineNumber')[0]\r\n\r\n if auxString = struct.outlinenumber\r\n index = auxString.rindex('.')\r\n if index\r\n index -= 1\r\n struct.outnum = auxString[0..index]\r\n end\r\n end\r\n\r\n struct.tid = task.get_elements('ID')[0].text.to_i if task.get_elements('ID')[0]\r\n struct.uid = task.get_elements('UID')[0].text.to_i if task.get_elements('UID')[0]\r\n struct.title = task.get_elements('Name')[0].text.strip if task.get_elements('Name')[0]\r\n struct.start = task.get_elements('Start')[0].text.split(\"T\")[0] if task.get_elements('Start')[0]\r\n struct.finish = task.get_elements('Finish')[0].text.split(\"T\")[0] if task.get_elements('Finish')[0]\r\n\r\n s1 = task.get_elements('Start')[0].text.strip if task.get_elements('Start')[0]\r\n s2 = task.get_elements('Finish')[0].text.strip if task.get_elements('Finish')[0]\r\n\r\n task.each_element( \"ExtendedAttribute[FieldID='#{tracker_field_id}']/Value\") do | tracker_value |\r\n struct.tracker_name = tracker_value.text\r\n end\r\n\r\n # If the start date and the finish date are the same it is a milestone\r\n struct.milestone = (s1 == s2) ? 1 : 0\r\n\r\n struct.percentcomplete = task.get_elements( 'PercentComplete')[0].text.to_i\r\n struct.notes = task.get_elements( 'Notes' )[ 0 ].text.strip if task.get_elements( 'Notes' )[0]\r\n struct.predecessors = []\r\n struct.delays = []\r\n task.each_element( 'PredecessorLink' ) do | predecessor |\r\n begin\r\n struct.predecessors.push( predecessor.get_elements('PredecessorUID')[0].text.to_i )\r\n struct.delays.push( predecessor.get_elements('LinkLag')[0].text.to_i )\r\n end\r\n end\r\n\r\n tasks.push( struct )\r\n #rescue\r\n# rescue => error\r\n# # Ignore errors; they tend to indicate malformed tasks, or at least,\r\n# # XML file task entries that we do not understand.\r\n# logger.error \"DEBUG: Unrecovered error getting tasks: #{error}\"\r\n end\r\n end\r\n\r\n # Sort the array by ID. By sorting the array this way, the order\r\n # order will match the task order displayed to the user in the\r\n # project editor software which generated the XML file.\r\n\r\n tasks = tasks.sort_by { | task | task.tid }\r\n\r\n outlinenumber2UID = tasks.group_by(&:outlinenumber)\r\n\r\n # Step through the sorted tasks. Each time we find one where the\r\n # *next* task has an outline level greater than the current task,\r\n # then the current task MUST be a summary. Record its name and\r\n # blank out the task from the array. Otherwise, use whatever\r\n # summary name was most recently found (if any) as a name prefix.\r\n\r\n all_categories = []\r\n category = ''\r\n\r\n tasks.each_index do | index |\r\n task = tasks[ index ]\r\n next_task = tasks[ index + 1 ]\r\n\r\n # Instead of deleting the sumary tasks I only delete the task 0 (the project)\r\n\r\n #if ( next_task and next_task.level > task.level )\r\n # category = task.title.strip.gsub(/:$/, '') unless task.title.nil? # Kill any trailing :'s which are common in some project files\r\n # all_categories.push(category) # Keep track of all categories so we know which ones might need to be added\r\n #tasks[ index ] = \"Prueba\"\r\n if task.level == 0\r\n category = task.title.strip.gsub(/:$/, '') if task.title.present? # Kill any trailing :'s which are common in some project files\r\n all_categories.push(category) # Keep track of all categories so we know which ones might need to be added\r\n tasks[ index ] = nil\r\n else\r\n task.category = category\r\n end\r\n end\r\n\r\n # Remove any 'nil' items we created above. Add parent_uid field\r\n tasks = tasks.compact.uniq.map do |task|\r\n task.parent_uid = outlinenumber2UID[task.outnum][0].uid if outlinenumber2UID[task.outnum].present?\r\n task\r\n end\r\n\r\n # Now create a secondary array, where the UID of any given task is\r\n # the array index at which it can be found. This is just to make\r\n # looking up tasks by UID really easy, rather than faffing around\r\n # with \"tasks.find { | task | task.uid = <whatever> }\".\r\n\r\n uid_tasks = []\r\n\r\n tasks.each do | task |\r\n uid_tasks[ task.uid ] = task\r\n end\r\n\r\n # OK, now it's time to parse the assignments into some meaningful\r\n # array. These will become our redmine issues. Assignments\r\n # which relate to empty elements in \"uid_tasks\" or which have zero\r\n # work are associated with tasks which are either summaries or\r\n # milestones. Ignore both types.\r\n\r\n real_tasks = []\r\n\r\n #doc.each_element( 'Project/Assignments/Assignment' ) do | as |\r\n # task_uid = as.get_elements( 'TaskUID' )[ 0 ].text.to_i\r\n # task = uid_tasks[ task_uid ] unless task_uid.nil?\r\n # next if ( task.nil? )\r\n\r\n # work = as.get_elements( 'Work' )[ 0 ].text\r\n # Parse the \"Work\" string: \"PT<num>H<num>M<num>S\", but with some\r\n # leniency to allow any data before or after the H/M/S stuff.\r\n # hours = 0\r\n # mins = 0\r\n # secs = 0\r\n\r\n # strs = work.scan(/.*?(\\d+)H(\\d+)M(\\d+)S.*?/).flatten unless work.nil?\r\n # hours, mins, secs = strs.map { | str | str.to_i } unless strs.nil?\r\n\r\n #next if ( hours == 0 and mins == 0 and secs == 0 )\r\n\r\n # Woohoo, real task!\r\n\r\n # task.duration = ( ( ( hours * 3600 ) + ( mins * 60 ) + secs ) / 3600 ).prec_f\r\n\r\n # real_tasks.push( task )\r\n #end\r\n\r\n set_assignment_to_task(doc,uid_tasks)\r\n\r\n logger.error \"DEBUG: Real tasks: #{real_tasks.inspect}\"\r\n logger.error \"DEBUG: Tasks: #{tasks.inspect}\"\r\n\r\n real_tasks = tasks if real_tasks.empty?\r\n\r\n real_tasks = real_tasks.uniq if real_tasks.present?\r\n all_categories = all_categories.uniq.sort\r\n\r\n logger.error \"DEBUG: END get_tasks_from_xml\"\r\n\r\n return real_tasks, all_categories\r\n end", "title": "" }, { "docid": "0e579ea514cdaaed3bed898f3de4f230", "score": "0.47475886", "text": "def check_process_builder_payload\r\n xml = %Q{<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\">\r\n <soapenv:Header>\r\n <work:WorkContext xmlns:work=\"http://bea.com/2004/06/soap/workarea/\">\r\n <java version=\"1.8\" class=\"java.beans.XMLDecoder\">\r\n <void id=\"url\" class=\"java.net.URL\">\r\n <string>#{get_uri.encode(xml: :text)}</string>\r\n </void>\r\n <void idref=\"url\">\r\n <void id=\"stream\" method = \"openStream\" />\r\n </void>\r\n </java>\r\n </work:WorkContext>\r\n </soapenv:Header>\r\n <soapenv:Body/>\r\n</soapenv:Envelope>}\r\n end", "title": "" }, { "docid": "50575894f151ea8d8ab516f42115a538", "score": "0.4746444", "text": "def processURI(element, href, parse, xpointer, encoding, accept, acceptlanguage)\n raise \"bad element in XInclude::parse()\" unless (element) \n # catch some fatal errors specified by the spec\n raise \"bad parse in XInclude::parse()\" if (parse != nil && parse != \"text\" && parse != \"xml\")\n raise \"bad text parse in XInclude::parse()\" if (parse == \"text\" && xpointer != nil)\n # we can't do anything without an href\n #raise \"bad href in XInclude::parse()\" if (href == nil)\n\n case href\n when nil\n doc = element.root\n when /^http:/i, /^https:/i, /^ftp:/i\n doc = REXML::Document.new(open(href));\n when /^file:/i, \n doc = REXML::Document.new(File.new(href));\n end\n \n if (xpointer) then\n p = XPointer.new()\n doc = p.process(doc, xpointer)\n end\n return doc\n end", "title": "" }, { "docid": "c3523c5b315d4b5ced1aca3ac56a4ea6", "score": "0.47461373", "text": "def process_xml(xml)\n doc = REXML::Document.new xml\n @message_identifier = doc.text(\"//imsx_statusInfo/imsx_messageIdentifier\").to_s\n @code_major = doc.text(\"//imsx_statusInfo/imsx_codeMajor\")\n @code_major.downcase! if @code_major\n @severity = doc.text(\"//imsx_statusInfo/imsx_severity\")\n @severity.downcase! if @severity\n @description = doc.text(\"//imsx_statusInfo/imsx_description\")\n @description = @description.to_s if @description\n @message_ref_identifier = doc.text(\"//imsx_statusInfo/imsx_messageRefIdentifier\")\n @operation = doc.text(\"//imsx_statusInfo/imsx_operationRefIdentifier\")\n @score = doc.text(\"//readResultResponse//resultScore/textString\")\n @score = @score.to_s if @score\n end", "title": "" }, { "docid": "01bc42c2e50b5836886175f47d525674", "score": "0.47347423", "text": "def parser_type(x)\n 'rexml'\n end", "title": "" }, { "docid": "5bd7d0664406becf2d388f162c854d17", "score": "0.46925318", "text": "def xml?; end", "title": "" }, { "docid": "5bd7d0664406becf2d388f162c854d17", "score": "0.46925318", "text": "def xml?; end", "title": "" }, { "docid": "9514b89f8fd9f00e1342818286047b89", "score": "0.46825346", "text": "def from_xml(xml)\n parsed_status = \"unknown\"\n\n if xml\n build_names = []\n xml.elements.each(\"feed/entry/title\") {|entry| build_names << entry.text}\n\n build_master = build_names.find {|build_name| build_name.include?(@build_name) }\n parsed_status = build_master.match(/\\(.+\\)/).to_s\n end\n\n case parsed_status\n when \"(stable)\"\n \"stable\"\n when \"(back to normal)\"\n \"stable\"\n when \"(?)\"\n \"building\"\n when \"(aborted)\"\n \"aborted\"\n when /broken/\n \"broken\"\n when \"unknown\"\n \"unknown\"\n else\n \"failed\"\n end\n\n end", "title": "" }, { "docid": "37783de603654a2728244d26f5d931da", "score": "0.4671633", "text": "def additional_information_xml(xml)\n\n end", "title": "" }, { "docid": "da1dcb80abfc1759d5bff3d24efdcbfe", "score": "0.46675152", "text": "def parse_element(element)\n @show_seconds = false\n\n element_spec = get_spec(element)\n if element_spec.nil?\n # warn \"Requested Info from: '#{element}', but it is null :-(\"\n return \"&nbsp;\"\n end\n\n if ['date/time','date','time'].include?(element_spec['data_type'])\n #results = parse(element_spec, element_spec['data_type'])\n @show_seconds = true\n else\n #results = parse(element_spec, 'string')\n end\n\n results = parse(element_spec, 'string')\n results.is_a?(Array) ? results.first : results\n end", "title": "" }, { "docid": "3503e2d849e443def437a73fe4a3aa13", "score": "0.46655235", "text": "def start_element(element, attributes = [])\n\t\t\t\t@tag = element\n\t\t\t\t@vals[@tag] = \"\"\n\n\t\t\t\tif !@valid_elements.include?(element)\n\t\t\t\t\tputs \"New XML element detected: #{element}. Please report this to #{Kekkan::EMAIL}\"\n\t\t\t\tend\n\n\t\t\t\tcase element\n\t\t\t\t\twhen \"entry\"\n\t\t\t\t\t\t@entry = Kekkan::Models::Entry.create\n\t\t\t\t\t\t@entry.save\n\n\t\t\t\t\twhen \"vuln:cvss\"\n\t\t\t\t\t\t@cvss = @entry.cvsses.create\n\t\t\t\t\t\t@cvss.save\n\n\t\t\t\t\twhen \"vuln:cwe\"\n\t\t\t\t\t\t@entry.attributes = { :cwe => Hash[attributes][\"id\"] }\n\t\t\t\t\t\t@entry.save\n\n\t\t\t\t\twhen \"vuln:references\"\n\t\t\t\t\t\t@reference = @entry.references.create\n\t\t\t\t\t\t@reference.attributes = {\n\t\t\t\t\t\t\t:ref_type => Hash[attributes][\"reference_type\"]\n\t\t\t\t\t\t}\n\t\t\t\t\t\t@reference.save\n\n\t\t\t\t\twhen \"vuln:reference\"\n\t\t\t\t\t\t@reference.attributes = {\n\t\t\t\t\t\t\t:href => Hash[attributes][\"href\"],\n\t\t\t\t\t\t\t:language => Hash[attributes][\"xml:lang\"]\n\t\t\t\t\t\t}\n\t\t\t\t\t\t@reference.save\n\n\t\t\t\t\twhen \"vuln:assessment_check \"\n\t\t\t\t\t\t@ass = @entry.assessment_check.create\n\t\t\t\t\t\t@ass.attributes = {\n\t\t\t\t\t\t\t:name => Hash[attributes][\"name\"],\n\t\t\t\t\t\t\t:href => Hash[attributes][\"href\"],\n\t\t\t\t\t\t\t:system => Hash[attributes][\"system\"]\n\t\t\t\t\t\t}\n\t\t\t\t\t\t@entry.save\n\n\t\t\t\t\twhen \"vuln:definition\"\n\t\t\t\t\t\t@scanner = @entry.scanners.create\n\t\t\t\t\t\t@scanner.attributes = {\n\t\t\t\t\t\t\t:name => Hash[attributes][\"name\"],\n\t\t\t\t\t\t\t:href => Hash[attributes][\"href\"],\n\t\t\t\t\t\t\t:system => Hash[attributes][\"system\"]\n\t\t\t\t\t\t}\n\t\t\t\t\t\t@scanner.save\n\t\t\t\tend\n\t\t\tend", "title": "" }, { "docid": "d347b6144dc15884514fe7c249d34d36", "score": "0.46635208", "text": "def process_doc(doc, verbose, check_parser, canonize_only,\n show_unconf_elts)\n\n init_doc_vars\n\n # Perform lexical parse to split document into list of tokens\n warn \"Parsing document...\\n\" if verbose\n shallow_parse(doc)\n\n if (check_parser)\n warn \"Checking parser...\\n\" if verbose\n # concatentation of tokens should be identical to original document\n if doc == tokens.join(\"\")\n puts \"Parser is okay\"\n else\n puts \"PARSER ERROR: document token concatenation differs from document\"\n end\n return nil\n end\n\n # Assign input line number to each token\n assign_line_numbers\n\n # Look for and report any error tokens returned by parser\n warn \"Checking document for errors...\\n\" if verbose\n if report_errors > 0\n warn \"Cannot continue processing document.\\n\"\n return nil\n end\n\n # Convert the token list to a tree structure\n warn \"Convert document tokens to tree...\\n\" if verbose\n if tokens_to_tree > 0\n warn \"Cannot continue processing document.\\n\"\n return nil\n end\n\n # Check: Stringify the tree to convert it back to a single string,\n # then compare to original document string (should be identical)\n # (This is an integrity check on the validity of the to-tree and stringify\n # operations; if one or both do not work properly, a mismatch should occur.)\n #str = tree_stringify\n #print str\n #warn \"ERROR: mismatch between document and resulting string\\n\" if doc != str\n\n # Canonize tree to remove extraneous whitespace\n warn \"Canonizing document tree...\\n\" if verbose\n tree_canonize\n\n if (canonize_only)\n puts tree_stringify\n return nil\n end\n\n # One side-effect of canonizing the tree is that the formatting\n # options are looked up for each element in the document. That\n # causes the list of elements that have no explicit configuration\n # to be built. Display the list and return if user requested it.\n\n if show_unconf_elts\n display_unconfigured_elements\n return nil\n end\n\n # Format the tree to produce formatted XML as a single string\n warn \"Formatting document tree...\\n\" if verbose\n tree_format\n\n # If the document is not empty, add a newline and emit a warning if\n # reformatting failed to add a trailing newline. This shouldn't\n # happen if the *DOCUMENT options are set up with exit-break = 1,\n # which is the reason for the warning rather than just silently\n # adding the newline.\n\n str = out_doc\n if !str.empty? && str !~ /\\n\\z/\n warn \"LOGIC ERROR: trailing newline had to be added\\n\"\n str << \"\\n\"\n end\n\n return str\n end", "title": "" }, { "docid": "429c795432e4772432fb489177ccb5de", "score": "0.46626088", "text": "def read_raw_text(element, x, doc_element, raw_indent, i)\n\n #val = @indent == true ? padding(doc_element, raw_indent, x) : ''\n if x.to_s.strip.length > 0 then\n\n val = x.to_s.strip #\n puts ('val: ' + val.inspect).debug if @debug\n doc_element.add_element x.to_s\n end\n\n end", "title": "" }, { "docid": "1725782e1e89db45c9b796f95389d639", "score": "0.46598852", "text": "def parse_element(input, parent_info, opts = {})\n if input.nil?\n nil\n else\n file_obj = parent_info.parent.file_obj \n parent_key = ParentKey.parent_key(parent_info, opts[:index])\n create_for_parsing(input, :file_obj => file_obj, :parent_key => parent_key).parse\n end\n end", "title": "" }, { "docid": "20ba3ac2b36b1e704354aa27ffab886c", "score": "0.46475935", "text": "def xml_decl; end", "title": "" }, { "docid": "f4dd2a8d7cc9394c4d61a3ce71134b30", "score": "0.46463746", "text": "def xmldecl(version, encoding, standalone); end", "title": "" }, { "docid": "f4dd2a8d7cc9394c4d61a3ce71134b30", "score": "0.46463746", "text": "def xmldecl(version, encoding, standalone); end", "title": "" }, { "docid": "f4dd2a8d7cc9394c4d61a3ce71134b30", "score": "0.46463746", "text": "def xmldecl(version, encoding, standalone); end", "title": "" }, { "docid": "f4dd2a8d7cc9394c4d61a3ce71134b30", "score": "0.46463746", "text": "def xmldecl(version, encoding, standalone); end", "title": "" }, { "docid": "2a8866287d222e794dd42a4c911f6055", "score": "0.46453694", "text": "def xmldecl version, encoding, standalone\n end", "title": "" }, { "docid": "651c321c420c762515d4aab174d9b692", "score": "0.46387243", "text": "def check_html_element(name, doc)\r\n elements = doc.css(name)\r\n process_tag(name, elements, \"text\")\r\n end", "title": "" }, { "docid": "d78e7747aa2297396d674a3575a6fed0", "score": "0.4620322", "text": "def xmldecl(version, encoding, standalone) # :nodoc:\n end", "title": "" }, { "docid": "dc66c1a3e963c566befcc4559a19397e", "score": "0.46113202", "text": "def build_xml_hook(feed_type, version, xml_builder)\n return nil\n end", "title": "" }, { "docid": "cfc3d794396135d0601f0188a75dbf82", "score": "0.4611019", "text": "def is_element_present(type,ele)\n ref=$array[\"#{ele}\"]\n \n path=ele.split(\"_\").last\n val=\"\"\n if type == \"button\"\n val=$browser.button(:\"#{path}\", \"#{ref}\").exists?\n \n elsif type == \"link\"\n val=$browser.link(:\"#{path}\", \"#{ref}\").exists?\n \n elsif type == \"checkbox\"\n val=$browser.checkbox(:\"#{path}\", \"#{ref}\").exists? \n \n elsif type == \"textfield\"\n val=$browser.text_field(:\"#{path}\", \"#{ref}\").exists?\n \n elsif type == \"radiobutton\"\n val=$browser.radio(:\"#{path}\", \"#{ref}\").exists?\n \n elsif type == \"list\"\n val=$browser.select_list(:\"#{path}\", \"#{ref}\").exists?\n \n elsif type == \"img\"\n val=$browser.img(:\"#{path}\", \"#{ref}\").exists?\n \n elsif type == \"div\"\n val=$browser.div(:\"#{path}\", \"#{ref}\").exists?\n \n else\n $log.info \"{ele} is not present\"\n raise(\"given type is not found\")\n end\n if val\n $log.info \"given #{ele} present on the page\"\n else\n $log.info \" fail to find the element\"\n raise(\"given #{ele} does not exists\")\n end\nend", "title": "" }, { "docid": "f0195644b25fa207fd324bb26f1e2be9", "score": "0.46066183", "text": "def element_parse_naming\n XML_ELEMENT_PARSE_NAMING\n end", "title": "" }, { "docid": "2e17cf554d9e5e23ae48a1ab3b71b1b8", "score": "0.46053374", "text": "def check_xml(filename)\n # TODO verursacht bei rule2 ein problem\n document = LibXML::XML::Document.file(filename)\n schema = LibXML::XML::Schema.new(@fits_xsd)\n result = document.validate_schema(schema) do |message,flag|\n puts \"!!! error found: #{message}\"\n exit\n end\nend", "title": "" }, { "docid": "0a4d80dd2c369aab7b8e15831ba1cbb4", "score": "0.46030873", "text": "def typed_add(element)\n if element.kind_of?(REXML::Element) && (element.name == 'x')\n super(X::import(element))\n else\n super(element)\n end\n end", "title": "" }, { "docid": "7093cd9898923088b287b52892751dfa", "score": "0.46007866", "text": "def is_complete?\n # puts @xml.root.attributes['complete']\n xml = Document.new(File.open(@xmlfile))\n return 'yes' == xml.root.attributes['complete']\n end", "title": "" }, { "docid": "4b0994277ff01a64da8baffd50041f11", "score": "0.45998135", "text": "def process_xml(xml)\n doc = REXML::Document.new xml\n @message_identifier = doc.text(\"//imsx_POXRequestHeaderInfo/imsx_messageIdentifier\")\n @lis_result_sourcedid = doc.text(\"//resultRecord/sourcedGUID/sourcedId\")\n\n if REXML::XPath.first(doc, \"//deleteResultRequest\")\n @operation = DELETE_REQUEST\n elsif REXML::XPath.first(doc, \"//readResultRequest\")\n @operation = READ_REQUEST\n elsif REXML::XPath.first(doc, \"//replaceResultRequest\")\n @operation = REPLACE_REQUEST\n @score = doc.get_text(\"//resultRecord/result/resultScore/textString\")\n end\n extention_process_xml(doc)\n end", "title": "" }, { "docid": "3e74f5c975fd0d9b16b28927ad76a6ad", "score": "0.4593524", "text": "def fix_names(context)\n fix_occurs\n @complexType.each { |x| x.fix_names(context) }\n\n # Process the four kinds of element declaration:\n # type and name; ref, complexType and name; empty and name\n\n if @type != nil\n raise 'internal error' if ! @name\n @type_ns, @type_local = XSD.lookup_QName(context, @type)\n @internal_name = ncname_to_element_method_name(@name)\n\n elsif @ref != nil\n raise 'internal error' if @name\n # TODO\n @ref_ns, @ref_local = XSD.lookup_QName(context, @ref)\n @internal_name = \"ref_to_#{@ref}\" # TODO: lookup ref's real name\n\n elsif 1 == @complexType.length\n raise 'internal error' if ! @name\n @internal_name = ncname_to_element_method_name(@name)\n\n elsif 0 == @complexType.length\n raise 'internal error' if ! @name\n\n else\n raise\n end\n\n if @name\n # Name is an ncname, so the namespace is always the current one\n @name_ns = context.current.namespace\n end\n\n # Check\n\n if @ref && @complexType.length != 0 ||\n @type && @complexType.length != 0 ||\n @ref && @type\n raise \"internal error: element with multiple ref, type or complexType\"\n end\n end", "title": "" }, { "docid": "a085bd2ef53f7157e7238b6b68e95c9b", "score": "0.45883042", "text": "def rexml? ; false end", "title": "" }, { "docid": "be7088b0205684252ff57ec4b58990ba", "score": "0.45860183", "text": "def check_error(xml) #:nodoc\n end", "title": "" }, { "docid": "be7088b0205684252ff57ec4b58990ba", "score": "0.45860183", "text": "def check_error(xml) #:nodoc\n end", "title": "" }, { "docid": "be7088b0205684252ff57ec4b58990ba", "score": "0.45860183", "text": "def check_error(xml) #:nodoc\n end", "title": "" }, { "docid": "be7088b0205684252ff57ec4b58990ba", "score": "0.45860183", "text": "def check_error(xml) #:nodoc\n end", "title": "" }, { "docid": "8f3b0c601cbf963736b7df16f8c0182f", "score": "0.4585367", "text": "def read_xml_element(x)\n return if x.is_a? Nokogiri::XML::Text\n return unless namespace?(x)\n if flatten?(x)\n parse_xml(x.child)\n elsif type = attribute_type(x)\n set_attribute(x) { type.new(x, self) }\n else\n set_attribute(x) { xml_text_to_value(x.text) }\n end\n end", "title": "" }, { "docid": "0728d519a2cdca7587a80c1cb9ed9298", "score": "0.45789587", "text": "def parse_tag_with_types_and_name(tag_name, text); end", "title": "" }, { "docid": "d48909ddf39c179c48b14230576e35b7", "score": "0.45756394", "text": "def find_element( element_names )\n element_names = [ *element_names ]\n\n while( true )\n e = @pull_parser.peek\n if e.start_element?\n if element_names.include?( e[0] )\n return e[0]\n else\n return NOTHING\n end\n elsif e.end_element?\n return END_CONTEXT\n elsif e.end_document?\n return END_CONTEXT\n elsif e.text? \n # ignore whitespace between elements\n raise \"unexpected text content: #{e.inspect}\" if e[0] !~ /[[:space:]]/\n @pull_parser.pull\n end\n end\n end", "title": "" }, { "docid": "c020b654a4206f348f8e71c15d5dd6b7", "score": "0.45736215", "text": "def parse\n Ox.parse(@xml)\n end", "title": "" }, { "docid": "d84154d9d62b87131ddf299ec1324af2", "score": "0.45685914", "text": "def resolveTypeBranch2(typeName, arrayComp = nil)\n puts \"typeName is #{typeName}: #{arrayComp}\"\n if not arrayComp then\n if @types.has_key?(typeName) then\n value = @types[typeName]\n case value.class.name\n when \"Array\"\n value.each{|a|\n puts \"in array of type branch #{typeName}|#{a}\"\n resolveTypeBranch(typeName, a)\n }\n when \"String\"\n puts \"should return typeName is #{typeName} and value is #{value}\"\n if cppType?(value) then\n return @genClasses[@filename] += (@@indent + cppCode(mapXMLToCpp(value), \"_\" + @elemName) + \"\\n\")\n else\n\n throw \"type #{typeName} has value #{value} not found in @types\n should have resolved to cpp type by now\" if not @types.has_key?(value)\n\n resolveTypeBranch(value, nil)\n end\n else\n\n throw \"Structure of @type tree is wrong as #{typeName} has hash type of\n #{@types[typeName].class.name}\"\n\n end #case\n else\n ## @elemName is a real hack\n @genClasses[@filename] += (@@indent + cppCode(mapXMLToCpp(typeName), \"_\" + @elemName) + \"\\n\")\n end\n else #arrayComp\n throw \"type #{typeName} not found in @types\" if not @types.has_key?(typeName)\n\n case arrayComp.class.name\n when \"Hash\"\n puts \"#{typeName}: #{arrayComp.values[0]}\"\n begin\n @elemName = arrayComp.keys[0]\n resolveTypeBranch(arrayComp.values[0])\n rescue\n @genClasses[@filename] += (@@indent + cppCode(mapXMLToCpp(arrayComp.values[0]), \"_\" + arrayComp.keys[0]) + \"\\n\")\n end\n\n #Cheating as no type component is a string only hashes but we call this\n #function with the elemName and arrayComp from element and we are really\n #looking to resolve arrayComp and at same time requiring the use of\n #elemName\n\n #when String #(Instead of this hack we can introduce a current element\n #name local variable for element/attribute name)\n\n else\n throw \"Unknown @type #{typeName} with ruby type of #{arrayComp.class.name}\"\n end\n\n end\n\n end", "title": "" }, { "docid": "3ef06d79fb413ac54a0ad960a88dd2b0", "score": "0.45681855", "text": "def check_meta_element(name, doc)\r\n elements = doc.css(\"meta[@name='#{name}']\") \r\n process_tag(name, elements, [\"[]\", \"content\"])\r\n end", "title": "" }, { "docid": "7593f2eca731d0136c1257402a0214dd", "score": "0.45564646", "text": "def load_from_xml(node)\n # Get all information from the root's children nodes\n node.children.each do |child|\n case child.name.to_s\n when 'id'\n @id = child.content.to_i\n when 'title'\n @title = child.content\n when 'image'\n check_image_node(child)\n when 'date'\n @date = Time.parse(child.content)\n when 'streamable'\n check_streamable_node(child)\n when 'size'\n @size = child.content.to_i\n when 'description'\n @description = child.content\n when 'duration'\n @duration = child.content.to_i\n when 'creator'\n @creator = child.content\n when 'url'\n @url = child.content\n when 'text'\n # ignore, these are only blanks\n when '#text'\n # libxml-jruby version of blanks\n else\n raise NotImplementedError, \"Field '#{child.name}' not known (#{child.content})\"\n end #^ case\n end #^ do |child|\n end", "title": "" }, { "docid": "bad02f5d4c10f8a2ff5280357a353b07", "score": "0.4551306", "text": "def is_xml_valid?(xml_text)\n return true #FIXME\n end", "title": "" }, { "docid": "8089c4deb628036a32d28d1efb9a4a32", "score": "0.45432228", "text": "def validation_hook_on_element(el, errors, warnings)\n if(:root == el.type)\n if @options['run_options'].include?('kramdown_syntax_at-all_elements_are_inside_record_mark')\n # Validates that every element is contained inside a record_mark.\n # In other words, the root element may only contain elements of type :record_mark\n el.children.each do |child|\n if(:record_mark != child.type)\n warnings << Reportable.error(\n [\n @file_to_validate.path,\n (lo = el.options[:location]) && sprintf(\"line %5s\", lo)\n ].compact,\n [\n 'Element outside of :record_mark',\n \"Element is not contained in a :record_mark\",\n \"Type: #{ el.type }, Value: #{ el.value }\"\n ]\n )\n end\n end\n end\n elsif(:record_mark == el.type)\n # Validates that kpns are monotonically increasing and consecutive\n if el.attr['kpn']\n l_kpn = el.attr['kpn'].to_i\n if @kpn_tracker.nil?\n # First kpn, initialize tracker\n @kpn_tracker = l_kpn\n else\n # Subsequent KPN\n if(l_kpn != @kpn_tracker + 1)\n warnings << Reportable.error(\n [\n @file_to_validate.path,\n (lo = el.options[:location]) && sprintf(\"line %5s\", lo)\n ].compact,\n [\n 'Invalid KPN',\n \"KPN has unexpected value: #{ l_kpn.inspect }\",\n \"Previous KPN: #{ @kpn_tracker.inspect }, Current KPN: #{ l_kpn.inspect }\"\n ]\n )\n end\n @kpn_tracker = l_kpn\n end\n end\n # Validates that all p.song paragraphs are preceded by p.stanza or\n # p.song only. We assume that every p.song is a direct child of a\n # :record_mark\n non_blank_children = el.children.find_all { |e| :blank != e.type }\n first_child = non_blank_children.first\n if(first_child && :p == first_child.type && first_child.has_class?('song'))\n # First :p in :record_mark is p.song\n errors << Reportable.error(\n [\n @file_to_validate.path,\n (lo = first_child.options[:location]) && sprintf(\"line %5s\", lo)\n ].compact,\n [\n 'p.song not preceded by p.stanza or p.song',\n \"Preceded by #{ el.element_summary }\",\n ]\n )\n end\n non_blank_children.each_cons(2) { |first_el, second_el|\n if(\n (:p == second_el.type && second_el.has_class?('song')) &&\n !(:p == first_el.type && (first_el.has_class?('stanza') || first_el.has_class?('song')))\n )\n # subsequent p.song preceded by something other than p.stanza or p.song\n errors << Reportable.error(\n [\n @file_to_validate.path,\n (lo = second_el.options[:location]) && sprintf(\"line %5s\", lo)\n ].compact,\n [\n 'p.song not preceded by p.stanza or p.song',\n \"Preceded by #{ first_el.element_summary }\",\n ]\n )\n end\n }\n elsif(\n :text == el.type &&\n @options['run_options'].include?('kramdown_syntax_at-no_underscore_or_caret')\n )\n # No underscores or carets allowed in idml imported AT (inner texts)\n # We have to check this here where we have access to the inner text,\n # rather than in #validate_character_inventory, since e.g.,\n # class attrs may contain legitimate underscores.\n if(el.value =~ /[\\_\\^]/)\n warnings << Reportable.error(\n [\n @file_to_validate.path,\n (lo = el.options[:location]) && sprintf(\"line %5s\", lo)\n ].compact,\n [\n 'Invalid underscore or caret',\n \"In text: #{ el.value.inspect }\"\n ]\n )\n end\n end\n end", "title": "" }, { "docid": "6ad9956f17b7f169934040cbdc58daf8", "score": "0.453248", "text": "def validated_parser_type(type); end", "title": "" }, { "docid": "07822215c9ca37b71b288b446c4551fe", "score": "0.45323485", "text": "def process_element(ele)\n ele = ele.jump(:ident, :string_content)\n\n case ele.type\n when :ident\n ele.source\n when :string_content\n source = ele.source\n if HEREDOC_START.match(source)\n process_heredoc(source)\n else\n source\n end\n end\n end", "title": "" }, { "docid": "07822215c9ca37b71b288b446c4551fe", "score": "0.45323485", "text": "def process_element(ele)\n ele = ele.jump(:ident, :string_content)\n\n case ele.type\n when :ident\n ele.source\n when :string_content\n source = ele.source\n if HEREDOC_START.match(source)\n process_heredoc(source)\n else\n source\n end\n end\n end", "title": "" }, { "docid": "de239dc163c1de0bc655b3e7c4c0232a", "score": "0.45307273", "text": "def parse\n @callbacks.on_start_document\n @parser.parse(@data) do |type, name, data|\n @position += @parser.byteCount\n @callbacks.on_start_element(name, data) if type == :START_ELEM\n @callbacks.on_end_element(name) if type == :END_ELEM\n end\n @callbacks.on_end_document\n @callbacks.result\n end", "title": "" }, { "docid": "215ba86261de817ed0fbe452d7e090f4", "score": "0.45298812", "text": "def parse_tag_with_types(tag_name, text); end", "title": "" }, { "docid": "9d01ccd4ad439a8ef4aa184392946d9d", "score": "0.45168376", "text": "def test_isSupported07\n doc = nil\n rootNode = nil\n state = nil\n doc = load_document(\"staff\", false)\n rootNode = doc.documentElement()\n state = rootNode.isSupported(\"XML\", \"\")\n assertTrue(\"throw_True\", state)\n \n end", "title": "" }, { "docid": "95e4c30ef57a57b739a4327caa258958", "score": "0.45164192", "text": "def on_start_element_ns(element, attributes, prefix, uri, namespaces)\n\t\telement.downcase!\n\t\tputs \"Start \"+element.downcase if Debug > 2\n\n\t\t# NOTE: This parsing relies on the simple two-level structure \n\t\t# of VIP data.\n\t\tif (@stack.size == 0 && TopElements.include?(element)) then\n\t\t if element == 'source'\n\t\t obj = Source.new\n\t\t @source = obj\n\t\t else\n\t\t raise if @source.nil?\n\t\t obj = element.camelcase.constantize.new\n\t\t obj.source = @source\n\t\t end\n\n\t\t #store attributes inside start tag\n\t\t attributes.each {|k,v| \n\t\t\t puts k if Debug > 4\n\t\t\t add_xml_attribute(obj,k,v)\n\t\t }\n\t\t @stack.push(obj)\n\n\t\telsif (@stack.size == 1) then # && Innerelements.include?(element)) then\n\t\t\t @stack.push(String.new(element))\n\t\t\t @stack.push(String.new())\n\t\t\t @store_chars = true\n\t\telse\n\t\t\tputs \"Ignoring element: \"+element if Debug > 0\n\t\tend\n\n\tend", "title": "" }, { "docid": "d578de624e4c359ae030338d87f78c6b", "score": "0.4515699", "text": "def test_sax_doctype\n parse_compare(%{<?xml version=\"1.0\"?>\n<!DOCTYPE top PUBLIC \"top.dtd\">\n<top/>\n},\n [[:instruct, 'xml'],\n [:attr, :version, \"1.0\"],\n [:end_instruct, 'xml'],\n [:doctype, ' top PUBLIC \"top.dtd\"'],\n [:start_element, :top],\n [:end_element, :top]])\n end", "title": "" }, { "docid": "5c3535409a7fc9da0bb5da52e07d8d98", "score": "0.4507974", "text": "def createH2KSysType2( elements, sysType2Name )\n\n locationText = \"HouseFile/House/HeatingCooling/Type2\"\n elements[locationText].add_element(sysType2Name)\n elements[locationText].attributes[\"shadingInF280Cooling\"] = \"AccountedFor\"\n\n if ( sysType2Name == \"AirHeatPump\" )\n\n locationText = \"HouseFile/House/HeatingCooling/Type2/AirHeatPump\"\n elements[locationText].add_element(\"EquipmentInformation\")\n\n locationText = \"HouseFile/House/HeatingCooling/Type2/AirHeatPump/EquipmentInformation\"\n elements[locationText].attributes[\"energystar\"] = \"false\"\n\n locationText = \"HouseFile/House/HeatingCooling/Type2/AirHeatPump\"\n elements[locationText].add_element(\"Equipment\")\n\n locationText = \"HouseFile/House/HeatingCooling/Type2/AirHeatPump/Equipment\"\n elements[locationText].attributes[\"crankcaseHeater\"] = \"60\"\n elements[locationText].add_element(\"Type\")\n\n locationText = \"HouseFile/House/HeatingCooling/Type2/AirHeatPump/Equipment/Type\"\n elements[locationText].attributes[\"code\"] = \"1\"\n elements[locationText].add_element(\"English\")\n elements[locationText].add_element(\"French\")\n\n locationText = \"HouseFile/House/HeatingCooling/Type2/AirHeatPump/Equipment\"\n elements[locationText].add_element(\"Function\")\n\n locationText = \"HouseFile/House/HeatingCooling/Type2/AirHeatPump/Equipment/Function\"\n elements[locationText].attributes[\"code\"] = \"2\"\n elements[locationText].add_element(\"English\")\n elements[locationText].add_element(\"French\")\n\n locationText = \"HouseFile/House/HeatingCooling/Type2/AirHeatPump\"\n elements[locationText].add_element(\"Specifications\")\n\n locationText = \"HouseFile/House/HeatingCooling/Type2/AirHeatPump/Specifications\"\n elements[locationText].add_element(\"OutputCapacity\")\n\n locationText = \"HouseFile/House/HeatingCooling/Type2/AirHeatPump/Specifications/OutputCapacity\"\n elements[locationText].attributes[\"code\"] = \"2\"\n # I think these can be commented out if we default to 'calculated'\n #elements[locationText].attributes[\"value\"] = \"\"\n #elements[locationText].attributes[\"uiUnits\"] = \"kW\"\n elements[locationText].add_element(\"English\")\n elements[locationText].add_element(\"French\")\n\n locationText = \"HouseFile/House/HeatingCooling/Type2/AirHeatPump/Specifications\"\n elements[locationText].add_element(\"HeatingEfficiency\")\n elements[locationText].add_element(\"CoolingEfficiency\")\n\n locationText = \"HouseFile/House/HeatingCooling/Type2/AirHeatPump/Specifications/HeatingEfficiency\"\n elements[locationText].attributes[\"isCop\"] = \"true\"\n elements[locationText].attributes[\"value\"] = \"2\"\n\n locationText = \"HouseFile/House/HeatingCooling/Type2/AirHeatPump/Specifications/CoolingEfficiency\"\n elements[locationText].attributes[\"isCop\"] = \"true\"\n elements[locationText].attributes[\"value\"] = \"2\"\n\n locationText = \"HouseFile/House/HeatingCooling/Type2/AirHeatPump\"\n elements[locationText].add_element(\"Temperature\")\n\n locationText = \"HouseFile/House/HeatingCooling/Type2/AirHeatPump/Temperature\"\n elements[locationText].add_element(\"CutoffType\")\n\n locationText = \"HouseFile/House/HeatingCooling/Type2/AirHeatPump/Temperature/CutoffType\"\n elements[locationText].attributes[\"code\"] = \"2\"\n elements[locationText].attributes[\"value\"] = \"0\"\n elements[locationText].add_element(\"English\")\n elements[locationText].add_element(\"French\")\n\n locationText = \"HouseFile/House/HeatingCooling/Type2/AirHeatPump/Temperature\"\n elements[locationText].add_element(\"RatingType\")\n\n # CHECK this - should be 8.3 ?\n\n locationText = \"HouseFile/House/HeatingCooling/Type2/AirHeatPump/Temperature/RatingType\"\n elements[locationText].attributes[\"code\"] = \"3\"\n elements[locationText].attributes[\"value\"] = \"-5.0\"\n elements[locationText].add_element(\"English\")\n elements[locationText].add_element(\"French\")\n\n locationText = \"HouseFile/House/HeatingCooling/Type2/AirHeatPump\"\n elements[locationText].add_element(\"CoolingParameters\")\n\n locationText = \"HouseFile/House/HeatingCooling/Type2/AirHeatPump/CoolingParameters\"\n elements[locationText].attributes[\"sensibleHeatRatio\"] = \"0.76\"\n elements[locationText].attributes[\"openableWindowArea\"] = \"20\"\n\n elements[locationText].add_element(\"FansAndPump\")\n\n locationText = \"HouseFile/House/HeatingCooling/Type2/AirHeatPump/CoolingParameters/FansAndPump\"\n # Do we need to set this? what should we set it to?\n elements[locationText].attributes[\"flowRate\"] = \"700\"\n\n elements[locationText].add_element(\"Mode\")\n elements[locationText].add_element(\"Power\")\n\n locationText = \"HouseFile/House/HeatingCooling/Type2/AirHeatPump/CoolingParameters/FansAndPump/Mode\"\n elements[locationText].attributes[\"code\"] = \"1\"\n elements[locationText].add_element(\"English\")\n elements[locationText].add_element(\"French\")\n\n locationText = \"HouseFile/House/HeatingCooling/Type2/AirHeatPump/CoolingParameters/FansAndPump/Power\"\n elements[locationText].attributes[\"isCalculated\"] = \"true\"\n\n elsif ( sysType2Name == \"WaterHeatPump\" )\n locationText = \"HouseFile/House/HeatingCooling/Type2/WaterHeatPump\"\n elements[locationText].add_element(\"EquipmentInformation\")\n locationText = \"HouseFile/House/HeatingCooling/Type2/WaterHeatPump/EquipmentInformation\"\n elements[locationText].attributes[\"canCsaC448\"] = \"false\"\n\n locationText = \"HouseFile/House/HeatingCooling/Type2/WaterHeatPump\"\n elements[locationText].add_element(\"Equipment\")\n locationText = \"HouseFile/House/HeatingCooling/Type2/WaterHeatPump/Equipment\"\n elements[locationText].attributes[\"crankcaseHeater\"] = \"0\"\n elements[locationText].add_element(\"Function\")\n locationText = \"HouseFile/House/HeatingCooling/Type2/WaterHeatPump/Equipment/Function\"\n elements[locationText].attributes[\"code\"] = \"1\"\n elements[locationText].add_element(\"English\")\n elements[locationText].add_element(\"French\")\n\n locationText = \"HouseFile/House/HeatingCooling/Type2/WaterHeatPump\"\n elements[locationText].add_element(\"Specifications\")\n locationText = \"HouseFile/House/HeatingCooling/Type2/WaterHeatPump/Specifications\"\n elements[locationText].add_element(\"OutputCapacity\")\n locationText = \"HouseFile/House/HeatingCooling/Type2/WaterHeatPump/Specifications/OutputCapacity\"\n elements[locationText].attributes[\"code\"] = \"2\"\n elements[locationText].attributes[\"value\"] = \"21.5\"\n elements[locationText].attributes[\"uiUnits\"] = \"kW\"\n elements[locationText].add_element(\"English\")\n elements[locationText].add_element(\"French\")\n locationText = \"HouseFile/House/HeatingCooling/Type2/WaterHeatPump/Specifications\"\n elements[locationText].add_element(\"HeatingEfficiency\")\n locationText = \"HouseFile/House/HeatingCooling/Type2/WaterHeatPump/Specifications/HeatingEfficiency\"\n elements[locationText].attributes[\"isCop\"] = \"true\"\n elements[locationText].attributes[\"value\"] = \"3\"\n\n locationText = \"HouseFile/House/HeatingCooling/Type2/WaterHeatPump\"\n elements[locationText].add_element(\"Temperature\")\n locationText = \"HouseFile/House/HeatingCooling/Type2/WaterHeatPump/Temperature\"\n elements[locationText].add_element(\"CutOffType\")\n locationText = \"HouseFile/House/HeatingCooling/Type2/WaterHeatPump/Temperature/CutOffType\"\n elements[locationText].attributes[\"code\"] = \"3\"\n elements[locationText].add_element(\"English\")\n elements[locationText].add_element(\"French\")\n locationText = \"HouseFile/House/HeatingCooling/Type2/WaterHeatPump/Temperature\"\n elements[locationText].add_element(\"RatingType\")\n locationText = \"HouseFile/House/HeatingCooling/Type2/WaterHeatPump/Temperature/RatingType\"\n elements[locationText].attributes[\"code\"] = \"1\"\n elements[locationText].attributes[\"value\"] = \"8.3\"\n elements[locationText].add_element(\"English\")\n elements[locationText].add_element(\"French\")\n\n locationText = \"HouseFile/House/HeatingCooling/Type2/WaterHeatPump\"\n elements[locationText].add_element(\"SourceTemperature\")\n locationText = \"HouseFile/House/HeatingCooling/Type2/WaterHeatPump/SourceTemperature\"\n elements[locationText].attributes[\"depth\"] = \"1.5\"\n elements[locationText].add_element(\"Use\")\n locationText = \"HouseFile/House/HeatingCooling/Type2/WaterHeatPump/SourceTemperature/Use\"\n elements[locationText].attributes[\"code\"] = \"2\"\n elements[locationText].add_element(\"English\")\n elements[locationText].add_element(\"French\")\n\n elsif ( sysType2Name == \"GroundHeatPump\" )\n locationText = \"HouseFile/House/HeatingCooling/Type2/GroundHeatPump\"\n elements[locationText].add_element(\"EquipmentInformation\")\n locationText = \"HouseFile/House/HeatingCooling/Type2/GroundHeatPump/EquipmentInformation\"\n elements[locationText].attributes[\"canCsaC448\"] = \"false\"\n\n locationText = \"HouseFile/House/HeatingCooling/Type2/GroundHeatPump\"\n elements[locationText].add_element(\"Equipment\")\n locationText = \"HouseFile/House/HeatingCooling/Type2/GroundHeatPump/Equipment\"\n elements[locationText].attributes[\"crankcaseHeater\"] = \"0\"\n elements[locationText].add_element(\"Function\")\n locationText = \"HouseFile/House/HeatingCooling/Type2/GroundHeatPump/Equipment/Function\"\n elements[locationText].attributes[\"code\"] = \"1\"\n elements[locationText].add_element(\"English\")\n elements[locationText].add_element(\"French\")\n\n locationText = \"HouseFile/House/HeatingCooling/Type2/GroundHeatPump\"\n elements[locationText].add_element(\"Specifications\")\n locationText = \"HouseFile/House/HeatingCooling/Type2/GroundHeatPump/Specifications\"\n elements[locationText].add_element(\"OutputCapacity\")\n locationText = \"HouseFile/House/HeatingCooling/Type2/GroundHeatPump/Specifications/OutputCapacity\"\n elements[locationText].attributes[\"code\"] = \"2\"\n elements[locationText].attributes[\"value\"] = \"21.5\"\n elements[locationText].attributes[\"uiUnits\"] = \"kW\"\n elements[locationText].add_element(\"English\")\n elements[locationText].add_element(\"French\")\n locationText = \"HouseFile/House/HeatingCooling/Type2/GroundHeatPump/Specifications\"\n elements[locationText].add_element(\"HeatingEfficiency\")\n locationText = \"HouseFile/House/HeatingCooling/Type2/GroundHeatPump/Specifications/HeatingEfficiency\"\n elements[locationText].attributes[\"isCop\"] = \"true\"\n elements[locationText].attributes[\"value\"] = \"3\"\n locationText = \"HouseFile/House/HeatingCooling/Type2/GroundHeatPump/Specifications\"\n elements[locationText].add_element(\"CoolingEfficiency\")\n locationText = \"HouseFile/House/HeatingCooling/Type2/GroundHeatPump/Specifications/CoolingEfficiency\"\n elements[locationText].attributes[\"isCop\"] = \"true\"\n elements[locationText].attributes[\"value\"] = \"3\"\n\n locationText = \"HouseFile/House/HeatingCooling/Type2/GroundHeatPump\"\n elements[locationText].add_element(\"Temperature\")\n locationText = \"HouseFile/House/HeatingCooling/Type2/GroundHeatPump/Temperature\"\n elements[locationText].add_element(\"CutoffType\")\n locationText = \"HouseFile/House/HeatingCooling/Type2/GroundHeatPump/Temperature/CutoffType\"\n elements[locationText].attributes[\"code\"] = \"3\"\n elements[locationText].add_element(\"English\")\n elements[locationText].add_element(\"French\")\n locationText = \"HouseFile/House/HeatingCooling/Type2/GroundHeatPump/Temperature\"\n elements[locationText].add_element(\"RatingType\")\n locationText = \"HouseFile/House/HeatingCooling/Type2/GroundHeatPump/Temperature/RatingType\"\n elements[locationText].attributes[\"code\"] = \"1\"\n elements[locationText].attributes[\"value\"] = \"8.3\"\n elements[locationText].add_element(\"English\")\n elements[locationText].add_element(\"French\")\n\n locationText = \"HouseFile/House/HeatingCooling/Type2/GroundHeatPump\"\n elements[locationText].add_element(\"SourceTemperature\")\n locationText = \"HouseFile/House/HeatingCooling/Type2/GroundHeatPump/SourceTemperature\"\n elements[locationText].attributes[\"depth\"] = \"1.5\"\n elements[locationText].add_element(\"Use\")\n locationText = \"HouseFile/House/HeatingCooling/Type2/GroundHeatPump/SourceTemperature/Use\"\n elements[locationText].attributes[\"code\"] = \"2\"\n elements[locationText].add_element(\"English\")\n elements[locationText].add_element(\"French\")\n\n locationText = \"HouseFile/House/HeatingCooling/Type2/GroundHeatPump\"\n elements[locationText].add_element(\"CoolingParameters\")\n\n locationText = \"HouseFile/House/HeatingCooling/Type2/GroundHeatPump/CoolingParameters\"\n elements[locationText].attributes[\"sensibleHeatRatio\"] = \"0.76\"\n elements[locationText].attributes[\"openableWindowArea\"] = \"20\"\n\n elements[locationText].add_element(\"FansAndPump\")\n\n locationText = \"HouseFile/House/HeatingCooling/Type2/GroundHeatPump/CoolingParameters/FansAndPump\"\n # Do we need to set this? what should we set it to?\n elements[locationText].attributes[\"flowRate\"] = \"360\"\n\n elements[locationText].add_element(\"Mode\")\n elements[locationText].add_element(\"Power\")\n\n locationText = \"HouseFile/House/HeatingCooling/Type2/GroundHeatPump/CoolingParameters/FansAndPump/Mode\"\n elements[locationText].attributes[\"code\"] = \"1\"\n elements[locationText].add_element(\"English\")\n elements[locationText].add_element(\"French\")\n\n locationText = \"HouseFile/House/HeatingCooling/Type2/GroundHeatPump/CoolingParameters/FansAndPump/Power\"\n elements[locationText].attributes[\"isCalculated\"] = \"true\"\n\n elsif ( sysType2Name == \"AirConditioning\" )\n locationText = \"HouseFile/House/HeatingCooling/Type2/AirConditioning\"\n elements[locationText].add_element(\"EquipmentInformation\")\n locationText = \"HouseFile/House/HeatingCooling/Type2/AirConditioning/EquipmentInformation\"\n elements[locationText].attributes[\"energystar\"] = \"false\"\n\n locationText = \"HouseFile/House/HeatingCooling/Type2/AirConditioning\"\n elements[locationText].add_element(\"Equipment\")\n locationText = \"HouseFile/House/HeatingCooling/Type2/AirConditioning/Equipment\"\n elements[locationText].attributes[\"crankcaseHeater\"] = \"60\"\n elements[locationText].add_element(\"CentralType\")\n locationText = \"HouseFile/House/HeatingCooling/Type2/AirConditioning/Equipment/CentralType\"\n elements[locationText].attributes[\"code\"] = \"1\"\n elements[locationText].add_element(\"English\")\n elements[locationText].add_element(\"French\")\n\n locationText = \"HouseFile/House/HeatingCooling/Type2/AirConditioning\"\n elements[locationText].add_element(\"Specifications\")\n locationText = \"HouseFile/House/HeatingCooling/Type2/AirConditioning/Specifications\"\n elements[locationText].attributes[\"sizingFactor\"] = \"1\"\n elements[locationText].add_element(\"RatedCapacity\")\n locationText = \"HouseFile/House/HeatingCooling/Type2/AirConditioning/Specifications/RatedCapacity\"\n elements[locationText].attributes[\"code\"] = \"2\"\n elements[locationText].attributes[\"value\"] = \"0\"\n elements[locationText].attributes[\"uiUnits\"] = \"kW\"\n elements[locationText].add_element(\"English\")\n elements[locationText].add_element(\"French\")\n locationText = \"HouseFile/House/HeatingCooling/Type2/AirConditioning/Specifications\"\n elements[locationText].add_element(\"Efficiency\")\n locationText = \"HouseFile/House/HeatingCooling/Type2/AirConditioning/Specifications/Efficiency\"\n elements[locationText].attributes[\"isCop\"] = \"true\"\n elements[locationText].attributes[\"value\"] = \"3\"\n\n locationText = \"HouseFile/House/HeatingCooling/Type2/AirConditioning\"\n elements[locationText].add_element(\"CoolingParameters\")\n locationText = \"HouseFile/House/HeatingCooling/Type2/AirConditioning/CoolingParameters\"\n elements[locationText].attributes[\"sensibleHeatRatio\"] = \"0.76\"\n elements[locationText].attributes[\"openableWindowArea\"] = \"20\"\n elements[locationText].add_element(\"FansAndPump\")\n locationText = \"HouseFile/House/HeatingCooling/Type2/AirConditioning/CoolingParameters/FansAndPump\"\n elements[locationText].attributes[\"flowRate\"] = \"0\"\n elements[locationText].add_element(\"Mode\")\n locationText = \"HouseFile/House/HeatingCooling/Type2/AirConditioning/CoolingParameters/FansAndPump/Mode\"\n elements[locationText].attributes[\"code\"] = \"1\"\n elements[locationText].add_element(\"English\")\n elements[locationText].add_element(\"French\")\n locationText = \"HouseFile/House/HeatingCooling/Type2/AirConditioning/CoolingParameters/FansAndPump\"\n elements[locationText].add_element(\"Power\")\n locationText = \"HouseFile/House/HeatingCooling/Type2/AirConditioning/CoolingParameters/FansAndPump/Power\"\n elements[locationText].attributes[\"isCalculated\"] = \"true\"\n end\nend", "title": "" }, { "docid": "e266f175b79ded22d5b0de7423f5407e", "score": "0.45078418", "text": "def parse(doc)\n mime = doc.properties[:mime_type]\n pdoc = PlanR::ParsedDocument.new(name, doc)\n begin\n ['text/html', 'application/xhtml+xml'].include?(mime) ?\n parse_html(pdoc, doc.contents) :\n parse_xml(pdoc, doc.contents)\n rescue Exception => e\n $stderr.puts 'Nokigiri :parse_doc Exception: ' + e.message\n $stderr.puts e.backtrace[0..5].join(\"\\n\")\n end\n pdoc\n end", "title": "" }, { "docid": "b30de945a0b0646ad5e119daf6b0c6df", "score": "0.44963822", "text": "def parse_xml(pdoc, data)\n # TODO: DTD, etc\n src = ::Nokogiri::XML(data)\n extract_plaintext(src.root, pdoc)\n pdoc.content_type=\"application/xml; charset=#{src.encoding}\"\n end", "title": "" }, { "docid": "84230e4add3745f1fda1290e23db2ab3", "score": "0.44917282", "text": "def simpleType( elem, context = XSDContext.new )\n composer = context.parent\n\n #puts \"IN simpleType - #{composer.inspect}\"\n if(composer.nil? )\n # SimpleType to store as high level Type\n\n if(elem.attributes['name'])\n parent = find_or_create_asset_and_root( elem.attributes['name'] )\n elsif\n # TODO - what should we do here ?\n puts \"#### TODO - SIMPLE TYPE WITH NO NAME : #{elem.inspect}\"\n end\n else\n if( elem.attributes['name'] )\n parent = ReadFromXSD::add_composer( composer.asset, elem.attributes['name'], composer)\n else\n parent = create_anonymous(composer)\n end\n end\n\n ctype = BasicType.multi_find_by_name( 'simpleType', 'xsd' ) unless ctype\n\n parent.create_composer_type( :klass => ctype ) if ctype\n\n next_context = XSDContext.new(parent)\n\n descend_tree( elem, next_context )\n end", "title": "" }, { "docid": "f5d31cb4df4f4e07d962dab16ed68861", "score": "0.4489477", "text": "def checkCreatePV( elements )\n if ( elements[\"HouseFile/House/Generation/PhotovoltaicSystems\"] == nil )\n locationText = \"HouseFile/House/Generation\"\n elements[locationText].add_element(\"PhotovoltaicSystems\")\n locationText = \"HouseFile/House/Generation/PhotovoltaicSystems\"\n elements[locationText].add_element(\"System\")\n locationText = \"HouseFile/House/Generation/PhotovoltaicSystems/System\"\n elements[locationText].attributes[\"rank\"] = \"1\"\n elements[locationText].add_element(\"EquipmentInformation\")\n elements[locationText].add_element(\"Array\")\n locationText = \"HouseFile/House/Generation/PhotovoltaicSystems/System/Array\"\n elements[locationText].attributes[\"area\"] = \"50\"\n elements[locationText].attributes[\"slope\"] = \"42\"\n elements[locationText].attributes[\"azimuth\"] = \"0\"\n\n locationText = \"HouseFile/House/Generation/PhotovoltaicSystems/System\"\n elements[locationText].add_element(\"Efficiency\")\n locationText = \"HouseFile/House/Generation/PhotovoltaicSystems/System/Efficiency\"\n elements[locationText].attributes[\"miscellaneousLosses\"] = \"3\"\n elements[locationText].attributes[\"otherPowerLosses\"] = \"1\"\n elements[locationText].attributes[\"inverterEfficiency\"] = \"90\"\n elements[locationText].attributes[\"gridAbsorptionRate\"] = \"90\"\n\n locationText = \"HouseFile/House/Generation/PhotovoltaicSystems/System\"\n elements[locationText].add_element(\"Module\")\n locationText = \"HouseFile/House/Generation/PhotovoltaicSystems/System/Module\"\n elements[locationText].attributes[\"efficiency\"] = \"13\"\n elements[locationText].attributes[\"cellTemperature\"] = \"45\"\n elements[locationText].attributes[\"coefficientOfEfficiency\"] = \"0.4\"\n elements[locationText].add_element(\"Type\")\n locationText = \"HouseFile/House/Generation/PhotovoltaicSystems/System/Module/Type\"\n elements[locationText].attributes[\"code\"] = \"1\"\n elements[locationText].add_element(\"English\")\n elements[locationText].add_element(\"French\")\n end\nend", "title": "" }, { "docid": "199f4d4ea0b38b199ba659a452a22096", "score": "0.4488291", "text": "def parse(doc)\n document = Nokogiri::XML(doc).remove_namespaces!\n @formats.each do |key, format|\n if document.xpath(format.finder).length > 0\n return self.send(\"parse_#{key}\".to_sym, doc)\n end\n end\n raise \"Error: Parser not found!\"\n end", "title": "" }, { "docid": "e731f046656d2232131abf9f1581a758", "score": "0.44862074", "text": "def seek_to_tag(xml, tag_name)\n ret = true\n while ret==true && !is_a(xml, tag_name)\n ret = xml.read\n end\n ret\nend", "title": "" }, { "docid": "d3a7b2f1a0068b1fa41aa5cf098d2dbb", "score": "0.44825077", "text": "def parse_element(element, fields)\n # Handle properties in a special way, for better rendering and management\n properties = fields.delete('Properties')\n parse_properties(element, properties) if properties\n\n # look at the remaining fields, grabbing each one that isn't a simple string and capture them as child elements\n fields.each_pair do |field_name, field_val|\n if field_name.match(FUNCTION_REGEX)\n extracted = fields.delete(field_name) # remove the entry so that we are left with only entries that we want to treat as element fields\n nested = CFDoc::Model::Function.new(field_name)\n parse_function(nested, field_val)\n element << nested unless nested.nil?\n elsif field_name.match(REF_REGEX)\n ref = CFDoc::Model::Ref.new(field_val)\n element << ref\n elsif field_name.match(DESCRIPTION_REGEX) and element.metadata? # only process this if it is part of a Metadata element\n fields.delete(field_name)\n desc = CFDoc::Model::Description.new(field_name, field_val)\n element << desc\n elsif field_name.match(PLATFORM_REGEX) and element.metadata? # only process this if it is part of a Metadata element\n fields.delete(field_name)\n vendor = CFDoc::Model::Platform.new(field_name, field_val)\n element << vendor\n elsif field_name.match(METADATA_REGEX)\n metadata = CFDoc::Model::Metadata.new(field_name)\n parse_element(metadata, field_val)\n element << metadata\n elsif field_val.kind_of?(Array)\n # don't do anything - it will be captured as a field whose value is an array\n elsif field_val.kind_of?(Hash)\n extracted = fields.delete(field_name) # remove the entry so that we are left with only entries that we want to treat as element fields\n nested = CFDoc::Model::Element.new(field_name)\n parse_element(nested, extracted)\n element << nested unless nested.nil?\n end\n end\n\n element.fields = fields\n element\n end", "title": "" }, { "docid": "023581dae8b497a32a59acf42447cb0f", "score": "0.4482253", "text": "def parse(document_xml)\n @xml = Nokogiri::XML(document_xml)\n\n # Iterate over each element node and dispatch it to the appropriate parser\n @xml.xpath('//w:body').children.each do |node|\n case node.name\n when 'p'\n no_numbering_prop = node.xpath('.//w:numPr').length.zero? || node.xpath('.//w:numPr/w:ilvl | .//w:numPr/w:numId').length.zero?\n not_multiparagraph_list_item = (@buffer.is_a?(Swordfish::Node::List) ? node.xpath('.//w:ind[@w:left]').length.zero? : true)\n if no_numbering_prop && not_multiparagraph_list_item\n # Regular paragraph\n # (The buffer check makes sure that this isn't an indented paragraph immediately after a list item,\n # which means we're most likely dealing with a multi-paragraph list item)\n flush\n @swordfish_doc.append _node_parse_paragraph(node)\n elsif node.xpath('.//w:numPr/ancestor::w:pPrChange').length.zero?\n # List paragraph\n # (must have a numPr node, but cannot have a pPrChange ancestor, since that means\n # we are just looking at historical changes)\n # (Don't flush because we need to first ensure the list is fully parsed)\n _node_parse_list(node)\n end\n when 'tbl'\n flush\n @swordfish_doc.append _node_parse_table(node)\n end\n end\n flush\n end", "title": "" }, { "docid": "508a3e204f7339a977d953951086a9aa", "score": "0.4479427", "text": "def process_value element\n case element.name\n when 'date'\n Time.parse(element.content)\n when 'string'\n element.content\n when 'real'\n element.content.to_f\n when 'true'\n true\n when 'false'\n false\n when 'array'\n element.xpath('*').map{ |e| process_value(e) }\n when 'dict'\n process_dict(element)\n end\n end", "title": "" }, { "docid": "0cd03d690b36ad3bd5401dd89509b5e4", "score": "0.4479365", "text": "def parse(io)\n self.doc = Nokogiri::XML(io)\n end", "title": "" }, { "docid": "09be4616d0e5ee6575fd5c7e6449347d", "score": "0.44780704", "text": "def XOcheckFor(tag, tvalue)\n\t\turl= @wwBrws.url.to_s\n\t\tres=OK\n\t\t$alog.lwrite(('Checking element '+tag.to_s+' with value /'+tvalue+'/'), 'DEBG')\n\t\tbegin\n\t\t\t$pfd.tstart( url)\n\t\t\tfound= findElement(tag, tvalue)\n\t\t\tif(found)\n\t\t\t\t$pfd.calcApplRes(true,'Check: '+tag.to_s+' found:/'+tvalue+'/', url)\n\t\t\t\tres= OK\n\t\t\telse\n\t\t\t\t$pfd.calcApplRes(true, tag.to_s+' not found. Value: /'+tvalue+'/ '+$!.to_s, url)\n\t\t\t\tres= WARNING\n\t\t\tend\n\t\trescue\n\t\t\tmsg= tag.to_s+' not selectable. Value: /'+tvalue+'/ '+$!.to_s\n\t\t\tres= setResCritical( msg)\n\t\tend\n\t\treturn res\n\tend", "title": "" }, { "docid": "5a38af380c6a7409e610c1e3f347a7a5", "score": "0.44739008", "text": "def prepare_types(elements)\n return if not elements\n elements.elements.each(\"typedef\") do\n |typedef|\n @types[typedef.attributes[\"name\"]]=typedef.attributes[\"basetype\"]\n format=typedef.elements[\"format\"].text\n if format =~ /^d-[0-9]+$/\n @decimals[typedef.attributes[\"name\"]]=format.sub(/^d-/,\"\").to_i\n end\n end\n end", "title": "" }, { "docid": "5066821f77a235b61fd6498b5ea2c081", "score": "0.4470889", "text": "def initialize\n\t@xml = '<?xml version=\"1.0\"?>\n<?misc:processingInstruction \"with arguments\"?>\n<?other:piNoArgs ?>\n<!DOCTYPE outer PUBLIC \"public id\" \"foobar\" [\n <!ENTITY foo \"bletch\">\n <!ELEMENT el>\n <!ATTLIST el EMPTY>\n <!NOTATION notation ignored>\n]>\n<!-- comment -->\n<outer>\n data&amp;&foo;\nmore on next line<simpleTag>text</simpleTag>\n<inner:tag a=\"tabs\tto\tspaces&foo;\"/><![CDATA[xx<z&xx</\nnewline in cdata\n]]>\n<p>text <b>bold café coffee</b> more text</p>\n</outer>'\n\n\temptyAttrs = Hash.new()\n\t@newlineTok = NQXML::Text.new(\"\\n\")\n\n\tattrs = Hash.new()\n\tattrs['version'] = '1.0'\n\t@xmlDecl = NQXML::XMLDecl.new('xml', attrs, '<?xml version=\"1.0\"?>')\n\n\tsrc = '<?misc:processingInstruction \"with arguments\"?>'\n\t@piWithArgs =\n\t NQXML::ProcessingInstruction.new('misc:processingInstruction',\n\t\t\t\t\t '\"with arguments\"', src)\n\n\t@piNoArgs = NQXML::ProcessingInstruction.new('other:piNoArgs', '',\n\t\t\t\t\t\t '<?other:piNoArgs ?>')\n\n\t@entityTag =\n\t NQXML::GeneralEntityTag.new('foo', 'bletch', nil, nil,\n\t\t\t\t\t'<!ENTITY foo \"bletch\">')\n\t@element = NQXML::Element.new('el', '', '<!ELEMENT el>')\n\t@attlist = NQXML::Attlist.new('el', 'EMPTY', '<!ATTLIST el EMPTY>')\n\t@notation = NQXML::Notation.new('notation', 'ignored',\n\t\t\t\t\t'<!NOTATION notation ignored>')\n\t@doctypePubid =\n\t NQXML::PublicExternalID.new('\"public id\"', '\"foobar\"',\n\t\t\t\t\t'PUBLIC \"public id\" \"foobar\"')\n\t@doctype =\n\t NQXML::Doctype.new('outer', @doctypePubid,\n\t\t\t [@entityTag, @element, @attlist, @notation],\n\t\t\t \"<!DOCTYPE outer PUBLIC \\\"public id\\\" \\\"foobar\\\" [\\n\" +\n\t\t\t \" <!ENTITY foo \\\"bletch\\\">\\n\" +\n\t\t\t \" <!ELEMENT el>\\n\" +\n\t\t\t \" <!ATTLIST el EMPTY>\\n\" +\n\t\t\t \" <!NOTATION notation ignored>\\n\" +\n\t\t\t \"]>\")\n\n\t@comment = NQXML::Comment.new('<!-- comment -->')\n\t@outerStart = NQXML::Tag.new('outer', emptyAttrs, false, '<outer>')\n\t@textDataWithSub = NQXML::Text.new(\"\\n data&bletch\\nmore on next line\")\n\t@simpleTagStart = NQXML::Tag.new('simpleTag', emptyAttrs, false,\n\t\t\t\t\t '<simpleTag>')\n\t@simpleTextData = NQXML::Text.new('text')\n\t@simpleTagEnd = NQXML::Tag.new('simpleTag', nil, true, '</simpleTag>')\n\n\tattrs = Hash.new()\n\tattrs['a'] = 'tabs to spacesbletch'\n\t@innerTagStart = NQXML::Tag.new('inner:tag', attrs, false,\n\t\t\t\t\t'<inner:tag a=\"tabs\tto\tspaces&foo;\"/>')\n\n\t@innerTagEnd = NQXML::Tag.new('inner:tag', nil, true,\n\t\t\t\t\t'<inner:tag a=\"tabs\tto\tspaces&foo;\"/>')\n\t@pTagStart = NQXML::Tag.new('p', emptyAttrs, false, '<p>')\n\t@pTagEnd = NQXML::Tag.new('p', nil, true, '</p>')\n\t@bTagStart = NQXML::Tag.new('b', emptyAttrs, false, '<b>')\n\t@bTagEnd = NQXML::Tag.new('b', nil, true, '</b>')\n\t@textText = NQXML::Text.new('text ')\n\t@boldText = NQXML::Text.new('bold café coffee')\n\t@moreTextText = NQXML::Text.new(' more text')\n\n\t@cdata = NQXML::Text.new(\"xx<z&xx</\\nnewline in cdata\\n\",\n\t\t\t\t \"<![CDATA[xx<z&xx</\\nnewline in cdata\\n]]>\")\n\t@outerEnd = NQXML::Tag.new('outer', nil, true, '</outer>')\n\n\t@sub1_xml = '<?xml version=\"1.0\"?>\n<!DOCTYPE outer SYSTEM \"foobar\" [\n <!ENTITY example \"<p>An ampersand (&#38;#38;) may be escaped numerically (&#38;#38;#38;) or with a general entity (&amp;amp;).</p>\" >\n]>\n'\n\tsrc = '<!ENTITY example \"<p>An ampersand (&#38;#38;) may be' +\n\t ' escaped numerically (&#38;#38;#38;) or with a general entity' +\n\t ' (&amp;amp;).</p> >'\n\tval = \"<p>An ampersand (&#38;) may be escaped numerically\" +\n\t \" (&#38;#38;) or with a general entity (&amp;amp;).</p>\"\n\t@sub1Entity = NQXML::GeneralEntityTag.new('example', val, nil, nil,\n\t\t\t\t\t\t src)\n\t\t\t\t\t\t\n\t@sub2_xml = '<?xml version=\"1.0\"?>\n<!DOCTYPE test [\n<!ELEMENT test (#PCDATA) >\n<!ENTITY % xx \\'&#37;zz;\\'>\n<!ENTITY % zz \\'&#60;!ENTITY tricky \"error-prone\" >\\' >\n%xx;\n]>\n<test>This sample shows a &tricky; method.</test>\n'\n\t@xxEntity =\n\t NQXML::ParameterEntityTag.new('xx', '%zz;', nil,\n\t\t\t\t\t '<!ENTITY % zz \\'&#37;zz;\\'>')\n\n\tsrc = '<!ENTITY % zz \\'&#60;!ENTITY tricky \"error-prone\" >\\' >'\n\tval = '<!ENTITY tricky \"error-prone\" >'\n\t@zzEntity = NQXML::ParameterEntityTag.new('zz', val, nil, src)\n end", "title": "" }, { "docid": "bc520ab8d21a77ca9b2d0ce30a42b9ef", "score": "0.44634017", "text": "def parse(xml, parse_ext = false)\n if @external\n @tree = @document.createDocumentFragment\n else\n @tree = @document\n end\n @parse_ext = parse_ext\n @current = @tree\n @inDocDecl = 0\n @decl = \"\"\n @inDecl = 0\n @idRest = 0\n @extID = nil\n @cdata_f = false\n @cdata_buf = ''\n @nsdecl = []\n super(xml)\n @tree\n end", "title": "" }, { "docid": "feab678ed2caef0de49a5edd403c10d6", "score": "0.44630286", "text": "def parse(xml)\n raise NotImplementedError, \"inheritor should define #{__method__}\"\n end", "title": "" }, { "docid": "eea38f65920137bad10275a3e776dd2b", "score": "0.44615608", "text": "def parse(element, return_data_type='string', filter_negative_fields=true)\n raise ArgumentError.new('parse(element) requires element name or spec (Hash) argument') if element.nil?\n\n element_spec = nil\n case\n when element.is_a?(Hash)\n element_spec = element\n else\n element_spec = get_spec(element)\n end\n\n return if element_spec.nil?\n\n return_data_type ||= element_spec['data_type']\n\n return_data_type.downcase!\n\n # TODO This is a bit odd... in that the yml file contains much more granular data types that we could take advantage of\n return_data_type = 'string' unless ['string', 'object', 'raw'].include?(return_data_type)\n\n xpath = \"//#{element_spec['node']}\"\n\n begin\n nodes = xml_doc.xpath(xpath)\n\n if element_spec['is_multi_entry'].to_i.eql?(1)\n values = []\n nodes.each do |node|\n case return_data_type\n when 'string' then values << get_str(element_spec, node)\n when 'object' then values << get_obj(element_spec, node, filter_negative_fields)\n when 'raw' then values << get_raw(element_spec, node)\n end\n end if nodes\n return values.size > 1 ? values : values.first\n else\n value = \"\"\n node = nodes && nodes.first or nil\n case return_data_type\n when 'string' then value = get_str(element_spec, node)\n when 'object' then value = get_obj(element_spec, node, filter_negative_fields)\n when 'raw' then value = get_raw(element_spec, node)\n end if node\n return value\n end\n rescue Nokogiri::XML::XPath::SyntaxError => err\n puts \"Element [#{xpath}] Syntax Error: #{err}\"\n rescue Exception => err\n puts \"Element [#{xpath}] unknown parsing error: #{err}\"\n end\n end", "title": "" }, { "docid": "3a35760e5bf1ea765e960444e074187d", "score": "0.44545743", "text": "def valid_xml?(xml)\n create_document(xml) != nil\nend", "title": "" }, { "docid": "8cc79d0118736a365b2b8c7178b891d2", "score": "0.44480026", "text": "def proofread_document(xml)\n use_document(xml)\n proofread # returns valid?\n end", "title": "" }, { "docid": "3c6e8a741fffac11acf15ff69d617b04", "score": "0.44432604", "text": "def determine_type(xml)\n id_element = xml.scan(/<id.*?\\/id/).first\n matches = id_element.scan(TYPE_MATCH).flatten\n\n matches.join '_'\n end", "title": "" } ]
fd41cb22a8e170195506e07a4a5e1b08
Set Delivery Service Configure the delivery service type used as the destination for messages received at a FoneNumber.
[ { "docid": "c6a746596546a54c48d9d4cbb76281ce", "score": "0.0", "text": "def configure_message_receive_0(fonenumber, type, value, url_method, opts = {})\n data, _status_code, _headers = configure_message_receive_0_with_http_info(fonenumber, type, value, url_method, opts)\n return data\n end", "title": "" } ]
[ { "docid": "7d9a27567228eeca04119fdbf7f81a9a", "score": "0.6993159", "text": "def set_delivery_type\n @delivery_type = DeliveryType.find(params[:id])\n end", "title": "" }, { "docid": "1db9fd8ca240529fc43deb78a9cb25a7", "score": "0.69387317", "text": "def set_ShippingService(value)\n set_input(\"ShippingService\", value)\n end", "title": "" }, { "docid": "1db9fd8ca240529fc43deb78a9cb25a7", "score": "0.69387317", "text": "def set_ShippingService(value)\n set_input(\"ShippingService\", value)\n end", "title": "" }, { "docid": "1db9fd8ca240529fc43deb78a9cb25a7", "score": "0.69387317", "text": "def set_ShippingService(value)\n set_input(\"ShippingService\", value)\n end", "title": "" }, { "docid": "554d83be27913a67728d3985ec74a3f2", "score": "0.66468245", "text": "def set_delivery_type\n @delivery_type = DeliveryType.find(params[:id])\n end", "title": "" }, { "docid": "7012a992b15c0b55fd2b594d0ff5c1f3", "score": "0.66276956", "text": "def set_delivery\n @delivery = Shop::Delivery.find(params[:id])\n end", "title": "" }, { "docid": "8250000185007195b726dea4d7ac5d71", "score": "0.6571858", "text": "def set_delivery_method\n @delivery_method = DeliveryMethod.find(params[:id])\n end", "title": "" }, { "docid": "90e161bb820ea45bcac341cc66a51895", "score": "0.646026", "text": "def set_delivery\n @delivery = Delivery.find(params[:id])\n end", "title": "" }, { "docid": "90e161bb820ea45bcac341cc66a51895", "score": "0.646026", "text": "def set_delivery\n @delivery = Delivery.find(params[:id])\n end", "title": "" }, { "docid": "90e161bb820ea45bcac341cc66a51895", "score": "0.646026", "text": "def set_delivery\n @delivery = Delivery.find(params[:id])\n end", "title": "" }, { "docid": "90e161bb820ea45bcac341cc66a51895", "score": "0.646026", "text": "def set_delivery\n @delivery = Delivery.find(params[:id])\n end", "title": "" }, { "docid": "90e161bb820ea45bcac341cc66a51895", "score": "0.646026", "text": "def set_delivery\n @delivery = Delivery.find(params[:id])\n end", "title": "" }, { "docid": "90e161bb820ea45bcac341cc66a51895", "score": "0.646026", "text": "def set_delivery\n @delivery = Delivery.find(params[:id])\n end", "title": "" }, { "docid": "90e161bb820ea45bcac341cc66a51895", "score": "0.646026", "text": "def set_delivery\n @delivery = Delivery.find(params[:id])\n end", "title": "" }, { "docid": "90e161bb820ea45bcac341cc66a51895", "score": "0.646026", "text": "def set_delivery\n @delivery = Delivery.find(params[:id])\n end", "title": "" }, { "docid": "90e161bb820ea45bcac341cc66a51895", "score": "0.646026", "text": "def set_delivery\n @delivery = Delivery.find(params[:id])\n end", "title": "" }, { "docid": "90e161bb820ea45bcac341cc66a51895", "score": "0.646026", "text": "def set_delivery\n @delivery = Delivery.find(params[:id])\n end", "title": "" }, { "docid": "90e161bb820ea45bcac341cc66a51895", "score": "0.646026", "text": "def set_delivery\n @delivery = Delivery.find(params[:id])\n end", "title": "" }, { "docid": "90e161bb820ea45bcac341cc66a51895", "score": "0.646026", "text": "def set_delivery\n @delivery = Delivery.find(params[:id])\n end", "title": "" }, { "docid": "90e161bb820ea45bcac341cc66a51895", "score": "0.646026", "text": "def set_delivery\n @delivery = Delivery.find(params[:id])\n end", "title": "" }, { "docid": "90e161bb820ea45bcac341cc66a51895", "score": "0.646026", "text": "def set_delivery\n @delivery = Delivery.find(params[:id])\n end", "title": "" }, { "docid": "90e161bb820ea45bcac341cc66a51895", "score": "0.646026", "text": "def set_delivery\n @delivery = Delivery.find(params[:id])\n end", "title": "" }, { "docid": "bad6f1c937269d7075da5344d9e33d6a", "score": "0.6315174", "text": "def set_delivery\n @agent_delivery = @site.deliveries.find(params[:id])\n end", "title": "" }, { "docid": "1c8223fc05fe44ce67cb8a87959485f1", "score": "0.630381", "text": "def set_delivery\n @delivery = Delivery.friendly.find(params[:id])\n end", "title": "" }, { "docid": "4acacbce95d175d0bf7ce74668a6bed6", "score": "0.62662584", "text": "def set_ShippingType(value)\n set_input(\"ShippingType\", value)\n end", "title": "" }, { "docid": "4acacbce95d175d0bf7ce74668a6bed6", "score": "0.62662584", "text": "def set_ShippingType(value)\n set_input(\"ShippingType\", value)\n end", "title": "" }, { "docid": "4acacbce95d175d0bf7ce74668a6bed6", "score": "0.62662584", "text": "def set_ShippingType(value)\n set_input(\"ShippingType\", value)\n end", "title": "" }, { "docid": "566de78d68676109384d452ec6a620eb", "score": "0.6238236", "text": "def set_delivery\n if params.has_key?(:id)\n @delivery = Order.find(params[:id])\n else\n @delivery = active_delivery\n end\n end", "title": "" }, { "docid": "e89c08673702af824988c1afda744e0a", "score": "0.6201849", "text": "def set_delivery\n @delivery = current_user.deliveries.find(params[:id])\n end", "title": "" }, { "docid": "1e95ae66aaeb3fa199ae424d176ffe6e", "score": "0.6177126", "text": "def set_ShippingServiceCost(value)\n set_input(\"ShippingServiceCost\", value)\n end", "title": "" }, { "docid": "1e95ae66aaeb3fa199ae424d176ffe6e", "score": "0.6176393", "text": "def set_ShippingServiceCost(value)\n set_input(\"ShippingServiceCost\", value)\n end", "title": "" }, { "docid": "1e95ae66aaeb3fa199ae424d176ffe6e", "score": "0.6176393", "text": "def set_ShippingServiceCost(value)\n set_input(\"ShippingServiceCost\", value)\n end", "title": "" }, { "docid": "3a6c92d37ca84ee1f042d7440e45b4ca", "score": "0.61745006", "text": "def set_test_delivery\n @test_delivery = TestDelivery.find(params[:id])\n end", "title": "" }, { "docid": "b5fd3e45906cacf1c4f3bbc8c5cf0f9a", "score": "0.61511487", "text": "def set_delivery\n @delivery = Delivery.find(params[:id])\n end", "title": "" }, { "docid": "8ef83115806ac5d63ab404b2946d2b63", "score": "0.6142036", "text": "def delivery_service\n super || available_delivery_services.first\n end", "title": "" }, { "docid": "64761a796375a9346355e5840ad49f57", "score": "0.6141358", "text": "def delivery_klass\n case delivery_method\n when \"noop\"\n Delivery::Noop\n when \"logger\"\n Delivery::Logger\n when \"letter_opener\"\n Delivery::LetterOpener\n else\n Delivery::Postback\n end\n end", "title": "" }, { "docid": "64761a796375a9346355e5840ad49f57", "score": "0.6141358", "text": "def delivery_klass\n case delivery_method\n when \"noop\"\n Delivery::Noop\n when \"logger\"\n Delivery::Logger\n when \"letter_opener\"\n Delivery::LetterOpener\n else\n Delivery::Postback\n end\n end", "title": "" }, { "docid": "fa81d89f58a75c4059f055336fc961a0", "score": "0.6140738", "text": "def set_format_delivery\n @format_delivery = FormatDelivery.find(params[:id])\n end", "title": "" }, { "docid": "fa81d89f58a75c4059f055336fc961a0", "score": "0.6140738", "text": "def set_format_delivery\n @format_delivery = FormatDelivery.find(params[:id])\n end", "title": "" }, { "docid": "a5a4c08b576f62ef921b0dc166aa1949", "score": "0.61279356", "text": "def set_order_delivery\n @order_delivery = OrderDelivery.find(params[:id])\n end", "title": "" }, { "docid": "6a4c4c6c537fc033d91eaccc44ae6914", "score": "0.6125922", "text": "def delivery_type=(delivery_type)\n validator = EnumAttributeValidator.new('String', ['SLOW', 'BALANCED', 'FAST', 'BURST'])\n unless validator.valid?(delivery_type)\n fail ArgumentError, 'invalid value for \"delivery_type\", must be one of #{validator.allowable_values}.'\n end\n @delivery_type = delivery_type\n end", "title": "" }, { "docid": "09d6b2c4189e86899c7d77deb76963a5", "score": "0.60613346", "text": "def set_delivery_address\n @delivery_address = DeliveryAddress.find(params[:id])\n end", "title": "" }, { "docid": "38da67fa9ac78efd7e952e7cbc11cdc9", "score": "0.6054546", "text": "def delivery_klass\n case delivery_method\n when \"noop\"\n Delivery::Noop\n when \"logger\"\n Delivery::Logger\n when \"letter_opener\"\n Delivery::LetterOpener\n when \"sidekiq\"\n Delivery::Sidekiq\n when \"que\"\n Delivery::Que\n else\n Delivery::Postback\n end\n end", "title": "" }, { "docid": "525ab7ef70d5a2c7c8c271cffa451c77", "score": "0.60314286", "text": "def set_delivery\n @delivery = DeliveryService.search({id:params[:id]}).first\n end", "title": "" }, { "docid": "0a673f1559c5b6ef32d61f7fb8e6d7ef", "score": "0.60102165", "text": "def set_delivery_flow\n @delivery_flow = DeliveryFlow.find(params[:id])\n end", "title": "" }, { "docid": "2f857e4d30438ff2490942ef02c81f29", "score": "0.5992678", "text": "def set_delivery_status\n @delivery_status = DeliveryStatus.find(params[:id])\n end", "title": "" }, { "docid": "424a5563026f059903b47a82374236ca", "score": "0.5963416", "text": "def set_delivery_address\n @delivery_address = DeliveryAddress.where(id: params[:id], sme_user_id: current_sme_user.id).first\n end", "title": "" }, { "docid": "cd04f7e9e40f91d131f97fc96b12518f", "score": "0.5962847", "text": "def delivery_method=(delivery_method); end", "title": "" }, { "docid": "aea9b397c35f114d9773427eef22a4ad", "score": "0.5957054", "text": "def set_delivery_person\n @delivery_person = DeliveryPerson.find(params[:id])\n end", "title": "" }, { "docid": "f01bab1ec46daef7ab78548e532fcd04", "score": "0.59470874", "text": "def set_shipping_type\n @shipping_type = ShippingType.find(params[:id])\n end", "title": "" }, { "docid": "cc759d9150defd62c3070f5471b86e28", "score": "0.594018", "text": "def set_status_delivery\n @status_delivery = StatusDelivery.find(params[:id])\n end", "title": "" }, { "docid": "e91eda70c14471a5e5c48e110748c530", "score": "0.5923042", "text": "def set_delivery\n @delivery = current_user.deliveries.find(params[:id])\n end", "title": "" }, { "docid": "4138aa7d10ec78c9f60250e74b5f6cb6", "score": "0.58759725", "text": "def set_shipping_service_provider\n @shipping_service_provider = ShippingServiceProvider.find(params[:id])\n end", "title": "" }, { "docid": "9b7d10f821a1b051aaf016845d116a34", "score": "0.5869984", "text": "def delivery_services_edit(delivery_service)\n code = delivery_service[:code]\n url = \"#{@url}reference/delivery-services/#{code}/edit\"\n @params[:deliveryService] = delivery_service.to_json\n make_request(url, 'post')\n end", "title": "" }, { "docid": "773f8e7555db0908bb0189008eca3a45", "score": "0.58441997", "text": "def set_delivery_item\n @delivery_item = DeliveryItem.find(params[:id])\n end", "title": "" }, { "docid": "02d2e32f5e5518279b8ae92948f8eaef", "score": "0.5817334", "text": "def delivery_method=(delivery_method)\n @delivery_method = delivery_method\n end", "title": "" }, { "docid": "494a4ee7249b146eb42c1fb13c55fca3", "score": "0.57812095", "text": "def service_type=(value)\n @service_type = value\n end", "title": "" }, { "docid": "984699a44e1771c1398596f6238c0616", "score": "0.57571256", "text": "def shipping=(shipping)\n @shipping = ensure_type(Shipping, shipping)\n end", "title": "" }, { "docid": "984699a44e1771c1398596f6238c0616", "score": "0.57571256", "text": "def shipping=(shipping)\n @shipping = ensure_type(Shipping, shipping)\n end", "title": "" }, { "docid": "984699a44e1771c1398596f6238c0616", "score": "0.57571256", "text": "def shipping=(shipping)\n @shipping = ensure_type(Shipping, shipping)\n end", "title": "" }, { "docid": "7de20a7942bbbe13bca97f7e1d610a26", "score": "0.5752072", "text": "def delivery_method\n settings[:delivery_method]\n end", "title": "" }, { "docid": "a16375aa3085fc6229210364d32766b9", "score": "0.5745479", "text": "def set_delivery_detail\n @delivery_detail = DeliveryDetail.find(params[:id])\n end", "title": "" }, { "docid": "706eddd3570bef5ec102956d78aba84a", "score": "0.5733599", "text": "def delivery_method(value = nil)\n value ? @delivery_method = lookup_delivery_method(value) : @delivery_method ||= Mail::SMTP\n end", "title": "" }, { "docid": "9d5c1e5e0e5fe259a33ae3bc0fc80099", "score": "0.5730769", "text": "def set_DestinationType(value)\n set_input(\"DestinationType\", value)\n end", "title": "" }, { "docid": "850249d63bd14f4ffa9bca13643079ce", "score": "0.57280356", "text": "def set_delivery_entry\n @delivery_entry = DeliveryEntry.find(params[:id])\n end", "title": "" }, { "docid": "c5e12508967f9f0181742f3b93587a10", "score": "0.57081515", "text": "def service_type\n if @recipient[:residential].to_s =~ /true/i and @service_type =~ /GROUND/i and @recipient[:country_code] =~ /US/i\n \"GROUND_HOME_DELIVERY\"\n else\n @service_type\n end\n end", "title": "" }, { "docid": "c5e12508967f9f0181742f3b93587a10", "score": "0.57081515", "text": "def service_type\n if @recipient[:residential].to_s =~ /true/i and @service_type =~ /GROUND/i and @recipient[:country_code] =~ /US/i\n \"GROUND_HOME_DELIVERY\"\n else\n @service_type\n end\n end", "title": "" }, { "docid": "34bad36da5ebee0091ae57df032bba80", "score": "0.5699847", "text": "def service=(value)\n @service = value\n end", "title": "" }, { "docid": "34bad36da5ebee0091ae57df032bba80", "score": "0.5699847", "text": "def service=(value)\n @service = value\n end", "title": "" }, { "docid": "34bad36da5ebee0091ae57df032bba80", "score": "0.5699847", "text": "def service=(value)\n @service = value\n end", "title": "" }, { "docid": "34bad36da5ebee0091ae57df032bba80", "score": "0.5699847", "text": "def service=(value)\n @service = value\n end", "title": "" }, { "docid": "270f42023d27fc84ddb74aea69bf4633", "score": "0.56926817", "text": "def set_food_delivery\n @food_delivery = FoodDelivery.friendly.find(params[:id])\n end", "title": "" }, { "docid": "641a897d8299136c90a6da133b535f00", "score": "0.5678823", "text": "def set_delivery_plan\n @delivery_plan = DeliveryPlan.find(params[:id])\n end", "title": "" }, { "docid": "127ff57694904e66f2f442769874ff5c", "score": "0.5676764", "text": "def delivery_method(method = nil, settings = nil)\n @delivery_method = method\n end", "title": "" }, { "docid": "9d87b85979675e7ce7777af150ba6a3c", "score": "0.56712544", "text": "def set_delivery_list\n @delivery_list = DeliveryList.find(params[:id])\n end", "title": "" }, { "docid": "9d87b85979675e7ce7777af150ba6a3c", "score": "0.56712544", "text": "def set_delivery_list\n @delivery_list = DeliveryList.find(params[:id])\n end", "title": "" }, { "docid": "5f4d723cdefe3984df7829b611edcf9b", "score": "0.5648507", "text": "def remove_delivery_service_if_invalid\n unless self.valid_delivery_service?\n self.delivery_service = nil\n self.save\n end\n end", "title": "" }, { "docid": "28d5422f1257cad2ab59cd0ee2c501c7", "score": "0.56472534", "text": "def set_delivery_slip_processing\n @delivery_slip_processing = DeliverySlipProcessing.find(params[:id])\n end", "title": "" }, { "docid": "a778ac2086dbc965596ce297b78827a9", "score": "0.5624884", "text": "def set_mail_delivery\n @mail_delivery = MailDelivery.find(params[:id])\n end", "title": "" }, { "docid": "9a7a99d9ef6770703cdfe4e0ac2d442d", "score": "0.5614467", "text": "def delivery_action=(value)\n @delivery_action = value\n end", "title": "" }, { "docid": "0e744281313db545c87c6aeb76147019", "score": "0.5605247", "text": "def set_offer_delivery\n @offer_delivery = OfferDelivery.find(params[:id])\n end", "title": "" }, { "docid": "b53805d9dd4ed4d29bd197936e02832d", "score": "0.5565764", "text": "def delivery_method; end", "title": "" }, { "docid": "b53805d9dd4ed4d29bd197936e02832d", "score": "0.5565764", "text": "def delivery_method; end", "title": "" }, { "docid": "b53805d9dd4ed4d29bd197936e02832d", "score": "0.5565764", "text": "def delivery_method; end", "title": "" }, { "docid": "7d0a1ef8284b8f2eae0b221f8ada0106", "score": "0.5559664", "text": "def set_service_type_service\n @service_type_service = ServiceTypeService.find(params[:id])\n end", "title": "" }, { "docid": "bf4c6afc432a8e85bb0825d0c2cf0cfc", "score": "0.55413723", "text": "def set_delivery\n @delivery = Delivery.find(params[:id])\n @order = @delivery.order\n @orders = (@order.customer.undelivered_orders << @order).uniq\n @order_items = OrderItem.where(\"(orderable_id = ? AND orderable_type = 'Order') OR (orderable_id = ? AND orderable_type = 'Delivery')\", @order.id, @delivery.id).group_by(&:product_id)\n end", "title": "" }, { "docid": "f308f96e019969327ea9353c779ae422", "score": "0.5535023", "text": "def set_request_delivery\n @request_delivery = RequestDelivery.find(params[:id])\n end", "title": "" }, { "docid": "a80de774e799132534d0ecd188de6e1e", "score": "0.55271506", "text": "def set_contractor_delivery\n location.can_deliver?(to: delivery_spot.coordinates)\n if location.delivery_via_contractor\n self.contractor_delivery = true\n self.order_type = Order::CONTRACTOR\n self.contractor_id = location.contractor_available(to: delivery_spot.coordinates).id\n end\n end", "title": "" }, { "docid": "05254a55acf2e9c4046ca69498ab2de5", "score": "0.55149585", "text": "def set_Service(value)\n set_input(\"Service\", value)\n end", "title": "" }, { "docid": "08fa91fa72d76f4dfa31053d91778bb5", "score": "0.55050755", "text": "def delivery_date=(date)\n date = Date.parse(date) if date.is_a?(String)\n\n order.delivery_date = date\n order.dispatch_date = DispatchDeliveryDate.dispatch_date(spec, date)\n order.save if valid?\n end", "title": "" }, { "docid": "0779ed33e8af2a3259bf5b8f77d6caaa", "score": "0.547939", "text": "def delivery_mode_sym=(mode)\n val = case mode\n when :persistent\n JMS::DeliveryMode::PERSISTENT\n when :non_persistent\n JMS::DeliveryMode::NON_PERSISTENT\n else\n raise \"Unknown delivery mode symbol: #{mode}\"\n end\n self.delivery_mode = val\n end", "title": "" }, { "docid": "bf07556e2f5c69058b915edaec2995d1", "score": "0.5474881", "text": "def destination_service_name=(value)\n @destination_service_name = value\n end", "title": "" }, { "docid": "c1e60aab003699371d9b93535b019823", "score": "0.5472956", "text": "def set_postal_delivery_address\n delivery_address || client.delivery_address || client.postal_address || build_delivery_address\n end", "title": "" }, { "docid": "dfbac582c0d96e07decb69b47b29232e", "score": "0.5465288", "text": "def set_service_to_type\n @service_to_type = ServiceToType.find(params[:id])\n end", "title": "" }, { "docid": "30bf8e6f33cc5e472a8a66f205aaf801", "score": "0.5463016", "text": "def set_delivery_office\n @delivery_office = DeliveryOffice.find(params[:id])\n end", "title": "" }, { "docid": "f8945585f6865ace8616b7a9707cb1e8", "score": "0.5460032", "text": "def set_service_type\n @service_type = ServiceType.find(params[:id])\n end", "title": "" }, { "docid": "f8945585f6865ace8616b7a9707cb1e8", "score": "0.5460032", "text": "def set_service_type\n @service_type = ServiceType.find(params[:id])\n end", "title": "" }, { "docid": "f8945585f6865ace8616b7a9707cb1e8", "score": "0.5460032", "text": "def set_service_type\n @service_type = ServiceType.find(params[:id])\n end", "title": "" }, { "docid": "f8945585f6865ace8616b7a9707cb1e8", "score": "0.5460032", "text": "def set_service_type\n @service_type = ServiceType.find(params[:id])\n end", "title": "" }, { "docid": "78c211340f893fa04c2b387dddfc0bb9", "score": "0.54563004", "text": "def set_ebay_shipping_service_option\n @ebay_shipping_service_option = Ebay::ShippingServiceOption.find(params[:id])\n end", "title": "" }, { "docid": "37002642c4d84af9da9789e76575643b", "score": "0.544364", "text": "def deliverer=(val)\n @@deliverer = val\n end", "title": "" } ]
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "3d981d2cf6d16a09d2030dd80f3446b8", "score": "0.0", "text": "def glucose_params\n params.require(:glucose).permit(:user_id, :reading, :date)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.74964964", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.6957765", "text": "def strong_params\n params.require(:request).permit(param_whitelist)\n end", "title": "" }, { "docid": "c72da3a0192ce226285be9c2a583d24a", "score": "0.69230586", "text": "def strong_params\n params.require(:post).permit(param_whitelist)\n end", "title": "" }, { "docid": "3d346c1d1b79565bee6df41a22a6f28d", "score": "0.68947256", "text": "def strong_params\n params.require(:resource).permit(param_whitelist)\n end", "title": "" }, { "docid": "aa06a193f057b6be7c0713a5bd30d5fb", "score": "0.67858917", "text": "def strong_params\n params.require(:listing).permit(param_whitelist)\n end", "title": "" }, { "docid": "f6060519cb0c56a439976f0c978690db", "score": "0.6744584", "text": "def permitted_params\n params.permit!\n end", "title": "" }, { "docid": "fad8fcf4e70bf3589fbcbd40db4df5e2", "score": "0.66838515", "text": "def allowed_params\n # Only this one attribute will be allowed, no hacking\n params.require(:user).permit(:username)\n end", "title": "" }, { "docid": "b453d9a67af21a3c28a62e1848094a41", "score": "0.66377395", "text": "def strong_params\n params.require(:kpi).permit(param_whitelist)\n end", "title": "" }, { "docid": "2c8e2be272a55477bfc4c0dfc6baa7a7", "score": "0.6630126", "text": "def strong_params\n params.require(:community_member).permit(param_whitelist)\n end", "title": "" }, { "docid": "1685d76d665d2c26af736aa987ac8b51", "score": "0.66275877", "text": "def permitted_params\n params.permit!\n end", "title": "" }, { "docid": "77f5795d1b9e0d0cbd4ea67d02b5ab7f", "score": "0.6563836", "text": "def safe_params\n params.except(:host, :port, :protocol).permit!\n end", "title": "" }, { "docid": "cc1542a4be8f3ca5dc359c2eb3fb7d18", "score": "0.6491144", "text": "def strong_params\n params.require(:message).permit(param_whitelist)\n end", "title": "" }, { "docid": "e291b3969196368dd4f7080a354ebb08", "score": "0.64795035", "text": "def permitir_parametros\n \t\tparams.permit!\n \tend", "title": "" }, { "docid": "2d2af8e22689ac0c0408bf4cb340d8c8", "score": "0.64554673", "text": "def allowed_params\n params.require(:user).permit(:name, :email)\n end", "title": "" }, { "docid": "236e1766ee20eef4883ed724b83e4176", "score": "0.6400335", "text": "def param_whitelist\n [\n :name,\n :tagline, :contact, :summary, :stage,\n :website, :facebook, :twitter, :linkedin, :github,\n :founded_at,\n community_ids: [],\n sectors: [\n :commercial,\n :social,\n :research\n ],\n privacy: [\n contact: [],\n kpis: []\n ],\n permission: [\n listings: [],\n profile: [],\n posts: [],\n kpis: []\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end", "title": "" }, { "docid": "b29cf4bc4a27d4b199de5b6034f9f8a0", "score": "0.6383865", "text": "def safe_params\n params\n .require( self.class.model_class.name.underscore.to_sym )\n .permit( self.class.params_list )\n end", "title": "" }, { "docid": "bfb292096090145a067e31d8fef10853", "score": "0.63651955", "text": "def param_whitelist\n whitelist = [\n :title, :description, :skills,\n :positions, :category, :salary_period,\n :started_at, :finished_at,\n :deadline,\n :salary_min, :salary_max, :hours,\n :equity_min, :equity_max,\n :privacy,\n :owner_id, :owner_type,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n unless action_name === 'create'\n whitelist.delete(:owner_id)\n whitelist.delete(:owner_type)\n end\n \n whitelist\n end", "title": "" }, { "docid": "6bf3ed161b62498559a064aea569250a", "score": "0.63397634", "text": "def require_params\n return nil\n end", "title": "" }, { "docid": "b4c9587164188c64f14b71403f80ca7c", "score": "0.63365567", "text": "def sanitize_params!\n request.sanitize_params!\n end", "title": "" }, { "docid": "b63e6e97815a8745ab85cd8f7dd5b4fb", "score": "0.63255155", "text": "def excluded_from_filter_parameters; end", "title": "" }, { "docid": "38bec0546a7e4cbf4c337edbee67d769", "score": "0.63213927", "text": "def user_params\n # Returns a sanitized hash of the params with nothing extra\n params.permit(:name, :email, :img_url, :password)\n end", "title": "" }, { "docid": "5ec018b4a193bf3bf8902c9419279607", "score": "0.6316403", "text": "def user_params # contains strong parameters\n params.require(:user).permit(:name, :email, :password,\n :password_confirmation)\n # strong parameters disallows any post information that is not permitted (admin security) when signing_up\n # so not all users will get admin access by hacking params using curl\n end", "title": "" }, { "docid": "37d1c971f6495de3cdd63a3ef049674e", "score": "0.6315604", "text": "def param_whitelist\n whitelist = [\n :name,\n :overview,\n :website, :facebook, :twitter,\n :privacy,\n :avatar_id, :community_id, :category_ids,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n unless action_name === 'create'\n whitelist.delete(:community_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "91bfe6d464d263aa01e776f24583d1d9", "score": "0.6307638", "text": "def permitir_parametros\n params.permit!\n end", "title": "" }, { "docid": "e012d7306b402a37012f98bfd4ffdb10", "score": "0.63021296", "text": "def strong_params\n params.require(:team).permit(param_whitelist)\n end", "title": "" }, { "docid": "157e773497f78353899720ad034a906a", "score": "0.62997764", "text": "def white_list_params\n params.require(:white_list).permit(:ip, :comment)\n end", "title": "" }, { "docid": "8c384af787342792f0efc7911c3b2469", "score": "0.6296763", "text": "def whitelisted_vegetable_params\n params.require(:vegetable).permit(:name, :color, :rating, :latin_name)\n end", "title": "" }, { "docid": "0f69d0204a0c9a5e4a336cbb3dccbb2c", "score": "0.62929094", "text": "def allowed_params\n params.permit(:campaign_id,:marketer_id,:creator_id,:status)\n end", "title": "" }, { "docid": "0f69d0204a0c9a5e4a336cbb3dccbb2c", "score": "0.62929094", "text": "def allowed_params\n params.permit(:campaign_id,:marketer_id,:creator_id,:status)\n end", "title": "" }, { "docid": "9b76b3149ac8b2743f041d1af6b768b5", "score": "0.62788033", "text": "def filter_params\n params.permit(\n\t\t\t\t:name,\n\t\t\t\t:sitedefault,\n\t\t\t\t:opinions,\n\t\t\t\t:contested,\n\t\t\t\t:uncontested,\n\t\t\t\t:initiators,\n\t\t\t\t:comments,\n\t\t\t\t:following,\n\t\t\t\t:bookmarks,\n\t\t\t\t:lone_wolf,\n\t\t\t\t:level_zero,\n\t\t\t\t:level_nonzero,\n\t\t\t\t:private,\n\t\t\t\t:public_viewing,\n\t\t\t\t:public_comments,\n\t\t\t\t:has_parent,\n\t\t\t\t:has_no_parent,\n\t\t\t\t:today,\n\t\t\t\t:last_week,\n\t\t\t\t:last_month,\n\t\t\t\t:last_year,\n\t\t\t\t:sort_by_created_at,\n\t\t\t\t:sort_by_updated_at,\n\t\t\t\t:sort_by_views,\n\t\t\t\t:sort_by_votes,\n\t\t\t\t:sort_by_scores,\n\t\t\t\t:who_id)\n end", "title": "" }, { "docid": "603f4a45e5efa778afca5372ae8a96dc", "score": "0.6273929", "text": "def param_whitelist\n [:role]\n end", "title": "" }, { "docid": "f6399952b4623e5a23ce75ef1bf2af5a", "score": "0.6268545", "text": "def allowed_params\n\t\tparams.require(:password).permit(:pass)\n\tend", "title": "" }, { "docid": "505e334c1850c398069b6fb3948ce481", "score": "0.62560433", "text": "def sanitise!\n @params.keep_if {|k,v| whitelisted? k}\n end", "title": "" }, { "docid": "37c5d0a9ebc5049d7333af81696608a0", "score": "0.62552184", "text": "def safe_params\n\t\tparams.require(:event).permit(:title, :event_date, :begti, :endti, :comments, :has_length, :is_private)\n\tend", "title": "" }, { "docid": "6c4620f5d8fd3fe3641e0474aa7014b2", "score": "0.6251849", "text": "def white_listed_parameters\n params\n .require(:movie)\n .permit(:title, :description, :year_released)\n end", "title": "" }, { "docid": "d14bb69d2a7d0f302032a22bb9373a16", "score": "0.6235865", "text": "def protect_my_params\n return params.require(:photo).permit(:title, :artist, :url)\n\tend", "title": "" }, { "docid": "d370098b1b3289dbd04bf1c073f2645b", "score": "0.62297344", "text": "def allow_params\n params.permit(:id, :email, :password)\n end", "title": "" }, { "docid": "78cbf68c3936c666f1edf5f65e422b6f", "score": "0.62295026", "text": "def whitelisted_user_params\n if params[:user]\n params.require(:user).permit(:email, :username, :password)\n else\n { :email => params[:email],\n :username => params[:username],\n :password => params[:password] }\n end\nend", "title": "" }, { "docid": "5629f00db37bf403d0c58b524d4c3c37", "score": "0.62290955", "text": "def filtered_params\n params.require(:user).permit(:name, :email, :password, :password_confirmation)\n end", "title": "" }, { "docid": "fde8b208c08c509fe9f617229dfa1a68", "score": "0.62265784", "text": "def strong_params\n params.require(:thread).permit(param_whitelist)\n end", "title": "" }, { "docid": "d38efafa6be65b2f7da3a6d0c9b7eaf5", "score": "0.6201104", "text": "def roaster_params\n # Returns a sanitized hash of the params with nothing extra\n params.permit(:name, :email, :img_url, :password_digest, :address, :website, :phone, :latitude, :longitutde, :description)\n end", "title": "" }, { "docid": "d724124948bde3f2512c5542b9cdea74", "score": "0.6191696", "text": "def alpha_provider_params\n params.require(:alpha_provider).permit!\n end", "title": "" }, { "docid": "d18a36785daed9387fd6d0042fafcd03", "score": "0.6182714", "text": "def white_listed_parameters\n params\n .require(:company)\n .permit(:company_name, :company_avatar)\n end", "title": "" }, { "docid": "36956168ba2889cff7bf17d9f1db41b8", "score": "0.61806464", "text": "def set_param_whitelist(*param_list)\n self.param_whitelist = param_list\n end", "title": "" }, { "docid": "07bc0e43e1cec1a821fb2598d6489bde", "score": "0.6163644", "text": "def accept_no_params\n accept_params {}\n end", "title": "" }, { "docid": "fc4b1364974ea591f32a99898cb0078d", "score": "0.61625385", "text": "def request_params\n params.permit(:username, :password, :user_id, :status, :accepted_by, :rejected_by)\n end", "title": "" }, { "docid": "13e3cfbfe510f765b5944667d772f453", "score": "0.6156412", "text": "def admin_security_params\n params.require(:security).permit(:name, :url, :commonplace_id)\n end", "title": "" }, { "docid": "84bd386d5b2a0d586dca327046a81a63", "score": "0.6155956", "text": "def good_params\n permit_params\n end", "title": "" }, { "docid": "b9432eac2fc04860bb585f9af0d932bc", "score": "0.6136645", "text": "def wall_params\n params.permit(:public_view, :guest)\n end", "title": "" }, { "docid": "f2342adbf71ecbb79f87f58ff29c51ba", "score": "0.6133421", "text": "def housing_request_params\n params[:housing_request].permit! #allow all parameters for now\n end", "title": "" }, { "docid": "8fa507ebc4288c14857ace21acf54c26", "score": "0.6120651", "text": "def strong_params\n # to dooo\n end", "title": "" }, { "docid": "fc43ee8cb2466a60d4a69a04461c601a", "score": "0.6118827", "text": "def check_params; true; end", "title": "" }, { "docid": "fc43ee8cb2466a60d4a69a04461c601a", "score": "0.6118827", "text": "def check_params; true; end", "title": "" }, { "docid": "9292c51af27231dfd9f6478a027d419e", "score": "0.61142564", "text": "def domain_params\n params[:domain].permit!\n end", "title": "" }, { "docid": "a3aee889e493e2b235619affa62f39c3", "score": "0.6111942", "text": "def user_params\n params.permit(:full_name, :email, :job, :about, :max_search_distance,\n :website_url, :linkedin_url,\n :behance_url, :github_url, :stackoverflow_url)\n end", "title": "" }, { "docid": "585f461bf01ed1ef8d34fd5295a96dca", "score": "0.6103834", "text": "def param_whitelist\n whitelist = [\n :message,\n :privacy,\n :author_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:author_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "585f461bf01ed1ef8d34fd5295a96dca", "score": "0.6103834", "text": "def param_whitelist\n whitelist = [\n :message,\n :privacy,\n :author_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:author_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "b63ab280629a127ecab767e2f35b8ef0", "score": "0.60985845", "text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end", "title": "" }, { "docid": "b63ab280629a127ecab767e2f35b8ef0", "score": "0.60985845", "text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end", "title": "" }, { "docid": "677293afd31e8916c0aee52a787b75d8", "score": "0.6086854", "text": "def newsletter_params\n params.permit!.except(:action, :controller, :_method, :authenticity_token)\n end", "title": "" }, { "docid": "b7ab5b72771a4a2eaa77904bb0356a48", "score": "0.6086072", "text": "def search_params\n params.permit!.except(:controller, :action, :format)\n end", "title": "" }, { "docid": "e50ea3adc222a8db489f0ed3d1dce35b", "score": "0.60840344", "text": "def params_without_facebook_data\n params.except(:signed_request).permit!.to_hash\n end", "title": "" }, { "docid": "b2841e384487f587427c4b35498c133f", "score": "0.60800475", "text": "def allow_params_authentication!\n request.env[\"devise.allow_params_authentication\"] = true\n end", "title": "" }, { "docid": "3f5347ed890eed5ea86b70281803d375", "score": "0.6075834", "text": "def user_params\n params.permit!\n end", "title": "" }, { "docid": "0c8779b5d7fc10083824e36bfab170de", "score": "0.60682875", "text": "def white_base_params\n params.fetch(:white_base, {}).permit(:name)\n end", "title": "" }, { "docid": "a3dc8b6db1e6584a8305a96ebb06ad21", "score": "0.6068218", "text": "def need_params\n end", "title": "" }, { "docid": "fa0608a79e8d27c2a070862e616c8c58", "score": "0.6067243", "text": "def vampire_params\n # whitelist all of the vampire attributes so that your forms work!\n end", "title": "" }, { "docid": "7646659415933bf751273d76b1d11b40", "score": "0.60659254", "text": "def whitelisted_observation_params\n return unless params[:observation]\n\n params[:observation].permit(whitelisted_observation_args)\n end", "title": "" }, { "docid": "4f8205e45790aaf4521cdc5f872c2752", "score": "0.60643286", "text": "def search_params\n params.permit(:looking_for, :utf8, :authenticity_token, :min_age,\n :max_age, :sort_by, likes:[])\n end", "title": "" }, { "docid": "e39a8613efaf5c6ecf8ebd58f1ac0a06", "score": "0.60638577", "text": "def permitted_params\n params.permit :utf8, :_method, :authenticity_token, :commit, :id,\n :encrypted_text, :key_size\n end", "title": "" }, { "docid": "c436017f4e8bd819f3d933587dfa070a", "score": "0.60627776", "text": "def filtered_parameters; end", "title": "" }, { "docid": "d6886c65f0ba5ebad9a2fe5976b70049", "score": "0.60595316", "text": "def allow_params_authentication!\n request.env[\"devise.allow_params_authentication\"] = true\n end", "title": "" }, { "docid": "f78d6fd9154d00691c34980d7656b3fa", "score": "0.6049658", "text": "def authorize_params\n super.tap do |params|\n %w[display with_offical_account forcelogin].each do |v|\n if request.params[v]\n params[v.to_sym] = request.params[v]\n end\n end\n end\n end", "title": "" }, { "docid": "f78d6fd9154d00691c34980d7656b3fa", "score": "0.6049658", "text": "def authorize_params\n super.tap do |params|\n %w[display with_offical_account forcelogin].each do |v|\n if request.params[v]\n params[v.to_sym] = request.params[v]\n end\n end\n end\n end", "title": "" }, { "docid": "96ddf2d48ead6ef7a904c961c284d036", "score": "0.6048805", "text": "def user_params\n permit = [\n :email, :password, :password_confirmation,\n :image, :name, :nickname, :oauth_token,\n :oauth_expires_at, :provider, :birthday\n ]\n params.permit(permit)\n end", "title": "" }, { "docid": "75b7084f97e908d1548a1d23c68a6c4c", "score": "0.60472894", "text": "def allowed_params\n params.require(:sea).permit(:name, :temperature, :bio, :mood, :image_url, :favorite_color, :scariest_creature, :has_mermaids)\n end", "title": "" }, { "docid": "080d2fb67f69228501429ad29d14eb29", "score": "0.6041993", "text": "def filter_user_params\n params.require(:user).permit(:name, :email, :password, :password_confirmation)\n end", "title": "" }, { "docid": "aa0aeac5c232d2a3c3f4f7e099e7e6ff", "score": "0.603529", "text": "def parameters\n params.permit(permitted_params)\n end", "title": "" }, { "docid": "0bdcbbe05beb40f7a08bdc8e57b7eca8", "score": "0.6030866", "text": "def filter_params\n end", "title": "" }, { "docid": "cf73c42e01765dd1c09630007357379c", "score": "0.6026469", "text": "def params_striper\n\t \tparams[:user].delete :moonactor_ability\n\t end", "title": "" }, { "docid": "793abf19d555fb6aa75265abdbac23a3", "score": "0.6022541", "text": "def user_params\n if admin_user?\n params.require(:user).permit(:email, :password, :password_confirmation, :name, :address_1, :address_2, :apt_number, :city, :state_id, :zip_code, :newsletter, :active, :admin, :receive_customer_inquiry)\n else\n # Don't allow non-admin users to hack the parameters and give themselves admin security; self created records automatically set to active\n params.require(:user).permit(:email, :password, :password_confirmation, :name, :address_1, :address_2, :apt_number, :city, :state_id, :zip_code, :newsletter)\n end\n end", "title": "" }, { "docid": "2e70947f467cb6b1fda5cddcd6dc6304", "score": "0.60210687", "text": "def strong_params(wimpy_params)\n ActionController::Parameters.new(wimpy_params).permit!\nend", "title": "" }, { "docid": "2a11104d8397f6fb79f9a57f6d6151c7", "score": "0.6017866", "text": "def user_params\n sanitize params.require(:user).permit(:username, :password, :password_confirmation, :display_name, :about_me, :avatar, :current_password, :banned, :ban_message)\n end", "title": "" }, { "docid": "a83bc4d11697ba3c866a5eaae3be7e05", "score": "0.6016719", "text": "def user_params\n\t params.permit(\n\t :name,\n\t :email,\n\t :password\n\t \t )\n\t end", "title": "" }, { "docid": "2aa7b93e192af3519f13e9c65843a6ed", "score": "0.6009781", "text": "def user_params\n params[:user].permit!\n end", "title": "" }, { "docid": "45b8b091f448e1e15f62ce90b681e1b4", "score": "0.60081726", "text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "title": "" }, { "docid": "45b8b091f448e1e15f62ce90b681e1b4", "score": "0.60081726", "text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "title": "" }, { "docid": "9c8cd7c9e353c522f2b88f2cf815ef4e", "score": "0.6006408", "text": "def case_sensitive_params\n params.require(:case_sensitive).permit(:name)\n end", "title": "" }, { "docid": "9736586d5c470252911ec58107dff461", "score": "0.60043436", "text": "def params_without_classmate_data\n params.clone.permit!.except(*(CLASSMATE_PARAM_NAMES + DEBUG_PARAMS))\n end", "title": "" }, { "docid": "e7cad604922ed7fad31f22b52ecdbd13", "score": "0.6003569", "text": "def member_params\n # byebug\n params.require(:member).permit(\n :first_name, \n :last_name, \n :username, \n :email, \n :password, \n :image, \n :family_size, \n :address)\n\n end", "title": "" }, { "docid": "f70301232281d001a4e52bd9ba4d20f5", "score": "0.60022444", "text": "def room_allowed_params\n end", "title": "" }, { "docid": "58ad32a310bf4e3c64929a860569b3db", "score": "0.6002005", "text": "def user_params\n\t\tparams.require(:user).permit!\n\tend", "title": "" }, { "docid": "58ad32a310bf4e3c64929a860569b3db", "score": "0.6002005", "text": "def user_params\n\t\tparams.require(:user).permit!\n\tend", "title": "" }, { "docid": "2e6de53893e405d0fe83b9d18b696bd5", "score": "0.6001209", "text": "def user_params\n params.require(:user).permit(:username, :password, :realname, :email, :publicvisible)\n end", "title": "" }, { "docid": "19bd0484ed1e2d35b30d23b301d20f7c", "score": "0.5999349", "text": "def unsafe_params\n ActiveSupport::Deprecation.warn(\"Using `unsafe_params` isn't a great plan\", caller(1))\n params.dup.tap(&:permit!)\n end", "title": "" }, { "docid": "19bd0484ed1e2d35b30d23b301d20f7c", "score": "0.5999349", "text": "def unsafe_params\n ActiveSupport::Deprecation.warn(\"Using `unsafe_params` isn't a great plan\", caller(1))\n params.dup.tap(&:permit!)\n end", "title": "" }, { "docid": "0f53610616212c35950b45fbcf9f5ad4", "score": "0.5994614", "text": "def user_params(params)\n\tparams.permit(:email, :password, :name, :blurb)\n end", "title": "" }, { "docid": "b545ec7bfd51dc43b982b451a715a538", "score": "0.599459", "text": "def user_params\n params_allowed = %i[email password password_confirmation is_admin]\n params.require(:user).permit(params_allowed)\n end", "title": "" }, { "docid": "a50ca4c82eaf086dcbcc9b485ebd4261", "score": "0.5993829", "text": "def white_listed_parameters\n params\n .require(:story)\n .permit(:title, :link, :upvotes, :category)\n end", "title": "" }, { "docid": "0b704016f3538045eb52c45442e7f704", "score": "0.59919024", "text": "def admin_params\n filtered_params = params.require(:admin).permit(:display_name, :email, :password, :password_confirmation)\n if filtered_params[:password] == \"\"\n filtered_params.delete(:password)\n filtered_params.delete(:password_confirmation)\n end\n filtered_params\n end", "title": "" }, { "docid": "6af3741c8644ee63d155db59be10a774", "score": "0.5991034", "text": "def allowed_params\n %i[\n lock_version\n comments\n organization\n job_title\n pronouns\n year_of_birth\n gender\n ethnicity\n opted_in\n invite_status\n acceptance_status\n registered\n registration_type\n can_share\n registration_number\n can_photo\n can_record\n name\n name_sort_by\n name_sort_by_confirmed\n pseudonym\n pseudonym_sort_by\n pseudonym_sort_by_confirmed\n ]\n end", "title": "" } ]
25ff21b1b49b9a84e005a5ac21b0028f
Total of all values recorded in the last x seconds
[ { "docid": "85fba92671c41edae08c9611d0618403", "score": "0.75098646", "text": "def total(seconds = DEFAULT_PERIOD)\n records = records_newer_than(Time.now - seconds)\n records.inject(0) do |sum,record|\n sum += record[:value]\n end\n end", "title": "" } ]
[ { "docid": "892ca19b7e5cc38f7d76097275416ebd", "score": "0.735645", "text": "def update_total(result)\n \tself.secs = results.reduce(0) do |total, result|\n \t\ttotal + result.secs.to_i\n \tend\n end", "title": "" }, { "docid": "c864727831ab3de930a9379346eb9658", "score": "0.710485", "text": "def total_time_reset\n @mutex.synchronize do\n retval = [@time_count, @total_time]\n @time_count = 0\n @total_time = 0.0\n return retval\n end\n end", "title": "" }, { "docid": "8fcb727dd368b9c32c4b1c09fe19fa94", "score": "0.7002924", "text": "def total_time\n @entries.reduce(0) { |sum, entry| sum + entry.duration }\n end", "title": "" }, { "docid": "ac3f5e1962face731e241cb1bc1badd6", "score": "0.69972456", "text": "def total_time\n total_times.reduce(0.0, :+)\n end", "title": "" }, { "docid": "a387c0e508a62f0ea454038afe8a395e", "score": "0.6936778", "text": "def total_time\n sets(:all).inject(0) {|sum, set| sum += set.seconds_to_find }\n end", "title": "" }, { "docid": "a387c0e508a62f0ea454038afe8a395e", "score": "0.6936778", "text": "def total_time\n sets(:all).inject(0) {|sum, set| sum += set.seconds_to_find }\n end", "title": "" }, { "docid": "fd354de58a49f434e4f7c975a4fbbce2", "score": "0.6925136", "text": "def total_time(values)\n\t\tsum = 0\n\t\tvalues.group_by{|v| v[:id]}.each do |v_key, visitor|\n\t\t\ttime_spent = (visitor[1][:timestamp].to_i - visitor[0][:timestamp].to_i)+1\n\t\t\tsum += time_spent\n\t\tend\n\t\tsum\n\tend", "title": "" }, { "docid": "e24e4c3bf981085d1fc58f244a8ac1e0", "score": "0.6867666", "text": "def total_time; end", "title": "" }, { "docid": "e24e4c3bf981085d1fc58f244a8ac1e0", "score": "0.6867666", "text": "def total_time; end", "title": "" }, { "docid": "e24e4c3bf981085d1fc58f244a8ac1e0", "score": "0.6867666", "text": "def total_time; end", "title": "" }, { "docid": "e1fec9b16834da8ff37863df6665ba1c", "score": "0.68357795", "text": "def total_time\n time_entries.inject(0) {|sum, time_entry| sum + time_entry.total_time}\n end", "title": "" }, { "docid": "c045818b13bb0b398872127f66813438", "score": "0.6788181", "text": "def esteemed_total_seconds\n @esteemed_total_seconds ||= compute_total_seconds\n end", "title": "" }, { "docid": "e0e0c5b0395a4874ad695bf62142f2b7", "score": "0.67366403", "text": "def total_time_spent\n @seconds_spent = history.collect(&:seconds_spent).inject(0) {|sum, t| sum + t } if @seconds_spent.nil?\n @seconds_spent\n end", "title": "" }, { "docid": "c6a4486ae2bcf1516707c96c4cf076c5", "score": "0.6660634", "text": "def compute_total_seconds\n group_list = build_group_list_hash\n group_secs = 0\n group_list.each do |_group_id, group_hash| # Sum the total secs for each group:\n group_secs += group_hash[:datarows].inject(0) do |sum, row|\n sum + row.full_row_seconds\n end * group_hash[:times]\n end\n # Start the sum of the rest of the rows using the previous result:\n training_rows.without_groups.inject(group_secs) do |sum, row|\n sum + row.full_row_seconds\n end\n end", "title": "" }, { "docid": "ffb32cf14083167506a26784eb34eed3", "score": "0.66585314", "text": "def total_time=(v); end", "title": "" }, { "docid": "4141fbdba274bff379b6cfe8fd73ca65", "score": "0.66511256", "text": "def TotalTime=(v)", "title": "" }, { "docid": "e1045f83d5d8995546c2ad3bf2e419ff", "score": "0.6622384", "text": "def total_time\r\n self.measurement.total_time\r\n end", "title": "" }, { "docid": "48ee9cf176da0838d3259c852d6bb4f5", "score": "0.6598092", "text": "def total_time\n lock.synchronize do\n @total_time += (internal_profiler.total_time * 1000).round\n internal_profiler.clear\n end\n\n if @total_time > 2_000_000_000\n @total_time = 0\n end\n\n @total_time\n end", "title": "" }, { "docid": "a693b6234dfd306bed6d40097e5e2749", "score": "0.6545093", "text": "def sum_up_total_value_of_time_trackings(values)\n sum = 0\n values.each { |v|\n sum = sum + v.spent_time * v.hourly_rate\n }\n sum\n end", "title": "" }, { "docid": "b5981e320a564ca875ff3e9fcff7e6e2", "score": "0.6535572", "text": "def overall_calspersec\n total = 0\n self.calspersecs.all.each do |x|\n total += x.calories_persec\n end\n return total\n end", "title": "" }, { "docid": "c1b2a1d7fec416972479ccc3d0c8af71", "score": "0.6533406", "text": "def total_time\n extract_from_time_hash :total_time\n end", "title": "" }, { "docid": "35fa6772e78419de387b89d73ac458fa", "score": "0.65222174", "text": "def get_total_time\n\t\tquestion_scores = QuestionScore.for_game_record(self.id)\n\t\ttime = 0\n\t\tquestion_scores.length.times do |i|\n\t\t\ttime += question_scores[i].time\n\t\tend\n\t\ttime\n\tend", "title": "" }, { "docid": "d201ce582a002947e9ac14dcc715421c", "score": "0.65092665", "text": "def total\n items.inject(0.0) do |sum, duration|\n sum += duration.to_f if duration.respond_to?(:to_f)\n end\n end", "title": "" }, { "docid": "34b889cd7c93d20677a59c88ff9a5321", "score": "0.64613134", "text": "def total\n @pgsql.exec('SELECT COUNT(balance) FROM payable WHERE updated > NOW() - INTERVAL \\'30 DAYS\\'')[0]['count'].to_i\n end", "title": "" }, { "docid": "e8e28a330b93631dadd2d495acc0b2ad", "score": "0.64351714", "text": "def total_duration\n n = 0.0\n @durations.values.each{ |d| n += d }\n n\n end", "title": "" }, { "docid": "7ecbd9dcddedc22064a2af2e7def63e2", "score": "0.64278454", "text": "def time_total\n @now - @start_time\n end", "title": "" }, { "docid": "170b84483c9426c4eee49677e735b18d", "score": "0.6423344", "text": "def total_time\n tasks.inject(0) {|total, t| total + t.total_time }\n end", "title": "" }, { "docid": "6adbab20715f691449e8d89c26351997", "score": "0.64112294", "text": "def total\n self.inject(0) { |total, current| total += current.last_roll }\n end", "title": "" }, { "docid": "4cf3e004823702fd85448913cb8941fc", "score": "0.6391283", "text": "def alltime_total\n @data['alltime']['total']\n end", "title": "" }, { "docid": "2d1cad6dae3166b838484193f3ff8384", "score": "0.6361258", "text": "def total\n @data.inject(0) { |sum, item| sum += item[:value]; sum }\n end", "title": "" }, { "docid": "509e1698e54b18ed622c66befd7f5ff5", "score": "0.6358645", "text": "def total_recorded_hours\n recorded_hours.sum(:hours)\n end", "title": "" }, { "docid": "afa5ce3f6b69006499fdddc5ad68eebc", "score": "0.63410795", "text": "def update_total_time(last_updated_total_time_driven, time_stamp_array)\n return last_updated_total_time_driven.to_i + (time_stamp_array.last.to_i - time_stamp_array.first.to_i)\n end", "title": "" }, { "docid": "6fa07c5f6c42f7ccae6acbfcb39c21be", "score": "0.6335199", "text": "def return_time\n return @totalTime\n end", "title": "" }, { "docid": "5bda85c43298ee1dc6d3d072f9cd6a42", "score": "0.63344485", "text": "def logged\n logs.map(&:duration).sum\n end", "title": "" }, { "docid": "b338fe16c2e56e0414ce7589e785f7cc", "score": "0.6331872", "text": "def duration\n @timed_stats.sum\n end", "title": "" }, { "docid": "16d796496f1cbe2fdf0ff972bb59e285", "score": "0.6320947", "text": "def get_temps_total\n nb_process = @@tab_process.size\n temps_total = 0\n for proc in @@tab_process\n ## proc correspond au tableau tab_step de chaque proc\n for step in proc\n temps_total += step[\"Computation_time\"]\n end\n end\n # on retourne la moyenne du temps\n (temps_total / nb_process )\nend", "title": "" }, { "docid": "529b047b62e5110b21ac3ddd85a9a840", "score": "0.6314593", "text": "def total_cpu_time\n @timing_hash.inject(0) {|total, a|\n total += a[1][:cpu_time]\n }\n end", "title": "" }, { "docid": "549cc9be1bece687549dd238ddc573ce", "score": "0.63055325", "text": "def total_sleep_time\n extract_from_time_hash :sleep_time \n end", "title": "" }, { "docid": "0f4ddce1785afa6a0d06bd6dc3ad0fa6", "score": "0.62931687", "text": "def runtime\n @stats.inject(0) { |sum,query| sum + query[:seconds] }\n end", "title": "" }, { "docid": "6b9ce59da61a94da8cf9f96ad9ff50cd", "score": "0.626202", "text": "def calculate_counter(current_time, name, value)\n result = nil\n # only check if a past run has a value for the specified query type\n if memory(name) && memory(name).is_a?(Hash)\n last_time, last_value = memory(name).values_at(:time, :value)\n # We won't log it if the value has wrapped\n if last_value and value >= last_value\n elapsed_seconds = current_time - last_time\n elapsed_seconds = 1 if elapsed_seconds < 1\n result = value - last_value\n\n # calculate per-second\n result = result / elapsed_seconds.to_f\n end\n end\n remember(name => {:time => current_time, :value => value})\n \n result\n end", "title": "" }, { "docid": "b798e4c563398ac06064b83b7044a0a5", "score": "0.6255508", "text": "def sum_frames\n total = 0\n (1..10).each do |f|\n total = total + self[\"frame_#{f}_total\"] if self[\"frame_#{f}_total\"]!=nil\n end\n total\n end", "title": "" }, { "docid": "c392e8dd9b424a645b9baf1101422f5c", "score": "0.6248542", "text": "def total_duration\n\t\thh_mm_sec physical_objects.inject(0){|sum, p| p[:duration].to_i + sum }\n\tend", "title": "" }, { "docid": "62d445fe3544b41db908c5d9cdd8cb31", "score": "0.6229803", "text": "def total_time\n\t\tself.out - self.in\n\tend", "title": "" }, { "docid": "affb60d960c96bcfa0ac18551f14d415", "score": "0.622479", "text": "def total_time\n total_cpu_time + total_wait_time\n end", "title": "" }, { "docid": "2ae01f40a991dafe168dfc8de4450f11", "score": "0.62158424", "text": "def total_time\n @bike_trips.reduce(0) { |a, e| a + (e.duration || 0) }\n end", "title": "" }, { "docid": "4ee9936a9dff4fdc8b615c1f591de5bd", "score": "0.6214525", "text": "def compute_total_seconds\n if exercise_rows\n exercise_rows.sort_by_part_order.inject(0) do |sum, row|\n sum + row.compute_total_seconds\n end\n else\n 0\n end\n end", "title": "" }, { "docid": "2f1a4b3f4c02807ab055f9ce69292b7d", "score": "0.6202795", "text": "def running_total\n run_total = 0\n self.chores.where(completed: true).each do |chore|\n run_total += chore.points\n end\n \n self.total = run_total\n end", "title": "" }, { "docid": "2f1a4b3f4c02807ab055f9ce69292b7d", "score": "0.6202795", "text": "def running_total\n run_total = 0\n self.chores.where(completed: true).each do |chore|\n run_total += chore.points\n end\n \n self.total = run_total\n end", "title": "" }, { "docid": "3c4748016c073f769352eb23c4819a68", "score": "0.6191197", "text": "def running_total(numbers)\n cumulative_sum = []\n sum = 0\n\n numbers.each { |num| cumulative_sum << sum += num }\n cumulative_sum\nend", "title": "" }, { "docid": "09ecb156eee8b8e9763228327d7cad56", "score": "0.6189552", "text": "def calculateAccumulatedAverageTime(task_results)\n accumulatedAverageTime = [0.0]\n task_results.each do |result|\n length = accumulatedAverageTime.length\n accumulatedAverageTime[length] = (accumulatedAverageTime[length-1] + result.time) / length\n end\n return accumulatedAverageTime\n end", "title": "" }, { "docid": "30f089b3cb8b3758d771fd26c51d3595", "score": "0.618148", "text": "def total_time=(_arg0); end", "title": "" }, { "docid": "cbdbffe172a1c8a7b3976d291577b4c3", "score": "0.61773497", "text": "def time_total(options={})\n time_remaining_on_day(start_on, options)\n end", "title": "" }, { "docid": "8f7cb4cfdde8c2334d4a65c52b29c0bb", "score": "0.6173415", "text": "def calculate_counter(current_time, name, value)\n result = nil\n # only check if a past run has a value for the specified query type\n if memory(name.to_sym) && memory(name.to_sym).is_a?(Hash)\n last_time, last_value = memory(name.to_sym).values_at(:time, :value)\n # We won't log it if the value has wrapped\n if last_value and value >= last_value\n elapsed_seconds = current_time - last_time\n elapsed_seconds = 1 if elapsed_seconds < 1\n result = value - last_value\n\n # calculate per-second\n result = result / elapsed_seconds.to_f\n end\n end\n remember(name.to_sym => {:time => current_time, :value => value})\n result\n end", "title": "" }, { "docid": "e805324a41037ff11a52fe31b69b6277", "score": "0.61718744", "text": "def ts\n with_mutex { @updated.to_i }\n end", "title": "" }, { "docid": "089b4ceff4e1db9123ccf2a41d9ddc32", "score": "0.6165002", "text": "def hours_total\n (@total_secs.to_f / 3600)\n end", "title": "" }, { "docid": "eafe1d63ce404f8cae5af528c708458b", "score": "0.6162998", "text": "def time_spent\n changes.collect(&:minutes).sum\n end", "title": "" }, { "docid": "fa731feceae95503f9ac1e6fba833b74", "score": "0.6153293", "text": "def total_wall_time\n @timing_hash.inject(0) {|total, a|\n total += a[1][:wall_time]\n }\n end", "title": "" }, { "docid": "67b5b9811959173db5964865cf2c6be5", "score": "0.61484957", "text": "def running_total(input)\n output = []\n total = 0\n\n input.each do |el|\n total += el\n output << total\n end\n\n output\nend", "title": "" }, { "docid": "32a2bebc7cdb4f32b204d08756d08ac9", "score": "0.61349964", "text": "def total_duration; end", "title": "" }, { "docid": "32a2bebc7cdb4f32b204d08756d08ac9", "score": "0.61349964", "text": "def total_duration; end", "title": "" }, { "docid": "4b99cdbf2b2152329da9d8c2bfeea6bf", "score": "0.61309785", "text": "def running_total(array)\n current_total = 0\n results_array = []\n array.each do |number|\n current_total += number\n results_array << current_total\n end\n results_array\nend", "title": "" }, { "docid": "3de46c90d686d79370d48f9738259a28", "score": "0.6127118", "text": "def total_test_time\n tests.inject(0) { |total, test| total + test.time }\n end", "title": "" }, { "docid": "6bb284d42503e754510c9c850dad2235", "score": "0.6123669", "text": "def total_time\n (@fetch_time || 0) + (@parse_time || 0)\n end", "title": "" }, { "docid": "6bb284d42503e754510c9c850dad2235", "score": "0.6123669", "text": "def total_time\n (@fetch_time || 0) + (@parse_time || 0)\n end", "title": "" }, { "docid": "6bb284d42503e754510c9c850dad2235", "score": "0.6123669", "text": "def total_time\n (@fetch_time || 0) + (@parse_time || 0)\n end", "title": "" }, { "docid": "ccc21741e79f2ee84768293f53e05cf9", "score": "0.61200225", "text": "def average_execution_time\n successes = Timberline.redis.xmembers(attr(\"success_stats\")).map { |item| Envelope.from_json(item)}\n times = successes.map do |item|\n if item.finished_processing_at\n item.finished_processing_at.to_f - item.started_processing_at.to_f\n elsif item.fatal_error_at\n item.fatal_error_at.to_f - item.started_processing_at.to_f\n else\n nil\n end\n end\n times.reject! { |t| t.nil? }\n if times.size == 0\n 0\n else\n times.inject(0, :+) / times.size.to_f\n end\n end", "title": "" }, { "docid": "c3ffdd078115b81b5e3ade1df4ae11fb", "score": "0.6116012", "text": "def get_total_runtime\n events = self.events\n start_time = DateTime.parse(events.first['timestamp'])\n completion_time = DateTime.parse(events.last['timestamp'])\n TimeDifference.between(start_time, completion_time).humanize\n end", "title": "" }, { "docid": "7ac716d18d7a75837930d740c1ffe80b", "score": "0.610736", "text": "def void_last_transaction\n @total = @total- @@lastupdate\nend", "title": "" }, { "docid": "ae079dd3e8a5071f8445e81041089772", "score": "0.61035585", "text": "def total_duration\n\t\tinject(0) {|memo, song| memo + song.duration }\n\tend", "title": "" }, { "docid": "da6ebb0b444856919192c3716b14fef5", "score": "0.61029804", "text": "def final_avg\n @wait_time.to_i / @avg_count.to_i # return average\n end", "title": "" }, { "docid": "a5fb947a94fe92ca173bf91d376e4ef8", "score": "0.61023915", "text": "def total\n # Cache for performance\n compute_stats if @total.nil? \n return @total\n end", "title": "" }, { "docid": "bede4fa175a93c426805bd128c3ae8e5", "score": "0.6078021", "text": "def total_playtime_ms\n self[:total_playtime_ms] || SegmentHistory.where(segment: segments).sum(:realtime_duration_ms)\n end", "title": "" }, { "docid": "857ab92ed1a52c7616b2034dbad7e299", "score": "0.6077451", "text": "def runtime\n @stats.map { |query| query[:seconds] }.sum\n end", "title": "" }, { "docid": "9e2dff499af1634f1cf7c4df4d0109fc", "score": "0.60620683", "text": "def running_total(numbers)\n sum = 0\n numbers.each_with_object(list_total = []) do |num|\n list_total << sum += num\n end\nend", "title": "" }, { "docid": "8214e9a946f30336b5c5d5ab940e273f", "score": "0.60550904", "text": "def total_model_time\n Model.includes(:last_correct_perf_test).all\n .map(&:last_correct_perf_test)\n .reject{|t| t.nil?}\n .map{|t| t.runtime_seconds}\n .sum\n end", "title": "" }, { "docid": "3045dbabb1b63dff75a51e37b864fe9b", "score": "0.6041654", "text": "def running_total(array)\n total = 0\n running_total = []\n\n array.each do |item|\n total += item\n running_total.push(total)\n end\n\n running_total\nend", "title": "" }, { "docid": "848a05e7242875a7a04e629fccad8455", "score": "0.603391", "text": "def running_total(array)\n totals = []\n total = 0\n array.each do |item|\n total += item\n totals << total\n end\n totals\nend", "title": "" }, { "docid": "109d99fb8f6617bc5f1794e73283f4de", "score": "0.6026826", "text": "def running_total(array)\n sum = 0\n p array.each_with_object([]){|value, new_array| new_array << sum += value}\nend", "title": "" }, { "docid": "f47e37d0477717815fdc60dd60429880", "score": "0.60242826", "text": "def total_hours\n time_entries.sum(:time)\n end", "title": "" }, { "docid": "bc2c71f83bd13791bed9bc55503eb6f6", "score": "0.6022254", "text": "def durchschnitt\n summe / size\n end", "title": "" }, { "docid": "fa3f0aaa208abf9b0aadbc0f386a6c07", "score": "0.60220563", "text": "def get_total\n return @scheduler.get_total\n end", "title": "" }, { "docid": "6497a5722982c88b714cd6c47df3e77e", "score": "0.6019068", "text": "def calculate_timer\n self.timer += self.timer_increment\n end", "title": "" }, { "docid": "d126bbdca93d99eb59701cf28f4d18be", "score": "0.60116684", "text": "def total_call_time\n messages = @data['messages']\n time = 0\n messages.each do |m|\n begin\n if m[\"type\"] == \"Call\"\n time = time + m[\"call_duration\"].to_i\n end\n\n rescue\n next\n end\n\n end\n @callTime = time\n return time\n end", "title": "" }, { "docid": "cd08dd406c9c0147dc3858e5672a1a70", "score": "0.6008699", "text": "def calculate_total_time_in_hours\n last_time = self.points.last(:order => :time.asc).time if self.points.last(:order => :time.asc)\n return unless last_time\n x = last_time / 1000\n seconds = x % 60\n x /= 60\n minutes = x % 60\n x /= 60\n hours = x % 24\n \"%02d\" % (hours).to_s << \":\" << \"%02d\" % (minutes).to_s << \":\" << \"%02d\" % (seconds).to_s\n end", "title": "" }, { "docid": "a9c4e82adb30e8a48b15ade4fb5fea15", "score": "0.60051614", "text": "def total_tracked\n self.timings.submitted_timings.sum(:duration_minutes)\n end", "title": "" }, { "docid": "dc626c5961af3d1ebe3ea36ee117a0d9", "score": "0.59980565", "text": "def most_recent_time_accumulated\n Time.now - @most_recent_time_started\n end", "title": "" }, { "docid": "097e013c5e5584f4d2dce8c8d8685103", "score": "0.5993907", "text": "def running_total(array)\n sum = 0\n results = []\n array.each do |n|\n sum += n\n results << sum\n end\n results\nend", "title": "" }, { "docid": "72fcad8c8f4c74346d6acd2bb034d818", "score": "0.5988837", "text": "def update\n diff = Time.new - @current_systime\n @actual += diff.to_i\n @current_systime = Time.new\n end", "title": "" }, { "docid": "6d8dbf5ae9f71636e643f43bf09143c9", "score": "0.59887266", "text": "def delays_total\n total = 0\n \n [:trucks, :paving, :mot, :other].each do |delay_type|\n val = self[\"delays_#{delay_type}\"].to_f\n total += val\n end\n \n total\n end", "title": "" }, { "docid": "76695156f918d52bf57823ff24cb0d2c", "score": "0.5985679", "text": "def running_total(input)\n sum = 0\n input.map { |el| sum += el }\nend", "title": "" }, { "docid": "51ddef51dc2c5b9be77dba849c424724", "score": "0.59843194", "text": "def running_total(array)\n sum = 0\n array.map { |value| sum += value }\nend", "title": "" }, { "docid": "51ddef51dc2c5b9be77dba849c424724", "score": "0.59843194", "text": "def running_total(array)\n sum = 0\n array.map { |value| sum += value }\nend", "title": "" }, { "docid": "00a44e235300be78339691b746d34e57", "score": "0.59828", "text": "def sum_times\n time = 0\n time = 1000 if one_sec\n time += 2000 if two_sec\n time += 5000 if five_sec\n time += 10000 if ten_sec\n time += 30000 if thirty_sec\n time\n end", "title": "" }, { "docid": "3a865aa7099bc9ae582f40f1fa046127", "score": "0.59762543", "text": "def running_total(array)\n total = 0\n total_array = []\n\n array.each do |num|\n total += num\n total_array << total\n end\n\n total_array\nend", "title": "" }, { "docid": "542e7e6fd3a377c2849be0634fb93a77", "score": "0.5974186", "text": "def running_total(array)\n sum = 0\n array.map { |val| sum += val }\nend", "title": "" }, { "docid": "9fee68a566998feca6b3c31111ab0e93", "score": "0.5973147", "text": "def total_cpu_time\n self.timings.cpu_time(\"Time for this iteration\")\n # begin\n # total= self.timings.find{|t| t[:description] =~ /Time for this iteration/}\n # total[:cpu_time]\n # rescue\n # self.timings.inject(0){|total, time|\n # total = total + (time[:cpu_time] || 0)\n # }\n # end\n end", "title": "" }, { "docid": "63ed0f649858f824f4b0556cb224c546", "score": "0.59663403", "text": "def sum_durations node\n sum = 0\n\n node[1]['durations'].each do |key, value|\n sum += value\n end\n\n return sum\n end", "title": "" }, { "docid": "b879f8e07b956740c95505bf395ff9d2", "score": "0.5963839", "text": "def running_total(array)\n starting_value = 0\n new_array = []\n\n array.each do |ele|\n starting_value += ele\n new_array << starting_value\n end\n\n new_array\nend", "title": "" }, { "docid": "69f21e384f91ce8559384081b5e12983", "score": "0.5962596", "text": "def total_hours\n self.time_entries.inject(0) {|sum, x| sum + x.hours}\n end", "title": "" }, { "docid": "69f21e384f91ce8559384081b5e12983", "score": "0.5962596", "text": "def total_hours\n self.time_entries.inject(0) {|sum, x| sum + x.hours}\n end", "title": "" } ]
ec371adc97ed498c42b8030d73124ad4
Query across all types of campaigns
[ { "docid": "afcf366f53340395a096af270f7e3d05", "score": "0.0", "text": "def get_outbound_campaigns_all_divisionviews(opts = {})\n data, _status_code, _headers = get_outbound_campaigns_all_divisionviews_with_http_info(opts)\n return data\n end", "title": "" } ]
[ { "docid": "e415535ff2bc1becf093700fb5db133b", "score": "0.7840914", "text": "def find_campaigns_by_type(campaign_type, *args)\n campaigns({:type => campaign_type}, *args)['data']\n end", "title": "" }, { "docid": "6b703001a6c2aeca66792632a09ee093", "score": "0.7630074", "text": "def find_campaigns_by_type(type, start = 0, limit = 25)\n call(\"campaigns\", {:type => type}, start, limit)\n end", "title": "" }, { "docid": "0eeb27eca5770a792f620000aed14459", "score": "0.6873046", "text": "def all\n get(\"#{domain}/campaigns\")\n end", "title": "" }, { "docid": "cfa538aa1aee034cc9b20d33b7210e7c", "score": "0.68447286", "text": "def find_campaigns\n account = FacebookAccount.find_by_uid @facebook_session.user.id\n \n @campaigns = Campaign.find(:all).select { |campaign| campaign.matches?(account) }\n end", "title": "" }, { "docid": "f5b5a9d934feffff55e4cee960079d87", "score": "0.6742244", "text": "def campaigns_list cID: nil, aID: nil \n call_adglare_api 'campaigns_list', {cID: cID, aID: aID}\n end", "title": "" }, { "docid": "27932a73cafae2668ea55469647199b8", "score": "0.6732308", "text": "def get_campaign_types\n [\n [ 'Scrape' ],\n [ 'List' ],\n [ 'Ads' ],\n [ 'Other' ]\n ]\n end", "title": "" }, { "docid": "dd8378d3a211801f9eb5f13d1286266d", "score": "0.6713295", "text": "def test_get_all_campaigns\n test_add_campaigns() unless (@campaign_1 and @campaign_2)\n found_1 = false\n found_2 = false\n selector = @campaign_srv.module::CampaignSelector.new\n response = @campaign_srv.get(selector)\n assert_not_nil(response.rval.entries, 'Empty result set returned')\n response.rval.entries.each do |campaign|\n found_1 = true if campaign.id == @campaign_1.id\n found_2 = true if campaign.id == @campaign_2.id\n end\n assert(found_1, 'Campaign #1 not found in returned results')\n assert(found_2, 'Campaign #2 not found in returned results')\n end", "title": "" }, { "docid": "f1e1abc7fca9eca945ad496e315429de", "score": "0.6643779", "text": "def campaigns\n ActiveRecord::Base.connection.execute \"\n SELECT campaigns.*\n FROM revenue_shares\n JOIN tracking_urls ON revenue_shares.tracking_url_id = tracking_urls.id\n JOIN publishers ON publishers.tracking_url_id = tracking_urls.id\n JOIN places ON places.publisher_id = publishers.id\n JOIN posts ON posts.place_id = places.id\n JOIN ads ON posts.ad_id = ads.id\n JOIN campaigns ON ads.campaign_id = campaigns.id\n WHERE revenue_shares.id = #{self.id}\"\n end", "title": "" }, { "docid": "9e885c241ff5ac2c2a81e4bbc6ad6b1c", "score": "0.66194105", "text": "def campaigns\r\n Campaigns.instance\r\n end", "title": "" }, { "docid": "0cb4f2dedc013dc897fabae07aff3772", "score": "0.66085714", "text": "def index\n # if we have query params, make an array for the options of the second dropdown\n # byebug\n @campaigns = Campaign.search(params[:campaign])\n \n end", "title": "" }, { "docid": "44656fbbd042580b2fd5aa258a0ac204", "score": "0.6587518", "text": "def campaigns(params)\n response = YandexDirect::V5::Request.new(self, @token, 'campaigns', 'get', params).perform\n @available_units = response[:available_units]\n response[:result]\n end", "title": "" }, { "docid": "72b190ff4ca249af6f70a1203c574d9f", "score": "0.6585493", "text": "def get_campaigns\n get('/fcb30500-7b98-476f-810d-463a0b8fc3df')\n end", "title": "" }, { "docid": "9f59a007d722f351cfadf026f18fc8d4", "score": "0.6554428", "text": "def campaigns(request, options = {})\n offset = 0\n limit = 50\n response = []\n loop do\n options[:offset] = offset\n options[:limit] = limit\n page = Campaign.where(request, options.merge(marketer_id: id))\n .campaigns\n .to_a\n response.concat(page)\n break if page.blank? || page.size < limit\n offset += limit\n end\n return response\n end", "title": "" }, { "docid": "c971f4e997ee5cf6bbdbe9d5b3a9e72d", "score": "0.6533571", "text": "def index\n @campaigns = Campaign.search(params[:search])\n end", "title": "" }, { "docid": "fda35742b871546f5da9964a307216a1", "score": "0.65127623", "text": "def campaigns(client_id)\n handle_response(Client_GetCampaigns(\"ClientID\" => client_id)) do |response|\n response[\"Campaign\"].collect{|c| Campaign.new(c) }\n end\n end", "title": "" }, { "docid": "fc7bc6de26e667c5cbd8a133e9f6530e", "score": "0.65069574", "text": "def campaigns\n @_campaigns ||= UplandMobileCommonsRest::Campaigns.new(client: self)\n end", "title": "" }, { "docid": "5799619765be2031d6b4a1e3ca6883fb", "score": "0.6501515", "text": "def get_campaigns()\n exec_get(\"#{@base_path}/api/v2/customers/campaigns.json?api_key=#{@api_key}\")\n end", "title": "" }, { "docid": "1436e6eb81244b6a44126f592866ef90", "score": "0.64765453", "text": "def find_campaigns_by_list_id(list_id, start = 0, limit = 25)\n call(\"campaigns\", {:list_id => list_id}, start, limit)\n end", "title": "" }, { "docid": "2298b9d22072717bfa8e6bed716943c9", "score": "0.6452436", "text": "def campaigns\n response = get 'campaigns'\n response.map{|item| Hashie::Mash.new(item)}\n end", "title": "" }, { "docid": "56307c69485775cd824c6f013ccede9e", "score": "0.6443083", "text": "def get_campaigns\n number_per_page = DEFAULT_NBR_PER_PAGE\n total_num_entries = get_campaigns_for_page(0, number_per_page)\n number_of_page = total_num_entries / number_per_page\n return if number_of_page == 0\n workers = total_num_entries < number_per_page * 2 ? 1 : DEFAULT_WORKER_NUMBER\n Parallel.each(lambda { (1...number_of_page + 1).to_a.pop || Parallel::Stop }, :in_threads => workers) { |index|\n get_campaigns_for_page(index * number_per_page, number_per_page)\n }\n end", "title": "" }, { "docid": "394b1c9882c0d120d2175237e1056d96", "score": "0.63994604", "text": "def campaigns\r\n # Prepare query url.\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << '/post/direct-mail/campaigns'\r\n _query_url = APIHelper.clean_url _query_builder\r\n\r\n # Prepare and execute HttpRequest.\r\n _request = @http_client.get(\r\n _query_url\r\n )\r\n BasicAuth.apply(_request)\r\n _context = execute_request(_request)\r\n\r\n # Validate response against endpoint and global error codes.\r\n return nil if _context.response.status_code == 404\r\n validate_response(_context)\r\n\r\n # Return appropriate response type.\r\n _context.response.raw_body\r\n end", "title": "" }, { "docid": "af00a8ebab72d21b362b3ba0cddeedf9", "score": "0.63926405", "text": "def index\n authorize! :index, Campaign\n @admin_campaigns = Admin::Campaign.accessible_by(current_ability, :read)\n @admin_campaigns = @admin_campaigns.search(params[:search]) unless params[:search].blank?\n @admin_campaigns = @admin_campaigns.order(\"#{sort_column} #{sort_direction}\") unless sort_column.blank?\n @admin_campaigns = @admin_campaigns.paginate(page: params[:page], per_page: params[:per_page] || 100)\n end", "title": "" }, { "docid": "c7e7850979f921c65242c3db3de78147", "score": "0.63732785", "text": "def campaigns\n @campaigns\n end", "title": "" }, { "docid": "c19c097a6ea0bae743f64d4767a4192e", "score": "0.6366507", "text": "def generate_campaigns_list\n @campaigns = Campaign.all.select {|c| c.scheduled? or c.active?}\n end", "title": "" }, { "docid": "b3161fa96b195d0e72792e8d31b5b0cd", "score": "0.6352234", "text": "def campaigns_by_status(status, options = {})\n connection.get(\"campaigns/#{status}\", options)\n end", "title": "" }, { "docid": "75d72c7cd6d0556c9dd6fabd5876256e", "score": "0.63415176", "text": "def list_campaigns(limit = nil, offset = nil)\n data = {}\n data.merge!({limit: limit}) unless limit.nil?\n data.merge!({offset: offset}) unless offset.nil?\n send_request('campaigns', 'GET', data)\n end", "title": "" }, { "docid": "53bb7b94437b2684bda01ef749703946", "score": "0.6333816", "text": "def search_campaigns(query, offset=0, snip_start=nil, snip_end=nil)\n _params = {:query => query, :offset => offset, :snip_start => snip_start, :snip_end => snip_end}\n return @master.call 'helper/search-campaigns', _params\n end", "title": "" }, { "docid": "552cca91343ed986afb0bbdd3bd9ceab", "score": "0.6330255", "text": "def get_campaigns(status = nil)\n url = @base_url + '/campaigns'\n url = status.present? ? url + \"?status=#{status}\" : url\n campaigns = Campaign.get_campaigns(url, self)\n return campaigns\n end", "title": "" }, { "docid": "1fd0132c41726316f68b45575fa906e4", "score": "0.6328883", "text": "def get_campaigns(settings_file, campaign_key, goal_identifier, goal_type_to_track = 'ALL')\n campaigns = []\n if campaign_key.nil?\n campaigns = get_campaigns_for_goal(settings_file, goal_identifier, goal_type_to_track)\n elsif campaign_key.is_a?(Array)\n campaigns = get_campaigns_from_campaign_keys(campaign_key, settings_file, goal_identifier, goal_type_to_track)\n elsif campaign_key.is_a?(String)\n campaign = get_campaign_for_campaign_key_and_goal(campaign_key, settings_file, goal_identifier, goal_type_to_track)\n campaigns = [campaign] if campaign\n end\n if campaigns.length == 0\n Utils::Logger.log(\n LogLevelEnum::ERROR,\n 'CAMPAIGN_NOT_FOUND_FOR_GOAL',\n {\n '{file}' => FileNameEnum::CAMPAIGN_UTIL,\n '{goalIdentifier}' => goal_identifier\n }\n )\n end\n campaigns\n end", "title": "" }, { "docid": "279cf72b0d68bd999a2187ec33646d07", "score": "0.62972367", "text": "def campaigns(user_id)\n self.class.get(\"/users/\"+user_id+\"/campaigns\", @options)\n end", "title": "" }, { "docid": "aef31ac52f9cf522665bfee49fcc4c2f", "score": "0.6289376", "text": "def get_campaigns(journey_id, page)\n full_path = full_resource_path(\"/#{journey_id}/journey_campaigns\")\n query_params = MaropostApi.set_query_params({:pae => page})\n \n MaropostApi.get_result(full_path, query_params)\n end", "title": "" }, { "docid": "9e5f14be38fa8bf8f2ce39e2eafda4e3", "score": "0.62882125", "text": "def index\n @campaigns = Campaign.all.order(created_at: :asc)\n @campaignsEdu = Campaign.popular.where(:category => \"EDUCATION\").order(created_at: :asc)\n @campaignsSpr = Campaign.popular.where(:category => \"SPORTS\").order(created_at: :asc)\n @campaignsMed = Campaign.popular.where(:category => \"MEDICINE\").order(created_at: :asc)\n @campaignsFoo = Campaign.popular.where(:category => \"FOOD\").order(created_at: :asc)\n @campaignsPet = Campaign.popular.where(:category => \"PETS\").order(created_at: :asc)\n end", "title": "" }, { "docid": "51bc856673541b93c0966491eded1373", "score": "0.6286708", "text": "def GetCampaigns\n cm_client.campaigns(self.id)\n end", "title": "" }, { "docid": "aaec4092a91002280acda10412da269c", "score": "0.6283915", "text": "def campaigns(advertizer_id, params = {})\n get_collection('campaign/get/', params.merge(advertiser_id: advertizer_id))\n end", "title": "" }, { "docid": "5fa36e97b249a7fbd07344db6efb285f", "score": "0.6275634", "text": "def index\n @q = GreeCampaign.search(params[:q])\n @gree_campaigns = @q.result.order(id: :desc).page params[:page]\n end", "title": "" }, { "docid": "f6e524bbf14e5a5b5299eefd2cdcff6f", "score": "0.626229", "text": "def active_campaigns\n campaigns.where('campaigns.status = :s', s: CAMPAIGN_STATUS_ACTIVE)\n end", "title": "" }, { "docid": "cad4e3f1e9043718c9d0abb6ca047bb5", "score": "0.6245458", "text": "def find_campaigns_by_list_name(list_name, start = 0, limit = 25)\n call(\"campaigns\", {:list_id => find_list_id_by_name(list_name)}, start, limit)\n end", "title": "" }, { "docid": "84cd5f72ae463c68eebe38b105d98e5e", "score": "0.6239026", "text": "def index\n @q = Campaign.ransack(params[:q])\n @campaigns = @q.result.paginate(:page => params[:page], :per_page => 10)\n end", "title": "" }, { "docid": "103e4b0064c0ebb25aca59d98604cbeb", "score": "0.6204268", "text": "def campaigns(page=1, page_size=1000, order_direction=\"desc\",\n sent_from_date='', sent_to_date='', tags='')\n options = { :query => {\n :page => page,\n :pagesize => page_size,\n :orderdirection => order_direction,\n :sentfromdate => sent_from_date,\n :senttodate => sent_to_date,\n :tags => tags\n }}\n\n response = get 'campaigns', options\n Hashie::Mash.new(response)\n end", "title": "" }, { "docid": "1de8bc3e844f776e24d0ddfa9e330a98", "score": "0.61967874", "text": "def campaigns\n if request.xhr? && Page.find_by(page_id: params[:page_id])\n page = Page.find_by(page_id: params[:page_id])\n data = page.campaigns\n\n send_response(data)\n end\n end", "title": "" }, { "docid": "5f61c6cfe9d1addeb519f871f27b6d6c", "score": "0.61429805", "text": "def list_campaigns(options = {})\n response = connection.get do |req|\n req.url \"campaigns/list\", options\n end\n return_error_or_body(response, response.body.response.campaigns.items)\n end", "title": "" }, { "docid": "515849f4fb15b3c406578b84f7bd38f1", "score": "0.6139561", "text": "def find_campaigns_by_title(campaign_title, *args)\n campaigns({:title => campaign_title}, *args)['data']\n end", "title": "" }, { "docid": "db9684a3a8950bf3ee8b34f138570a6d", "score": "0.6131343", "text": "def get_available_campaigns\n @campaigns = []\n @campaigns = @company.campaigns.select { |e| e.mail_sent }\n end", "title": "" }, { "docid": "74abed4adae414c6563049e9cf28984b", "score": "0.61197966", "text": "def index\n @campaigns = @org.campaigns\n end", "title": "" }, { "docid": "9d96395ed27908728e9a21fdaa211d54", "score": "0.61165917", "text": "def find_campaigns_by_list_id(list_id, *args)\n campaigns({:list_id => list_id}, *args)['data']\n end", "title": "" }, { "docid": "731184e4bbac3c13901906ed0277c8cb", "score": "0.6111041", "text": "def get_and_create_campaigns\n LogHandle.info_ \"STARTING get and create all campaigns\"\n campaigns_arr = []\n response = RestUtil.run(\"campaigns\")\n response.each do |cmp|\n temp = {}\n temp[:id] = cmp[\"id\"]\n temp[:length_of_interview] = cmp[\"length_of_interview\"]\n temp[:cpi] = cmp[\"cpi\"]\n temp[:name] = cmp[\"name\"]\n campaigns_arr << temp\n end\n campaigns_response = Campaign.import! campaigns_arr # or use import!\n LogHandle.info_ \"ALL Campaign will be created object of campaigns array: #{campaigns_arr}\"\n if campaigns_response\n LogHandle.info_ \"Success - ALL Campaign were created.\"\n true\n else\n LogHandle.err_ \"Fail object of campaigns created : ERR: #{campaigns_response.errors}\"\n false\n end\n end", "title": "" }, { "docid": "886adfdb908a21a5d634628e1756a5ab", "score": "0.60956544", "text": "def adcampaigns(options = {})\n\t\t\tself.id = self.id + \"/adcampaigns\"\n\t\t\tread options\n\t\tend", "title": "" }, { "docid": "3d1f1bfd125279333c79ba091a3374fe", "score": "0.60664654", "text": "def load_campaigns; end", "title": "" }, { "docid": "793b9fc65b1ed4ac2d12d6f8275fef85", "score": "0.6046574", "text": "def campaing_list\n @account_id=params[:account_id]\n if params[:account_id]\n @account_id=params[:account_id]\n response = request_campaigns_list(ong)\n if response\n @campaigns = Campaign.get_campaigns_list(response)\n @campaign_count = response[:total_num_entries]\n end\n end \n\n end", "title": "" }, { "docid": "9906c18b97f5aaf5e2da4c17bebeeba6", "score": "0.60362613", "text": "def index\n @campaigns = Campaign.where(:advertiser_id => @advertiser.id)\n end", "title": "" }, { "docid": "7e7d914c68aa485d4c41f38bd58b3a03", "score": "0.6032943", "text": "def index\n @campaign_results = CampaignResult.all\n end", "title": "" }, { "docid": "f97d661d29f224ef9ce7b3788171aa85", "score": "0.60308725", "text": "def find_campaigns_by_list_name(list_name, *args)\n campaigns({:list_id => find_list_id_by_name(list_name)}, *args)['data']\n end", "title": "" }, { "docid": "5b5e2f5de4413ad04904a2fe269ac707", "score": "0.60305494", "text": "def sync_campaigns(opts={})\n page = opts[:page] ||= 1\n\n logger.info \"REQUESTING PAGE #{page}, FILTER: #{opts[:filter] || 'None'}\"\n response = parse_request(list_campaigns(page, opts[:filter]))\n\n unless response[\"result_code\"].zero? # 10 per page on campaigns\n response.slice(*(0..9).map(&:to_s)).values.each do |campaign|\n sync_campaign(campaign)\n end\n\n sync_campaigns(page: page + 1, filter: opts[:filter])\n end\n end", "title": "" }, { "docid": "307e10c1bd8a29ed20b5b4a3a70d9a6d", "score": "0.60286134", "text": "def test_get_campaign\n test_add_campaign() unless @campaign\n selector = @campaign_srv.module::CampaignSelector.new\n selector.ids = [@campaign.id]\n response = @campaign_srv.get(selector)\n assert_not_nil(response.rval.entries, 'Empty result set returned')\n assert_equal(1, response.rval.entries.size,\n 'Unexpected number of entries returned')\n assert_equal(@campaign.id, response.rval.entries.first.id)\n end", "title": "" }, { "docid": "08f9d15243e11804d12c0fbd1c6781d0", "score": "0.59997857", "text": "def index\n #@campaings = Campaing.all\n @selected_account = selected_account\n\n if @selected_account\n response = request_campaigns_list()\n if response\n @campaigns = Campaign.get_campaigns_list(response)\n @campaign_count = response[:total_num_entries]\n end\n end\n end", "title": "" }, { "docid": "d80d4202b2229d8bd23fa0a0e87d6783", "score": "0.5994318", "text": "def index\n @campaigns = Campaign.all\n end", "title": "" }, { "docid": "d80d4202b2229d8bd23fa0a0e87d6783", "score": "0.5994318", "text": "def index\n @campaigns = Campaign.all\n end", "title": "" }, { "docid": "d80d4202b2229d8bd23fa0a0e87d6783", "score": "0.5994318", "text": "def index\n @campaigns = Campaign.all\n end", "title": "" }, { "docid": "d80d4202b2229d8bd23fa0a0e87d6783", "score": "0.5994318", "text": "def index\n @campaigns = Campaign.all\n end", "title": "" }, { "docid": "d80d4202b2229d8bd23fa0a0e87d6783", "score": "0.5994318", "text": "def index\n @campaigns = Campaign.all\n end", "title": "" }, { "docid": "d80d4202b2229d8bd23fa0a0e87d6783", "score": "0.5994318", "text": "def index\n @campaigns = Campaign.all\n end", "title": "" }, { "docid": "d80d4202b2229d8bd23fa0a0e87d6783", "score": "0.5994318", "text": "def index\n @campaigns = Campaign.all\n end", "title": "" }, { "docid": "d80d4202b2229d8bd23fa0a0e87d6783", "score": "0.5994318", "text": "def index\n @campaigns = Campaign.all\n end", "title": "" }, { "docid": "d80d4202b2229d8bd23fa0a0e87d6783", "score": "0.5994318", "text": "def index\n @campaigns = Campaign.all\n end", "title": "" }, { "docid": "d80d4202b2229d8bd23fa0a0e87d6783", "score": "0.5994318", "text": "def index\n @campaigns = Campaign.all\n end", "title": "" }, { "docid": "d80d4202b2229d8bd23fa0a0e87d6783", "score": "0.5994318", "text": "def index\n @campaigns = Campaign.all\n end", "title": "" }, { "docid": "d80d4202b2229d8bd23fa0a0e87d6783", "score": "0.5994318", "text": "def index\n @campaigns = Campaign.all\n end", "title": "" }, { "docid": "fa68b3bbe0ed6eca19f614da96bc1a65", "score": "0.5959492", "text": "def reports_campaigns date_from:, date_until:, cID: nil\n call_adglare_api 'reports_campaigns', {date_from: date_from, date_until: date_until, cID: cID}\n end", "title": "" }, { "docid": "7124888cf73994fd7f996d508eeb06e0", "score": "0.59558904", "text": "def campaign_reports(request, options = {})\n offset = 0\n limit = 50\n response = []\n loop do\n options[:offset] = offset\n options[:limit] = limit\n page = CampaignReport.where(request, options.merge(marketer_id: id))\n .results\n .to_a\n response.concat(page)\n break if page.blank? || page.size < limit\n offset += limit\n end\n return response\n end", "title": "" }, { "docid": "8a8b2fd9754eaf0588b3e484f9edf80c", "score": "0.59491175", "text": "def index\n @email_campaigns = EmailCampaign.all\n stats\n end", "title": "" }, { "docid": "a101dee5ac700f1ae94510895a519927", "score": "0.5944671", "text": "def search_by\n params[:filter] = 'all' unless params[:filter]\n @trackings = []\n @customer_count = 0;\n @campaigns = current_user.campaigns_users.all\n case params[:filter]\n when 'all'\n current_user.customers.each do |c|\n @trackings += c.trackings.all\n end\n when 'week'\n # @campaigns = current_user.campaigns_users.where(:created_at.gte => DateTime.now.beginning_of_week, :created_at.lte => DateTime.now.end_of_week)\n current_user.customers.each do |c|\n @trackings += c.trackings.where(:created_at.gte => DateTime.now.beginning_of_week, :created_at.lte => DateTime.now.end_of_week)\n end\n when 'month'\n # @campaigns = current_user.campaigns_users.where(:created_at.gte => DateTime.now.beginning_of_month, :created_at.lte => DateTime.now.end_of_month)\n current_user.customers.each do |c|\n @trackings += c.trackings.where(:created_at.gte => DateTime.now.beginning_of_month, :created_at.lte => DateTime.now.end_of_month)\n end\n when '3months'\n # @campaigns = current_user.campaigns_users.where(:created_at.gte => DateTime.now.beginning_of_month, :created_at.lte => DateTime.now.end_of_month.advance(months: +3))\n current_user.customers.each do |c|\n @trackings += c.trackings.where(:created_at.gte => DateTime.now.beginning_of_month, :created_at.lte => DateTime.now.end_of_month.advance(months: +3))\n end\n when '6months'\n # @campaigns = current_user.campaigns_users.where(:created_at.gte => DateTime.now.beginning_of_month, :created_at.lte => DateTime.now.end_of_month.advance(months: +6))\n current_user.customers.each do |c|\n @trackings += c.trackings.where(:created_at.gte => DateTime.now.beginning_of_month, :created_at.lte => DateTime.now.end_of_month.advance(months: +6))\n end\n when 'year'\n # @campaigns = current_user.campaigns_users.where(:created_at.gte => DateTime.now.beginning_of_year, :created_at.lte => DateTime.now.end_of_year)\n current_user.customers.each do |c|\n @trackings += c.trackings.where(:created_at.gte => DateTime.now.beginning_of_year, :created_at.lte => DateTime.now.end_of_year)\n end\n else\n # @campaigns = current_user.campaigns_users.where(:created_at.gte => DateTime.now.beginning_of_day, :created_at.lte => DateTime.now.end_of_day)\n current_user.customers.each do |c|\n @trackings += c.trackings.where(:created_at.gte => DateTime.now.beginning_of_day, :created_at.lte => DateTime.now.end_of_day)\n end\n end\n end", "title": "" }, { "docid": "58da0e97e52a372080cf6b32dc95915f", "score": "0.5932893", "text": "def get_sms_campaigns\r\n\r\n # prepare query url\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << '/sms-campaigns'\r\n _query_url = APIHelper.clean_url _query_builder\r\n\r\n # prepare and execute HttpRequest\r\n _request = @http_client.get _query_url\r\n BasicAuth.apply(_request)\r\n _context = execute_request(_request)\r\n\r\n # validate response against endpoint and global error codes\r\n if _context.response.status_code == 404\r\n return nil\r\n end\r\n validate_response(_context)\r\n\r\n # return appropriate response type\r\n return _context.response.raw_body\r\n end", "title": "" }, { "docid": "4679d83aec8d896f5475fe6a85f96a1a", "score": "0.59234035", "text": "def index\n #@campaigns = current_user.campaigns\n @cms = current_user.campaign_members\n @campaigns_gm = []\n @campaigns_player = []\n @cms.each do |cm|\n if cm.role == CampaignRole::PLAYER || cm.role == CampaignRole::INVITED\n @campaigns_player << cm.campaign\n else\n @campaigns_gm << cm.campaign\n end\n end\n\n respond_to do |format|\n format.html \n format.xml { render :xml => @campaigns }\n end\n end", "title": "" }, { "docid": "c36ba3affeed3de825ce151c6390d988", "score": "0.58949476", "text": "def get_campaigns_by_account_id(account_id)\n\t\t\tresponse = call(:get_campaigns_by_account_id, \n\t\t\t\t{account_id: account_id})\n\t\t\tresponse_hash = get_response_hash(response, __method__)\n\t\t\tcampaigns = response_hash[:campaigns][:campaign].map do |camp_hash|\n\t\t\t\tBingAdsApi::Campaign.new(camp_hash)\n\t\t\tend\n\t\t\treturn campaigns\n\t\tend", "title": "" }, { "docid": "f776d2a68f883f7eaa625ca74370a632", "score": "0.5876494", "text": "def get_campaigns_for_goal(settings_file, goal_identifier, goal_type_to_track = 'ALL')\n campaigns = []\n if settings_file\n settings_file['campaigns'].each do |campaign|\n next if campaign.key?(:status) && campaign[:status] != 'RUNNING'\n\n goal = get_campaign_goal(campaign, goal_identifier)\n campaigns.push(campaign) if validate_goal(goal, goal_type_to_track)\n end\n end\n campaigns\n end", "title": "" }, { "docid": "0d27dbc230e8ad8bef171fb316e8819a", "score": "0.58677566", "text": "def stores_with_active_campaigns\n # hard-coded for now\n return [\n {id: 4168, name: \"Ashley Stewart\"},\n {id: 789, name: \"Best Buy\"}\n ]\nend", "title": "" }, { "docid": "11c10178b1c83f09dfa85f844b00f961", "score": "0.58614767", "text": "def get_campaigns_by_account_id(account_id)\n\t\t\tresponse = call(:get_campaigns_by_account_id,\n\t\t\t\t{account_id: account_id})\n\t\t\tresponse_hash = get_response_hash(response, __method__)\n\t\t\tresponse_campaigns = [response_hash[:campaigns][:campaign]].flatten.compact\n\t\t\tcampaigns = response_campaigns.map do |camp_hash|\n\t\t\t\tBingAdsApi::Campaign.new(camp_hash)\n\t\t\tend\n\t\t\treturn campaigns\n\t\tend", "title": "" }, { "docid": "11c10178b1c83f09dfa85f844b00f961", "score": "0.58614767", "text": "def get_campaigns_by_account_id(account_id)\n\t\t\tresponse = call(:get_campaigns_by_account_id,\n\t\t\t\t{account_id: account_id})\n\t\t\tresponse_hash = get_response_hash(response, __method__)\n\t\t\tresponse_campaigns = [response_hash[:campaigns][:campaign]].flatten.compact\n\t\t\tcampaigns = response_campaigns.map do |camp_hash|\n\t\t\t\tBingAdsApi::Campaign.new(camp_hash)\n\t\t\tend\n\t\t\treturn campaigns\n\t\tend", "title": "" }, { "docid": "bc039876335692de6154d306ff9b5c44", "score": "0.58573025", "text": "def get_all_campaigns(format, apikey, opts = {})\n data, _status_code, _headers = get_all_campaigns_with_http_info(format, apikey, opts)\n return data\n end", "title": "" }, { "docid": "e40623de818ab12be63f6678a06fd612", "score": "0.5856949", "text": "def get_campaigns_by_account_id(account_id)\n response = call(:get_campaigns_by_account_id,\n {account_id: account_id})\n response_hash = get_response_hash(response, __method__)\n response_campaigns = [response_hash[:campaigns][:campaign]].flatten.compact\n campaigns = response_campaigns.map do |camp_hash|\n BingAdsApi::Campaign.new(camp_hash)\n end\n return campaigns\n end", "title": "" }, { "docid": "3edb7d6674330433838850b91669ca2c", "score": "0.5854139", "text": "def index\n @campaigns = Campaign.active\n end", "title": "" }, { "docid": "74f5fda5aecf5b65eca6fb4f916b12a9", "score": "0.58540136", "text": "def ad_campaigns(search_terms: nil, sort_fields: nil, page_start_index: 0, page_size: 10)\n query = { \"AdvertiserId\": self.AdvertiserId,\n \"SearchTerms\": search_terms,\n \"SortFields\": sort_fields,\n \"PageStartIndex\": page_start_index,\n \"PageSize\": page_size }\n query.delete_if { |_k, v| v.nil? }\n AdCampaign.post('campaign/query/advertiser', query: query, objectify: AdCampaign)\n end", "title": "" }, { "docid": "68a92758b512d2f281134be0c7ebbc2c", "score": "0.5850422", "text": "def get_all_adwords\n create_client\n @profile_id = session['google_adwords_id']\n\n @adwords_clicks = get_metric_from_api('ga:adclicks', \"ga:campaign,ga:date\")\n @prev_adwords_clicks = get_metric_from_api_30_days_ago('ga:adclicks')\n @adwords_campaigns = get_metric_from_api('ga:adclicks,ga:adcost,ga:cpc,ga:ctr', 'ga:campaign')\n @prev_adwords_campaigns = get_metric_from_api_30_days_ago('ga:adclicks,ga:adcost,ga:cpc,ga:ctr', 'ga:campaign')\n end", "title": "" }, { "docid": "5580056c4fe38d3d2a1c61c34f1e6115", "score": "0.5825344", "text": "def find_campaigns_by_title(title)\n call(\"campaigns\", {:title => title})\n end", "title": "" }, { "docid": "8ef1dde144664a355843a7225b52e04a", "score": "0.5816195", "text": "def get_campaigns(opts = {})\n data, _status_code, _headers = get_campaigns_with_http_info(opts)\n data\n end", "title": "" }, { "docid": "2442bd70080688cbadce6dc86c0652aa", "score": "0.57888895", "text": "def index\n @campaign = Campaign.find(params[:campaign_id])\n @profiles = Profile.search(params[:campaign_id], params[:search])\n end", "title": "" }, { "docid": "976ff342dc083a8c4907e59d8def6514", "score": "0.5780379", "text": "def list(options={})\n Mailgun.submit(:get, campaign_url, options)[\"items\"] || []\n end", "title": "" }, { "docid": "aead553d895536db2e0ef0a55457ff6c", "score": "0.57715994", "text": "def email_stats_all(campaign_id, start = 0, limit = 100)\n call(\"campaignEmailStatsAIMAll\", campaign_id, start, limit)\n end", "title": "" }, { "docid": "c012fea3408b9011102a59a2d2ad51f6", "score": "0.57552314", "text": "def get_campaigns_for_page(offset = 0, number_per_page = DEFAULT_NBR_PER_PAGE)\n campaign_srv = @client.service(:CampaignService, @api_version)\n # Set initial values.\n page = {}\n # Get all the campaigns for this account.\n selector = {\n :fields => [\"Id\", \"Name\", \"Status\"],\n :ordering => [\n {:field => \"Id\", :sort_order => \"ASCENDING\"},\n ],\n :paging => {\n :start_index => 0,\n :number_results => number_per_page,\n },\n }\n begin\n page = campaign_srv.get(selector)\n if page[:entries]\n page[:entries].each do |campaign|\n @campaigns << {id: campaign[:id], name: campaign[:name], status: campaign[:status]}\n end\n end\n end\n page[:total_num_entries]\n end", "title": "" }, { "docid": "3604a674c7030419694204d0b8d784d2", "score": "0.575075", "text": "def index\n @campaigns = Campaign.paginate(page: params[:page])\n end", "title": "" }, { "docid": "884fcddb8c3925d4816335d65159730e", "score": "0.57302666", "text": "def index\n @ad_campaigns = AdCampaign.all\n end", "title": "" }, { "docid": "9e3c5d60684a609f005d8e7650280516", "score": "0.57162774", "text": "def ad_set_stats(get_all, ad_campaign_ids=[], start_time = nil, end_time = nil)\n stats_query_hash = self.class.get_stats_query(start_time, end_time)\n stats_path = path+\"/adcampaignstats\"\n if ad_campaign_ids.length > 0 && ad_campaign_ids.length < 200\n stats_query_hash[:campaign_ids] = \"[#{ad_campaign_ids.join(',')}]\"\n end\n stats_path += \"?\" + stats_query_hash.to_query if stats_query_hash.keys.length > 0\n \n result = []\n if get_all\n r = get(graph, stats_path)\n while r.to_a.count > 0\n result.concat(r.to_a)\n r = r.next_page\n end\n else\n\n result = get(graph, stats_path)\n end\n return result\n end", "title": "" }, { "docid": "869ae08c9c54f974963df53f04b0b243", "score": "0.5712561", "text": "def get_complaint_reports(campaign_id, page)\n full_path = full_resource_path(\"/#{campaign_id}/complaint_report\")\n query_params = MaropostApi.set_query_params({page: page})\n \n MaropostApi.get_result(full_path, query_params)\n end", "title": "" }, { "docid": "fc32be878d640065cd4d6b439785da17", "score": "0.57102466", "text": "def search_campaign\n data=params \n cuser = get_employee_user\n usermy_campaigns = cuser.employee.my_campaign == true\n if usermy_campaigns\n @campaigns = Campaign.all(:select => \"campaigns.*,(select first_mailed_date from campaign_members where first_mailed_date is not null and campaign_id = campaigns.id limit 1) as first_mailed_date,(select alvalue from company_lookups where id = campaigns.campaign_status_type_id) as campaign_status ,(select username from users where id = campaigns.owner_employee_user_id) as username,(select count(*) from campaign_members where campaign_id = campaigns.id and deleted_at is null) as member_count, (select count(responded_date) from campaign_members where campaign_id = campaigns.id and responded_date is not null) as responded_date, (select count(campaign_member_status_type_id) from campaign_members where campaign_id = campaigns.id and campaign_member_status_type_id = (select id from company_lookups where company_id = #{@company.id} and type ='CampaignMemberStatusType' and lvalue = 'Responded')) as campaign_member_status_type_id, (select count(*) from opportunities where campaign_id = campaigns.id and deleted_at is null) as opportunity, (select sum(amount) from opportunities where campaign_id = campaigns.id) as opportunity_amount\",:conditions=>[\"campaigns.owner_employee_user_id in (?)\", @emp_user_id],:order=>params[:order])\n else\n @campaigns = @company.campaigns.find_all_campaign(params,current_company)\n end \n @campaign = data[:parent_id].nil? ? @company.campaigns.new : @company.campaigns.find(data[:parent_id])\n @campaign.name='Copy Of ' + @campaign.name\n @campaign.starts_on =nil\n @campaign.parent_id= data[:parent_id]\n @campaign.ends_on =nil\n @campaign.campaign_status_type_id = CampaignStatusType.find_by_lvalue('InProgress')\n @status_types= @current_company.campaign_status_types\n @users = User.except(@current_user).all\n @msg=true\n @employees = User.find_user_not_admin_not_client(@company.id)\n render :partial=>'create'\n end", "title": "" }, { "docid": "82ac2be05561f5be399083c32afe30fd", "score": "0.5710101", "text": "def list_campaigns(page, since=nil)\n params = { api_key: ::APP_CONFIG[:api_key], api_action: \"campaign_list\",\n api_output: \"json\", sort: \"cdate\", sort_direction: \"ASC\",\n page: page }\n if since\n params[:filters] = { ldate_since_datetime: since }\n else\n params[:ids] = \"all\"\n end\n # returning 2015-12-14 - what the fuck. glad I went with the above version, but slightly in awe that I even came up with something so dense. -kbuckley\n # was gunning for impenetrability with this version:\n #params.[]=(*since ? [:filters,{ldate_since_datetime: since}] : [:ids,\"all\"])\n\n query_params = queryise(params)\n Net::HTTP::Get.new(\"/admin/api.php?#{query_params}\")\n end", "title": "" }, { "docid": "4c706a9bb97d093420a7ef2eaa911295", "score": "0.5693973", "text": "def sphinx_search_campaign\n @search_result =[]\n cuser = get_employee_user\n usermy_campaigns = cuser.employee.my_campaign == true\n unless params[:q].blank?\n if usermy_campaigns\n @search_result = @company.campaigns.search \"*\" + params[:q] + \"*\",:with =>{:owner_employee_user_id=>@current_user.id}, :limit => 10000\n else\n @search_result = @company.campaigns.search \"*\" + params[:q] + \"*\" , :limit => 10000\n end\n else\n inprogress = CampaignStatusType.find_all_by_lvalue_and_type_and_company_id('Inprogress', 'CampaignStatusType', @current_company).collect{|p| p.id}\n planned = CampaignStatusType.find_all_by_lvalue_and_type_and_company_id('Planned','CampaignStatusType', @current_company).collect{|p| p.id}\n if usermy_campaigns\n @search_result = @company.campaigns.all(:conditions => [\"owner_employee_user_id = ? AND campaign_status_type_id IN (?,?)\",@current_user.id, inprogress, planned], :order => 'created_at DESC')\n else\n @search_result = @company.campaigns.all(:conditions => [\"campaign_status_type_id IN (?,?)\", inprogress, planned], :order => 'created_at DESC')\n end\n end\n render :partial=> 'campaign_auto_complete', :object => @search_result\n end", "title": "" }, { "docid": "2ed500bdbe494a047da43656bcfa2775", "score": "0.5691263", "text": "def get_all_campaigns_with_http_info(format, apikey, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: CampaignsApi.get_all_campaigns ...\"\n end\n # verify the required parameter 'format' is set\n if @api_client.config.client_side_validation && format.nil?\n fail ArgumentError, \"Missing the required parameter 'format' when calling CampaignsApi.get_all_campaigns\"\n end\n # verify enum value\n if @api_client.config.client_side_validation && !['json', 'xml'].include?(format)\n fail ArgumentError, \"invalid value for 'format', must be one of json, xml\"\n end\n # verify the required parameter 'apikey' is set\n if @api_client.config.client_side_validation && apikey.nil?\n fail ArgumentError, \"Missing the required parameter 'apikey' when calling CampaignsApi.get_all_campaigns\"\n end\n # resource path\n local_var_path = \"/campaigns.{Format}\".sub('{' + 'Format' + '}', format.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'apikey'] = apikey\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = []\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 => 'GetAllCampaignsResponse')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CampaignsApi#get_all_campaigns\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "00d5f511e36cd94c7b34e786a9143319", "score": "0.5682616", "text": "def get_email_campaigns_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: EmailCampaignsApi.get_email_campaigns ...'\n end\n if @api_client.config.client_side_validation && opts[:'type'] && !['classic', 'trigger'].include?(opts[:'type'])\n fail ArgumentError, 'invalid value for \"type\", must be one of classic, trigger'\n end\n if @api_client.config.client_side_validation && opts[:'status'] && !['suspended', 'archive', 'sent', 'queued', 'draft', 'inProcess'].include?(opts[:'status'])\n fail ArgumentError, 'invalid value for \"status\", must be one of suspended, archive, sent, queued, draft, inProcess'\n end\n if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100\n fail ArgumentError, 'invalid value for \"opts[:\"limit\"]\" when calling EmailCampaignsApi.get_email_campaigns, must be smaller than or equal to 100.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"limit\"]\" when calling EmailCampaignsApi.get_email_campaigns, must be greater than or equal to 0.'\n end\n\n if @api_client.config.client_side_validation && opts[:'sort'] && !['asc', 'desc'].include?(opts[:'sort'])\n fail ArgumentError, 'invalid value for \"sort\", must be one of asc, desc'\n end\n # resource path\n local_var_path = '/emailCampaigns'\n\n # query parameters\n query_params = {}\n query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil?\n query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?\n query_params[:'startDate'] = opts[:'start_date'] if !opts[:'start_date'].nil?\n query_params[:'endDate'] = opts[:'end_date'] if !opts[:'end_date'].nil?\n query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?\n query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?\n query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['api-key', 'partner-key']\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 => 'GetEmailCampaigns')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: EmailCampaignsApi#get_email_campaigns\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "f320cf827f955023e3e01c620b5ba2b6", "score": "0.5680462", "text": "def show\n @campaign = Campaign.find(params[:id])\n @gms = @campaign.campaign_members.where(:role => CampaignRole::GM)\n @assts = @campaign.campaign_members.where(:role => CampaignRole::ASST_GM)\n @players = @campaign.campaign_members.where(:role => CampaignRole::PLAYER)\n @invites = @campaign.campaign_members.where(:role => CampaignRole::INVITED)\n\n respond_to do |format|\n format.html \n format.xml { render :xml => @campaign }\n end\n end", "title": "" }, { "docid": "130270a11fc3c8f16b676837dcb743cf", "score": "0.56792593", "text": "def get_email_campaign_schedules(access_token, campaign)\n\t\t\tcampaign_id = get_argument_id(campaign, 'Campaign')\n\t\t\tServices::CampaignScheduleService.get_schedules(access_token, campaign_id)\n\t\tend", "title": "" }, { "docid": "9cf4f850027aa55fbf4b80a0b85a0885", "score": "0.5678382", "text": "def show\n @campaign = Campaign.find(params[:id])\n @clients = Client.where({:location => @campaign.location})\n end", "title": "" } ]
e9a3e3ce51e4d8c61f05e803ac9e6b4c
Returns whether or not the given arguments are acceptable when running the task. In addition to returning the boolean outcome, if a block is given, it is called with a string of formatted error messages that describes the difference between what was given and what is expected. The error message may have multiple lines of text, and each line is indented one space.
[ { "docid": "9ffff8253386356358688f38734f5237", "score": "0.6206897", "text": "def runnable_with?(args_hash)\n params = @task.parameters\n params_type = if params.nil?\n T_GENERIC_TASK_HASH\n else\n Puppet::Pops::Types::TypeFactory.struct(params)\n end\n return true if params_type.instance?(args_hash)\n\n if block_given?\n tm = Puppet::Pops::Types::TypeMismatchDescriber.singleton\n error = if params.nil?\n tm.describe_mismatch('', params_type, Puppet::Pops::Types::TypeCalculator.infer_set(args_hash))\n else\n tm.describe_struct_signature(params_type, args_hash).flatten.map {|e| e.format }.join(\"\\n\")\n end\n yield \"Task #{@task.name}:\\n#{error}\"\n end\n false\n end", "title": "" } ]
[ { "docid": "8bac988523927a92284adf8890e3344b", "score": "0.6327658", "text": "def arguments_valid?\n raise \"TODO - parse arguments\"\n end", "title": "" }, { "docid": "c41a8f075b76e63e8bb5a76b3ddfd598", "score": "0.632534", "text": "def arguments_valid? \n case @arguments.length\n when 1\n %w[projects milestones users list].include?(@arguments[0]) \n when 2\n %w[show resolve new reopen].include?(@arguments[0]) \n when 3\n %w[assign new milestone].include?(@arguments[0]) \n when 4\n %w[new].include?(@arguments[0]) \n else\n false\n end \n end", "title": "" }, { "docid": "6b07804711b09366874339f55045d4a2", "score": "0.62595135", "text": "def is_executed(*args, &block)\n ExecutionFailure.to_matcher(args, &block)\n end", "title": "" }, { "docid": "7248c721478b03cfc91294d573197fc5", "score": "0.62061423", "text": "def test_cmd_args_not_interpreted1\n checker = ArguementChecker.new\n assert_equal false, checker.arguement_check(%w[Cat 3 2])\n end", "title": "" }, { "docid": "33aba1a0c2428e50fc62b74ae1c2ee5f", "score": "0.6205409", "text": "def test_cmd_args_not_interpreted2\n checker = ArguementChecker.new\n assert_equal false, checker.arguement_check(%w[1 Cat 3])\n end", "title": "" }, { "docid": "ad0119658526a74a19fe49df5b8f4c49", "score": "0.6154953", "text": "def test_cmd_args_valid_input\n checker = ArguementChecker.new\n assert_equal true, checker.arguement_check(%w[1 3 2])\n end", "title": "" }, { "docid": "2786f166d0651d33dc727e81edebbd2b", "score": "0.61535025", "text": "def validateArgs()\n \n return true\nend", "title": "" }, { "docid": "e404367294f8224d48c47b6aa8fdbce6", "score": "0.61345595", "text": "def raise_error_args?\n arg_types = arguments.map(&:sexp_type)\n [[], [:str], [:const], %i[const str], [:colon2]].include?(arg_types)\n end", "title": "" }, { "docid": "34ae73587c0f9d71ebe7c6596eed8be6", "score": "0.61255145", "text": "def raise_error_args?\n arg_types = arguments.map(&:sexp_type)\n [[], [:str], [:const], [:const, :str]].include?(arg_types)\n end", "title": "" }, { "docid": "a3663d769fe7e4486335c5c6e2577513", "score": "0.6118525", "text": "def valid_arguments?\n begin\n if(@options.file)\n raise LoadError,\"The file you specified doesn't exist: #{@options.file}\" if File.exist?(@options.file) == false\n else\n @log.error \"Select a file using -f or --file FILE\"\n end\n \n if(@options.output)\n # not going to worry about this one.\n else\n @log.error \"No output was specified select using -o or --output\"\n end\n rescue LoadError => bam\n @log.error bam\n exit\n end\n \n return true\n end", "title": "" }, { "docid": "3d82c5ad549f45f49265fc58d7ad262b", "score": "0.61109066", "text": "def args_are_valid\n begin\n Integer(eval(ARGV[0]))\n return true\n rescue Exception => e\n return false\n end\nend", "title": "" }, { "docid": "87b82717ecb46dfb82ba36e240e10417", "score": "0.61076456", "text": "def test_cmd_args_negative2\n checker = ArguementChecker.new\n assert_equal false, checker.arguement_check(%w[1 3 -2])\n end", "title": "" }, { "docid": "bdaa008db716e3049fcf85118c7555e1", "score": "0.60992247", "text": "def test_cmd_args_not_interpreted3\n checker = ArguementChecker.new\n assert_equal false, checker.arguement_check(%w[1 2 Cat])\n end", "title": "" }, { "docid": "54daf010da367773171ddd7d5f3f4de5", "score": "0.60979223", "text": "def arguments_valid?\n true if (@arguments[0].is_a?(String) && @arguments[1].is_a?(String))\n end", "title": "" }, { "docid": "9370624a8ecf3958f48d067532ff884a", "score": "0.6097258", "text": "def allowed_argument_error?(err, cmd, args)\n msg = RUBY_ENGINE == 'rbx' && err.class == ArgumentError ?\n /given \\d+, expected \\d+/ : /wrong number of arguments/\n err.message[msg] && (cmd_obj = Command.find(cmd)) &&\n cmd_obj.incorrect_arg_size?(args)\n end", "title": "" }, { "docid": "bb0ff10f280ca73dd9e65e42e3ec456c", "score": "0.6059853", "text": "def block_pass_in_args?(arg_nodes)\n arg_nodes.any? && arg_nodes.last.type == :block_pass\n end", "title": "" }, { "docid": "bf78260277104a3dadb0d932d5177063", "score": "0.60597706", "text": "def test_cmd_args_negative1\n checker = ArguementChecker.new\n assert_equal false, checker.arguement_check(%w[1 -2 3])\n end", "title": "" }, { "docid": "b71e17e1934611de7f0435dd1825f111", "score": "0.6053284", "text": "def arguments_valid?\n if @options.assemble and @options.expand\n puts \"process, assemble and expand are mutually exclusive options\"\n return false\n end\n return true\n end", "title": "" }, { "docid": "be1abfc68f77f2abae2b36810e1841d8", "score": "0.60530096", "text": "def is_task_argument_error( backtrace, task_name )\n backtrace[0].end_with?(\"in `#{task_name}'\") and # inside the task method\n backtrace[1].end_with?(\"in `call'\") and # in Task#call\n backtrace[2].end_with?(\"in `execute'\") and # in Task#execute\n backtrace[3].end_with?(\"in `start!'\") # in Caty::start!\n end", "title": "" }, { "docid": "f2e9a1a6d1c4f1b23065425e2bd68028", "score": "0.6015951", "text": "def arguments_valid?\n if !@options.parameter.nil? && !@options.start.nil? && !@options.end.nil? && !@options.steps.nil? && @arguments.length == 1\n true\n elsif @arguments.length == 2\n true\n else\n false\n end\n end", "title": "" }, { "docid": "277adbfe610b82610259e8ea4d4ebd1b", "score": "0.6004134", "text": "def validate_task_arguments\n arguments_match_task_attributes if arguments.present?\n if task.invalid?\n error_messages = task.errors\n .map { |error| \"#{error.attribute.inspect} #{error.message}\" }\n errors.add(\n :arguments,\n \"are invalid: #{error_messages.join(\"; \")}\"\n )\n end\n rescue Task::NotFoundError\n nil\n end", "title": "" }, { "docid": "0ff38ca1e199c1ad42d62212258d9f2e", "score": "0.59911895", "text": "def args_correct?(args, target_length, usage)\n puts 'Invalid arguments. Usage: #{usage}' if args.length < target_length\n return args.length >= target_length\n end", "title": "" }, { "docid": "1d9e3c38c9e842a98775b9cc3ac758aa", "score": "0.59849596", "text": "def test_cmd_args_one\n checker = ArguementChecker.new\n assert_equal false, checker.arguement_check([1])\n end", "title": "" }, { "docid": "c67ac0434d56805bb61ed8b437536f02", "score": "0.5983921", "text": "def valid_args?(accepted_arg_formats)\n valid_args = false\n\n accepted_arg_formats.each { |format|\n # if no arguments exist, and no arguments is an accepted format, args are valid.\n if format.empty? && @current_args.empty?\n valid_args = true\n else\n passed_in_args = @current_args.clone\n\n format.each_with_index { |arg, i|\n passed_in_args[i] = arg if CMD_BLACKLIST.include?(arg)\n }\n\n @invalid_args = passed_in_args - format - [nil]\n\n valid_args = true if passed_in_args == format\n end\n }\n\n valid_args\n end", "title": "" }, { "docid": "3a097f18e708528461d0160a9fc594cd", "score": "0.5969178", "text": "def arguments_valid?\n if (@options.barbers > 0 and @options.chairs > 0 and\n @options.waiting > 0 and @options.registers > 0)\n true\n else\n puts \"Cannot have a working barber shop without positive numbers.\".color(@color_err)\n false\n end\n end", "title": "" }, { "docid": "6158fdf796603b589d573819a7102f39", "score": "0.5931082", "text": "def arguments_valid?\n valid = true\n\n # If there is a config option set and the file doesnt' exist, then we have a\n # problem\n if (@options.config && !File::exists?(File.expand_path(@options.config)))\n puts \"Invalid configuration file path #{@options.config}\"\n valid = false\n end\n\n valid\n end", "title": "" }, { "docid": "e611bc37ef31f2462e22d9a4a02204c7", "score": "0.59267503", "text": "def test_cmd_args_two\n checker = ArguementChecker.new\n assert_equal false, checker.arguement_check(%w[1 2])\n end", "title": "" }, { "docid": "eaa0a1837658836979489dfb2197e5c6", "score": "0.59217674", "text": "def arguments_valid?\n # LOG.info(\"Checking arguments/options @arguments.length=#{ @arguments.length} @options.username=#{@options.username} @options.hostname=#{@options.hostname} @options.destination=#{@options.destination}\")\n true if @arguments.length == 1 && @options.username && @options.hostname && @options.destination\n end", "title": "" }, { "docid": "3279db4bc732685ecb941a064a114796", "score": "0.5913972", "text": "def valid_args? *args\n\t\targs.each do |arg|\n\t\t\traise ArgumentError.new('Invalid Argument') if arg.nil? or (arg.instance_of? String and arg.strip.empty?)\n\t\tend\n\t\treturn true\n\tend", "title": "" }, { "docid": "efb4e09ba1c7952a0386e95c4f495ff7", "score": "0.5907996", "text": "def arguments_valid?\n valid = true\n\n # If there is a config option set and the file doesnt' exist, then we have a problem\n if (@options.config && !File::exists?(File.expand_path(@options.config)))\n puts \"Invalid configuration file path #{@options.config}\"\n valid = false\n end\n\n valid\n end", "title": "" }, { "docid": "8afe10cb9118a78b5d6fb781e77004df", "score": "0.5906999", "text": "def run_fails?(command, args = nil)\n !run_succeeds?(command, args)\n end", "title": "" }, { "docid": "4240a47dad9ebb8b04e7c2c2b9e007fb", "score": "0.58918965", "text": "def arguments_valid?\n # No arguments to validate so just return true \n true\n end", "title": "" }, { "docid": "1f96bab8fdae89226902f6132e62e2b6", "score": "0.587391", "text": "def check_params(args)\n if args[2].to_i <= 2\n puts \"num_boots must be a natural number higher than 30\"\n wrong_arg = true\n end\n\n if args[3].to_s != \"true\" && args[3].to_s != \"false\"\n puts \"backbone must be 'true' or 'false'.\"\n wrong_arg = true\n end\n\n if args[4].gsub(/[pmc]/, '').to_i <= 0\n puts \"min_frequency must be a natural number X (optional with description Xpm or Xpc)\"\n wrong_arg = true\n end\n\n if ! (['bbrc', 'mean', 'mle'].include? args[5])\n puts \"method must be 'bbrc', 'mean' or 'mle'\"\n wrong_arg = true\n end\n\n if args[6].to_s != \"true\" && args[6].to_s != \"false\"\n puts \"find_min_frequency must be 'true' or 'false'\"\n wrong_arg = true\n end\n\n if args[7].to_i < 1\n puts \"start_seed must be a natural number\"\n wrong_arg = true\n end\n\n if args[8].to_i < 1\n puts \"end_seed must be a natural number\"\n wrong_arg = true\n end\n\n if args[7].to_i > args[8].to_i\n puts \"start_seed has to be smaller than end_seed\"\n wrong_arg = true\n end\n\n if ! (args[9].to_f <= 0.9 && args[9].to_f >= 0.1)\n puts \"split_ratio must be between 0.1 and 0.9\"\n wrong_arg = true\n end\n\n if ! (args[10].to_f <= 0.1 && args[10].to_f >= 0.0005)\n puts \"time_per_cmpd must be between 0.0005 and 0.1\"\n wrong_arg = true\n end\n \n if wrong_arg == true\n return false\n else\n return true\n end\nend", "title": "" }, { "docid": "eedce7f6ace2734c858e7fdb9a738232", "score": "0.5870104", "text": "def test_verify_args_one_invalid\n refute verify_args(['1', '-1', '1'])\n end", "title": "" }, { "docid": "038ebb88e8ffbaddc30f608efd8edfe3", "score": "0.585838", "text": "def arguments_valid?\n if not @options.file then\n return false\n end\n return true\n end", "title": "" }, { "docid": "f6d2cf356db23e558cd8797ca76adb35", "score": "0.5853789", "text": "def arguments_valid?\n return false if (@options[:partition_class] and @options[:rmcls])\n\n if @options[:rmcls]\n return false unless (@options[:cls_file] and @options[:lrn_file])\n elsif @options[:partition_class]\n return false unless (@options[:cls_file] and @options[:name_file] and @options[:fasta_file])\n end\n true\n end", "title": "" }, { "docid": "63d69d95f23b0ecdee514a8224a0c6ac", "score": "0.5853052", "text": "def validate_options!\n if override_and_named_given?\n ui.error('--override_runlist and --named_run_list are exclusive')\n exit 1\n end\n if json_attribs_without_override_given?\n ui.error(\n '--json-attributes must be used with --override-runlist ' \\\n 'or passed json should includes key `run-list` ' \\\n 'to avoid unexpected updating local node object.'\n )\n exit 1\n end\n true\n end", "title": "" }, { "docid": "0e8aa5d9c9fbcbb55fa3772e8e0c2a4d", "score": "0.58490443", "text": "def args_valid?\n return true if !args\n return true if args.is_a?(String)\n return true if args.is_a?(Integer)\n if args.is_a?(Array)\n args.each do |a|\n return false if !a.kind_of?(String) && !a.kind_of?(Integer)\n end\n\n return true\n end\n end", "title": "" }, { "docid": "0e8aa5d9c9fbcbb55fa3772e8e0c2a4d", "score": "0.58490443", "text": "def args_valid?\n return true if !args\n return true if args.is_a?(String)\n return true if args.is_a?(Integer)\n if args.is_a?(Array)\n args.each do |a|\n return false if !a.kind_of?(String) && !a.kind_of?(Integer)\n end\n\n return true\n end\n end", "title": "" }, { "docid": "8a216332530fbc95a24e5014ccabf642", "score": "0.58465713", "text": "def check_arguments(&body)\n @check_arguments_block = body\n end", "title": "" }, { "docid": "7165cdb4d62679cdc4815195a61b11be", "score": "0.5824999", "text": "def arguments_valid?\n true if @arguments.length == 2 and @arguments[0] != @arguments[1]\n end", "title": "" }, { "docid": "2346b954bee405b0a31225cd874f9da6", "score": "0.58191305", "text": "def sanity_check_arguments(args)\n if ARGV.length == 0\n raise(\"No arguments - usage is: ruby i18nChecker.rb <file_spec_glob> [complete] [summary]\")\n end\n \n file_spec = args[0]\n complete = false;\n summary = false;\n \n args[1..-1].each do |arg|\n if \"complete\" == arg.downcase()\n complete = true\n elsif \"summary\" == arg.downcase()\n summary = true\n else \n raise(\"'#{arg}' is an invalid argument\")\n end\n end\n\n puts \"file_spec = '#{file_spec}', complete = #{complete}, summary = #{summary}\"\n return file_spec, complete, summary\n end", "title": "" }, { "docid": "f690c553f1b42f0f02d01d087adb4305", "score": "0.580987", "text": "def block_argument?\n arguments? &&\n (last_argument.block_pass_type? || last_argument.blockarg_type?)\n end", "title": "" }, { "docid": "8c19e269d69dd50371d017ac0b6c1a67", "score": "0.5803913", "text": "def test_bad_single_input\r\n\tassert_equal 0, @arg_checker.check_args(['hello'])\r\n end", "title": "" }, { "docid": "142bdad0932a6d9e5d675e149f843bbc", "score": "0.57916737", "text": "def test_check_args_invalid_string3\n args = CheckArgs.new\n assert_equal false, args.check_args(['HI', 4])\n end", "title": "" }, { "docid": "f3b918916adc6f2de8635beecde4022c", "score": "0.5788496", "text": "def test_args_valid\n args = [0, 1, 1]\n refute check_args(args)\n end", "title": "" }, { "docid": "b82e666e10f37b6bbd33aaa1c13b59da", "score": "0.57489127", "text": "def run_succeeds?(command, args = nil)\n run_quietly(command, args)\n true\n rescue RunError\n false\n end", "title": "" }, { "docid": "b35bf1d58f759c278728303bbdf373f3", "score": "0.57479286", "text": "def valid_args?(args)\n args.count == 2 && args[1].to_i > 0\nrescue StandardError\n false\nend", "title": "" }, { "docid": "80c5ed23ddc1db541a0588ba64a0a1b5", "score": "0.57450616", "text": "def test_invalid_arg_type\n argue = %w[hello world]\n check = Checker.new\n assert_equal check.check_args(argue), false\n end", "title": "" }, { "docid": "93d7a09233cb370d14eabbda302b4300", "score": "0.57390636", "text": "def test_check_args_invalid_string2\n args = CheckArgs.new\n assert_equal false, args.check_args(%w[HI HI2])\n end", "title": "" }, { "docid": "76e1b4fadfbd83d15360247751d015cf", "score": "0.5737668", "text": "def check_block_arity!(block, args)\n # Convert the block to a lambda-style proc. You can't make this shit up.\n obj = Object.new\n obj.define_singleton_method(:block, &block)\n block = obj.method(:block).to_proc\n # Check\n required_args = block.arity < 0 ? ~block.arity : block.arity\n if args.length < required_args || (block.arity >= 0 && args.length > block.arity)\n raise ArgumentError.new(\"wrong number of arguments (#{args.length} for #{required_args}#{block.arity < 0 ? '+' : ''})\")\n end\n end", "title": "" }, { "docid": "51180d806645050cbcde38d2e23c87fc", "score": "0.57254666", "text": "def checkLegit_ness\n\t\tif ARGV.length > 2\n\t\t\tputs \"error\"\n\t\telse\n\t\t\trunCode\n\t\tend\n\tend", "title": "" }, { "docid": "26550701592ed45d472299c6b84601d1", "score": "0.57220197", "text": "def validate_arguments\n # Total number of arguments must 3\n raise 'Incorrect number of arguments given. Expecting 3 arguments' unless ARGV.length == 3\n # Last argument must be either 'north', 'south', 'east', or 'west' (not case sensitive)\n raise 'Invalid direction given. Must be either north, south, east, or west' unless ACCEPTED_DIRECTIONS.include?(ARGV[2].downcase)\nend", "title": "" }, { "docid": "7889971f6b809d18586869f86bb996ff", "score": "0.57184935", "text": "def arguments_valid?\n unless @arguments.length == 1 \n raise InvalidArgumentError, \"No source file specified\"\n end\n \n unless File.file? @arguments[0] \n raise InvalidArgumentError, \"Cannot find source file #{@arguments[0]}\"\n end\n\n true\n end", "title": "" }, { "docid": "9793e31b4c48afa7907bf67f915c6fc7", "score": "0.5714117", "text": "def error\n \"Invalid input `#{args.join(',')}` for #{@name}.\\nUsage: #{@correct_format}\"\n end", "title": "" }, { "docid": "1daceffe5918fa845ea8ec76f43c595a", "score": "0.57138216", "text": "def validateArguments()\n # XXX extract error messages to different file\n # NULL checks\n if @metric == nil and @regexp == nil\n return false, \"Metric and regexp can't be both empty\"\n end\n if @socket == nil\n return false, \"The socket can't be empty\"\n end\n if @critical == nil\n return false, \"Critical can't be empty\"\n end\n if @warning == nil\n return false, \"Warning can't be empty\"\n end\n if @data_name == nil\n return false, \"Data name can't be empty\"\n end\n if @timeout == nil\n return false, \"Timeout can't be empty\"\n end\n if @cli_handler == nil\n return false, \"The cli handler can't be empty\"\n end\n # Validate data type\n if !self.isFloat(@critical)\n return false, \"Critical has to be a number\"\n elsif @critical.to_f < 0\n return false, \"Critical has to be a positive number\"\n end\n if !self.isFloat(@warning)\n return false, \"Warning has to be a number\"\n elsif @warning.to_f < 0\n return false, \"Warning has to be a positive number\"\n end\n if !self.isFloat(@timeout)\n return false, \"Timeout has to be a number\"\n elsif @timeout.to_f < 0\n return false, \"Timeout has to be a positive number\"\n end\n if @metric != nil and !(@metric.instance_of? String)\n return false, \"Metric has to be a string\"\n end\n if @regexp != nil and !(@regexp.instance_of? String)\n return false, \"Regexp has to be a string\"\n end\n # Validate that metric and regexp are not both set at the same time\n if (@metric != nil and @metric != \"\") and (@regexp != nil and @regexp != \"\")\n return false, \"Only one of the options, metric or regexp, can be provided\"\n end\n return true, \"\"\n end", "title": "" }, { "docid": "3d9a51cdd31459eeb082477dc1229b39", "score": "0.5711939", "text": "def arguments_valid?\n true\n end", "title": "" }, { "docid": "3d9a51cdd31459eeb082477dc1229b39", "score": "0.5711939", "text": "def arguments_valid?\n true\n end", "title": "" }, { "docid": "3d9a51cdd31459eeb082477dc1229b39", "score": "0.5711939", "text": "def arguments_valid?\n true\n end", "title": "" }, { "docid": "3d9a51cdd31459eeb082477dc1229b39", "score": "0.5711939", "text": "def arguments_valid?\n true\n end", "title": "" }, { "docid": "3d9a51cdd31459eeb082477dc1229b39", "score": "0.5711939", "text": "def arguments_valid?\n true\n end", "title": "" }, { "docid": "3d9a51cdd31459eeb082477dc1229b39", "score": "0.5711939", "text": "def arguments_valid?\n true\n end", "title": "" }, { "docid": "3d9a51cdd31459eeb082477dc1229b39", "score": "0.5711939", "text": "def arguments_valid?\n true\n end", "title": "" }, { "docid": "7354681dd35f5057a54dc2ad247eeecf", "score": "0.5705372", "text": "def test_check_args_invalid2\n args = CheckArgs.new\n assert_equal false, args.check_args([1])\n end", "title": "" }, { "docid": "e8de4791dee4651bf8002608a9c1e506", "score": "0.56999534", "text": "def validate_args(opts={})\n return if (missing = [:rows, :cols].select{ |a| opts[a].to_i <= 0 }).empty?\n return if (missing ||= [:out, :rows, :cols].select{|a| opts[a].nil? }).empty?\n usage(missing)\n end", "title": "" }, { "docid": "76ac1c3403d8621561ac79b3c0d55497", "score": "0.56993717", "text": "def invalid_argument?(arguments)\n return true if arguments.nil?\n\n # arguments = \"X,Y,DIRECTION\"\n *positions, direction = arguments.split(\",\")\n \n position_x, position_y = positions.map { |num_string| num_string.to_i }\n direction = direction.to_sym\n return true if position_x.nil? || position_y.nil? || direction.nil?\n\n # returns true if any of the 3 arguments are invalid\n !(valid_position_x?(position_x) && valid_position_y?(position_y) && valid_direction?(direction))\n end", "title": "" }, { "docid": "893b34cc3331035a080babede2c3fcbf", "score": "0.56957704", "text": "def arguments_valid?\n true if @arguments.length >= 4 && @options.interval && @options.user\n end", "title": "" }, { "docid": "d1da8a5e1ddeab018d3644ba5245d797", "score": "0.56945735", "text": "def valid_command?(command, command_args)\n command &&\n (command.number_of_arguments == command_args.size) &&\n command.valid_format?(command_args)\n end", "title": "" }, { "docid": "02a190baa65b2ea3594c764e31e77652", "score": "0.5690097", "text": "def arguments_valid?\n\t\t# TO DO - implement your real logic here\n\t\t#puts \"arguments = #{@arguments.length} \\n\"\n\t\ttrue if @arguments.length >= 1 \n\tend", "title": "" }, { "docid": "432c438225656d123d20a08c50b54372", "score": "0.5679438", "text": "def arguments_valid?\n true if @options.author.length >= 1 or @options.key.length >= 1 or\n @options.conf.length >= 1 or @options.keyword.length >= 1 or @options.input != nil\n end", "title": "" }, { "docid": "6ad30ec7ca0d6ad06ffc8364def43a97", "score": "0.5676093", "text": "def allowed_multiline_argument?(node); end", "title": "" }, { "docid": "2bf85bd14ac71e06686a36666c77dc41", "score": "0.56710076", "text": "def check_min_args\n arg_message = 'Not enough arguments. Please use the following format: '\n arg_message += './templater.rb [template_name] [data_name] [output_name]'\n fail arg_message if ARGV.size < 2\n end", "title": "" }, { "docid": "b3f102a9a8f558cc1f3128ce13b8adbf", "score": "0.56675524", "text": "def test_check_args_invalid_name\n assert_equal false, check_args(\"this isn't a real file.txt\")\n end", "title": "" }, { "docid": "c7639532fdfdb2111a61494535fd79ed", "score": "0.5658258", "text": "def place_args_valid?(args)\n return false if args.nil?\n args = place_args_deconstruct(args)\n Helper::is_i?(args[0]) and Helper::is_i?(args[1]) and directions.include?(args[2])\n end", "title": "" }, { "docid": "657f1cbba2807e15fbadecbe394de423", "score": "0.5657385", "text": "def test_check_args_invalid_string\n args = CheckArgs.new\n assert_equal false, args.check_args(['HI'])\n end", "title": "" }, { "docid": "a13935a3ec714a14b691d7cdaf5d10b0", "score": "0.56451726", "text": "def run(model, runner, user_arguments)\n super(model, runner, user_arguments)\n\n # use the built-in error checking\n if !runner.validateUserArguments(arguments(model), user_arguments)\n return false\n end\n\n fail \"Major bad\"\n\n return true\n\n end", "title": "" }, { "docid": "35089176099769e481f73ba1f641d2d0", "score": "0.5645153", "text": "def arguments_valid?\n\t\tnum_required = 0\n\t\treturn false if @arguments.length != num_required\n\t\t# TO DO - check if arguments are valid\n\t\tprocess_arguments\n\tend", "title": "" }, { "docid": "d18c8b80615a12ed0ec9fd09343430f1", "score": "0.5642255", "text": "def verify_args(args)\n return false unless args.count == 3\n\n verify_int(args[0]) && verify_positive_int(args[1]) && verify_positive_int(args[2])\nend", "title": "" }, { "docid": "d5c93b62a064694e8d88eaf186402a39", "score": "0.5639454", "text": "def argument_error?(data, type = nil, &block)\n return block.yield if block\n return true unless type && data.is_a?(type)\n\n false\n end", "title": "" }, { "docid": "020e30bd0c4e954251498898e1e5ce09", "score": "0.5637666", "text": "def test_verify_args_mixed_2\n refute verify_args(['1', 'foo', '-22'])\n end", "title": "" }, { "docid": "72338dd11a4638cf99af9373606e77b6", "score": "0.5632563", "text": "def valid_arguments?\n @args.size == 1\n end", "title": "" }, { "docid": "4aab77e0e7dedce374d05fe6ef101d0d", "score": "0.5632412", "text": "def arguments_valid?\n true if @arguments.length == 1 || @options.list == true\n end", "title": "" }, { "docid": "677407f36d32efaa516d87f968ceb04d", "score": "0.56315833", "text": "def arguments_valid?\n \n end", "title": "" }, { "docid": "34802443dceef0207f07c5d58fcdd9be", "score": "0.5631421", "text": "def check_arguments_number?(command, number)\n user_output(\"bad_args\", true) if number != command.count\n true # I guess you're doing it because a method with \"?\" is supposed to always return a boolean but\n # a better solution would be to change the name of this method\n end", "title": "" }, { "docid": "97775fc0baabd3a67748d489ec6bef51", "score": "0.5625294", "text": "def run(*arguments, &block)\n parse_options\n yield(*arguments) if block_given?\n return print_errors\n rescue ExitException => exception\n return exception.status\n end", "title": "" }, { "docid": "c3b417cb7525f828ab76157c290d1805", "score": "0.56228745", "text": "def arguments_valid?\n #things to do check file, add further\n begin\n raise LoadError,\"The file you specified doesn't exist: #{@options.file}\" if (File.exist?(@options.file) == false)\n #raise DirectoryError,\"The directory you specified as the outpath doesn't exist: #{@options.outpath}\" if File.directory?(@options.outpath) == false\n rescue LoadError => bam\n puts bam\n exit\n resuce DirectoryError => boom\n puts boom\n # puts \"creating directory and giving it another try (okay not yet implemented\"\n exit\n end\n \n return true\n end", "title": "" }, { "docid": "24311709b4aa21fcc80ce6fab4b1a58b", "score": "0.5622367", "text": "def test_check_args_invalid_negative\n args = CheckArgs.new\n assert_equal false, args.check_args([-2, 2])\n end", "title": "" }, { "docid": "22f160d9fcc2002657981f726763b2b6", "score": "0.5620292", "text": "def arguments_valid?\r\n # TO DO - implement your real logic here\r\n true if @arguments.length == 2\r\n end", "title": "" }, { "docid": "a7d1860a0d2677140231f262ea540564", "score": "0.5614017", "text": "def check_args(args)\r\n args.count == 2\r\n ARGV[1].to_i > 0\r\nrescue StandardError\r\n false\r\nend", "title": "" }, { "docid": "45e818913fb6ede220fdec0013f7d5fd", "score": "0.56126034", "text": "def verify_args!(opts={})\n args = opts[:args] || []\n count = opts[:count]\n # simplify output for verify_args!(min:2, max:2) or verify_args!(max:0)\n if opts[:min] && opts[:max] && opts[:min] == opts[:max]\n count = opts[:min]\n elsif opts[:max] == 0\n count = 0\n end\n if count\n if args.count < count\n raise_args_error(\"not enough arguments, expected #{count} and got #{args.count == 0 ? '0' : args.count.to_s + ': '}#{args.join(', ')}\", args, opts[:optparse])\n elsif args.count > count\n raise_args_error(\"too many arguments, expected #{count} and got #{args.count == 0 ? '0' : args.count.to_s + ': '}#{args.join(', ')}\", args, opts[:optparse])\n end\n else\n if opts[:min]\n if args.count < opts[:min]\n raise_args_error(\"not enough arguments, expected #{opts[:min] || '0'}-#{opts[:max] || 'N'} and got #{args.count == 0 ? '0' : args.count.to_s + ': '}#{args.join(', ')}\", args, opts[:optparse])\n end\n end\n if opts[:max]\n if args.count > opts[:max]\n raise_args_error(\"too many arguments, expected #{opts[:min] || '0'}-#{opts[:max] || 'N'} and got #{args.count == 0 ? '0' : args.count.to_s + ': '}#{args.join(', ')}\", args, opts[:optparse])\n end\n end\n end\n true\n end", "title": "" }, { "docid": "93c59fd09b28b58e59411044df89feb9", "score": "0.5604626", "text": "def arguments_valid?\n true if ['most_improved', 'oaklands_slugging_in_2007', 'tripple_crown_winners_2011_2012'].any? { |i| @arguments.include?(i) }\n end", "title": "" }, { "docid": "33b95762f282a249c8f7469a0247538d", "score": "0.5604319", "text": "def check_args\n error_str = ''\n\n if path_to_controller[0] == '/'\n error_str += \"ERROR: 'path_to_controller' can't begin with a '/'\\n\"\n end\n\n if path_to_controller[path_to_controller.length - 1] != '/'\n error_str += \"ERROR: 'path_to_controller' must end with a '/'\\n\"\n end\n\n if error_str.length > 0\n puts Rainbow(error_str).red\n abort\n end\n\n if options[:vue] && methods_actions_names.present?\n puts Rainbow('--vue is incompatible with method action names, an index is created by default').red\n abort\n end\n end", "title": "" }, { "docid": "6653089116b200d35617de9c8eab1f9a", "score": "0.560357", "text": "def check_required_argument(arg, arg_string_format)\n if arg.nil? or arg.empty?\n puts \"please add required #{arg_string_format} argument for this command.\"\n exit!\n end\nend", "title": "" }, { "docid": "cc1915e4a2289bdfd1e0d37a9a78fce8", "score": "0.5600743", "text": "def arguments_valid?\n #things to do check file, add further\n if(!@options.file && !@options.download)\n @log.error \"you need to specify either a file using -f or to download the files using -d\"\n exit!\n end\n\n if(@options.file && !@options.dir && !@options.download)\n @log.error \"You need to specific the directory to parse -l or to download the files -d\"\n exit!\n elsif(@options.file && File.exist?(@options.file) == false && !@options.download && !@options.dir)\n @log.error \"The file you specified doesn't exist: #{@options.file}\" \n exit!\n end\n\n if(!@options.output)\n @log.error \"You need to specify an output directory using -o PATH\"\n exit!\n end\n \n if(!File.exists?(@options.output))\n @log.info \"No directory found generating directory: #{@options.output}\"\n Dir.mkdir(File.expand_path(@options.output))\n end\n\n if(@options.download)\n @log.info \"Downloading files from #{@source} to ~/Downloads\"\n system(\"curl -o ~/Downloads/toxcast.zip #{@source} > /dev/null\")\n system(\"mkdir ~/Downloads/toxcast\")\n system(\"unzip ~/Downloads/toxcast.zip -d ~/Downloads/toxcast/\")\n @options.dir = File.expand_path(\"~/Downloads/toxcast\")\n end \n \n return true\n end", "title": "" }, { "docid": "71a54f491704af5ad9706af3099a89dc", "score": "0.55907005", "text": "def check_call(method, spec, args, block)\n conformed_args = S.conform(spec.args, args) if spec.args\n\n if conformed_args == :\"Speculation/invalid\"\n return explain_check(args, spec.args, args, :args)\n end\n\n conformed_block = S.conform(spec.block, block) if spec.block\n\n if conformed_block == :\"Speculation/invalid\"\n return explain_check(block, spec.block, block, :block)\n end\n\n ret = method.call(*args, &block)\n\n conformed_ret = S.conform(spec.ret, ret) if spec.ret\n\n if conformed_ret == :\"Speculation/invalid\"\n return explain_check(args, spec.ret, ret, :ret)\n end\n\n return true unless spec.args && spec.ret && spec.fn\n\n if S.valid?(spec.fn, :args => conformed_args, :block => conformed_block, :ret => conformed_ret)\n true\n else\n explain_check(args, spec.fn, { :args => conformed_args, :block => conformed_block, :ret => conformed_ret }, :fn)\n end\n end", "title": "" }, { "docid": "621d0f3522815fcfaddb2d3e313aa95e", "score": "0.55893254", "text": "def arguments_valid?\n if @options.ipaddress == ''\n return false\n elsif @options.secret == ''\n return false\n elsif @options.hostname == ''\n return false\n elsif @options.server == ''\n return false\n elsif @options.password == ''\n return false\n elsif @options.username == ''\n return false\n end\n true\n end", "title": "" }, { "docid": "91400e29dbad291c7079ff0856deb056", "score": "0.55861247", "text": "def arguments_valid?\n true if @arguments.length == 1 && File.exists?(@arguments.first)\n end", "title": "" }, { "docid": "91400e29dbad291c7079ff0856deb056", "score": "0.55861247", "text": "def arguments_valid?\n true if @arguments.length == 1 && File.exists?(@arguments.first)\n end", "title": "" }, { "docid": "91400e29dbad291c7079ff0856deb056", "score": "0.55861247", "text": "def arguments_valid?\n true if @arguments.length == 1 && File.exists?(@arguments.first)\n end", "title": "" } ]
b0dc83f0898ea6e7d389813cc33ea7d0
Retrieve the latest messages in the form of TaggedData Override in subclass to extend behavior
[ { "docid": "6ba25000ac2eccbae0fd88091e2d3db0", "score": "0.0", "text": "def retrieve\n raise 'Retrieve latest not overridden, or calling base class.'\n end", "title": "" } ]
[ { "docid": "259787d3104ac2afb4bbba5f1b4c7ef3", "score": "0.6904365", "text": "def retrieve\n messages = @redd.my_messages('moderator', false, limit: RETRIEVAL_COUNT)\n messages = expand(messages)\n messages.map do |m|\n TaggedData.new(m.name, Models::Modmail.from_data(m))\n end\n end", "title": "" }, { "docid": "608b0e72336487b97ae736d25e31b011", "score": "0.674433", "text": "def retrieve\n messages =\n @redd.subreddit_from_name(@subreddit)\n .get_new(limit: RETRIEVAL_COUNT)\n messages.map do |m|\n TaggedData.new(m.name, Models::Submission.from_data(m))\n end\n end", "title": "" }, { "docid": "64a5c18dff1535562ce30f8e46734522", "score": "0.6718911", "text": "def retrieve\n messages =\n @redd.get_comments(@subreddit, limit: RETRIEVAL_COUNT)\n messages.map do |m|\n TaggedData.new(m.name, m)\n end\n end", "title": "" }, { "docid": "93dd4e3208d0032e13c10c9f84fdc533", "score": "0.6584902", "text": "def most_recent_messages\n\t\tmessages(true).map(&:get_current_message)\n\tend", "title": "" }, { "docid": "46450fa05084a5934b6833b96aff80ad", "score": "0.6326381", "text": "def old_messages\n self.read_messages\n end", "title": "" }, { "docid": "9599b515e5632bef82e4f5708768a0d8", "score": "0.63251674", "text": "def retrieve_messages\n params = Message.last.nil? ? {} : {:since_id => Message.last.original_id}\n TwitterAPI.direct_messages(params).each {|mash| save_message(mash)}\n end", "title": "" }, { "docid": "367b2021b896b78390945fb9d8837134", "score": "0.6305189", "text": "def messages\n _received_messages\n end", "title": "" }, { "docid": "92f2ab5edec6359145358fadf68b2bea", "score": "0.6293895", "text": "def retrieve_messages\n raise NotImplementedError\n end", "title": "" }, { "docid": "357ac5ac630e68ede138fd6f3823136c", "score": "0.62797356", "text": "def messages\n @messages ||= refresh\n end", "title": "" }, { "docid": "1ffed2ae82390b6a4fca9577c9ebeaf9", "score": "0.62240016", "text": "def get_msgs\n\n super rescue []\n end", "title": "" }, { "docid": "640154e47a4300fa2871c4de1681a661", "score": "0.6220925", "text": "def last_message\n return messages.last\n end", "title": "" }, { "docid": "640154e47a4300fa2871c4de1681a661", "score": "0.6220925", "text": "def last_message\n return messages.last\n end", "title": "" }, { "docid": "640154e47a4300fa2871c4de1681a661", "score": "0.6220925", "text": "def last_message\n return messages.last\n end", "title": "" }, { "docid": "640154e47a4300fa2871c4de1681a661", "score": "0.6220925", "text": "def last_message\n return messages.last\n end", "title": "" }, { "docid": "9a7516a5a390ab176d352281710ab159", "score": "0.6216504", "text": "def messages\n return [] if data['messages'].nil?\n \n result = []\n \n data['messages'].each do |message|\n result << OpenStruct.new({\n :address => address,\n :time => Thimbl::Utils.parse_time( message['time'] ),\n :text => message['text']\n })\n end\n \n result = result.sort { |a,b| a.time <=> b.time }\n \n return result\n end", "title": "" }, { "docid": "f06c1a2b1d5b7a6cbc4562bd7c563c3c", "score": "0.62129563", "text": "def retrieve\n messages =\n @redd.subreddit_from_name(@subreddit)\n .get_comments(limit: RETRIEVAL_COUNT)\n messages.map do |m|\n TaggedData.new(m.name, Models::Comment.from_data(m))\n end\n end", "title": "" }, { "docid": "e665f9d4dee100513f272458d68842f2", "score": "0.6160858", "text": "def messages\n @attributes[:messages]\n end", "title": "" }, { "docid": "408c0267364ded00570a988e224f90ed", "score": "0.6155889", "text": "def _message_get_all\n return @message_stack\n end", "title": "" }, { "docid": "4fd9e88bc6a58cf9905c6e374f6963b6", "score": "0.6151742", "text": "def message_history\n return @message_history\n end", "title": "" }, { "docid": "9cc0c2dbbc6a67aca783192e932ec8c3", "score": "0.6150029", "text": "def messages\n @messages_with_timestamps.map{|m,t| m }\n end", "title": "" }, { "docid": "0e387e898089a547ffa50b10ebf53aac", "score": "0.61482966", "text": "def _received_messages\n @_received_messages ||= []\n end", "title": "" }, { "docid": "53139d83a1f044f38c8f605d289b2759", "score": "0.61409605", "text": "def recent_messages\n @recent_messages = if current_user.is_admin? or current_user.has_read_access_to?(@forum)\n @forum.message_posts.order('updated_at DESC').limit(10)\n else\n []\n end\n respond_to do |format|\n format.html\n format.json { render :json => @recent_messages.to_json }\n end\n end", "title": "" }, { "docid": "5b280254dfc1b6dab602ea71e0695062", "score": "0.6122316", "text": "def last\n (@messages||[]).last\n end", "title": "" }, { "docid": "dedbd6fe33a21968ed32a42b38bb1307", "score": "0.6104276", "text": "def messages\n []\n end", "title": "" }, { "docid": "f6f632d183f786fd8309534fd9dd64cb", "score": "0.6098503", "text": "def msgs\n data['msgs']\n end", "title": "" }, { "docid": "d92a3d2cff0cd8df4021be12c2604628", "score": "0.60904944", "text": "def get_messages #:nodoc:\n raise NotImplementedError, \"This method should be overridden by subclass\"\n end", "title": "" }, { "docid": "898f1387774ea8d8405ea89e68cdb343", "score": "0.6071865", "text": "def messages\n return @messages\n end", "title": "" }, { "docid": "898f1387774ea8d8405ea89e68cdb343", "score": "0.6071865", "text": "def messages\n return @messages\n end", "title": "" }, { "docid": "898f1387774ea8d8405ea89e68cdb343", "score": "0.6071865", "text": "def messages\n return @messages\n end", "title": "" }, { "docid": "22f04b56a8fcca458e6f784e78a21c85", "score": "0.6069882", "text": "def getNewMessages\n newmessages = @messages[@lastMessageRead..@messages.length]\n @lastMessageRead = @messages.length\n return newmessages\n end", "title": "" }, { "docid": "8b8b00919f53da57e232df4c6ea025c9", "score": "0.606424", "text": "def messages\r\n []\r\n end", "title": "" }, { "docid": "28c6dc3ea679e531846810ccd5dec03d", "score": "0.60416615", "text": "def messages\n @messages ||= Sumo::Collection.new(\n :get_values => proc { |hash| self.get_messages(hash) },\n :get_status => proc { self.status },\n :count_key => 'messageCount'\n ).each\n end", "title": "" }, { "docid": "e7811e686de9004f4a8e636cb00d1851", "score": "0.60384154", "text": "def fetch\n new_messages = []\n \n # Ignore any messages that don't have the hashtag.\n # Use twitter search to do this instead?\n @twitter_client.replies.reject{|m| !m.text[/#wase/]}.each do |reply|\n message = Message.new(reply.id, reply.text)\n \n # Skip if we've already processed this message.\n unless @all_messages.include?(message)\n @all_messages << message\n new_messages << message\n end\n end\n new_messages\n end", "title": "" }, { "docid": "5b73adcfb782c3b635da62b31682352e", "score": "0.60322404", "text": "def get_driver_messages\n method = \"getDriverMessages\"\n hash = post_request(method)\n\n \n messages = []\n if !hash[\"DBEntityMessage\"].nil?\n message_list = hash[\"DBEntityMessage\"][0]\n message_list.each { |x|\n messages.push( { :descr => x[\"descr\"][0],\n :text => x[\"text\"][0],\n :mobileText => x[\"mobileText\"][0],\n :linkText => x[\"linkText\"][0],\n :afterAckLinkText => x[\"afterAckLinkText\"][0],\n :requireCheckBox => x[\"requireCheckBox\"][0],\n :priorityPk => x[\"priorityPk\"][0],\n :priority => x[\"priority\"][0],\n :priorityPKtoValue => x[\"priorityPKtoValue\"][0],\n :id => x[\"id\"][0],\n :type => x[\"type\"][0]\n\n } ) }\n end\n messages\n end", "title": "" }, { "docid": "6edcf64d4bc194efd1da699280121837", "score": "0.6025002", "text": "def most_recent_message\n self.touches.order(\"created_at DESC\").first\n end", "title": "" }, { "docid": "2f12f26e1280765980555d15d68f5e84", "score": "0.60194707", "text": "def last_message\n object.last_message\n end", "title": "" }, { "docid": "58d85058c4872f91f0500b38e973779e", "score": "0.60091364", "text": "def get_msgs\n return @msgs.clone\n end", "title": "" }, { "docid": "d8d043181d054a2119f594805aacc46a", "score": "0.59783113", "text": "def messages\n @messages ||= []\n end", "title": "" }, { "docid": "d8d043181d054a2119f594805aacc46a", "score": "0.59783113", "text": "def messages\n @messages ||= []\n end", "title": "" }, { "docid": "1e9768875734354805efa4c863cb6404", "score": "0.5973007", "text": "def get\n return messages\n end", "title": "" }, { "docid": "7114598cbb4ac1bd748df2e0d6b57e7b", "score": "0.5972314", "text": "def messages\n @mapped_messages ||= Basecamp3::Message.all(bucket.id, id)\n end", "title": "" }, { "docid": "277c12b17d6d51d60e3a0cf32a78d306", "score": "0.5969698", "text": "def last_message_at\n @fetched_last_message_at ||= begin\n if @last_message_at.present?\n @last_message_at.to_i\n else\n created_at = Message.redis.hget(\"message:#{message_ids.last}:attrs\", :created_at)\n attrs['last_message_at'] = created_at.to_i if created_at.present?\n end\n end\n end", "title": "" }, { "docid": "4af883d0f993ef160964bb3966779fd2", "score": "0.5963692", "text": "def fetch_messages()\n return false unless @y\n begin\n if @last_id != nil\n messages = @y.messages(:all, :newer_than => @last_id).reverse\n else\n messages = @y.messages(:all).reverse\n end\n unless messages.empty?\n notify messages unless @messages.empty?\n @messages += messages\n @last_id = messages.last.id\n end\n rescue => e\n puts \"Error fetching new messages: #{e.inspect}\"\n @message_entry.set_sensitive false\n @message_btn.set_sensitive false\n end\n @message_entry.set_sensitive true\n @message_btn.set_sensitive true\n end", "title": "" }, { "docid": "110c332b579f3a35cf52c79c13af51f5", "score": "0.5960259", "text": "def get_important_messages\n # TODO load more messages using :offset\n @a.messages.get(count: MAX_MSG_GET_COUNT, filters: 8)[\"items\"]\n end", "title": "" }, { "docid": "24f2b42a19dfa83a259aff25d9a7f16f", "score": "0.5958502", "text": "def recent_messages\n twilio_client.account.messages.list || []\n rescue StandardError => e\n e.message\n end", "title": "" }, { "docid": "9d609ea8adb30367598d3f9386cb7e83", "score": "0.595356", "text": "def messages\n self.class.messages\n end", "title": "" }, { "docid": "864a3eee47b04151757aeac47d8d6121", "score": "0.5934776", "text": "def get_new_messages\n @messages = policy_scope(Message);\n\n @messages = @messages.select do |om|\n om.received_on.nil?\n end\n\n render json: @messages\n end", "title": "" }, { "docid": "fc9bbba9273af46cca86442adeeb137a", "score": "0.5926738", "text": "def recent(options = {})\n options = { :limit => 10, :since_message_id => nil }.merge(options)\n # Build url manually, faraday has to be 8.0 to do this\n url = \"#{room_url_for(:recent)}?limit=#{options[:limit]}&since_message_id=#{options[:since_message_id]}\"\n\n connection.get(url)['messages'].map do |msg|\n parse_message(msg)\n end\n end", "title": "" }, { "docid": "0875a84fd48707c30fb5bbae61df2592", "score": "0.5922231", "text": "def messages\n object.messages\n end", "title": "" }, { "docid": "01648f6ff8d44522c52f90a587add8b6", "score": "0.5914176", "text": "def messages\n Message.all\n end", "title": "" }, { "docid": "46a18e751b57aaf8bbc0ca6c795e8c4e", "score": "0.5906834", "text": "def messages\n @messages ||= {}\n end", "title": "" }, { "docid": "c71aa97929270bc6358a1a374b64f2dc", "score": "0.59031844", "text": "def last_message\n self.messages.max_by{ |message| message.created_at }\n end", "title": "" }, { "docid": "6ba41cb62423ee4f5937e5171e7be566", "score": "0.5902772", "text": "def read_new_messages(last_id=nil)\n newer = \"\"\n newer = \"?since_id=#{last_id.to_s}\" if last_id\n # Get latest 20 messages\n begin\n reply = @access_token.get(\"/statuses/user_timeline.xml\" + newer)\n \n# File.open(\"tmp/dump.xml\", \"w\") do |f|\n# f.write reply.body \n# end\n \n # Parse xml. doc has xml, updates has the messages\n doc, @updates = Hpricot::XML(reply.body), []\n # Extract updates from XML\n last_id = 0\n (doc/:status).each do |msg|\n id = msg.at('id').innerHTML\n last_id = id.to_i if last_id < id.to_i\n from = msg.at('user/screen_name').innerHTML\n time = msg.at('created_at').innerHTML\n content= msg.at('text').innerHTML\n @updates << {:id => id, :from => from, :content => content, :time => time}\n end\n \n # Show\n# render :text => make_html(updates, names)\n rescue StandardError, Timeout::Error\n last_id = 0 # Timeouts are very common\n end\n last_id == 0 ? nil : last_id\n end", "title": "" }, { "docid": "dfa632f508575f21df9c16e33a33d1bd", "score": "0.5902384", "text": "def most_recent_notification_received\n notifications_received.order(created_at: :desc).first\n end", "title": "" }, { "docid": "2627193d91a319a6d4729d68d0d39218", "score": "0.5901083", "text": "def getHttpMessages; @messages; end", "title": "" }, { "docid": "596a0b2a21a2e345a6dcce8bdc3383c3", "score": "0.587891", "text": "def read_messages\n end", "title": "" }, { "docid": "2bfbc6abd0204c694c065f9953c5a17e", "score": "0.5872234", "text": "def get_history(channel_id)\n\n request = Slack.im_history(:channel => channel_id)\n history = request[\"messages\"]\n latest_message = history[0]\n latest_message_poster_id = latest_message[\"user\"]\n latest_message_text = latest_message[\"text\"]\n\nend", "title": "" }, { "docid": "176da52172ef609500eff077b072e68c", "score": "0.58663553", "text": "def messages\n @messages ||= {}\n end", "title": "" }, { "docid": "176da52172ef609500eff077b072e68c", "score": "0.58663553", "text": "def messages\n @messages ||= {}\n end", "title": "" }, { "docid": "81bf1d7b46502a5ca4765fa5128e89ac", "score": "0.5848472", "text": "def messages\n message.text\n end", "title": "" }, { "docid": "10b7a0bbb4facea7988800fa1e280b1e", "score": "0.5832522", "text": "def message_history\n end", "title": "" }, { "docid": "848aa81434392cc81caee1ab4eb3b14e", "score": "0.5827614", "text": "def all_messages\n\t\tget_messages nil\n\tend", "title": "" }, { "docid": "d90c622d77c318b5dc364a70c7e6363a", "score": "0.5819931", "text": "def extract_new_messages(messages)\n message_hash = JSON.parse(messages)\n message_hash[\"response\"][\"messages\"].map do |message|\n next if Message.where(groupme_id: message[\"id\"]).present?\n Message.create(groupme_id: message[\"id\"], text: message[\"text\"])\n message[\"text\"]\n end.compact\n end", "title": "" }, { "docid": "6830c23795605e1ab5de8f52609b348c", "score": "0.5817512", "text": "def messages\n ret = Array.new\n while msg = pop_message\n ret << msg\n end\n ret\n end", "title": "" }, { "docid": "a94121ef6d2b3d4879e2fae4e96e8ea7", "score": "0.57958776", "text": "def event_messages\n self.events.map {|event| event['description']}\n end", "title": "" }, { "docid": "3aadd66a4b3e67ffa453971aba5a8e25", "score": "0.579388", "text": "def last_message\n @last_message = self.messages.first if @last_message.nil?\n return @last_message\n end", "title": "" }, { "docid": "a62933f887fa83bfeceeb92ed56c39cf", "score": "0.57912385", "text": "def get_messages(last_received)\n last_received ||= -1\n @messages[(last_received+1..last_message_num)]\n end", "title": "" }, { "docid": "ebbebdcd85e5038f0e48f66b2b3eb760", "score": "0.57841516", "text": "def last_message\n @last_message ||= messages.not_system.order('created_at DESC').first\n end", "title": "" }, { "docid": "a52d2824be36ce941d287e563e61cf0c", "score": "0.5783938", "text": "def index\n @messages = @user.latest_messages\n end", "title": "" }, { "docid": "dbc96cdcfe96d0a5cfff134d321e521f", "score": "0.57782626", "text": "def messages\n get_data('/messages')\n end", "title": "" }, { "docid": "b0e16ae776e197e5f1e7fbafded4e738", "score": "0.57759273", "text": "def chat_history\n if @conversation\n last_deleted = @conversation.conversation_replies.where({archived_by: params[:user_id].to_s}).order_by(created_at: 'ASC').last\n if last_deleted\n conversation_replies = @conversation.conversation_replies.where({created_at: {'$gt' => last_deleted.created_at}}).order_by(created_at: 'ASC')\n else\n conversation_replies = @conversation.conversation_replies.order_by(created_at: 'ASC')\n end\n render json: {data: conversation_replies.map { |cr| cr.to_listing }}, status: :ok\n else\n render json: {data: []}, status: :ok\n end\n end", "title": "" }, { "docid": "fb1c2c671e0a589102cc2c4aa1f5ec53", "score": "0.5773826", "text": "def last_message\n @last_message ||= messages.order('created_at DESC').first\n end", "title": "" }, { "docid": "ba040f96eeeeb527caeb91c0f3fcea29", "score": "0.5773746", "text": "def full_messages\n messages\n end", "title": "" }, { "docid": "d637d0e501cbbf5a55cfb7562bc85578", "score": "0.5772643", "text": "def getRecentMessage(chat_id)\n messages = getAllMessages(chat_id)\n return messages[0]\nend", "title": "" }, { "docid": "c7cf750cec119e99e0505576b25ee46b", "score": "0.5765779", "text": "def all_recent_messages\n @forums = Forum.all\n unless current_user.is_admin?\n @forums = @forums.select { |f| current_user.has_read_access_to?(f) }\n end\n @recent_messages = MessagePost.where(:forum_id => @forums.map(&:id)).order('updated_at DESC').limit(10)\n respond_to do |format|\n format.html\n format.json { render :json => @recent_messages.to_json }\n end\n end", "title": "" }, { "docid": "0c4adb4a66ff982ceee2552b48d28597", "score": "0.57611597", "text": "def messages\n @messages ||= Message.new(self)\n end", "title": "" }, { "docid": "c65fb7aedeaa46705c1d3f7819ebe324", "score": "0.57454735", "text": "def messages\n\t\tMessage.with(self.id)\n\tend", "title": "" }, { "docid": "2d367775dd28945d0f8f279ecbc098c3", "score": "0.5738708", "text": "def messages\n result = if type == :list\n @inserted_messages + @data_store_messages # Set arithmetic will choose inserted over data_store\n elsif type == :fixed || type == :variable\n @inserted_messages.empty? ? @data_store_messages : @inserted_messages # if we inserted it, use it\n end\n\n result.to_a\n end", "title": "" }, { "docid": "42fc802d49b6d62e1107a6c45dfb4389", "score": "0.5732414", "text": "def get_live_guest_recent_metric_data(message)\n request(:get_live_guest_recent_metric_data, Array[Softlayer::Metric::Tracking::Object], message)\n end", "title": "" }, { "docid": "dce7d321b20515355344d71cc8a20310", "score": "0.5725706", "text": "def message_received\n @attributes[:message_received]\n end", "title": "" }, { "docid": "4afae230d44d661f57f11956736f1808", "score": "0.5720183", "text": "def all_messages\n @entries.find_all{ |entry_| entry_.type == :message }\n end", "title": "" }, { "docid": "0e98f79ad276e8416d9762177a0a6183", "score": "0.5712585", "text": "def last_message_time\n\t\tself.messages.last.created_at\n\tend", "title": "" }, { "docid": "385df637aa2f20d4fab4a9bacfe06a55", "score": "0.57113373", "text": "def read\n @messages = MarketplaceService::Inbox::Query.fetch_messages_after(params[:last_viewed_time], params[:conversation_id], @current_user.id)\n @last_viewed_time = @messages.any? ? @messages.last[:created_at] : params[:last_viewed_time]\n messages = []\n @messages.each do |m| \n messages << MessageEntity[m].merge(sender: person_entity_with_display_name(PersonEntity.person(Person.find(m.sender_id), @current_community.id)))\n end\n respond_to do |format|\n format.js {render :layout => false, locals: {messages: messages}}\n end\n\n end", "title": "" }, { "docid": "5f03dda1a6fa3d0d76ea3a4725ea2b96", "score": "0.5702466", "text": "def messages\n message_span.text\n end", "title": "" }, { "docid": "8a72038723bd500ee8c10bcc36f8a9e2", "score": "0.5699798", "text": "def slurp_messages(base_path = \"/1.1/direct_messages.json?count=200&skip_status=1\")\n headers = { \"Accept-Encoding\" => \"gzip\" }\n messages = parse_response(access_token.get(base_path, headers))\n \n earlier_messages = messages\n earliest_id_seen = earliest_id(earlier_messages)\n\n while earliest_id_seen\n earlier_messages = parse_response(access_token.get(\"#{base_path}&max_id=#{earliest_id_seen - 1}\", headers))\n messages.push(*earlier_messages)\n earliest_id_seen = earliest_id(earlier_messages)\n end\n\n messages\n end", "title": "" }, { "docid": "93075f3b0220c1966279dc9fbfc1bb96", "score": "0.56959474", "text": "def published_messages\n @published_messages ||= []\n end", "title": "" }, { "docid": "ccaccc54513d6523905402436be97e12", "score": "0.56895006", "text": "def parsed_data\n @parsed_data ||= MessageData.parse(self)\n end", "title": "" }, { "docid": "07f84373cd3ab52ff6da2418b5053a94", "score": "0.5686344", "text": "def messages\n raise NotImplementedError\n end", "title": "" }, { "docid": "07f84373cd3ab52ff6da2418b5053a94", "score": "0.5686344", "text": "def messages\n raise NotImplementedError\n end", "title": "" }, { "docid": "64a28e783fb9c6db632f8836c9099fc5", "score": "0.5675452", "text": "def previous_messages(mode)\n if mode == \"sent\"\n if self.original_message_id\n @message1=PrivateMessage.where(original_message_id:self.original_message_id, all_customer_id:self.all_customer_id).where(['created_at <= ?', self.created_at]) \n @message2=PrivateMessage.where(original_message_id:self.original_message_id, receiver_customer_id:self.all_customer_id).where(['created_at <= ?', self.created_at]) \n @messages=@message1+@message2\n @messages.sort_by { |message| message[:created_at] }\n \n end\n elsif mode == \"all\"\n if self.original_message_id\n @message1=PrivateMessage.where(original_message_id:self.original_message_id, all_customer_id:self.receiver_customer_id).where(['created_at <= ?', self.created_at]) \n @message2=PrivateMessage.where(original_message_id:self.original_message_id, receiver_customer_id:self.receiver_customer_id).where(['created_at <= ?', self.created_at]) \n @messages=@message1+@message2\n @messages.sort_by { |message| message[:created_at] }\n \n end\n end\n end", "title": "" }, { "docid": "a4ad1e73f59125bf534e63e8a527b73f", "score": "0.5665035", "text": "def msgs\n @history[CHANNEL]\n end", "title": "" }, { "docid": "8b7cfcdda70c8c7b6607e48ef591e023", "score": "0.56422544", "text": "def messages\n @messages = []\n\n # If has parameter last_msg_time, then use the method append_messages\n if params[:last_msg_time] && params[:last_msg_time]!=\"undefined\" then\n append_messages\n return\n else\n # Search Message for current_user as sender\n Message.where(sender_id: current_user.id, receiver_id: params[:talk_to]).find_each do |message|\n @messages.append(message)\n end\n # Search Message for current_user as receiver\n Message.where(sender_id: params[:talk_to], receiver_id: current_user.id).find_each do |message|\n @messages.append(message)\n end\n # Sort the result messages by time\n @messages.sort_by! do |message|\n message.created_at\n end\n @talk_to_name = User.find_by_id(params[:talk_to]).name\n @message = Message.new\n end\n\n end", "title": "" }, { "docid": "e17746c3dcf9d2dd6456d19404a16fef", "score": "0.5635702", "text": "def last_message\n @last_message = self.messages.last\n @last_message\n end", "title": "" }, { "docid": "537706b3ee61a797e5b6c9ad4d1301d4", "score": "0.56334454", "text": "def show\n @messages = Message.latest(20)\n end", "title": "" }, { "docid": "b403bb8339e1888c085df155acdc58f2", "score": "0.5631059", "text": "def last_messages\n @last_messages.flush\n end", "title": "" }, { "docid": "7f29481cbabc2565f0a8b4453c7dcc7d", "score": "0.56303513", "text": "def all\n @messages = Message.all.order(\"created_at DESC\")\n end", "title": "" }, { "docid": "016b301c185409ee38b75f2401d591f7", "score": "0.56259894", "text": "def messages\n Ahoy::Messages.by_user_id.key(self._id)\n end", "title": "" }, { "docid": "80e1201280dd01b83069a8261bdfedf0", "score": "0.56251794", "text": "def last_message()\n @last_message = self.messages.find(:first, :order => 'created_at DESC') if @last_message.nil?\n return @last_message\n end", "title": "" }, { "docid": "2713f8081cb1e88a8371cd4312fccc65", "score": "0.5615177", "text": "def original_message\n @original_message ||= messages.order('created_at').first\n end", "title": "" }, { "docid": "2713f8081cb1e88a8371cd4312fccc65", "score": "0.5615177", "text": "def original_message\n @original_message ||= messages.order('created_at').first\n end", "title": "" }, { "docid": "549d9b1b2f4a27c033b0279f91f8171b", "score": "0.56121206", "text": "def receive_messages(message_return_value_hash); end", "title": "" } ]
55d899b99f29640ae993ab03114b9f92
Clears the command buffer and closes the connection
[ { "docid": "ffdccc43ccebafc49865062ca056ab16", "score": "0.6276137", "text": "def disconnect\n @connection_manager.disconnect\n clear_command_buffer\n timer = EM.add_periodic_timer(0.1) do\n unless @client.connected?\n timer.cancel\n puts \"Disconnected from server.\"\n @client.activate(:command_state)\n end\n end\n end", "title": "" } ]
[ { "docid": "a7c40f26e565902b58fe05b752d02e3a", "score": "0.7640243", "text": "def clear_command_buffer\n @command_buffer.clear\n end", "title": "" }, { "docid": "d5ef78da9475970bda853b335d38065e", "score": "0.7100268", "text": "def close_connection\n @connection.reset\n end", "title": "" }, { "docid": "271077e88d3063878cdfe78775f4ecc8", "score": "0.70004326", "text": "def reset_connection\n close\n end", "title": "" }, { "docid": "bceb9792cd4edeed88800ae7812da9a0", "score": "0.69545525", "text": "def flush_command_buffer\n @command_buffer.flush\n end", "title": "" }, { "docid": "7c1230bef1c983296da4f24cd5beed1e", "score": "0.6938484", "text": "def clear_connection\n @connection = nil\n end", "title": "" }, { "docid": "5203aa8caf0e0f81d3f370bf9d165ab0", "score": "0.69111687", "text": "def disconnect\n self.handle_event(:disconnect)\n empty_buffers\n self.connection.disconnect\n end", "title": "" }, { "docid": "658206705949c5945f2d0b2d51ecb486", "score": "0.6903229", "text": "def close\n close_socket(@command_socket)\n @command_socket = nil\n\n close_socket(@data_socket)\n @data_socket = nil\n end", "title": "" }, { "docid": "c0012d32d3f7af1aa6b1b37cb390c933", "score": "0.6878182", "text": "def clear\n socket_puts(\"clear\")\n end", "title": "" }, { "docid": "96dc38068dab2d4959085ad29b568ab3", "score": "0.6846866", "text": "def clearBuffer() \n @buffer = \"\" ;\n end", "title": "" }, { "docid": "7e4a88d8d4b5c091f385e93721f57733", "score": "0.66361177", "text": "def clear\n @buffer.clear\n end", "title": "" }, { "docid": "3dd5403b202b15ffdb720eb68b379eae", "score": "0.66131186", "text": "def clear_buffer\n @data_buffer = nil\n end", "title": "" }, { "docid": "806893a1f7f918321d556f1e0b388915", "score": "0.6565527", "text": "def clear\n @buffer = ''\n @write_pos = 0\n @read_pos = 0\n end", "title": "" }, { "docid": "0d9ec129dfd653df548dc67a66b8c393", "score": "0.6544282", "text": "def disconnect\n @pending_io = false\n @buffer = 0.chr * PIPE_BUFFER_SIZE\n super\n end", "title": "" }, { "docid": "c93af45bd783458d538ea5bac22e902a", "score": "0.65298337", "text": "def clear\n @buffer = nil\n end", "title": "" }, { "docid": "046b21e182762bebba01beaf35758dee", "score": "0.65071404", "text": "def clean_connection\n\tib = IB::Connection.current\n\tif ib\n\t\tif OPTS[:verbose]\n\t\t\tputs ib.received.map { |type, msg| [\" #{type}:\", msg.map(&:to_human)] }\n\t\t\tputs \" Logs:\", log_entries if @stdout\n\t\tend\n\t\t@stdout.string = '' if @stdout\n\t\tib.clear_received \n\tend\nend", "title": "" }, { "docid": "8b3bb7c769f299c648924ef4f2df9420", "score": "0.6484246", "text": "def clear_buffer\n @buffer.clear\n @pending_message_queue.clear\n end", "title": "" }, { "docid": "8b3bb7c769f299c648924ef4f2df9420", "score": "0.6484246", "text": "def clear_buffer\n @buffer.clear\n @pending_message_queue.clear\n end", "title": "" }, { "docid": "acce4d7e1fa269615402c78235019b44", "score": "0.6464812", "text": "def disconnect\n exec_cmd('QUIT')\n @sock.close\n end", "title": "" }, { "docid": "3643a42c7a2adff65eb522a0b86e70e4", "score": "0.6437706", "text": "def reset\n @connection = nil\n end", "title": "" }, { "docid": "4d1302478a6b20c3562439d534d3b12b", "score": "0.6417739", "text": "def clear\n @expect.clear_buffer!\n end", "title": "" }, { "docid": "5b4a6b853b3eb4311bc6a81ee3c91763", "score": "0.6389578", "text": "def reset(*args)\n @client.clear_command_buffer\n @client.reactivate\n end", "title": "" }, { "docid": "55bf98631515607a1330aea71236642f", "score": "0.6379512", "text": "def clean_connection\n ib = IB::Connection.current\n if ib\n if OPTS[:verbose]\n puts ib.received.map { |type, msg| [\" #{type}:\", msg.map(&:to_human)] }\n puts \" Logs:\", log_entries if @stdout\n end\n @stdout.string = '' if @stdout\n ib.clear_received\n end\nend", "title": "" }, { "docid": "d2ec2ba8c88d406d1af1759d3b87ade5", "score": "0.6362136", "text": "def clear()\n command('C')\n end", "title": "" }, { "docid": "14a315c1d3c69d6082b1b43f16ca9376", "score": "0.6360719", "text": "def close_buffer\n return @output_stream if @closed\n\n run_command\n @closed = true\n @output_stream\n end", "title": "" }, { "docid": "1b6fb7e95071fa731aff1e6295960a35", "score": "0.63492346", "text": "def close\n @socket.close if @socket and not @socket.closed?\n @read_buffer = ''\n @socket = nil\n end", "title": "" }, { "docid": "eeb6245581a55bfa2811de794247f0c3", "score": "0.63481677", "text": "def reset_connection\n @connection = nil\n end", "title": "" }, { "docid": "2605a9e3df393e93ed30f0e1b91d6241", "score": "0.6341465", "text": "def reset_connection\n @bunny_connection = nil\n @channel = nil\n end", "title": "" }, { "docid": "0c1efa5f5106c7b0d9d01cd3f1b36e67", "score": "0.63259065", "text": "def clear\n @server.clear_data\n end", "title": "" }, { "docid": "4e580317b0c139d11579ae13d7d13ba2", "score": "0.6323271", "text": "def clear_buffer\n @device.buffer.clear\n end", "title": "" }, { "docid": "45291228c4eb17bcc06e4e8a7e05bc77", "score": "0.63183683", "text": "def goodbye_my_love!\n debug 'Tearing down connection'\n if(socket && !socket.closed?)\n socket.write Command::Cls.new.to_line\n socket.close\n end\n @socket = nil\n info 'Connection torn down'\n end", "title": "" }, { "docid": "40adecfe3ea7fb16f9ac004c60220dbd", "score": "0.630656", "text": "def clear_key_buffer\n send_command( 0x45 )\n end", "title": "" }, { "docid": "12895c7786928e8db73b7ac993845de5", "score": "0.63048536", "text": "def cmd_quit(param)\n send_response \"221 Bye\"\n close_datasocket\n close_connection_after_writing\n end", "title": "" }, { "docid": "12895c7786928e8db73b7ac993845de5", "score": "0.63048536", "text": "def cmd_quit(param)\n send_response \"221 Bye\"\n close_datasocket\n close_connection_after_writing\n end", "title": "" }, { "docid": "eb27cb9987185d629f6694d1e450d307", "score": "0.6296536", "text": "def reset\n clear\n self.puts @buffer\n self\n end", "title": "" }, { "docid": "fd239f8ab967fbaf25febfbfbc3d8d2d", "score": "0.6288994", "text": "def quit\r\n command(:quit)\r\n socket.close\r\n end", "title": "" }, { "docid": "061a771c75512fd171583533fa053337", "score": "0.62760526", "text": "def clear\n io.truncate(0)\n self\n end", "title": "" }, { "docid": "9f16c43ed7ea2371b418fbdfaacc7475", "score": "0.6274476", "text": "def reset!\n @connection = nil\n self\n end", "title": "" }, { "docid": "3ca06a1f2161afd93b161d06720d4e10", "score": "0.62622565", "text": "def close\r\n @@con.unbind()\r\n @@my.close\r\n end", "title": "" }, { "docid": "861332bbf66328e53e0dba2f35b020e5", "score": "0.62586427", "text": "def clear()\n\t\treturn send_command(\"clear\")\n\tend", "title": "" }, { "docid": "53fb97b402904e9f0195959e9b3e19c0", "score": "0.6245616", "text": "def clear()\n\t\t@txt_output.buffer.text=\"\"\n\tend", "title": "" }, { "docid": "07259d5c4adb5eaba12a00599ae98963", "score": "0.6241473", "text": "def finalize\n @buffer = nil\n if @socket\n @socket.close\n @socket = nil\n end\n end", "title": "" }, { "docid": "de1bd82c4cbe65f79fb5c7deb23d1c82", "score": "0.62318885", "text": "def reset\n connection.close_all_channels\n end", "title": "" }, { "docid": "028f9161b8cde191373a6e5cd19d71f5", "score": "0.62304705", "text": "def clear\n registered_commands.each(&:terminate)\n registered_commands.clear\n\n self\n end", "title": "" }, { "docid": "f84bed58df90591097473d599d6dc07e", "score": "0.6206401", "text": "def clear\n\t\tif @buffer\n\t\t\t@text = nil\n\t\t\t@buffer.close\n\t\t\t@buffer = nil\n\t\tend\n\t\t\n\t\t@cached_i = nil\n\tend", "title": "" }, { "docid": "a4dbc448c02045a0f9349c2ba7b7b36c", "score": "0.6205242", "text": "def flush\n ensure_open\n @ibuffer.empty_to self\n self\n end", "title": "" }, { "docid": "f3f5a6cfff6f7fff53c48f33bac6a09f", "score": "0.61951786", "text": "def disconnect!\n raw_connection.close\n end", "title": "" }, { "docid": "3d0b62cddefd60a0f83bda836cc48a7e", "score": "0.61769396", "text": "def clear!\n @mutex.synchronize { @buffer.clear }\n end", "title": "" }, { "docid": "b9f788c752c52574fdc88ad7ab2f400a", "score": "0.617127", "text": "def reset\n self.buf = ''\n end", "title": "" }, { "docid": "a50975d1090a9c99d34ba94282ece853", "score": "0.6162584", "text": "def close() \n sendCommand(CliCmdCloseSession)\n @socket.close()\n @socket = nil\n end", "title": "" }, { "docid": "3b357db904aa2fcea834d8498ebe1dfe", "score": "0.6152965", "text": "def disconnect\n if connected?\n @conn.write \"quit\\n\"\n @conn.gets\n @conn.close unless @conn.closed?\n end\n end", "title": "" }, { "docid": "c00e83c54a267e873ca09fb3a3831eed", "score": "0.6142704", "text": "def close\n @connection.disconnect\n @running = false\n end", "title": "" }, { "docid": "f1b4c599db4f163146da6bf82d4b4d67", "score": "0.6135933", "text": "def close\n @connection.disconnect\n @running = false \n end", "title": "" }, { "docid": "50c4134f91ac58703455c1785fc1ef84", "score": "0.61221373", "text": "def disconnected_by_server\n @connection_manager.disconnected_by_server\n clear_command_buffer\n puts \"Connection closed by server.\"\n activate(:command_state)\n end", "title": "" }, { "docid": "0f83c652460709787292a17c1b7a0d6c", "score": "0.61178064", "text": "def close\n connection.close\n @connection = nil\n end", "title": "" }, { "docid": "b0b5bf9dfc0c2f351a83235610d64f30", "score": "0.61142975", "text": "def close() \n sendCommand(CliCmdCloseSession)\n @socket.close()\n @socket = nil\n end", "title": "" }, { "docid": "3fc21511e86261a42ee0d5c34d076fb9", "score": "0.6108648", "text": "def disconnect\n @server = nil\n end", "title": "" }, { "docid": "3fa6d90aeec207e000528bd55071c4cf", "score": "0.6108636", "text": "def disconnect!\n clear_cache!\n @connection = nil\n end", "title": "" }, { "docid": "35424847fdf7bc51d7050775217bd412", "score": "0.6108377", "text": "def disconnect\n connection.close_all_channels\n connection.close\n reset\n end", "title": "" }, { "docid": "35424847fdf7bc51d7050775217bd412", "score": "0.61076987", "text": "def disconnect\n connection.close_all_channels\n connection.close\n reset\n end", "title": "" }, { "docid": "3f762f43b51ab6b1ffebf3da1a048228", "score": "0.61011505", "text": "def stop\n @ch.close\n @conn.close\n end", "title": "" }, { "docid": "6e27ce085c570ae89c0c350dfb49b202", "score": "0.60964733", "text": "def reset!\n @socket.reset!\n end", "title": "" }, { "docid": "abf3c5f4a8020d0dee10edf6c5deec1a", "score": "0.6075502", "text": "def disconnect!\n super\n\n @raw_connection&.close rescue nil\n @raw_connection = nil\n end", "title": "" }, { "docid": "78e628f5df8d7aa1b85f1e4f051d63af", "score": "0.60728383", "text": "def clear_buffered\n return if @pipe_buffer.nil?\n\n @pb_offset += @pipe_buffer.size\n @pipe_buffer.clear\n end", "title": "" }, { "docid": "ded592cdc542772a4937d6e1329abece", "score": "0.60721415", "text": "def close\n # last chunk\n @socket.write(\"0\\r\\n\\r\\n\")\n @socket.flush\n end", "title": "" }, { "docid": "6796ac38a4c68d8ac1f313fff41b9a4c", "score": "0.60560495", "text": "def disconnect()\n # establish disconnection\n @socket.write(\"\\x11\")\n assert(RESULT_ACK, @socket.read(1))\n\n # disconnect from server\n @socket.close()\n end", "title": "" }, { "docid": "ef6c2653822fc01d89b78d4e82cf5d59", "score": "0.60539526", "text": "def reset\n tap { @buffer.clear }\n end", "title": "" }, { "docid": "56a0d9f6f58b554bb8e9bd1b0a31a641", "score": "0.6047581", "text": "def reset_buffering\n @ibuffer.unseek! self\n end", "title": "" }, { "docid": "ea38e3f61668dd4826df3f96b6bb96ad", "score": "0.6040001", "text": "def close!\n close_connection\n end", "title": "" }, { "docid": "d5321599981db72bd7a7daad7fc8a78d", "score": "0.60385233", "text": "def close\n @connection.close\n @connection = nil\n end", "title": "" }, { "docid": "89cfbfc6bbf3b3802763563c3467f8ea", "score": "0.6024929", "text": "def clear_cached_connection\n @connection = nil\n @file_connection = nil\n @last_response = nil\n end", "title": "" }, { "docid": "92950f68daf54921027d9252da9c6b3b", "score": "0.6021781", "text": "def disconnect!\n super \n clear_cache!\n #@connection.close rescue nil\n @connection = nil\n end", "title": "" }, { "docid": "776ee5a7c18e2a60ef65c97d5e542a5e", "score": "0.6015329", "text": "def close_connection\n @connection.finish if connected?\n end", "title": "" }, { "docid": "cd8d3a034512a1ad2ec7a9729ac72801", "score": "0.600861", "text": "def destroy_connection\r\n begin\r\n #kill the CDB process\r\n @stdin.close\r\n @stdout.close\r\n @stderr.close\r\n Process.kill( 9, @pid )\r\n rescue\r\n nil\r\n end\r\n end", "title": "" }, { "docid": "31d76ab8971b91a851caaf62ac6ae117", "score": "0.6008433", "text": "def reset!\n @socket.reset!\n end", "title": "" }, { "docid": "7760099a474521531bb17df04433e233", "score": "0.60073173", "text": "def flush\n @send_buffer.slice!(0, @send_buffer.length)\n end", "title": "" }, { "docid": "120064a4da948bea81cf571506e0953e", "score": "0.6003277", "text": "def flush\n out = @buffer\n @buffer = ''\n out\n end", "title": "" }, { "docid": "5a5213678fa735e8fe39d4b14313f79e", "score": "0.5993207", "text": "def flush\n @connection.flush\n end", "title": "" }, { "docid": "62e186cd3559f46ff9d4613ae76cff6b", "score": "0.5991554", "text": "def disconnect\n @connection.close_connection_after_writing\n end", "title": "" }, { "docid": "62e186cd3559f46ff9d4613ae76cff6b", "score": "0.5991554", "text": "def disconnect\n @connection.close_connection_after_writing\n end", "title": "" }, { "docid": "cb41f8b721b50c167478a94ebc327f99", "score": "0.598886", "text": "def reset\n @buffer = ''.b\n end", "title": "" }, { "docid": "7f1191bfdd8f234aa201909a76dd6621", "score": "0.5987974", "text": "def goodbye_my_love!\n debug 'Tearing down connection'\n if(socket && !socket.closed?)\n [lambda{ socket.write Command::Cls.new.to_line}, lambda{socket.close}].each do |action|\n begin\n action.call\n rescue IOError, SystemCallError => e\n warn \"Socket error encountered during teardown: #{e.class}: #{e}\"\n end\n end\n end\n @socket = nil\n info 'Connection torn down'\n nil\n end", "title": "" }, { "docid": "d627c53d1ee3ee32b15c8cdfa7807bd5", "score": "0.5976923", "text": "def connection_closed\n self.connection = nil\n end", "title": "" }, { "docid": "310e0c62f24ef8d9765486164117e996", "score": "0.5972976", "text": "def disconnect!\n clear_cache!\n @connection.close rescue nil\n end", "title": "" }, { "docid": "83666567dea2dd19a65d91397c84d0d6", "score": "0.5970736", "text": "def finalize\n @buffer = nil\n return unless @socket\n\n @socket.close\n @socket = nil\n end", "title": "" }, { "docid": "30165a76762b3360ce3252eade683730", "score": "0.5968563", "text": "def close() \n\tif con.nil?\n\t raise CliError, \"Statement already closed\"\n\tend\n @con.sendCommand(Connection::CliCmdFreeStatement)\n @con = nil\n end", "title": "" }, { "docid": "f1686b2abc5ab3637103324d056648a5", "score": "0.59653836", "text": "def clearCommands\n @commands = nil\n end", "title": "" }, { "docid": "e1a31ebf06d985a11fd0ee372fc2a704", "score": "0.5958202", "text": "def eof_reset\n @@eof.delete(@server)\n end", "title": "" }, { "docid": "79c14d28a468f210cb65ec8b55545d23", "score": "0.59567", "text": "def close\n conn.disconnect\n end", "title": "" }, { "docid": "ada90b2fdddfa6c4d68a6e5e5a6a07df", "score": "0.5950946", "text": "def quit\n @con.quit\n end", "title": "" }, { "docid": "14d4e9be8b1a97bf7e1c23477cc88bab", "score": "0.5948568", "text": "def clear_last_command!\n @last_command = nil\n end", "title": "" }, { "docid": "748abbf9ffec2f86dcd4ee5c23a70aa9", "score": "0.59458977", "text": "def close\n\t\t\t@connection.disconnect\n\t\tend", "title": "" }, { "docid": "5538b9465e70cb389ec4f5a32a19a114", "score": "0.59394544", "text": "def reset_connection!\n @grid = nil\n @db = nil\n @connection = nil\n end", "title": "" }, { "docid": "3c94d874349b5f6eb7f95bd314b8dc10", "score": "0.59374034", "text": "def disconnect\n @connection.disconnect\n @connection = nil\n end", "title": "" }, { "docid": "2059b9e7c2d0521f67593fdbe1e219d0", "score": "0.5929581", "text": "def reset!\n @server.clear_data\n end", "title": "" }, { "docid": "2059b9e7c2d0521f67593fdbe1e219d0", "score": "0.5929581", "text": "def reset!\n @server.clear_data\n end", "title": "" }, { "docid": "e6c23020f27949d9861f48d29089f9a5", "score": "0.5926297", "text": "def close\n @unbound = true\n EM.next_tick(method(:close_connection_after_writing))\n event(:connection_close, :signature => @signature, :msec => msec)\n end", "title": "" }, { "docid": "4dd732914fb744231aa54d3df7fcb8bc", "score": "0.5918316", "text": "def clear\n @client.flushall\n end", "title": "" }, { "docid": "20b6de40274046ac46c4b9a2fedce74b", "score": "0.5915467", "text": "def unbind\n send_line \"TCP connection closed successfully. Come back soon\"\n puts \"A client leaves us\"\n end", "title": "" }, { "docid": "5b84254ca8f1ebc13aa5795d52d1bcc6", "score": "0.59146386", "text": "def clear\n @req = nil\n @res = nil\n @rc = nil\n end", "title": "" }, { "docid": "953e167df1aadd89c32db0aa5fe28050", "score": "0.5911865", "text": "def clear\r\n @commands.clear\r\n nil\r\n end", "title": "" } ]
6d04dd82db9ca9980d0fda12eb0f9847
GET /cycles GET /cycles.json
[ { "docid": "a120cec79ad2c7c849e7c2421769d383", "score": "0.7171241", "text": "def index\n @cycles = Cycle.all\n end", "title": "" } ]
[ { "docid": "ad4ab0ad940377ac9064f3223e92b5c6", "score": "0.708707", "text": "def index\n @cycles = Cycle.where(group_id: params[:group_id])\n\n render json: @cycles\n end", "title": "" }, { "docid": "5cd04e942722278825f36eb1907db8c6", "score": "0.6800078", "text": "def show\n\n render json: @cycle\n end", "title": "" }, { "docid": "4d7eebe17f23131d173ae978ad0c9e80", "score": "0.6786475", "text": "def index\n @program_cycles = ProgramCycle.all\n end", "title": "" }, { "docid": "735f59cb132cad01f192be66e716e9ec", "score": "0.6708614", "text": "def index\n @cycles = current_user.cycles\n end", "title": "" }, { "docid": "39577b6bb8338a6c0dc4560e429335d3", "score": "0.62528396", "text": "def get_cycle(name)\n @_cycles = Hash.new unless defined?(@_cycles)\n @_cycles[name]\n end", "title": "" }, { "docid": "99b39eb30814c1aeee30a6ba106e1b9e", "score": "0.62522423", "text": "def get_test_cycles(project_id, opts = {})\r\n data, _status_code, _headers = get_test_cycles_with_http_info(project_id, opts)\r\n return data\r\n end", "title": "" }, { "docid": "be63d5238762aeb2ea3407f34e248414", "score": "0.6237355", "text": "def new\n @cycle = Cycle.new\n \n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cycle }\n end\n end", "title": "" }, { "docid": "17ff01e7c57d9ac0040d0321c50dcfe1", "score": "0.61879665", "text": "def get_cycle(name)\n @_cycles = Hash.new unless defined?(@_cycles)\n return @_cycles[name]\n end", "title": "" }, { "docid": "ae7761af1ece2101897bbc0ceffbac1b", "score": "0.60341984", "text": "def get_test_cycles_with_http_info(project_id, opts = {})\r\n if @api_client.config.debugging\r\n @api_client.config.logger.debug \"Calling API: TestcycleApi.get_test_cycles ...\"\r\n end\r\n # verify the required parameter 'project_id' is set\r\n fail ArgumentError, \"Missing the required parameter 'project_id' when calling TestcycleApi.get_test_cycles\" if project_id.nil?\r\n if opts[:'parent_type'] && !['root', 'release', 'test-cycle'].include?(opts[:'parent_type'])\r\n fail ArgumentError, 'invalid value for \"parent_type\", must be one of root, release, test-cycle'\r\n end\r\n if opts[:'expand'] && !['descendants'].include?(opts[:'expand'])\r\n fail ArgumentError, 'invalid value for \"expand\", must be one of descendants'\r\n end\r\n # resource path\r\n local_var_path = \"/api/v3/projects/{projectId}/test-cycles\".sub('{format}','json').sub('{' + 'projectId' + '}', project_id.to_s)\r\n\r\n # query parameters\r\n query_params = {}\r\n query_params[:'parentId'] = opts[:'parent_id'] if !opts[:'parent_id'].nil?\r\n query_params[:'parentType'] = opts[:'parent_type'] if !opts[:'parent_type'].nil?\r\n query_params[:'expand'] = opts[:'expand'] if !opts[:'expand'].nil?\r\n\r\n # header parameters\r\n header_params = {}\r\n\r\n # form parameters\r\n form_params = {}\r\n\r\n # http body (model)\r\n post_body = nil\r\n auth_names = ['Authorization']\r\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\r\n :header_params => header_params,\r\n :query_params => query_params,\r\n :form_params => form_params,\r\n :body => post_body,\r\n :auth_names => auth_names,\r\n :return_type => 'Array<TestCycleResource>')\r\n if @api_client.config.debugging\r\n @api_client.config.logger.debug \"API called: TestcycleApi#get_test_cycles\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\r\n end\r\n return data, status_code, headers\r\n end", "title": "" }, { "docid": "0e9bfab2b0f85c185509dc20fa7a398d", "score": "0.60175425", "text": "def cycle\n TflApi::Client::Cycle.new(self)\n end", "title": "" }, { "docid": "8885acfc02f24a0b90747d68438541aa", "score": "0.59552664", "text": "def index\n @house_account_cycles = HouseAccountCycle.all\n end", "title": "" }, { "docid": "b55448b7cceddd795ae858e22e5da60d", "score": "0.5945532", "text": "def show\n\n if params[:tag]\n @cycles = Cycle.tagged_with(params[:tag])\n else\n @cycle = Cycle.find(params[:id], :include => :terms)\n # @cycles = Cycle.all\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cycle }\n end\n end", "title": "" }, { "docid": "aa7f5ffafb5c68918912152f85bc6208", "score": "0.5915027", "text": "def create_next\n old_cycles = Maintenance::Cycle::CYCLE_TYPES.map { |type| Maintenance::Cycle.current(type) }.select{ |cycle| cycle && cycle.is_over? }\n cycles = []\n for old_cycle in old_cycles\n cycles << Maintenance::Cycle.generate_next_cycle( old_cycle.cycle_type )\n end\n flash[:sticky_messages] = []\n render json: cycles.map{|cycle| {cycle_number: cycle.ordinality_number, cycle_type: cycle.cycle_type_desc, year: cycle.year } }.to_json\n end", "title": "" }, { "docid": "fe6a801a11cf555cd4e64a3167aef65d", "score": "0.5875378", "text": "def get_cycle(name); end", "title": "" }, { "docid": "39507d773fba9a718e0c83df16defc72", "score": "0.5705871", "text": "def cycles\n @cycles ||= 5\n end", "title": "" }, { "docid": "408a6573a993b33702705aba5dce4335", "score": "0.5700656", "text": "def index\n @days = @trip.days.order(trip_day: :asc)\n render json: @days, include: [:activities]\n end", "title": "" }, { "docid": "61e25166b381c0e3526f43395e9fe48f", "score": "0.5672322", "text": "def all_cycles\n cycles = []\n start = adj_lists.first.name\n visited = [start] # stack\n previous = {}\n adj_lists.each {|v| previous[v.name] = nil}\n # each cycle may not be bigger than biggest SCC (strongly connected component)\n if max_cycle_length > 1\n answer = all_cycles_dfs(visited, previous, cycles)\n else\n return \"NO CYCLES EXIST\"\n end\n print \"Cycles: #{answer}\\n\\n\"\n answer\n end", "title": "" }, { "docid": "b84db0495d4162fa744bcbde89ca8c30", "score": "0.5632059", "text": "def detect_cycles\n cycles = Array.new\n\n self.courses.each do |course|\n courses = Hash.new\n stack = Array.new\n add_course(course, course, courses, cycles, stack) unless courses.has_key?(course.id)\n end\n\n return cycles\n end", "title": "" }, { "docid": "8b2262725323ff3c5300a16a95c633e4", "score": "0.55834484", "text": "def index\n puts params[:cycle_id];\n\n render json: Week.where({cycle_id: params[:cycle_id]}).as_json(\n include: [\n stocks: {\n :include => {\n orders: {\n include: [prossumer: {except: [:encrypted_password, :salt, :confirm_hash]}]\n },\n product: {\n include: [prossumer: {except: [:encrypted_password, :salt, :confirm_hash]}]\n }\n }\n }\n ])\n end", "title": "" }, { "docid": "fd39dffe7026e93da80b772636201c61", "score": "0.54941833", "text": "def get_test_cycle(project_id, test_cycle_id, opts = {})\r\n data, _status_code, _headers = get_test_cycle_with_http_info(project_id, test_cycle_id, opts)\r\n return data\r\n end", "title": "" }, { "docid": "9e8253c09bc3d43f8d42365c2d513588", "score": "0.5476748", "text": "def set_cycle\n @cycle = Cycle.find(params[:id])\n end", "title": "" }, { "docid": "9e8253c09bc3d43f8d42365c2d513588", "score": "0.5476748", "text": "def set_cycle\n @cycle = Cycle.find(params[:id])\n end", "title": "" }, { "docid": "59003dcf6b467ae0f0a4e876231784ff", "score": "0.5430767", "text": "def superhighways\n @client.get('/CycleSuperhighway')\n end", "title": "" }, { "docid": "7b9884edd5fe1e37bdeaa60bd9a452c0", "score": "0.53935736", "text": "def index\r\n @classdays = Classday.all\r\n\r\n render json: @classdays\r\n end", "title": "" }, { "docid": "249b5a56df7cee3aa73801ffe7a73803", "score": "0.5390063", "text": "def create\n @cycle = Cycle.new(cycle_params)\n\n respond_to do |format|\n if @cycle.save\n format.html { redirect_to @cycle, notice: 'Ciclo creado exitosamente.' }\n format.json { render :show, status: :created, location: @cycle }\n else\n format.html { render :new }\n format.json { render json: @cycle.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "58b208bcea73d30f3486259a49088948", "score": "0.53881097", "text": "def traffic id, date = Date.today.to_s\n uri = \"#{BASE_URL}/gauges/#{id}/traffic?date=#{date}\"\n fetch uri\n end", "title": "" }, { "docid": "c0dff641443fe5c5a84a25c68ed33cce", "score": "0.538031", "text": "def poll_cycle\n\n puts \"---------------------\"\n puts \"#{host}\"\n puts \"---------------------\"\n data = twemproxy_data()\n\n summary_ejections = 0\n summary_client_connections = 0\n summary_requests = 0\n summary_server_connections = 0\n summary_server_errors = 0\n summary_in_queue = 0\n summary_out_queue = 0\n summary_servers = 0\n data.keys.find_all{|k| data[k].is_a?(Hash)}.each do |pool|\n summary_client_connections += metric_total(\"client connections/#{pool}\", data[pool]['client_connections'], \"connections\")\n summary_ejections += metric_total(\"server ejections/#{pool}\", data[pool]['server_ejects'], \"ejects\")\n\n data[pool].keys.find_all{|k| data[pool][k].is_a?(Hash)}.each do |server|\n summary_servers += 1\n summary_requests += metric_value(\"server requests/#{pool}/#{server}\", data[pool][server]['requests'], \"requests\")\n summary_server_connections += metric_total(\"server connections/#{pool}/#{server}\", data[pool][server]['server_connections'], \"connections\")\n summary_server_errors += metric_value(\"server errors/#{pool}/#{server}\", data[pool][server]['server_err'], \"errors\")\n summary_in_queue += metric_total(\"in queue/#{pool}/#{server}\", data[pool][server]['in_queue'], \"ops\")\n summary_out_queue += metric_total(\"out queue/#{pool}/#{server}\", data[pool][server]['out_queue'], \"ops\")\n metric_value(\"request bytes/#{pool}/#{server}\", data[pool][server]['request_bytes'], \"bytes\")\n metric_value(\"response bytes/#{pool}/#{server}\", data[pool][server]['response_bytes'], \"bytes\")\n end\n end\n\n metric_total \"total ejections\", summary_ejections, \"ejects\"\n metric_total \"total client connections\", summary_client_connections, \"connections\"\n metric_total \"total server requests\", summary_requests, \"requests\"\n metric_total \"total server connections\", summary_server_connections, \"connections\"\n metric_total \"total server errors\", summary_server_errors, \"errors\"\n metric_total \"total in queue\", summary_in_queue, \"ops\"\n metric_total \"total out queue\", summary_out_queue, \"ops\"\n metric_total \"total servers\", summary_servers, \"servers\"\n metric_total \"percent up\", (((summary_servers - summary_ejections) / summary_servers) * 100.0), \"%\"\n end", "title": "" }, { "docid": "efd1f9d250f43712b61afb6f5bfca19e", "score": "0.53330207", "text": "def update\n @cycle = Cycle.find(params[:id])\n\n if @cycle.update(cycle_params)\n head :no_content\n else\n render json: @cycle.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "1e934eee018ddf47282bbc355b6a78d0", "score": "0.53292125", "text": "def index\n @pend_crates = Overview.get_pending_crates \n @paid_crates = Overview.get_last_paid_crates \n\n respond_to do |format|\n format.html # index.html.erb\n #format.json { render :json => @crates }\n end\n end", "title": "" }, { "docid": "14bab7d17cacb2a4e39e7225ec7ef1bc", "score": "0.53218424", "text": "def index\n @disciplines = Discipline.all\n\n render json: @disciplines\n end", "title": "" }, { "docid": "5a9dab53cf661120a575d0e0329583c4", "score": "0.5311027", "text": "def destroy\n @cycle = Cycle.find(params[:id])\n @cycle.destroy\n\n respond_to do |format|\n format.html { redirect_to cycles_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f5b2b4ccbf204cdd1e761b2f54fe77c6", "score": "0.5278904", "text": "def get_test_cycle_with_http_info(project_id, test_cycle_id, opts = {})\r\n if @api_client.config.debugging\r\n @api_client.config.logger.debug \"Calling API: TestcycleApi.get_test_cycle ...\"\r\n end\r\n # verify the required parameter 'project_id' is set\r\n fail ArgumentError, \"Missing the required parameter 'project_id' when calling TestcycleApi.get_test_cycle\" if project_id.nil?\r\n # verify the required parameter 'test_cycle_id' is set\r\n fail ArgumentError, \"Missing the required parameter 'test_cycle_id' when calling TestcycleApi.get_test_cycle\" if test_cycle_id.nil?\r\n # resource path\r\n local_var_path = \"/api/v3/projects/{projectId}/test-cycles/{testCycleId}\".sub('{format}','json').sub('{' + 'projectId' + '}', project_id.to_s).sub('{' + 'testCycleId' + '}', test_cycle_id.to_s)\r\n\r\n # query parameters\r\n query_params = {}\r\n query_params[:'expand'] = opts[:'expand'] if !opts[:'expand'].nil?\r\n\r\n # header parameters\r\n header_params = {}\r\n\r\n # form parameters\r\n form_params = {}\r\n\r\n # http body (model)\r\n post_body = nil\r\n auth_names = ['Authorization']\r\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\r\n :header_params => header_params,\r\n :query_params => query_params,\r\n :form_params => form_params,\r\n :body => post_body,\r\n :auth_names => auth_names,\r\n :return_type => 'TestCycleResource')\r\n if @api_client.config.debugging\r\n @api_client.config.logger.debug \"API called: TestcycleApi#get_test_cycle\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\r\n end\r\n return data, status_code, headers\r\n end", "title": "" }, { "docid": "14e12a14338cf9cea8dcddbb98ae433c", "score": "0.52785623", "text": "def create\n @cycle = Cycle.new(cycle_params)\n @cycle.user_id = current_user.id\n\n respond_to do |format|\n if @cycle.save\n @cycle.populate_days\n format.html { redirect_to cycle_days_path(@cycle), notice: 'Cycle was successfully created.' }\n format.json { render :show, status: :created, location: @cycle }\n else\n format.html { render :new }\n format.json { render json: @cycle.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b683182bd784f2547e37f8e67088169b", "score": "0.52735716", "text": "def show\n @cyclist = Cyclist.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cyclist }\n end\n end", "title": "" }, { "docid": "87486555a41d4cd008516366143ce95c", "score": "0.5258696", "text": "def index\n @crates = Crate.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @crates }\n end\n end", "title": "" }, { "docid": "3dc101340d1b5ccf06a56e569a20b186", "score": "0.52473074", "text": "def test_cycles\n all(QTest::TestCycle, project: @project.id, test_cycle: @id)\n end", "title": "" }, { "docid": "1d393f565d0168bb2cffb05644c055e3", "score": "0.5235023", "text": "def index\n @disciplines = Discipline.paginate(:page => params[:page], per_page: 30)\n @number = Discipline.count\n respond_to do |format|\n format.html\n format.json { render :json => Discipline.all.to_json(include: :department) }\n end\n end", "title": "" }, { "docid": "2c8b3e7730239eadeae4f0549662c95a", "score": "0.5233203", "text": "def fetch\n http_request(url) do |body|\n incidents = JSON.parse body\n\n counts = {}\n total = incidents[\"resourceSets\"].first[\"estimatedTotal\"]\n resources = incidents[\"resourceSets\"].first[\"resources\"]\n resources.each do |resource|\n severity = resource[\"severity\"]\n counts[severity] = (counts.fetch severity, 0) + 1\n end\n\n @data = {}\n counts.each do |severity, count|\n @data[severity_label(severity)] = count\n end\n end\n end", "title": "" }, { "docid": "01b250f9abc84c2a7ad4787bc4b203d3", "score": "0.52036864", "text": "def index\n @discs = Disc.all\n end", "title": "" }, { "docid": "6f0851f92c5d61a8cae94ec81f6cf2b8", "score": "0.5200778", "text": "def index\n ends = End.find_each\n render json: ends\n end", "title": "" }, { "docid": "4079933a25e56707335170481f08eed4", "score": "0.5183044", "text": "def index\n @competencies = Competency.all\n respond_to do |format|\n format.json { render json: @competencies }\n end\n end", "title": "" }, { "docid": "ae1d96077dc08fb1b68f3786b3f9fb72", "score": "0.5178505", "text": "def index\n #@course = Course.find(params[:course_id])\n @course_days = Course.find(params[:course_id]).course_days\n end", "title": "" }, { "docid": "3711bf9c34baa7d32edacc2f1221d665", "score": "0.51707155", "text": "def create_cycle(project_id, body, opts = {})\r\n data, _status_code, _headers = create_cycle_with_http_info(project_id, body, opts)\r\n return data\r\n end", "title": "" }, { "docid": "ddbaceec081eca535662130f9a9e056f", "score": "0.5160404", "text": "def fetch_cdi_value\n token = get_financial_data_token\n if token\n\t\t\tactual_date = \"#{Date.current.year}-#{Date.current.month}-#{Date.current.day}\"\n\t\t\tif Cdi.all.count > 0\n\t\t\t\tlast_cdi_date = Cdi.last.date_tax + 1\n\t\t\telse\n\t\t\t\tlast_cdi_date = '2010-01-01'\n\t\t\tend\n uri = URI.parse(\"https://api.financialdata.io/v1/indices/CDI/serie?dataInicio=#{last_cdi_date}&dataFim=#{actual_date}\")\n header = {'Content-Type': 'application/json', 'Authorization': \"Bearer #{token}\"}\n http = Net::HTTP.new(uri.host, uri.port)\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n request = Net::HTTP::Get.new(uri.request_uri, header)\n response = http.request(request)\n return JSON.parse(response.read_body) \n end\n end", "title": "" }, { "docid": "1a37fff6ca51cc792e1cd82f42b5009d", "score": "0.5113834", "text": "def days\n @trainings = Training.all\n @activities = Activity.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @trainings }\n end\n end", "title": "" }, { "docid": "5baab109f279342e5d76568dc4d6ca64", "score": "0.51133907", "text": "def hours\n render json: Pings::Selector.new.hours(params)\n end", "title": "" }, { "docid": "6aa4920b9125d94ce295eff11345ed62", "score": "0.50847423", "text": "def credit\n handle_response(get(\"/credit.json\"))\n end", "title": "" }, { "docid": "78d2ec54867c1fe4cc267fbdfd791a1f", "score": "0.5083815", "text": "def index\n response = HTTParty.get(\"https://casa-core.herokuapp.com/api/units\", :headers => { \"Authorization\" => AUTH, \"Host\" => HOST})\n @units = JSON.parse(response.body)\n return @units\n end", "title": "" }, { "docid": "6119c72c3fbf6346654b95a5aca30d4c", "score": "0.508092", "text": "def index\n @deseases = Desease.order(:id)\n\n render json: @deseases\n end", "title": "" }, { "docid": "09831e32dfa1a74f611a214ec9b9e8a0", "score": "0.5070535", "text": "def calendar\n get '/gtfs/calendar'\n end", "title": "" }, { "docid": "8d8232195ab6ffa1c3c818314fab656a", "score": "0.5057694", "text": "def index\n @disciplines = Discipline.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @disciplines }\n end\n end", "title": "" }, { "docid": "fdf4053d85ce923fcafb3e221f2be64d", "score": "0.5057272", "text": "def index\n @circuses = Circus.all\n end", "title": "" }, { "docid": "707f7e7bf72fef06713d45c6f50ef98f", "score": "0.50571007", "text": "def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @service_demand_breakdowns }\n end\n end", "title": "" }, { "docid": "bdacc1593e0ccb6c6227a161e5268f4b", "score": "0.5047142", "text": "def index\n render jsonapi: Seances::UseCases::FetchAll.new.call\n end", "title": "" }, { "docid": "6c9ab7e1e0bc85fef5d89b69a9f008ba", "score": "0.50465894", "text": "def index\n\n @debtors = Debtor.all\n\n render json: @debtors\n end", "title": "" }, { "docid": "2374f115d2d86aeeebc45eca29dfbd75", "score": "0.50461614", "text": "def cycle_params\n params.require(:cycle).permit(:name, :semester, :year)\n end", "title": "" }, { "docid": "8eec72e4d384473d0d678c5b96593ded", "score": "0.5043274", "text": "def index\r\n @clocks = ClockResult.all\r\n\r\n respond_to do |format|\r\n format.html # index.html.erb\r\n format.json { render json: @clocks }\r\n end\r\n end", "title": "" }, { "docid": "46ca5cf2259fac1374a744bf0cf096b1", "score": "0.5040789", "text": "def retrieve_rates(date)\n path = \"http://openexchangerates.org/api/historical/#{date.to_s}.json?app_id=#{$app_id}\"\n response = Net::HTTP.get_response(URI.parse path)\n # TODO: error handling\n response.body\nend", "title": "" }, { "docid": "0d046d8f6fb8148747c66c9ef49dedce", "score": "0.5037281", "text": "def index\n @references = Reference.all\n\n render json: @references\n end", "title": "" }, { "docid": "2573c322a840547df6f0ce9904dd960f", "score": "0.50249124", "text": "def destroy\n @cycle.destroy\n respond_to do |format|\n format.html { redirect_to cycles_url, notice: 'Cycle was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "ecb1321a520494b14ce5c241d9ba8ae1", "score": "0.5024447", "text": "def index\n @demand_responses = DemandResponse.order(id: :desc).paginate(page: params[:page])\n end", "title": "" }, { "docid": "3cf1a4cae071b7b9bb7fb0ee974fc4aa", "score": "0.50131", "text": "def getNumCycles()\n return @numCycles\n end", "title": "" }, { "docid": "08e8cd675343293431e3a20c6c84105b", "score": "0.5009789", "text": "def get_cycle_times(issues)\n cycle_times = Hash.new\n issue_status_changes = Hash.new\n\n #get issue change log sets\n issues.select { |issue| issue[:issue_data][\"fields\"][\"status\"][\"name\"] == \"Resolved\" }.each do |issue|\n key = issue[:issue_data][\"key\"]\n issue_status_changes[key] = []\n\n issue[:issue_data][\"changelog\"][\"histories\"].each do |history|\n\n history[\"items\"].select { |item| item[\"field\"] == \"status\" }.each do |status_history|\n history_created = DateTime.parse(history[\"created\"])\n issue_status_changes[key] << history_created \n end\n end\n\n start_date = issue_status_changes[key].min\n end_date = issue_status_changes[key].max\n\n cycle_times[key] = ((end_date - start_date) * 24 * 60).floor\n end\n \n cycle_times\nend", "title": "" }, { "docid": "4a9fa0ce61383d762c7be0a036a04ff0", "score": "0.50095505", "text": "def index\n @acquired_energies = AcquiredEnergy.all\n end", "title": "" }, { "docid": "83c992adce9c16fa3d2cea1566ee2015", "score": "0.5006144", "text": "def create\n @assembler_cycle = AssemblerCycle.new(assembler_cycle_params)\n\n respond_to do |format|\n if @assembler_cycle.save\n format.html { redirect_to @assembler_cycle, notice: 'Assembler cycle was successfully created.' }\n format.json { render :show, status: :created, location: @assembler_cycle }\n else\n format.html { render :new }\n format.json { render json: @assembler_cycle.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f36946f2fbc0f97f9789c3502ae7a94d", "score": "0.4997604", "text": "def index\n @dis_durations = DisDuration.all\n end", "title": "" }, { "docid": "79194859df2776ea2e966b6e9bdf2f6c", "score": "0.49941584", "text": "def cycle_params\n params.require(:cycle).permit(:start_date)\n end", "title": "" }, { "docid": "478ddd2c8b9b0cb2f1a9afc5f3d10544", "score": "0.49689093", "text": "def index\n @crates = Crate.all\n end", "title": "" }, { "docid": "06dfadbc4c71401244b6e5de2c95d38f", "score": "0.4965978", "text": "def index\n @traffics = Traffic.all\n end", "title": "" }, { "docid": "1e6a8e887eae8581f312ef9ba159cea5", "score": "0.4952449", "text": "def index\n @timecard = Timecard.find(params[:timecard_id])\n render :json => Hour.timecard_hours(@timecard)\n end", "title": "" }, { "docid": "5fdfd1516e5c2a0ac81e0855de133773", "score": "0.4950035", "text": "def index\n @calorie_counters = CalorieCounter.all\n end", "title": "" }, { "docid": "9a93e590c45c3fac62758e11d73b2568", "score": "0.49495465", "text": "def usage\n @machine = Machine.find(params[:id])\n @usages = @machine.usages\n @calendar = Calendar.all\n @calendar.pry\n# @machine.gen_usage_stats\n\n respond_to do |format|\n format.html # show.html.erb\n end\n end", "title": "" }, { "docid": "5540d786aaba82c59814339f708dede1", "score": "0.49459535", "text": "def show\n @cycdatum = Cycdatum.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cycdatum }\n end\n end", "title": "" }, { "docid": "3171549bb2e58288dd9ef3d74edc0d54", "score": "0.49432418", "text": "def get_remaining_days(view_id, sprint_id)\n\thttp = create_http\n\trequest = create_request(\"/rest/greenhopper/1.0/gadgets/sprints/remainingdays?rapidViewId=#{view_id}&sprintId=#{sprint_id}\")\n\tresponse = http.request(request)\n\tJSON.parse(response.body)\nend", "title": "" }, { "docid": "97488dc06f848e384310c4fa0f816fed", "score": "0.49423772", "text": "def index\n @curriculums = Curriculum.all\n respond_to do |format|\n\t\t\tformat.html { render :index }\n\t\t\tformat.json { render json: Oj.dump(@curriculums) }\n\t\tend\n end", "title": "" }, { "docid": "1006b7ed63e20377ae452dccd9fde17e", "score": "0.49419418", "text": "def get(days,start_cep,end_cep)\n self.class.get(\"/api/v1/quote/available_scheduling_dates/#{days}/#{start_cep}/#{end_cep}\")\n end", "title": "" }, { "docid": "a08788d9adeab1f8ca7df7b72824b04d", "score": "0.49354023", "text": "def index\n @money = Money.all\n require 'net/http'\n require 'json'\n @url = 'https://api.coinmarketcap.com/v1/ticker/'\n @uri = URI(@url)\n @response = Net::HTTP.get(@uri)\n @lookup_money = JSON.parse(@response)\n end", "title": "" }, { "docid": "1474751eca2969afd37ab67f5b3b4c31", "score": "0.4934793", "text": "def index\n @countdowns = Countdown.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @countdowns }\n end\n end", "title": "" }, { "docid": "70e46f66e9ceeea7ffedf9a2a8c90515", "score": "0.49336562", "text": "def index\n @incidentcategories = Incidentcategory.all\n json_response(@incidentcategories)\n end", "title": "" }, { "docid": "35bcb3fbd25ade829b14a0fd2dfc8441", "score": "0.49293515", "text": "def index\n @cryptocurrencies = Cryptocurrency.all\n\n require 'net/http'\n require 'json'\n\n @url = 'https://api.coinmarketcap.com/v1/ticker/'\n @uri = URI(@url)\n @response = Net::HTTP.get(@uri)\n @lookup_crypto = JSON.parse(@response)\n\n @profit_loss = 0\n end", "title": "" }, { "docid": "f15f5e088dfa8e9a775cc17ac622c0b4", "score": "0.49285513", "text": "def index\n @clock = @employee.clock_in_out\n render json: @clock\n end", "title": "" }, { "docid": "a683ae0ad7a38d7137ba2a476a539da3", "score": "0.49277815", "text": "def show\n @traffic = Traffic.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @traffic }\n end\n end", "title": "" }, { "docid": "5340a0cfd8ac4d3051c8b7c0f674479a", "score": "0.49273467", "text": "def show\n #get the renting phase\n @renting_phases = RentingPhase.where(contract_id: params[:id]).order(start_date: :ASC)\n # Check if generate the invoices successfully\n if @renting_phases.present?\n @invoices_check = Invoice.where(renting_phase_id: @renting_phases.last.id)\n end\n # Calculate the max cycles month according to the Contract\n @max_cycles = (@contract.end_date - @contract.start_date)/1.month + 1\n end", "title": "" }, { "docid": "b98805b39b69ec4f2eaf656da52f8d83", "score": "0.49268523", "text": "def create_cycle_with_http_info(project_id, body, opts = {})\r\n if @api_client.config.debugging\r\n @api_client.config.logger.debug \"Calling API: TestcycleApi.create_cycle ...\"\r\n end\r\n # verify the required parameter 'project_id' is set\r\n fail ArgumentError, \"Missing the required parameter 'project_id' when calling TestcycleApi.create_cycle\" if project_id.nil?\r\n # verify the required parameter 'body' is set\r\n fail ArgumentError, \"Missing the required parameter 'body' when calling TestcycleApi.create_cycle\" if body.nil?\r\n if opts[:'parent_type'] && !['root', 'release', 'test-cycle'].include?(opts[:'parent_type'])\r\n fail ArgumentError, 'invalid value for \"parent_type\", must be one of root, release, test-cycle'\r\n end\r\n # resource path\r\n local_var_path = \"/api/v3/projects/{projectId}/test-cycles\".sub('{format}','json').sub('{' + 'projectId' + '}', project_id.to_s)\r\n\r\n # query parameters\r\n query_params = {}\r\n query_params[:'parentId'] = opts[:'parent_id'] if !opts[:'parent_id'].nil?\r\n query_params[:'parentType'] = opts[:'parent_type'] if !opts[:'parent_type'].nil?\r\n\r\n # header parameters\r\n header_params = {}\r\n\r\n # form parameters\r\n form_params = {}\r\n\r\n # http body (model)\r\n post_body = @api_client.object_to_http_body(body)\r\n auth_names = ['Authorization']\r\n data, status_code, headers = @api_client.call_api(:POST, local_var_path,\r\n :header_params => header_params,\r\n :query_params => query_params,\r\n :form_params => form_params,\r\n :body => post_body,\r\n :auth_names => auth_names,\r\n :return_type => 'TestCycleResource')\r\n if @api_client.config.debugging\r\n @api_client.config.logger.debug \"API called: TestcycleApi#create_cycle\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\r\n end\r\n return data, status_code, headers\r\n end", "title": "" }, { "docid": "330c516a8d4469bcc2ccaa9e905356f5", "score": "0.4925725", "text": "def index\n @day_crew_blocks = DayCrewBlock.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @day_crew_blocks }\n end\n end", "title": "" }, { "docid": "31bf859d5a0d25a14f4ad3b15a4f1ad8", "score": "0.49249145", "text": "def update\n respond_to do |format|\n if @cycle.update(cycle_params)\n format.html { redirect_to @cycle, notice: 'Cycle was successfully updated.' }\n format.json { render :show, status: :ok, location: @cycle }\n else\n format.html { render :edit }\n format.json { render json: @cycle.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0c9f541451a97474aa71659a2e2e9599", "score": "0.49233422", "text": "def index\n @announces = Announce.not_finished.order(\"stime DESC\")\n\t\t@pannounces = Announce.finished.last_24_hours.limit(20).order(\"etime DESC\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @announces }\n end\n end", "title": "" }, { "docid": "b96aba7831362107bb149d03a0efe7f8", "score": "0.49198726", "text": "def cycle_count\n put('o^')\n get.strip.to_i\n end", "title": "" }, { "docid": "3fbf389dbb08ae38733ca0cf6571f74b", "score": "0.4915425", "text": "def index\n @reserved_dates = ReservedDate.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @reserved_dates }\n end\n end", "title": "" }, { "docid": "218b049ef184a52b5e7aa86fa549d89b", "score": "0.49001145", "text": "def index\n @cn_curves = CnCurve.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @cn_curves }\n end\n end", "title": "" }, { "docid": "52657685929d7fff853a492e47276bc1", "score": "0.48981947", "text": "def show\n @days_since_visit = DaysSinceVisit.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @days_since_visit }\n end\n end", "title": "" }, { "docid": "88ef3b70e6cf84fd1ef7122681b92da6", "score": "0.4897322", "text": "def show\n @plan = Plan.find(params[:id])\n @plan_days = @plan.plan_days\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @plan }\n end\n end", "title": "" }, { "docid": "f3220c112de1944efac072d124342a1c", "score": "0.48953435", "text": "def details\n @daily_deal = DailyDeal.find(params[:id])\n respond_to do |format|\n format.json do\n render with_api_version\n end\n end\n end", "title": "" }, { "docid": "94affb44f478ccef5f4649f120e147a4", "score": "0.48947188", "text": "def cp_performance_chart_data\n data = ::Api::Charts::CPPerformance.new.cp_performance_all_sectors_data\n\n render json: data.chart_json\n end", "title": "" }, { "docid": "daf6e547c2f537b354ce3e6a661e09dc", "score": "0.48927703", "text": "def get_cages(opts = {})\n data, _status_code, _headers = get_cages_with_http_info(opts)\n data\n end", "title": "" }, { "docid": "cc9e82559bebc955c5af8abd56761c87", "score": "0.4891848", "text": "def events\n url = 'https://api.artic.edu/api/v1/exhibitions?limit=35'\n\n res = RestClient.get(url)\n JSON.parse(res)\nend", "title": "" }, { "docid": "37dc338b92204c7d8f4696b147206b4c", "score": "0.4888623", "text": "def credit\n handle_response(self.class.get(\"/credit.json\"))\n end", "title": "" }, { "docid": "28d42bc3c97b196cab1b9c29a0e462e9", "score": "0.48866972", "text": "def trades\n Client.current.get(\"#{resource_url}/trades\")\n end", "title": "" }, { "docid": "9fb7908935ddaa611fdcca1633acbe6e", "score": "0.48755094", "text": "def index\n @vehicle_realtimes = VehicleRealtime.all\n \n respond_to do |format|\n format.html\n format.json { render :json => @vehicle_realtimes.to_json(:include => [:vehicle_trip, :vehicle_route, :vehicle_stop]) }\n end\n end", "title": "" }, { "docid": "1146e59974221fa11b80504425310c8e", "score": "0.4873191", "text": "def index\n @traces = Trace.all\n\n render json: @traces\n end", "title": "" } ]
7ddf3cb0c01172c58124ba552d47690a
Find all supportnode that links to specified network
[ { "docid": "48c07385c488bace982b820bbb0b1552", "score": "0.68543184", "text": "def find_all_supports_by_network(nw_ref)\n @supports.find_all do |support|\n support.ref_network == nw_ref\n end\n end", "title": "" } ]
[ { "docid": "4ca9dd514ca26e347e9eb7f7f6ed3e5e", "score": "0.6065079", "text": "def links\n l=self.nodes().find_all {|n| n.parent_node}\n l.map {|n|\n \n Network::Link.new({\n :source_node=>n,\n :target_node=>n.parent_node,\n :link_value=>1\n })}\n end", "title": "" }, { "docid": "ec2e54a104a3362c7bbd18a4fea794c5", "score": "0.6024261", "text": "def find_enabled_networks\n @networks = Network.find :all,\n :conditions => {:enabled => true},\n :order => \"network_name ASC\"\n end", "title": "" }, { "docid": "0b90c89f2f8baacdbec5002b5225b9ed", "score": "0.58881694", "text": "def get_networks()\n $evm.log(:info, \"Running on Server Version: #{$evm.root['miq_server'].version}\")\n provider = $evm.vmdb('ems').find_by_type('ManageIQ::Providers::Vmware::InfraManager')\n all_dvs_names = []\n provider.hosts.each do |host|\n $evm.log(:info, \"Get dvs_networks for host #{host.name}\")\n next if host.tags.include?('exclusions/invisible')\n host.switches.each do |switch|\n switch.lans.each do |nw|\n $evm.log(:info, \"Parsing results for host #{host.name} nw: '#{nw.name}'\")\n if nw.name =~ /(\\d+)_(\\d+)_(\\d+)_(\\d+)_V(\\d+).*/\n all_dvs_names << [ nw.name, \"#{$1.to_i}.#{$2.to_i}.#{$3.to_i}.#{$4.to_i}\", $5.to_i]\n end\n end\n end\n end\n all_dvs_names.uniq\nend", "title": "" }, { "docid": "6a6ef8134a5f369be2987e889b139471", "score": "0.5861326", "text": "def connectable_nodes_from(nodes)\n @nodes_handler.prefetch_metadata_of nodes, :host_ip\n nodes.select { |node| @nodes_handler.get_host_ip_of(node) }\n end", "title": "" }, { "docid": "5ee20e246996126477029b1cf91df285", "score": "0.5747482", "text": "def network_list\n result = @connect.call('network.get_all', @session)\n result['Value'].map! do |ref|\n network_get_uuid(ref)['Value']\n end\n result['Value'].reject! do |network_uuid|\n network_get_detail(network_uuid)['Value']['bridge'] == 'xenapi'\n end\n result\n end", "title": "" }, { "docid": "52216a2c2fd34c14ff294d3d5c822a96", "score": "0.57415825", "text": "def org_network_links\n @links.select {|l| l.type == VCloud::Constants::ContentType::ORG_NETWORK}\n end", "title": "" }, { "docid": "890eea48240e2ab11d1dd19d1c6bfbbe", "score": "0.5697449", "text": "def all_links\n @networks.each do |nw|\n nw.links.each do |link|\n yield link, nw\n end\n end\n end", "title": "" }, { "docid": "b2ef9b2d5016ed59c43b0941d37ec46d", "score": "0.56963843", "text": "def network\n xpath 'source', 'network'\n end", "title": "" }, { "docid": "56ba32d1cf2ac819148bb18c63074bb2", "score": "0.5695272", "text": "def find_way_from_nodes(node_list)\n node_list.each do |node|\n @db.execute('SELECT way FROM way_node WHERE node = ?', node) do |way|\n yield way[0]\n end\n end\n end", "title": "" }, { "docid": "b130447cb865467801644411e8ff4c4f", "score": "0.5680803", "text": "def network_return(parameters)\n \tparamsize = parameters.size\n \tqueryfrom = ''\n \tqueryid = ''\n \tquerywhere = ''\n \tcount = 0\n \twhile count < paramsize\n \t\t\n \t\titer = count.to_s\n \t\tqueryfrom += ' networks as n'+ count.to_s\n \t\tif (count != paramsize - 1) \n \t\t\tqueryfrom += ','\n \t\tend\n\n \t\tqueryid += ' n'+ count.to_s + '.collection_id = '+ parameters[count].to_s\n \t\t\n \t\tif (count != paramsize - 1) \n \t\t\tqueryid += ' AND '\n \t\tend\n \t\t\n \t\tc = count + 1\n \t\twhile c < paramsize\n \t\t\t\n \t\t\tquerywhere += 'n'+ iter +'.network_address = n'+ c.to_s + '.network_address AND '\n\n \t\t\tc += 1\n \t\tend\n \t\tcount += 1\n \tend\n \t\n \tquery = 'select n0.network_address from' + queryfrom + ' where ' + querywhere + queryid\n \t\n \t\n network_allocation = Network.find_by_sql(\"select n0.network_address, n0.collection_id, n0.ancestry, n0.subnet_mask, n0.network_class, n0.description, n0.note, n0.updated_by from\" + queryfrom + \" where \" + querywhere + queryid) \n #network_allocation = Network.find_by_sql(\"select n0.network_address, n0.collection_id, n0.subnet_mask, n0.network_class from\" + \" networks as n0\" + \" where \" + \"n0.collection_id = 86\")\n \n ret = []\n network_allocation.each {|net| ret += Subnet.find :all, :conditions => { :network_address => net.network_address }, :order => 'network_address'}\n final = []\n ret.each do |last|\n final += last.descendants\n end\n final += ret\n return final\n \n end", "title": "" }, { "docid": "a49dac60c08b32440e57060802282cf2", "score": "0.56746966", "text": "def nodes_linked_to(node_name, exclude=[])\n node_names = @link_data.each_with_object([]) { |(src, target), acc|\n acc << target if node_name == src && !exclude.include?(target)\n acc << src if node_name == target && !exclude.include?(src)\n }.freeze\n\n to_exclude = node_names + [node_name] + exclude\n node_names.map do |mn|\n sec_tier = nodes_linked_to(mn, to_exclude)\n to_exclude += sec_tier\n sec_tier + [mn]\n end.flatten\n end", "title": "" }, { "docid": "1ba8508e36663b29420f67e715c93ca0", "score": "0.56566894", "text": "def networks\n nets = [] \n p = @link.client.proxy( 'network' )\n p.get_all(@link.sid)['Value'].each do |ref|\n nets << Network.new(@link, ref)\n end\n nets\n end", "title": "" }, { "docid": "0196cc6324448fe8a720be89dc62de7a", "score": "0.56322205", "text": "def networks(opts = {})\n res = []\n res << @network if @used\n res += @l.networks if @l\n res += @r.networks if @r\n res\n end", "title": "" }, { "docid": "74f822c22afd437bde6756bf2fc54ba1", "score": "0.55785227", "text": "def find_matching_network(networks, needle_options)\n networks.each do |network|\n if needle_options[:name] && needle_options[:name] == network[:name]\n return network\n elsif matching_network?(network, needle_options)\n return network\n end\n end\n\n nil\n end", "title": "" }, { "docid": "d76e334fd772c91d16111aaa20e62c6b", "score": "0.5563518", "text": "def network_mappings\n @network_mappings\n end", "title": "" }, { "docid": "711f4feb35210a7ae97f5c56d7b02643", "score": "0.55439633", "text": "def networks\n\t\t\telems = []\n\t\t\tget_resource_link(:networks, \"networks\", \"network\").each do |data|\n\t\t\t\telems << Network.new(data)\n\t\t\tend\n\t\t\telems\n\t end", "title": "" }, { "docid": "77a904166807b36b50b69a34ce872fb6", "score": "0.55210173", "text": "def hypernyms\n links = SemanticLink.find(:all, :conditions => {\n :synset_from_id => self.id,\n :link_id => 1\n })\n links.map{|l| l.synset_to}\n end", "title": "" }, { "docid": "f496d378db60086c95049ab256dd3c32", "score": "0.5497878", "text": "def networks\n @networks\n end", "title": "" }, { "docid": "f496d378db60086c95049ab256dd3c32", "score": "0.5497878", "text": "def networks\n @networks\n end", "title": "" }, { "docid": "f496d378db60086c95049ab256dd3c32", "score": "0.5497878", "text": "def networks\n @networks\n end", "title": "" }, { "docid": "f496d378db60086c95049ab256dd3c32", "score": "0.5497878", "text": "def networks\n @networks\n end", "title": "" }, { "docid": "ed83798c05ce553595072f5a2ad0c27f", "score": "0.54968923", "text": "def sources\n @nodes.select{|x| (edges x, :in).empty?}\n end", "title": "" }, { "docid": "d2b564d273fb1ff437148b0ce63046c9", "score": "0.5487561", "text": "def getNodeLinkNodes(node)\n\t\tnodeLinks = Array.new\n\t\t@links.each do |link|\n\t\t\tif link.include?(node)\n\t\t\t\t# You know for sure the node is an element in an array of two.\n\t\t\t\tindexNode = link.index(node)\n\n\t\t\t\t# If the index of the node is 0, than the other node's index is 1, and otherwise.\n\t\t\t\tif (indexNode == 0)\n\t\t\t\t\tnodeLinks.push link[1]\n\t\t\t\telse\n\t\t\t\t\tnodeLinks.push link[0]\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\t\tnodeLinks\n\tend", "title": "" }, { "docid": "aca392410114ae20c1cc2425c0c76db6", "score": "0.5482372", "text": "def possible_networks\n @possible_networks ||= Optopus::Network.where('address >> ?', self.ip_address.to_cidr)\n end", "title": "" }, { "docid": "a38cfe5a0b587a7b19bd38cc770451b7", "score": "0.54813707", "text": "def all_nodes\n @networks.each do |nw|\n nw.nodes.each do |node|\n yield node, nw\n end\n end\n end", "title": "" }, { "docid": "86bf6330872b2a502f4dcc5adb48eabd", "score": "0.5473252", "text": "def neighbors\n self.class.find_all_by_nodes node_ids\n end", "title": "" }, { "docid": "14b5cee791c97b9f98d3f9be19c8a4e2", "score": "0.54406726", "text": "def links_to_nodes(links)\n nodes = Likewise::Node.find links.map { |l| l[:ref_id] }\n nodes.each_with_index { |n, idx| n.context = links[idx] }\n nodes\n end", "title": "" }, { "docid": "9f5a17ff36a8d170d7991619acf135b3", "score": "0.542312", "text": "def nodes(specs = {})\n # rels(specs).map{|n| n.other_node(self)}\n end", "title": "" }, { "docid": "551a3a68c06418ec69ab199c7f34a66b", "score": "0.542168", "text": "def network_list\n @network_list ||= self.class.get(\"/networks/list.json\")\n end", "title": "" }, { "docid": "7f0ebb30a50162461a5b4884625ccc6a", "score": "0.54214376", "text": "def get_network(curr_user)\n @network = []\n curr_user.groups.each do |group|\n group.users.each do |user|\n if user.id != curr_user.id\n unless @network.include?(user)\n @network << user\n end\n end\n end\n end\n return @network\n end", "title": "" }, { "docid": "d7cd6518dcf7394531106d28baa0f2bf", "score": "0.541228", "text": "def peered_networks(name)\n raise ArgumentError, 'network does not exist' unless network?(name)\n\n list = []\n (network(name).peerings || []).each do |x|\n options = {\n direction: 'incoming',\n peering_name: x.name,\n region: @region\n }\n @compute.list_network_peering_routes(@project, name, options).items.each do |p|\n list.push(p)\n end\n end\n list\n end", "title": "" }, { "docid": "86805c3dfad9d73e6bb195d35cb92a6d", "score": "0.54074675", "text": "def nodes\n cloud_provider.nodes.select {|a| a.in_service? }\n end", "title": "" }, { "docid": "86805c3dfad9d73e6bb195d35cb92a6d", "score": "0.54074675", "text": "def nodes\n cloud_provider.nodes.select {|a| a.in_service? }\n end", "title": "" }, { "docid": "95a2de36d1bef5534acaad383a27a663", "score": "0.5404396", "text": "def get_neighbor_nodes(node)\n\nend", "title": "" }, { "docid": "bfd7ed1b97cb5a8d0b5c29735539f389", "score": "0.5383248", "text": "def networks_addresses\n Docker::Network.all.each do |network|\n network_info = network.json\n name = network_info['Name']\n ipam_driver = network_info.dig('IPAM', 'Driver')\n ipam_pool = network_info.dig('IPAM', 'Options', 'network')\n containers = network_info['Containers']\n\n debug \"Scanning network: #{name}\"\n\n if ipam_driver != 'kontena-ipam'\n debug \"Skip non-kontena network: IPAM.Driver=#{ipam_driver}\"\n\n elsif !ipam_pool\n warn \"Skip Kontena IPAM network with missing network= option for pool\"\n\n else\n debug \"Kontena IPAM network #{name}: pool=#{ipam_pool} containers=#{containers.size}\"\n\n containers.each { |container_id, container_info|\n debug \"container #{container_id}: #{container_info}\"\n\n yield ipam_pool, IPAddr.new(container_info['IPv4Address'])\n }\n end\n end\n end", "title": "" }, { "docid": "3c67b85fddf1ec0631350e6240bdfae5", "score": "0.53651434", "text": "def external_network_providers\n @external_network_providers\n end", "title": "" }, { "docid": "f2cc9647ea0c794bfb5856bfaa09220c", "score": "0.53611606", "text": "def extractNodeListFromRoadList()\n @roadList.each{|road|\n extractNodeListFromRoad(road) ;\n }\n end", "title": "" }, { "docid": "e2ebcf30eecae41e2d58252c17afe9a6", "score": "0.5355745", "text": "def find_links\n link_ids =[]\n results = CONNECTION.execute(\"SELECT * FROM assignments_links WHERE assignment_id = #{@id};\")\n results.each do |hash|\n link_ids << hash[\"link_id\"]\n end\n Link.find_many(link_ids)\n end", "title": "" }, { "docid": "2427bd474bb8cb51b85ea56354be4a6d", "score": "0.53351134", "text": "def search_matching_links_to name\n\t\tanswer = nil\n\t\tif internet_available?\n\t\t\tanswer = WikiClient.ask name\n\t\t\tanswer.select! { |link| !(link =~ /:/) }\n\t\telse\n\t\t\tanswer = @db.search name\n\t\tend\n\t\tanswer || []\n\tend", "title": "" }, { "docid": "db28bb4039be59921249039e52e4b4fd", "score": "0.53313005", "text": "def networks\n self.accounts.collect(&:network_name)\n end", "title": "" }, { "docid": "0046557d71c9da482c8dc90130d06f3f", "score": "0.5322598", "text": "def getNetworks interface\n return []\n end", "title": "" }, { "docid": "45bd83d6817ad0ff15d605f10c1f76f8", "score": "0.52936476", "text": "def in_network(network)\n where(:network_id => network)\n end", "title": "" }, { "docid": "1dcc76d6acaf017bbcefa8f103018000", "score": "0.5287298", "text": "def private_networks\n\t \telems = []\n\t\t\tget_resource_link(:networks, \"networks\", \"network\").each do |data|\n\t\t\t\telems << Network.new(data)\n\t\t\tend\n\t\t\telems\n\t end", "title": "" }, { "docid": "4c800b55219f2e9fe4096d5fa1a120c9", "score": "0.52852154", "text": "def network_search_by_tag(tag)\n networks = network_list\n networks['Value'].select! do |network_uuid|\n network_get_tags(network_uuid)['Value'].include?(tag)\n end\n networks\n end", "title": "" }, { "docid": "c392748940d755eae13267b16eb941cd", "score": "0.5277126", "text": "def nodes_links(page)\n neo = Neography::Rest.new\n cypher_query = \"START a = node:nodes_index(type='page')\"\n cypher_query << \"MATCH (a)-[:links]->(b), p=(b)-[?]->(c)\"\n cypher_query << \"WHERE a.name = \\'#{page}\\' AND b.type = 'post' AND c.type ?= 'post' \"\n cypher_query << \"RETURN ID(b), b.name?, extract(n in nodes(p) : ID(n) ), b.href?, b.img?, b.fixed?, b.x?, b.y?\"\n result = neo.execute_query(cypher_query)\n if result then result else nil end\n end", "title": "" }, { "docid": "94c26e9abbc9a1ef9150b74438f4dfdc", "score": "0.52763903", "text": "def link_nodes(n1,n2)\n # TODO Check that n1, n2 already in list of nodes\n if n1.link_to n2\n @edge_count += 1\n end\n #ds_union n1.id, n2.id\n @disjoint.union(n1.id,n2.id)\n end", "title": "" }, { "docid": "a226c9a449bdba660760491b3c02fc0d", "score": "0.52671987", "text": "def relevant_links\n ['libproxy.mit.edu', 'library.mit.edu', 'sfx.mit.edu', 'owens.mit.edu',\n 'libraries.mit.edu']\n end", "title": "" }, { "docid": "bcf69c581a9aab42a54a2c7028768a3f", "score": "0.52582085", "text": "def network?(name)\n networks.items.map(&:name).include?(name)\n end", "title": "" }, { "docid": "cb4092835932cb438a154560ffd7ee5d", "score": "0.5256601", "text": "def peer_list_for(n)\n assert(nodes.has_key?(n.id), \"No vertex w/ id #{n.id}\")\n nodes.values.select {|p| p.id != n.id}\n end", "title": "" }, { "docid": "e2d775cf5ac9818a657d00f544f28514", "score": "0.5250972", "text": "def with_node(node)\r\n (@link_list.collect do |link|\r\n link if link.contains(node)\r\n end).compact\r\n end", "title": "" }, { "docid": "0999bfb67ac53b1533c4eec8463c20c4", "score": "0.5250748", "text": "def hostonly_find_matching_network(config)\n this_netaddr = IPAddr.new(\"#{config[:ip]}/#{config[:netmask]}\")\n\n @env[:machine].provider.driver.read_host_only_interfaces.each do |interface|\n return interface if config[:name] && config[:name] == interface[:name]\n\n if interface[:ip] && this_netaddr.ipv4?\n netaddr = IPAddr.new(\"#{interface[:ip]}/#{interface[:netmask]}\")\n return interface if netaddr.include? this_netaddr\n end\n\n if interface[:ipv6] && this_netaddr.ipv6?\n netaddr = IPAddr.new(\"#{interface[:ipv6]}/#{interface[:ipv6_prefix]}\")\n return interface if netaddr.include? this_netaddr\n end\n end\n\n nil\n end", "title": "" }, { "docid": "a8ee5b4b5c9cbe89406509de352210af", "score": "0.52495575", "text": "def links(n)\n end", "title": "" }, { "docid": "823cb001d1b6c6ab8762e9c8b6bd06e4", "score": "0.52348316", "text": "def nodes_for_name(name)\n if node = @manager.nodes[name]\n return Config::ObjectList.new(node)\n elsif @environments.empty?\n if @manager.services[name]\n return @manager.env('_all_').services[name].node_list\n elsif @manager.tags[name]\n return @manager.env('_all_').tags[name].node_list\n else\n LeapCli::Util.log :warning, \"filter '#{name}' does not match any node names, tags, services, or environments.\"\n return Config::ObjectList.new\n end\n else\n node_list = Config::ObjectList.new\n if @manager.services[name]\n @environments.each do |env|\n node_list.merge!(@manager.env(env).services[name].node_list)\n end\n elsif @manager.tags[name]\n @environments.each do |env|\n node_list.merge!(@manager.env(env).tags[name].node_list)\n end\n else\n LeapCli::Util.log :warning, \"filter '#{name}' does not match any node names, tags, services, or environments.\"\n end\n return node_list\n end\n end", "title": "" }, { "docid": "7f923f71757297c3d347c7c66ee448d1", "score": "0.5233902", "text": "def node_services\n node.list\n end", "title": "" }, { "docid": "c3e059a6e481f42ff85c22a9cd362782", "score": "0.52292067", "text": "def layers\n # puts \" Links: #{@links.size}\"\n layer_links.collect{|l| l.layer}.uniq\n end", "title": "" }, { "docid": "53866397b02533c550790be2e5c254f1", "score": "0.522648", "text": "def relevant_nodes\n nodeset = query_root_node(\"rdf:Description\", @@NAMESPACES)\n @items = []\n if !nodeset.nil?\n nodeset.each do |item|\n node_obj = SemanticCrawler::LinkedGeoData::RelevantNode.new(item)\n @items << node_obj\n end\n end\n @items\n end", "title": "" }, { "docid": "9793421fd475f7d42d72d0af82e7ff77", "score": "0.52213854", "text": "def network_of_support(profile)\n question = profile.snapshot_1.questions.first\n\n network_of_support = {}\n network_of_support[:total] = 0\n response = (question.response_from(self) || \"0,0,0,0,0,0\").code.split(',').collect{|r| r.strip.to_i}\n %w(family school cbo peers others reasons).each_with_index do |category, i|\n network_of_support[category.to_sym] = response[i]\n network_of_support[:total] += response[i].to_i unless category == 'reasons'\n end\n\n return OpenStruct.new(network_of_support)\n end", "title": "" }, { "docid": "21e82d008d20270ac1afd9a823c4927f", "score": "0.52209234", "text": "def configure_networks(node, node_details)\n networks = node_details['networks']\n networks && networks.each do |network|\n network.each do |network_type, network_params|\n if network_params\n network_params = keys_to_symbols(network_params)\n node.vm.network network_type, network_params\n else\n node.vm.network network_type\n end\n end\n end\nend", "title": "" }, { "docid": "eeb63c8df01ce72139a225a699064456", "score": "0.52157426", "text": "def networks\n logger.info(\"vmware_api_adaptor.networks\")\n network_mors = self.hosts.map { |host| host[:mor].get_networks }.flatten.uniq { |network| network.get_mor.get_value }\n network_mors.map do |network|\n {\n \"mor\" => network,\n \"moref_id\" => network.get_mor.get_value,\n \"name\" => network.get_name,\n \"is_accessible\" => network.get_summary.is_accessible,\n \"ip_pool_name\" => network.get_summary.get_ip_pool_name\n }\n end\n end", "title": "" }, { "docid": "1f7e4c977b7d5296dc82630708afa309", "score": "0.52142924", "text": "def get_net_info_from_network\n ips = []\n network[:interfaces].sort_by{|k,v| k.to_s }.each do |name, info|\n next if info[:encapsulation] == 'Loopback'\n ip = info[:addresses].keys.detect{|addr| info[:addresses][addr][:family] == 'inet' }\n if name == network[:default_interface]\n ips.unshift(ip)\n else\n ips.push(ip)\n end\n end\n ips.flatten.compact.uniq\nend", "title": "" }, { "docid": "292eed5863b0c36359cd9c4b7e854a13", "score": "0.5213085", "text": "def all_related_nodes\n edges = uniq_edges\n Node.where(id: (edges.map(&:from_node_id) + edges.map(&:to_node_id) + self.nodes.map(&:id)).uniq)\n end", "title": "" }, { "docid": "d336278cd56d5f2a315f209746212b5d", "score": "0.5209521", "text": "def all_connections\n all_links + all_containments\n end", "title": "" }, { "docid": "1d531f5478937a51644768f75e977bed", "score": "0.5205293", "text": "def nodes in_or_out = :out, via: nil, where: nil, expand: false\n\t\t\tedges = detect_edges( in_or_out, via, expand: false )\n\t\t\treturn [] if edges.empty?\n\t\t\tq = query\t\t\t# q.to_s => \"select from #0x:0x \"\n\t\t\tedges = nil if via.nil?\n\t\t\tq.nodes in_or_out, via: edges , where: where, expand: expand\n\t\t\tdetected_nodes=\tq.execute{| record | record.is_a?(Hash)? record.values.first : record }\n\tend", "title": "" }, { "docid": "515b8d32382b9d18a1a55e4d072ba81c", "score": "0.5196498", "text": "def removeNonConnectedNodesLinks()\n pivotNode = findMostMajorGroupNode() ;\n nonConnectedNodes = findNonConnectedNodes(pivotNode) ;\n nonConnectedLinks = {} ;\n nonConnectedNodes.each{|node|\n node.linkList.each{|link|\n nonConnectedLinks[link] = true ;\n }\n @nodeTable.delete(node) ;\n }\n @nodeList = @nodeList - nonConnectedNodes ;\n @linkList = @linkList - nonConnectedLinks.keys ;\n end", "title": "" }, { "docid": "9fd78911658751001e63e75d386f7a85", "score": "0.5194774", "text": "def get_enabled_network(compute_service,attempted_networks)\n\n has_sdn = true\n enabled_networks = []\n if compute_service.has_key?('enabled_networks')\n enabled_networks = JSON.parse(compute_service['enabled_networks'])\n end\n\n if enabled_networks.nil? || enabled_networks.empty?\n enabled_networks = [ compute_service['subnet'] ]\n end\n\n enabled_networks = enabled_networks - attempted_networks\n\n if enabled_networks.size == 0\n exit_with_error \"no ip available in enabled networks for cloud #{node[:workorder][:cloud][:ciName]}. tried: #{attempted_networks} - escalate to openstack team\"\n end\n\n network_name = enabled_networks.sample\n Chef::Log.info(\"network_name: \"+network_name)\n\n # net_id for specifying network to use via subnet attr\n net_id = ''\n begin\n quantum = Fog::Network.new({\n :provider => 'OpenStack',\n :openstack_api_key => compute_service[:password],\n :openstack_username => compute_service[:username],\n :openstack_tenant => compute_service[:tenant],\n :openstack_auth_url => compute_service[:endpoint]\n })\n\n quantum.networks.each do |net|\n if net.name == network_name\n Chef::Log.info(\"network_id: \"+net.id)\n net_id = net.id\n break\n end\n end\n rescue Exception => e\n Chef::Log.warn(\"no quantum or neutron networking installed\")\n has_sdn = false\n end\n \n exit_with_error \"Your #{node[:workorder][:cloud][:ciName]} cloud is configured to use network: #{compute_service[:subnet]} but is not found.\" if net_id.empty? && has_sdn\n\n return network_name, net_id\nend", "title": "" }, { "docid": "005b92ac112807c319e3ed9c67e3a20e", "score": "0.51814854", "text": "def nodes_by_nodes_list\n no_list_nodes = @nodes_handler.known_nodes\n (\n @nodes_handler.known_nodes_lists.sort.map do |nodes_list|\n nodes_from_list = @nodes_handler.nodes_from_list(nodes_list, ignore_unknowns: true)\n no_list_nodes -= nodes_from_list\n [nodes_list, nodes_from_list]\n end + [\n ['No list', no_list_nodes],\n ['All', @nodes_handler.known_nodes]\n ]\n ).to_h.transform_values do |list_nodes|\n {\n nodes: list_nodes,\n tested_nodes: list_nodes & @tested_nodes,\n tested_nodes_in_error: list_nodes & group_errors(node_tests, :node).keys,\n tested_nodes_in_error_as_expected: list_nodes & group_errors(node_tests, :node, filter: :only_as_expected).keys\n }\n end\n end", "title": "" }, { "docid": "f35dfecb08c208a2e88dfaf72a4ea7e5", "score": "0.5180214", "text": "def network_get_default\n networks = network_list\n networks['Value'].select! do |network_uuid|\n network_get_detail(network_uuid)['Value']['other_config'].key?('automatic') && network_get_detail(network_uuid)['Value']['other_config']['automatic'] == true\n end\n networks\n end", "title": "" }, { "docid": "be07c74813c5b6e52730bb695c991318", "score": "0.5178798", "text": "def netset\n obj_retry(\"link\") do; nav.link(:text, 'Network Settings'); end\n end", "title": "" }, { "docid": "ca21908085606986eee3c43a383ef32a", "score": "0.51769656", "text": "def relevant_links\n ['libproxy.mit.edu', 'library.mit.edu', 'sfx.mit.edu', 'owens.mit.edu',\n 'libraries.mit.edu', 'content.ebscohost.com']\n end", "title": "" }, { "docid": "fc1f130614f520686126a87b115740b1", "score": "0.5165953", "text": "def networks\n @log.debug(\"Getting networks list on #{self.name}\") \n array_return = Array.new\n command = \"lshwres --rsubtype vnetwork -r virtualio -m #{self.name}\"\n output = self.hmc.run_command(command).chomp()\n regexp = /vnetwork=(?'vnetwork'\\S+),is_tagged=(?'tagged'\\d),vswitch=(?'vswitch'\\S+),vlan_id=(?'vlanid'\\d+)/\n output.scan(regexp).each do |entry|\n hash = { :vnetwork => entry[0],\n\t \t :is_tagged => entry[1].to_i,\n\t\t :vswitch => entry[2],\n\t \t :vlan_id => entry[3].to_i}\n\tarray_return.insert(-1,hash)\n end\n array_return\n end", "title": "" }, { "docid": "748964a2755775b82bc89ca5d12c2b82", "score": "0.51655084", "text": "def find_network(sCloudObj, hParams)\n begin\n # retrieve the Provider collection object.\n sQuery = {:name => hParams[:network_name]}\n oList = controler.query(sCloudObj, sQuery)\n query_single(sCloudObj, oList, sQuery, hParams[:network_name])\n rescue => e\n Logging.error(\"%s\\n%s\" % [e.message, e.backtrace.join(\"\\n\")])\n end\n end", "title": "" }, { "docid": "efaf926fa7deb7680919bc54894a6f7f", "score": "0.5163939", "text": "def connected_networks\n network_profiles.reject {|key, profiles| Array.wrap(profiles).find {|p| !p.connected?}}.keys\n end", "title": "" }, { "docid": "9566bcde9a95edca988f6df394accdf8", "score": "0.5163235", "text": "def networks_to_add\n options[:networks].select { |n| [nil, \"add\"].include?(n[:operation]) }\n end", "title": "" }, { "docid": "28a22db2a7b0ef36108db31fe535672b", "score": "0.5158921", "text": "def find_node_from_ways(way_list)\n way_list.each do |way|\n @db.execute('SELECT node FROM way_node WHERE way = ?', way) do |node|\n yield node[0]\n end\n end\n end", "title": "" }, { "docid": "d226b62abeb69f5ab8f97220c60d86f7", "score": "0.5157159", "text": "def network_get_xc\n networks = network_list\n networks['Value'].select! do |network_uuid|\n network_get_detail(network_uuid)['Value']['other_config'].key?('automatic')\n end\n networks\n end", "title": "" }, { "docid": "6f7193fa88c31fbad0e52d9ee4d22848", "score": "0.5151867", "text": "def networks\n @compute.list_networks(@project)\n end", "title": "" }, { "docid": "dc572a177e8a1dde43dd1f6c405d7926", "score": "0.51486456", "text": "def networkWires(n, wires)\n sorted = wires.sort{|a,b| a[2] <=> b[2]}\n graph = (0..n-1).to_a\n sum = 0 \n sorted.each do |edge|\n # p graph\n if verticesNotConnected(edge, graph)\n # add to graph, now how do I add to the graph? \n # build a literal graph using an adjaceny matrix or list?\n # Just add to the adjanceny matrix and search it using a DFS starting until all searched, \n # \n # Do this union find kind of thing with an array?\n # Just need to keep a record of things being connected with know the details of the\n # connection (this is a trade off)\n # The key to the union find idea is that the graph data structure stores information about connectivity but not the details of the connections. The trade-off is information for speed. \n graph = graph.map{|val| val == graph[edge[0]] ? graph[edge[1]] : val } \n sum += edge[2]\n end\n end \n sum\nend", "title": "" }, { "docid": "1d48a80b13877832cf5671ed7ab74d90", "score": "0.51374227", "text": "def connected_nodes_with_method(node_to, amethod)\r\n (@link_list.collect do |link|\r\n link if (link.to == node_to) && (link.from.respond_to?(amethod)) \r\n end).compact\r\n end", "title": "" }, { "docid": "f04aa9b5fcd7c678d256e120cb27ad06", "score": "0.5135207", "text": "def known_nodes_lists\n @nodes_list_platform.keys\n end", "title": "" }, { "docid": "5e4d5ece4540932d85581051355b01e5", "score": "0.51338255", "text": "def node_ids; end", "title": "" }, { "docid": "5e4d5ece4540932d85581051355b01e5", "score": "0.51338255", "text": "def node_ids; end", "title": "" }, { "docid": "4cdece0a11edd49e1fb6908dd43e2580", "score": "0.51305526", "text": "def known_nodes\n @nodes_platform.keys\n end", "title": "" }, { "docid": "ba41dc2d9cccc9ab0e487dbfd587df50", "score": "0.5121186", "text": "def fetch_relations(max_node_count = 999999)\n @log.info(\"#{self.class.to_s}##{__method__.to_s} started\")\n gid_relidnei_h = {}\n\n lower_bound, upper_bound = 1, 10000\n interval = 10000\n while lower_bound <= max_node_count\n futures = {}\n @redis.pipelined do\n lower_bound.upto(upper_bound) do |i|\n break if i > max_node_count\n futures[\"out:#{i}\"] = @redis.hgetall(\"out:#{i}\")\n futures[\"in:#{i}\"] = @redis.hgetall(\"in:#{i}\")\n end\n end\n\n lower_bound.upto(upper_bound) do |i|\n break if i > max_node_count\n gid_relidnei_h[i] = futures[\"out:#{i}\"].value.merge(futures[\"in:#{i}\"].value)\n end\n\n lower_bound += interval\n upper_bound += interval\n end\n\n gid_relidnei_h\n end", "title": "" }, { "docid": "1ca60d1b1b1a7690e1b807d99b1c67a5", "score": "0.5118215", "text": "def find_network(sCloudObj, hParams)\n query = { :name => hParams[:network_name] }\n\n query_single(sCloudObj, query, hParams[:network_name])\n rescue => e\n PrcLib.error(\"%s\\n%s\", e.message, e.backtrace.join(\"\\n\"))\n end", "title": "" }, { "docid": "5bf2656e799dc529baccade9f38054ff", "score": "0.5117591", "text": "def linked\n select(&:linked?)\n end", "title": "" }, { "docid": "ab2ff797a9a2d4fc7ad071b5939ab3f9", "score": "0.51173526", "text": "def setup_links(nodes)\n super\n @attributes['links'].keys.each do |name|\n spawn(\"ip link set #{name} master br0\")\n end\n end", "title": "" }, { "docid": "3a5db99c1da67fa25b30af9f0530a8e2", "score": "0.5114746", "text": "def find_all\n masters = Nodes.new(@config.settings[\"master\"][\"agent\"], @config.settings[\"master\"][\"filter\"], @config)\n\n masters.nodes\n end", "title": "" }, { "docid": "51439305000eac3d16aa7879e2769c6e", "score": "0.5111302", "text": "def find_nodes(query)\n query(query).to_a\n end", "title": "" }, { "docid": "59a2e3e22edb968e8017bb42634db365", "score": "0.5107339", "text": "def rest__list_connections\n assembly = ret_assembly_instance_object()\n find_missing, find_possible = ret_request_params(:find_missing, :find_possible)\n ret =\n if find_possible\n assembly.list_possible_component_links\n elsif find_missing\n fail Error.new('Deprecated')\n else\n fail Error.new('Deprecated')\n end\n rest_ok_response ret\n end", "title": "" }, { "docid": "fc304d422524120ed204930f37291242", "score": "0.5106326", "text": "def query_network_list\n get_resource_list('network', 'v2.0/networks', 'networks')\n puts 'The list of Networks in this PowerVC cloud are:'\n headers = ['Networks']\n print_table(headers, @resource_print_list)\n footer\n end", "title": "" }, { "docid": "25b1987066ad5d60059111c7df51acfa", "score": "0.5094858", "text": "def stanford_network? (host)\n if host == 'ALL'\n return false\n end\n\n host_network = IPAddr.new(host)\n\n # This is taken from puppet's list of network ranges.\n stanford_networks = ['171.64.0.0/14',\n '10.32.0.0/15',\n '10.34.0.0/15',\n '10.98.0.0/15',\n '10.109.28.0/22',\n '172.24.0.0/14',\n '172.20.206.128/25',\n '172.20.207.0/25',\n '128.12.0.0/16',\n '10.30.0.0/15',\n '172.19.0.0/16',\n '171.66.188.121/29',\n '171.66.128.0/23',\n '204.63.224.0/21',\n '172.20.224.0/21',\n '171.66.16.0/21',\n '171.66.24.0/21',\n '171.66.176.0/20',\n '171.67.35.128/25',\n '171.67.34.0/24',\n '172.27.34.0/24',\n '171.67.23.0/24',\n '171.67.33.192/27',\n '172.20.192.0/23',\n '171.67.35.0/25',\n '171.67.45.0/24',\n '171.67.21.0/24',\n '171.67.37.0/25',\n '171.67.36.0/25',\n '171.67.36.130',\n '172.16.70.29',\n '172.27.36.10',\n '171.67.36.131',\n '172.16.70.28',\n '172.27.36.11',\n '171.67.36.2',\n '171.67.46.131',\n '172.27.36.2',\n '171.67.36.3',\n '171.67.46.132',\n '172.27.36.3',\n '172.20.21.208/28',\n '172.20.21.192/28',\n '10.111.1.160/27',\n '171.67.8.224/27',\n '172.20.194.0/24',\n '171.67.33.224/27',\n ]\n stanford_networks.each do |network|\n network_range = IPAddr.new(network)\n if network_range.include?(host_network)\n return true\n end\n end\n\n return false\nend", "title": "" }, { "docid": "ec4b2e1ea1328826cec0967d0af8a43b", "score": "0.5094251", "text": "def extract_nodes\n nodes.each_with_object([]) do |node,links_accu|\n if (node['href'] !~ /^\\?/) && (node.inner_html != 'Parent Directory')\n links_accu << Addressable::URI.parse(@link_sanitizer.to_s + node['href']).normalize\n end\n end\n end", "title": "" }, { "docid": "12735effe65b926319136387a7224fb1", "score": "0.5087629", "text": "def network_list(mixins = nil)\n if mixins.blank?\n read_network_fixtures\n else\n filtered_networks = read_network_fixtures.to_a.select { |n| (n.mixins & mixins).any? }\n Occi::Core::Resources.new filtered_networks\n end\n end", "title": "" }, { "docid": "d7fde76ad6ced13fc737deee6c87a096", "score": "0.5083863", "text": "def read_network_interfaces\n end", "title": "" }, { "docid": "c5d1bab258cff5deabc9be7ff3910fda", "score": "0.5080407", "text": "def all_relations\n FeatureRelation.where(['child_node_id = ? OR parent_node_id = ?', id, id])\n end", "title": "" }, { "docid": "c5d1bab258cff5deabc9be7ff3910fda", "score": "0.5080407", "text": "def all_relations\n FeatureRelation.where(['child_node_id = ? OR parent_node_id = ?', id, id])\n end", "title": "" }, { "docid": "9493a77a50af87bc50893261a2e06fe9", "score": "0.5076973", "text": "def getAllNodeIPsBySubnet(network, netmask, dbhost = \"localhost:8080\")\n maskint = IPAddr.new(netmask).to_i\n netint = IPAddr.new(network).to_i & maskint\n\n nodes=JSON.parse(RestClient.get(\"http://#{dbhost}/v2/nodes\", {:accept => :json}))\n\n retVal = Hash.new\n nodes.each do |node|\n nodename = node[\"name\"]\n\n interfacedata = JSON.parse(RestClient.get(\"http://#{dbhost}/v2/nodes/#{nodename}/facts/interfaces\", {:accept => :json}))\n if interfacedata[0] != nil\n # Only use the first interface for auto generated records\n interfacedata[0][\"value\"].split(\",\").each do |interface|\n\n if interface == \"lo\"\n next\n end\n \n ipv4 = JSON.parse(RestClient.get(\"http://#{dbhost}/v2/nodes/#{nodename}/facts/ipaddress_#{interface}\", {:accept => :json}))\n if ipv4[0] != nil\n if (IPAddr.new(ipv4[0][\"value\"]).to_i & maskint) == netint\n if !retVal.has_key?(nodename)\n retVal[nodename] = Array.new\n end\n \n retVal[nodename].push(ipv4[0][\"value\"])\n end\n end\n \n end\n end\n end\n \n return retVal\nend", "title": "" }, { "docid": "1e84997936335882d7754d19a6b95b5a", "score": "0.50706", "text": "def network_list(mixins = nil)\n backend_instances['network'].list(mixins) || ::Occi::Core::Resources.new\n end", "title": "" }, { "docid": "29a12eeaade5ff539e1d2dcf0628bb45", "score": "0.5060976", "text": "def available_nodes\n nodes_avail\n end", "title": "" }, { "docid": "8c92393ccaf4b1125a35614a9932adf9", "score": "0.5059199", "text": "def nodes(nodeSet = Set.new)\n @nodeSets.each do |g|\n g.nodes(nodeSet)\n end\n return nodeSet\n end", "title": "" } ]
1ed79076b694efe968da961ff26b3a1f
Gets all the instances for the list of ids and returns them in the id order of the list, rather than the db order.
[ { "docid": "30ffa206453f9bc8fb05ae9f4567368b", "score": "0.6965871", "text": "def get_all(id_list)\n # This pure-db solution is Postgresql only unfortunately...\n #\n # values = []\n # id_list.each_with_index do |id, index|\n # values << (\"(\" << [id, index].join(\",\") << \")\")\n # end\n # ds = @dataset.filter(:id => id_list).qualify.\n # join(Sequel::LiteralString.new(\"(VALUES #{values.join(\",\")}) AS id_order (id, pos)\"), {:id_order__id => :id}, {:qualify => true}).\n # order(:id_order__pos)\n order = Hash[id_list.each_with_index.map { |id, index| [id, index] }]\n filter(:id => id_list).all.sort { |i1, i2|\n order[i1.id] <=> order[i2.id]\n }\n end", "title": "" } ]
[ { "docid": "4141991fbc483eb5898324f9faada5ab", "score": "0.6690929", "text": "def find_many(ids, options = {})\n return [] if ids.empty?\n\n Hari.redis.mget(ids).map &method(:from_json)\n end", "title": "" }, { "docid": "83da6992208577e8513acc3547df0035", "score": "0.66892695", "text": "def by_ids(ids)\n Array.wrap(ids).each_with_object([]) { |id, result| result << find_by_id(id) }\n end", "title": "" }, { "docid": "83da6992208577e8513acc3547df0035", "score": "0.66892695", "text": "def by_ids(ids)\n Array.wrap(ids).each_with_object([]) { |id, result| result << find_by_id(id) }\n end", "title": "" }, { "docid": "1580b7844d83209f816c996b26e48d56", "score": "0.6687432", "text": "def ids\n a = Array.new\n self.each {|entity|\n a.push entity.id\n }\n return a.sort\n end", "title": "" }, { "docid": "6bf778bec4d3960e3b164e441c0a451e", "score": "0.6682303", "text": "def find_all(ids)\n response = self.class.get(\"?id=#{ids.join(',')}\")\n parse_results(response)\n end", "title": "" }, { "docid": "d413df4c27824e6284d5c89abcad2fa5", "score": "0.66736543", "text": "def ordered_results(ids)\n model_lookup = self.find(ids).inject({}) do |h, m|\n h[m.id] = m\n h\n end\n\n ids.map { |id| model_lookup[id] }\n end", "title": "" }, { "docid": "48259e029649f0d2c1a7d9437c973bd4", "score": "0.659853", "text": "def ids\n @@ids ||= self.all.collect{|a| a.id}\n end", "title": "" }, { "docid": "0b3d8b8cf0cb5d52d99bf88646da986a", "score": "0.6584079", "text": "def get_many_by_ids(ids, options={})\n properties = options[:properties]\n return ids.map {|id| construct_entity_from_id(id)} if can_construct_from_id_alone?(properties)\n\n results_by_id = {}\n results = query(options[:properties]) do |ds,mapping|\n id_filter = @identity_mapper.make_multi_filter(ids.uniq, mapping[@identity_property])\n ds.filter(id_filter)\n end.to_a(options[:lazy])\n results.each {|object| results_by_id[object.id] = object}\n ids.map {|id| results_by_id[id]}\n end", "title": "" }, { "docid": "9d46ca0402a3f41f3c4b290a793f707d", "score": "0.65595245", "text": "def find_by_ids(ids, options = {})\n ids = ids.sort\n json_items = api_conn.get(self.resources_path, :query => {:id => ids.join(\",\")}).parsed_response\n\n resources = process_response(json_items, options)\n\n return resources\n end", "title": "" }, { "docid": "5185862505202c488b936b5ec2af2cd4", "score": "0.65053433", "text": "def instances\n all_instances.sort_by(&:first).map(&:last)\n end", "title": "" }, { "docid": "802dee55b7b7c23dd04f3dd74aa032df", "score": "0.6478403", "text": "def ids\n @ids ||= []\n end", "title": "" }, { "docid": "fef94cb8a26b30cf42b74137d71dadc6", "score": "0.6475", "text": "def instances\n instances = []\n @elb.instances.each do |inst|\n instances << inst.instance_id\n end\n instances\n end", "title": "" }, { "docid": "c7f1f2809efeb9920939bb11f57e99fb", "score": "0.6473644", "text": "def to_a\n fetch(ids)\n end", "title": "" }, { "docid": "e9c6a930e64c6bbd17ae0941426e4755", "score": "0.6435959", "text": "def find_many_by_ids(ids:)\n ids.each do |id|\n id = ::Valkyrie::ID.new(id.to_s) if id.is_a?(String)\n validate_id(id)\n end\n resources = []\n ids.uniq.map(&:to_s).each do |id|\n begin\n af_object = ActiveFedora::Base.find(id)\n resources << resource_factory.to_resource(object: af_object)\n rescue ::ActiveFedora::ObjectNotFoundError, Ldp::Gone\n next\n end\n end\n resources\n end", "title": "" }, { "docid": "7c087f3281a045e6f79690310fd6dd52", "score": "0.6422486", "text": "def fetch(ids)\n data = nil\n\n model.synchronize do\n ids.each do |id|\n redis.queue(\"HGETALL\", namespace[id])\n end\n\n data = redis.commit\n end\n\n return [] if data.nil?\n\n [].tap do |result|\n data.each_with_index do |atts, idx|\n if atts.is_a?(Array) && atts.size > 0\n result << model.new(Utils.dict(atts).update(:id => ids[idx]))\n end\n end\n end\n end", "title": "" }, { "docid": "8f1ce0e8663a0a1ec613d479f41fc166", "score": "0.63877654", "text": "def load_all(ids)\n ids.map { |id| self.load(id) }\n end", "title": "" }, { "docid": "e5c4999add4fddcdf0a194841f7fa2de", "score": "0.6379576", "text": "def getIds(list)\r\n\t\tids = Array.new\r\n\r\n\t\tlist.each {\r\n\t\t\t|item|\r\n\t\t\tids << item.Id\r\n\t\t}\t\t\t\r\n\t\t\r\n\t\treturn ids\r\n\tend", "title": "" }, { "docid": "cfcda13bf0885d6e1490dd4d9cf39ab9", "score": "0.63747436", "text": "def from_ids(ids)\n query = Query.static(ids)\n from_query(query)\n end", "title": "" }, { "docid": "425d8e8cbc2027dae19821a1a4295e3c", "score": "0.6361156", "text": "def compute_list_ids(mixins = nil)\n id_list = []\n\n Backends::Ec2::Helpers::AwsConnectHelper.rescue_aws_service(@logger) do\n instance_statuses = @ec2_client.describe_instance_status(include_all_instances: true).instance_statuses\n instance_statuses.each { |istatus| id_list << istatus[:instance_id] } if instance_statuses\n end\n\n id_list\n end", "title": "" }, { "docid": "93c090410e46653a90fa2f0dc2bf6f18", "score": "0.6353743", "text": "def ids\n map { |x| x.id }\n end", "title": "" }, { "docid": "03e72cb34df772b9eb52adc2294e6185", "score": "0.6348151", "text": "def get_instance_ids\n client.api_call('describe_instances', layer_id: id)[:instances].map{ |s| s[:instance_id] }\n end", "title": "" }, { "docid": "c8bbeb69c0a8f9739d88fd82a63c904c", "score": "0.6329727", "text": "def find_all_ordered(ids, conditions_present = false)\n relation = conditions_present ? where(id: ids) : self\n items_by_id = relation.index_by(&:id)\n ids.map { |i| items_by_id[i] }\n end", "title": "" }, { "docid": "08788173fa13d4aa6cc6cd919ca42920", "score": "0.632233", "text": "def load_all(ids)\n @clazz.multi_find(ids)\n end", "title": "" }, { "docid": "37b135550ac124e84b375569957b61ef", "score": "0.6320415", "text": "def find_all(ids, options = {})\n keys = []\n\n ids.each do |id|\n keys.push(get_key(id))\n end\n\n return [] if keys.empty?\n\n items = Dynamo::Client.batch_get_item(self.table_name, keys, options)\n items ? items.map{|i| from_database(i)} : []\n end", "title": "" }, { "docid": "f11783cef032ebfc5db06f61c4b11538", "score": "0.62655056", "text": "def find_all_by_id(*ids)\n ids = [ids].flatten\n find_many(ids)\n end", "title": "" }, { "docid": "8b725553ae61e8f56f60aefe73a09bef", "score": "0.6258277", "text": "def find_many(ids)\n existing, required = ids.partition { |id| has_record_for_id?(id) }\n if required.any?\n where(ids: ids) + existing.map { |id| record_for_id(id) }\n else\n existing.map { |id| record_for_id(id) }\n end\n end", "title": "" }, { "docid": "c810fb91ec7ffaf0a8f42bb28540c54f", "score": "0.6254015", "text": "def object_ids\n ids\n end", "title": "" }, { "docid": "8109d4a63b7cbc51f8046282e4f89ee7", "score": "0.625193", "text": "def find_many_by_ids(ids:)\n ids.map! do |id|\n id = Valkyrie::ID.new(id.to_s) if id.is_a?(String)\n validate_id(id)\n id.to_s\n end\n\n orm_class.where(id: ids).map do |orm_resource|\n resource_factory.to_resource(object: orm_resource)\n end\n end", "title": "" }, { "docid": "744fd128901d09f0f40301380187f591", "score": "0.6239714", "text": "def association_ids(*instances)\n ['id'] + instances.collect{|i| i.class.to_s.underscore + '_id'}\n end", "title": "" }, { "docid": "4b9f4fdf4c57f833a44bd330ea8c5e9e", "score": "0.6229779", "text": "def sorted_ids\n retrieve_id(@sorted)\n end", "title": "" }, { "docid": "e4f3d0057f0a3a3dd574c7400fa274ed", "score": "0.62233186", "text": "def find_associated_records(ids, reflection, preload_options)\n associated_records = []\n ids.each_slice(MAX_IDS_PER_ORACLE_QUERY) do |safe_for_oracle_ids|\n associated_records += super(safe_for_oracle_ids, reflection, preload_options)\n end\n associated_records\n end", "title": "" }, { "docid": "20ca35df358dee96c6cc9176b896c1bc", "score": "0.6222357", "text": "def records_for(ids)\n scope = query_scope ids\n klass.connection.select_all(scope.arel, 'SQL', scope.bind_values)\n end", "title": "" }, { "docid": "d6afa50b5486799e3d21091ec126ecb5", "score": "0.6199467", "text": "def multi_get(ids)\n cached_records = multi_fetch(ids)\n\n misses = cached_records.reduce([]) do |memo, (id, cached)|\n memo << id unless cached\n memo\n end\n\n db_records = misses.any? ? multi_store(where(id: misses).all.to_a) : {}\n\n ids.reduce({}) do |memo, id|\n memo[id] = cached_records[id] || db_records[id.to_i]\n memo\n end\n end", "title": "" }, { "docid": "03de64b871bcff5dfaaec5c7783778d9", "score": "0.6195747", "text": "def find_by_multiple_ids\n api_statement = generate_statement \"WHERE id IN (243342883, 244273363)\"\n page = @service.get_orders_by_statement api_statement.toStatement\n\n print_results page[:results] if page[:results]\n end", "title": "" }, { "docid": "8b0b47917c652b010734f86a39accb47", "score": "0.61944765", "text": "def ids_reader\n return [] if @owner.new_record?\n if loaded?\n load_target.map do |record|\n record.id\n end\n else\n proxies = load_proxies_from_solr(fl: 'id, next_ssim, proxyFor_ssim')\n create_linked_list(@owner.head_id, proxies)\n end\n end", "title": "" }, { "docid": "1b40b1e51ac57f394d9109368a0e096d", "score": "0.61625487", "text": "def get_bulk(ids, db = database)\n get_bulk!(ids, db) { nil }\n end", "title": "" }, { "docid": "a79530f5cb54476bc67cbf5fd8ac1037", "score": "0.61554646", "text": "def find_many(ids)\n existing, required = ids.partition { |id| has_record_for_id?(id) }\n if required.any?\n where(ids: required) + existing.map { |id| record_for_id(id) }\n else\n existing.map { |id| record_for_id(id) }\n end\n end", "title": "" }, { "docid": "7ec73eec2fc1cab5be952b008ac76fe8", "score": "0.61488146", "text": "def multi_get(ids, options={})\n index, type, options = extract_required_scope(options)\n results = execute(:multi_get, index, type, ids, options)\n if(results)\n hits = []\n results.each { |hit| hits << Hit.new(hit) }\n hits\n end\n end", "title": "" }, { "docid": "3965824e0c1505719859c719f50be5e1", "score": "0.6134358", "text": "def load_all(ids)\n @clazz.find(ids.map { |id| id.to_i }, :include => (@include || []))\n end", "title": "" }, { "docid": "5118bf722dde63a4b3ce520b6213f1c8", "score": "0.6112132", "text": "def find_by_ids(ids)\n QueryResult.new(ids.map {|id| @index_list[id] })\n end", "title": "" }, { "docid": "7cb8abb6a29db4488fc86fecef57ad93", "score": "0.61115915", "text": "def ids\n execute { |key| redis.smembers(key) }\n end", "title": "" }, { "docid": "7e7f0007809f10327880f6533f15b989", "score": "0.6110894", "text": "def all\n ids = redis.zrange(index_key_for(:id), 0, -1)\n find(ids)\n end", "title": "" }, { "docid": "37c8ea76153268556a88ed26036f0fb1", "score": "0.61101675", "text": "def ids\n self.map { |i| i['id'] }\n end", "title": "" }, { "docid": "50f8f058fa8beb37fc5c89ac07d600c0", "score": "0.61027056", "text": "def ids\n @ids ||= term.list_ids.sort\n end", "title": "" }, { "docid": "5ad2b889d4e5c0688ec3df8d4aedbf93", "score": "0.609711", "text": "def ordered_results_multi(ids_hash)\n model_lookup = self.find(ids_hash)\n ids_hash.map { |id_hash| model_lookup[id_hash[:id]] }\n end", "title": "" }, { "docid": "c357ea840fd6cda40dbaa0c06de9dc4e", "score": "0.6093527", "text": "def fetch_multi(*ids, includes: nil)\n ensure_base_model\n raise_if_scoped\n ids.flatten!(1)\n records = cached_primary_index.fetch_multi(ids)\n prefetch_associations(includes, records) if includes\n records\n end", "title": "" }, { "docid": "51ef8f71174dfa7d14a55c4bacbe7d44", "score": "0.6091558", "text": "def load_all(ids)\n @clazz.where(@clazz.primary_key => ids).merge(scope_for_load)\n end", "title": "" }, { "docid": "dfb190bed3e3893f6bbaa50f0293a7d0", "score": "0.6085009", "text": "def get_bulk(ids)\n all_docs(:keys => ids, :include_docs => true)\n end", "title": "" }, { "docid": "cffbbb8c21b67e826715f05f72ef6299", "score": "0.6069219", "text": "def ids_cache; end", "title": "" }, { "docid": "d02d09adfcbb6220a19e6300d10871a3", "score": "0.60468304", "text": "def find_all_ids(options={})\n find(:all, options.merge({:select => 'id', :limit => FIND_ALL_IDS_LIMIT})).map(&:id) \n end", "title": "" }, { "docid": "a7d063111ba949d996a8d9da063f4625", "score": "0.6042845", "text": "def fetch_all(id_or_ids)\n ids = Array(id_or_ids)\n \n # look in the cache for hits\n items, missing_ids = lookup_items(ids)\n \n # bulk fetch the missing ids\n fetch_items(missing_ids + read_queue)\n\n new_items, missing_ids = lookup_items(missing_ids)\n items_by_id = (items + new_items).inject({}){ |collection, item| collection[cache_key(item)] = item; collection}\n\n ids.map{|id| items_by_id[id] }\n end", "title": "" }, { "docid": "52b9c7f3af9c1abed3ef71f68ec3e088", "score": "0.6042052", "text": "def fetch_many(ids, extra_controller_params = {})\n solr_response = @repository.find_by_ids(ids, @eds_params)\n\n [solr_response, solr_response.documents]\n end", "title": "" }, { "docid": "52b9c7f3af9c1abed3ef71f68ec3e088", "score": "0.6042052", "text": "def fetch_many(ids, extra_controller_params = {})\n solr_response = @repository.find_by_ids(ids, @eds_params)\n\n [solr_response, solr_response.documents]\n end", "title": "" }, { "docid": "7f2f5f48d3d22fe74027dba7444d2fab", "score": "0.6013535", "text": "def find_multiple(ids)\n raise \"To be implemented in subclass\"\n end", "title": "" }, { "docid": "a9b1b33813847b18a0d35a8dacc8a3ac", "score": "0.59969133", "text": "def records_for(ids)\n scope.where(association_key_name => ids).load do |record|\n global_key = if model.connection_class_for_self == UnshardedRecord\n convert_key(record[association_key_name])\n else\n Shard.global_id_for(record[association_key_name], record.shard)\n end\n owner = owners_by_key[convert_key(global_key)].first\n association = owner.association(reflection.name)\n association.set_inverse_instance(record)\n end\n end", "title": "" }, { "docid": "34ab09ddbd1284af89b4a333613532a7", "score": "0.5987902", "text": "def find_many_by_ids(ids:)\n ids.map! do |id|\n id = Valkyrie::ID.new(id.to_s) if id.is_a?(String)\n validate_id(id)\n id\n end\n Valkyrie::Persistence::Solr::Queries::FindManyByIdsQuery.new(ids, connection: connection, resource_factory: resource_factory).run\n end", "title": "" }, { "docid": "0bc08e74ece730f2af55f4e95a74d7da", "score": "0.598281", "text": "def set_instance_list_from_id\n @id_list = params[:id].split(',')\n @instance_list = primary_model.where(id: @id_list)\n @master.current_user = current_user unless primary_model.no_master_association\n end", "title": "" }, { "docid": "8b629084c6e97e98db6a4f6f1721024c", "score": "0.59584665", "text": "def fetch_many(ids, eds_params = nil)\n ids = Array.wrap(ids)\n documents = ids.map { |id| fetch_one(id, eds_params).last }\n response = construct_response(documents)\n [response, response.documents]\n end", "title": "" }, { "docid": "45e40944f89775e687cd88bc55ba8409", "score": "0.59551406", "text": "def ids_reader; end", "title": "" }, { "docid": "d8c31c6629ac46cc68654e40dd3b2ec9", "score": "0.5948267", "text": "def many(ids)\n raise InvalidEndpointMethodError, \"'many' cannot be used on endpoint '#{@url}'\" unless @bulk\n\n return [] if ids.nil? || ids.empty?\n\n ids = ids.map(&:to_i).uniq\n pages = ids.each_slice(@max_page_size)\n .to_a\n .map { |page| { 'ids': page.join(',') } }\n\n call_multi(pages)\n end", "title": "" }, { "docid": "7e5a0e70abfbcb92ad48f1bd477e510b", "score": "0.5926322", "text": "def list(state=nil, inst_ids=[], &each_inst)\n instances = list_as_hash(state, inst_ids, &each_inst)\n instances &&= instances.values\n instances = nil if instances && instances.empty? # Don't return an empty hash\n instances\n end", "title": "" }, { "docid": "b2dc6d269a586cd624df79a87aeeeae9", "score": "0.5912606", "text": "def find_many(ids)\n aggregates = perform_cache_pass(ids)\n\n uncached_ids = aggregates.reject { |a| a.is_a? self }\n\n uncached = loaders_for_ids(uncached_ids).reduce({}) do |hash, loader|\n aggregate = loader.load\n unit_of_work.store_aggregate(aggregate)\n\n hash.merge aggregate.id => aggregate\n end\n\n aggregates.map do |id_or_agg|\n uncached[id_or_agg] ? uncached[id_or_agg] : id_or_agg\n end\n end", "title": "" }, { "docid": "d74598ef505129086534fbf6c769bce4", "score": "0.5911393", "text": "def get_instances!\n @instances=self.get_instances\n end", "title": "" }, { "docid": "e4239c79c054166469a4472ef21669b4", "score": "0.59065354", "text": "def find_all(*args, &evaluator)\n result = unwrap_remote_collection(find_instances(*args)) || []\n raise InvalidRepresentationError, 'expected Array, but got '+result.class.name unless Array===result\n result.map! do |record|\n instantiate(record, remote: true, &evaluator)\n end\n end", "title": "" }, { "docid": "055345ea3703f66598ea6df622a1b27c", "score": "0.58990294", "text": "def ids\n\t self.map(&:id)\n\tend", "title": "" }, { "docid": "369dbcfc096c6f6aa668b614f2dc960e", "score": "0.5892017", "text": "def get_all_id_list\n res = []\n User.all.each do |user|\n res.append(user.id)\n end\n res\n end", "title": "" }, { "docid": "e4c84e62b7bc3d1395914daf7be0eaee", "score": "0.58870345", "text": "def save_instances(entity_id, instance_resources)\n # This contains the instance ids of the newly created instances\n instances = []\n \n instance_resources.each do |instance_resource|\n instances << save_instance(entity_id, instance_resource)\n end\n return instances\n end", "title": "" }, { "docid": "5364cab9eb6d2835df2e32953769038e", "score": "0.5876129", "text": "def cache_ids\n values = lambda do |id|\n id.is_a?(Array) ? id.map(&values) : cache_id_value(id)\n end\n\n self.class.send(:cache_ids).map &values\n end", "title": "" }, { "docid": "19bfe5758d7e483b45b37eea17ab4d98", "score": "0.58722204", "text": "def search_entities_by_ids(ids)\n start.uri('/api/entity/search')\n .url_parameter('ids', ids)\n .get()\n .go()\n end", "title": "" }, { "docid": "f59937fe05d2b28385a47ae47fb1ae54", "score": "0.586936", "text": "def records\n @records ||= model.where id: ids\n end", "title": "" }, { "docid": "94384bbd1226f86cf7b003e8905f138f", "score": "0.58485895", "text": "def records_for(ids)\n records = if association_key_name.is_a?(Array)\n predicate = cpk_in_predicate(klass.arel_table, association_key_name, ids)\n scope.where(predicate)\n else\n scope.where(association_key_name => ids)\n end\n records.load do |record|\n # Processing only the first owner\n # because the record is modified but not an owner\n owner = owners_by_key[convert_key(record[association_key_name])].first\n association = owner.association(reflection.name)\n association.set_inverse_instance(record)\n end\n end", "title": "" }, { "docid": "143e9b246f7eadcd042a4ef5f7d22931", "score": "0.58460504", "text": "def organize_ids(ids); end", "title": "" }, { "docid": "58cb46b34f9012aae12fd31bf156f9e9", "score": "0.58429396", "text": "def show_instances(list = [])\n instances = make_request(\"#{self.web_api}/api/instances\",Net::HTTP::Get,account, list)\n build_instances_hash(instances,account)\n end", "title": "" }, { "docid": "f18fbafd86a27d48d41917ffb2db65b0", "score": "0.58413965", "text": "def ids_for_cache\n ids = @to_index.flat_map do |object|\n [find_parent_id(object), object.id] if object.respond_to?(:id)\n end\n ids.concat(@delete.map do |object|\n object.id if object.respond_to?(:id)\n end)\n ids.uniq.compact\n end", "title": "" }, { "docid": "1d7d28c8d6f2896ea18ad47eaed618c8", "score": "0.5840818", "text": "def ids\n pluck primary_key\n end", "title": "" }, { "docid": "62bb9eeb398b4fac3d7cd2579f14a24f", "score": "0.58360857", "text": "def instances\n return @instances ||= []\n end", "title": "" }, { "docid": "fa602b5bfb681aab0cb4d0a703f662c9", "score": "0.5830863", "text": "def get_ids_list(tables)\n tables.map(&:id)\n end", "title": "" }, { "docid": "7477cec44b0f96e286826d31fd1a14e1", "score": "0.5825505", "text": "def ids\n redis.zrange REDIS_KEY, 0, -1\n end", "title": "" }, { "docid": "47aaaf17418b84b6802859ea023c199c", "score": "0.58215415", "text": "def ids\n raise InvalidEndpointMethodError, \"'ids' cannot be used on endpoint '#{@url}'\" unless @bulk\n\n call\n end", "title": "" }, { "docid": "1d1065cd657034a6cedd8796f0cc1c67", "score": "0.5816258", "text": "def find_paginated(client, ids, fields: :all, batch_size: 100, raw: false)\n Enumerator.new do |yielder|\n loop do\n ids.each_slice(batch_size) do |array|\n find(client, array, fields: fields, raw: raw).map do |item|\n yielder << item\n end\n end\n raise StopIteration\n end\n end\n end", "title": "" }, { "docid": "c3ff0fe584ad96cd25ad4315c1146d51", "score": "0.58065325", "text": "def find_many(ids, params={})\n find_with_endpoint([:many, :default], {ids: ids.join(\",\")}.merge(params))\n end", "title": "" }, { "docid": "79ebd8c2855eb5a3b8ffb2e8b5e658d7", "score": "0.579717", "text": "def fetch_multiple_items(ids)\n responses = []\n\n @conn.in_parallel do\n ids.each do |id|\n # responses.push @conn.get \"item/#{id}.json\"\n (@conn.get \"item/#{id}.json\").on_complete { |res| responses << res }\n end\n end\n\n items = responses.each do |response|\n item = response.body\n raise HackerNewsApiError.new \"Response must be an item object.\", response unless item.kind_of?(Hash) && item.has_key?('id')\n item\n end\n\n Rails.logger.info \"Fetch multiple items succeed (count: #{responses.length})\"\n items\n end", "title": "" }, { "docid": "660debd3e1bf2122cd9f572e2d0a84e1", "score": "0.57931286", "text": "def ids\n @ids ||= documents.map(&:searchable_id)\n end", "title": "" }, { "docid": "05e35d93df683178a10af41d105422d8", "score": "0.5792333", "text": "def all\n order(:id)\n end", "title": "" }, { "docid": "ffcad145683401f22426ef3fe1acae36", "score": "0.57744074", "text": "def item_ids\n search = search_action(\n :description => 'order lookup', \n :model => 'order', \n :criteria => {:status => 'in_progress'}\n ).call[:search] \n\n ids = @store.with_session do |session| \n search.call(session).slice(0,9).inject([]) do |m,o| \n item_ids = []\n o.values.each do |item|\n uuid_resource = session.uuid_resource[:uuid => item.uuid]\n if display_item?(item, uuid_resource)\n item_ids << session.uuid_resource[:uuid => item.uuid].key\n end\n end\n m.merge(item_ids)\n end\n end\n end", "title": "" }, { "docid": "b3a0e2de5da56ffca45f567daeb0aa53", "score": "0.57710356", "text": "def ids(opts={})\n\n opts[:include_docs] = false\n\n all(opts).collect { |row| row['_id'] }\n end", "title": "" }, { "docid": "bec44afaf3481c7fb23f073338a32009", "score": "0.57683504", "text": "def find_many_by_ids(ids:)\n trace(\"valkyrie.find_many_by_ids\") do |span|\n span.set_tag(\"param.ids\", ids.map(&:to_s))\n __getobj__.find_many_by_ids(ids: ids)\n end\n end", "title": "" }, { "docid": "2a2bd56275b9cab933f657336021a08d", "score": "0.5767251", "text": "def list\n return list_intersect unless indexes.empty?\n\n from = options[:from]\n limit = stop == -1 ? stop : stop - start + 1\n\n ids = if from.present? && from[:direction] == 'up'\n Hari.redis.zrevrangebyscore key, '+inf', from[:score], limit: [start, limit]\n elsif from.present? && from[:direction] == 'down'\n Hari.redis.zrevrangebyscore key, from[:score], '-inf', limit: [start, limit]\n else\n Hari.redis.zrevrange key, start, stop\n end\n\n property.entity.find_many ids\n end", "title": "" }, { "docid": "055f27ac5ebe94da95192808dd502676", "score": "0.5754937", "text": "def find_many(ids, params={})\n find_with_endpoint([\"many\", \"default\"], {\"ids\" => ids.join(\",\")}.merge(params))\n end", "title": "" }, { "docid": "7c294feb4dcc9bc46b00c77396404dfc", "score": "0.57525796", "text": "def member_object_ids\n return [] unless id\n ActiveFedora::Base.search_with_conditions(\"member_of_collection_ids_ssim:#{id}\", rows: 1000 ).map(&:id)\n end", "title": "" }, { "docid": "23d81f14e56b433d7c6fe22a396c4b24", "score": "0.57495403", "text": "def ids_to_find\n @ids_to_find ||= begin\n limit = @options[:limit]\n limit ? ids[0...limit] : ids\n end\n end", "title": "" }, { "docid": "33b9421c770bd8eaa8098805fb88853d", "score": "0.5746385", "text": "def dids\n dids_list ? dids_list.collection : []\n end", "title": "" }, { "docid": "240fba26ac4b26b17f833463b45a0025", "score": "0.57456285", "text": "def all_instances\n load! if @all_instances.nil?\n @all_instances\n end", "title": "" }, { "docid": "dd5b7af33acb5c380ddcbdb886649362", "score": "0.5745254", "text": "def versions\n version = self.class.const_get(\"Version\")\n original_key = \"#{self.class.storage_name.singular}_id\".intern\n version.all(original_key => self.id, :order => [:id.asc])\n end", "title": "" }, { "docid": "5db662a3465fd01bd6a8b9612f3a624c", "score": "0.5744865", "text": "def list_instances(start, attempts)\n instances = execute( instance_list_req(), start, attempts )\n instances[\"items\"]\n end", "title": "" }, { "docid": "d7334e7d71dfbbf94dd0740d989514b8", "score": "0.57437384", "text": "def get_ids\n @fields.map(& :id)\n end", "title": "" }, { "docid": "f339eaf2f75e1a6c26c00e2a61385d8e", "score": "0.5741842", "text": "def get(ids)\n if ids.instance_of?(Array)\n rows = client.get(*ids)\n results = []\n rows = [] << rows unless rows.instance_of?(Array)\n\n rows.each_with_index do |row, index|\n results << wrap_row(ids[index], row)\n end\n results\n else\n wrap_row(ids, client.get(ids))\n end\n end", "title": "" }, { "docid": "a337b342b869932d1305b99e15a63222", "score": "0.5738221", "text": "def find(ids)\n ids = [ids] unless ids.is_a?(Array)\n cached = Set.new\n ids_miss = Array.new\n \n # Find items that are cached and remove ids from the query \n ids.each {|id|\n item = cache[id]\n unless item.nil?\n cached.add item\n else\n ids_miss.push id\n end\n } \n \n fetched = find_all(ids_miss)\n fetched.each {|item|\n cache.store(item.id, item)\n }\n return cached + fetched\n end", "title": "" }, { "docid": "309f1d1c7851d040a98af2e86e733a03", "score": "0.5736088", "text": "def ids; end", "title": "" }, { "docid": "309f1d1c7851d040a98af2e86e733a03", "score": "0.5736088", "text": "def ids; end", "title": "" } ]
4eaf7c008dc6f57d18f0a9cc50282fd7
invokes ability class url uri /categories path categories_path http method GET roles& responsibility to list all categories
[ { "docid": "3027d6442f2877fdf7dfe86d245ccbe4", "score": "0.6385729", "text": "def index\n\t\t@categories = Category.all\n\tend", "title": "" } ]
[ { "docid": "6d2573a7dd7e66c6b090cb93914bf727", "score": "0.7533894", "text": "def categories!\n mashup(self.class.get(\"/\", :query => method_params('aj.categories.getList'))).categories.category\n end", "title": "" }, { "docid": "efcb5e10780279c84a4be599091f0268", "score": "0.71782106", "text": "def categories\n call_api('/categories')\n end", "title": "" }, { "docid": "fbc94360b900fe51a6ed135e96903c21", "score": "0.70832205", "text": "def index\n authorize_action_for Category, at: current_store\n @categories = current_store.categories.roots\n end", "title": "" }, { "docid": "7875697f3f21f85bf299c7434f13cbc6", "score": "0.69747293", "text": "def get_categories\n\t\t\tunpack(self.send(refernet_url(\"Category\")))\n\t\tend", "title": "" }, { "docid": "778a1306eaf3da4396af3fd15aade974", "score": "0.6920052", "text": "def index\n # authorize\n authorize! :read, Category\n \n respond_to do |format|\n format.html { \n @categories = Category.get_categories #.paginate(:page => params[:page], :per_page => 10)\n }\n format.json { render json: Category.get_tree_json(current_user) }\n end\n \n end", "title": "" }, { "docid": "7b4732ded4341f5ea3b642910a83174e", "score": "0.6910633", "text": "def index\n if current_user.has_role? :admin\n @categories = current_user.categories\n end\n end", "title": "" }, { "docid": "3c4a619943cb2055182f9e3400233932", "score": "0.68782574", "text": "def list_categories\n header\n input = list(@categories)\n toggle(input) || list_apis(input)\n end", "title": "" }, { "docid": "86e5d5637eeb2a8cc989235e83e67c7b", "score": "0.6869089", "text": "def get\n payload = {}\n @client.post('categories/get', payload)\n end", "title": "" }, { "docid": "b7b1e4c10ab8174aa796e52ec580dc1b", "score": "0.6831872", "text": "def index\r\n get_item_categories \r\n end", "title": "" }, { "docid": "7e187d36c98abb278bc4f2b6f7766ed0", "score": "0.6830385", "text": "def index\n authorize! :index, Category, :message => 'Acceso denegado.'\n @categories = @university.categories\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @categories }\n end\n end", "title": "" }, { "docid": "bd7f457291ea26e7a11c69e4c64b3fd9", "score": "0.67851156", "text": "def fetch_categories\n xml = \"Request categories.\"\n respond_with_raw get(\"#{BASE_URL}/v1/categories?api_key=#{API_KEY}&format=json\", :body => xml)\n end", "title": "" }, { "docid": "ea3e58d2ff86a4710d0872c4a0bfc049", "score": "0.6710525", "text": "def index\n @categorizacoes = Categorizacao.all\n authorize @categorizacoes\n end", "title": "" }, { "docid": "cb5ce6ed9948fecb96ca43236b1d0c0c", "score": "0.67011666", "text": "def index\n @categories = current_user.categories\n end", "title": "" }, { "docid": "cb5ce6ed9948fecb96ca43236b1d0c0c", "score": "0.67011666", "text": "def index\n @categories = current_user.categories\n end", "title": "" }, { "docid": "5b59065449840ab8ddbe5bc4b9be53cd", "score": "0.66955185", "text": "def index\n respond_with(categories)\n end", "title": "" }, { "docid": "e65e9d20a145d387572cca4a3bc9f671", "score": "0.66932786", "text": "def list\n @categories = Category.find(:all)\n end", "title": "" }, { "docid": "db8efe7c57bc370544261565a29e2bde", "score": "0.66897446", "text": "def index\n if cannot? :manage, @categories\n flash[:error] = 'You do not have permission to view the category list.'\n redirect_to root_path\n end\n end", "title": "" }, { "docid": "0a61625c2395e4917eaa980e72784dbd", "score": "0.6685638", "text": "def index\n @category = Category.new\n @categorys ||= Category.all\n authorize! :create, @category\n end", "title": "" }, { "docid": "c53346177c668af4cc027667d049aa4d", "score": "0.6663618", "text": "def get_category_list\n begin\n render :status=>200,\n :json=>{:Message=>\"Successfully fetched the categories.\",\n :Response => \"Success\",\n :Data => {:Categories => Category.all.order(\"category_id DESC\")}}\n rescue Exception => e\n render :status=>401,\n :json=>{:Message=>\"Error while fetching categories.\",\n :Response => \"Fail\",\n :Data => e.message}\n end\n end", "title": "" }, { "docid": "3c16f317e7f9d37c0c8ba9c0228a8fbc", "score": "0.6636808", "text": "def list_categories\n self.button(:text=>\"List categories\").click\n self.wait_for_ajax(2)\n self.class.class_eval { include AddRemoveCategories }\n end", "title": "" }, { "docid": "3cba43678b445865af5afd71d9719de9", "score": "0.66260153", "text": "def get_categories()\n response = RestClient.get @host + \"/categories\", { :accept => :json }\n return JSON.parse(response.body)\n end", "title": "" }, { "docid": "f5809d8ac920d4e59e76fb13e3634c57", "score": "0.6623705", "text": "def categories\n render json: @user.categories_accessible_by(current_user).to_json\n end", "title": "" }, { "docid": "f874417d2a5d2cc0ad03ac829a2e657f", "score": "0.6619217", "text": "def lookup_get_categories\n # the base uri for api requests\n query_builder = Configuration.BASE_URI.dup\n\n # prepare query string for API call\n query_builder << \"/v1/categories\"\n\n # process optional query parameters\n query_builder = APIHelper.append_url_with_query_parameters query_builder, {\n \"client_id\" => @client_id,\n \"client_secret\" => @client_secret,\n }\n\n # validate and preprocess url\n query_url = APIHelper.clean_url query_builder\n\n # prepare headers\n headers = {\n \"user-agent\" => \"IAMDATA V1\",\n \"accept\" => \"application/json\"\n }\n\n # invoke the API call request to fetch the response\n response = Unirest.get query_url, headers:headers\n\n # Error handling using HTTP status codes\n if response.code == 404\n raise APIException.new \"Not Found\", 404, response.raw_body\n elsif response.code == 401\n raise APIException.new \"Unauthorized\", 401, response.raw_body\n elsif !(response.code.between?(200,206)) # [200,206] = HTTP OK\n raise APIException.new \"HTTP Response Not OK\", response.code, response.raw_body\n end\n\n response.body\n end", "title": "" }, { "docid": "c2e4d783874ac0c7b2eee8c85305d019", "score": "0.66101956", "text": "def categories\n self.button(:id=>\"entity_group_permissions\").click\n self.button(:text=>\"Categories\").click\n self.wait_until { self.text.include? \"Assign a category\" }\n self.class.class_eval { include AddRemoveCategories }\n end", "title": "" }, { "docid": "507828b7fd0df0fc1d241a319a7f43c9", "score": "0.6600942", "text": "def index\n @pagy, @operations = pagy(Operation.by_category(params[:id]))\n authorize! :read, Operation\n end", "title": "" }, { "docid": "8e1abd1795c29bc436d5ced01a91a98d", "score": "0.66005653", "text": "def get_appcon_categories \n get(\"/appcon.json/categories\")\nend", "title": "" }, { "docid": "6f5b1199df94a0f382a0f5270eb32454", "score": "0.6597545", "text": "def fetch_categories\r\n c_url = BASE_URL + \"categories/list?\" + \"app_key=\" + API_KEY\r\n\r\n uri = URI.parse(c_url)\r\n body = uri.read\r\n resp = Net::HTTP.get_response(uri)\r\n data = JSON.parse(resp.body)\r\n\r\n categories = data[\"category\"]\r\n # binding.pry\r\n categories.each do |c|\r\n Category.new(c[\"name\"])\r\n end\r\n end", "title": "" }, { "docid": "5658d2095b610d0e80f54e1d8442d1ef", "score": "0.6590298", "text": "def get_categories\n @categories = Category.all\n end", "title": "" }, { "docid": "3fc4726d90bcba545938e9b829a703ac", "score": "0.6579584", "text": "def index\n @categories = @user.categories\n end", "title": "" }, { "docid": "7cbedd5e5a08fcea7d61592f3dc35b18", "score": "0.6574458", "text": "def index\n @categories = current_user.categories.all\n end", "title": "" }, { "docid": "0d14a9aba64e10574f9d2ddd3f24c023", "score": "0.656917", "text": "def categories\n\t\t@categories = Category.list_categories\n\tend", "title": "" }, { "docid": "8e368bc755b2dd20879db24082f6d3d0", "score": "0.65688413", "text": "def categories\n CategoriesController.instance\n end", "title": "" }, { "docid": "317ffcfecab8ae061e222efaaa57bd08", "score": "0.6553616", "text": "def view_categories\n @categories = Category.all\n end", "title": "" }, { "docid": "cd9aeaaa225b5042b964d87b5e54ec14", "score": "0.65488523", "text": "def category_list\n #categories = Sap::Category.all #get_category_tree\n #CategoryRenderer.new(categories, self).render\n end", "title": "" }, { "docid": "6d6cce29fae6cf7022ecb7a2207ad77a", "score": "0.654834", "text": "def get_categories\r\n # the base uri for api requests\r\n query_builder = Configuration::BASE_URI.dup % [@version]\r\n\r\n # prepare query string for API call\r\n query_builder << \"/categories\"\r\n\r\n # validate and preprocess url\r\n query_url = APIHelper.clean_url query_builder\r\n\r\n # prepare headers\r\n headers = {\r\n \"user-agent\" => \"APIMATIC 2.0\",\r\n \"accept\" => \"application/json\",\r\n \"X-Api-Key\" => @x_api_key\r\n }\r\n\r\n # invoke the API call request to fetch the response\r\n response = Unirest.get query_url, headers:headers\r\n\r\n #Error handling using HTTP status codes\r\n if !(response.code.between?(200,206)) # [200,206] = HTTP OK\r\n raise APIException.new \"HTTP Response Not OK\", response.code, response.raw_body\r\n end\r\n\r\n response.body\r\n end", "title": "" }, { "docid": "53b5996dc401f757b74185bc77a589f0", "score": "0.6542557", "text": "def index\n @carnival_categories = Carnival::Category.all\n end", "title": "" }, { "docid": "96f271a4be3b9241d4e4bfdc6e8d0822", "score": "0.65424085", "text": "def list_categories\n self.list_categories_button\n self.wait_for_ajax\n self.class.class_eval { include AddRemoveCategories }\n end", "title": "" }, { "docid": "d6a8ba67c4bb02fcab072adfab2460c7", "score": "0.65264106", "text": "def categories\n begin\n print_verbose \"Retrieving module categories\"\n response = RestClient.get \"#{@url}categories\", {:params => {:token => @token}}\n categories = JSON.parse(response.body)\n print_good \"Retrieved #{categories.size} module categories\"\n categories\n rescue => e\n print_error \"Could not retrieve logs: #{e.message}\"\n end\nend", "title": "" }, { "docid": "a280a093ef98e314acc2c79346bfb159", "score": "0.6522213", "text": "def index\n categories\n end", "title": "" }, { "docid": "5afde6315e463695e22404528ddac2e0", "score": "0.6521822", "text": "def index\n\t\t\t\trespond_with Category.all\n\t\t\tend", "title": "" }, { "docid": "42a5e38641191448d85e311ae1318ff4", "score": "0.6516826", "text": "def index\n @resource_categories = ResourceCategory.where(company_id: current_user.company_id).accessible_by(current_ability).order(:name)\n render :json => @resource_categories\n end", "title": "" }, { "docid": "1945f36528d833e24d02acb7c3d412f0", "score": "0.6506452", "text": "def get_appcon_categories \n get(\"/appcon.json/categories\")\n end", "title": "" }, { "docid": "4142a8d060da658a5b36df997636377e", "score": "0.6502631", "text": "def categories\n @menu_categories = MenuCategory.all\n end", "title": "" }, { "docid": "25081f297e54bd1a294191c76b17b162", "score": "0.6484062", "text": "def get_charity_categories\n get(\"charity/categories\")\n end", "title": "" }, { "docid": "d21b3fa2528e0ba8b2f565cab79d7e92", "score": "0.64565235", "text": "def category_list\n\t\t@categories=Category.all\n\tend", "title": "" }, { "docid": "54dedf7c5130d9808da3da2c2cd2cf44", "score": "0.64550674", "text": "def categories\n @categories = Category\n end", "title": "" }, { "docid": "f477230c33075803bfb6dd600eb6cf1b", "score": "0.6434458", "text": "def categorize\n out = {}.to_json\n if params[:url]\n # uri_enc_url = Rack::Utils.escape(params[:url])\n endpoint = \"http://access.alchemyapi.com/calls/url/URLGetCategory\"\n q = \"#{endpoint}?apikey=#{ENV[\"ALCHEMY_KEY\"]}&url=#{params[:url]}&outputMode=json\"\n out = RestClient.get(q)\n end\n respond_to do |format|\n format.html\n format.json { render :json => out.body }\n end\n end", "title": "" }, { "docid": "f09fe5f64bb98a1b868da5d2360c6e9f", "score": "0.6425059", "text": "def index\n get_categorias\n end", "title": "" }, { "docid": "58b7a0097c4255aa208ae3956ba60611", "score": "0.6418102", "text": "def index\n \n selected_category_id = params[:selected_category]\n \n if selected_category_id.nil?\n \n @courses = Course.all\n authorize! :read, @courses\n @categories = Category.all\n respond_to do |format|\n format.html { render :action => \"index\", notice: \"current_user\" } # index.html.erb\n format.json { render json: @courses }\n end\n else \n @categories = Category.all\n @courses = Category.find(selected_category_id).courses\n authorize! :read, @courses\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @courses }\n end\n end\n end", "title": "" }, { "docid": "edf4fe8e2b40bc0f472a3e2abd24d342", "score": "0.64150536", "text": "def index\n @categories = Admin::Category.all\n end", "title": "" }, { "docid": "1a79b5404dd456eeb4020fa1f5e184f3", "score": "0.64128655", "text": "def active_categories\n cats = [h.params[:categories] || []].flatten.map do |id|\n Documents::Category.find(id)\n end\n\n Documents::CategoriesDecorator.decorate(cats)\n end", "title": "" }, { "docid": "2bd85a4101ce25ff3b275a1b7e24ce0f", "score": "0.64115804", "text": "def index\n @categories = @user.categories\n json_response(@categories)\n end", "title": "" }, { "docid": "fa51ef100ec142e9d09983cef8db6df0", "score": "0.63995606", "text": "def index\n authorize Category\n @categories_version = Category.version\n if params[:q].present?\n @categories = Category.find_by_tag_name params[:q]\n else\n @categories = Category.all\n end\n render\n end", "title": "" }, { "docid": "cfbafb879fe4ffe7bac26fbce2485a1c", "score": "0.6389761", "text": "def categories_for_decision\n @decision = Decision.find params[:id]\n @categories = @decision.categories\n end", "title": "" }, { "docid": "432e613d8cb521fa67985f803d3bbb51", "score": "0.6388691", "text": "def index\n @categories = Category.all\n render status: :ok\n end", "title": "" }, { "docid": "d4fdb9c4b41ddfcbd158025cdfe12aa7", "score": "0.63836783", "text": "def list_category_items(cat)\n list_items(TacoDeli::Menu.find_by_category(cat))\n end", "title": "" }, { "docid": "160d5097532fdcf8cad67dd3b224ba08", "score": "0.6375501", "text": "def categories\n response = HTTParty.get('https://www.boardgameatlas.com/api/game/categories?&client_id=' + ENV['CLIENT_ID'])\n @categories = response[\"categories\"]\n end", "title": "" }, { "docid": "841fe0e299904ffd5adcc242b5a89afb", "score": "0.63640356", "text": "def categories\n @categories = Category.all\n end", "title": "" }, { "docid": "841fe0e299904ffd5adcc242b5a89afb", "score": "0.63640356", "text": "def categories\n @categories = Category.all\n end", "title": "" }, { "docid": "2ed31c73469a4d9d65d15585222c683b", "score": "0.63629925", "text": "def categories\n add_category('item')\n @categories\n end", "title": "" }, { "docid": "92551817992741f712edcf025e4af284", "score": "0.6362514", "text": "def find_categories\n #retrieve all categories from DB.\n @categories = Category.all\n end", "title": "" }, { "docid": "92551817992741f712edcf025e4af284", "score": "0.6362514", "text": "def find_categories\n #retrieve all categories from DB.\n @categories = Category.all\n end", "title": "" }, { "docid": "9d66848a93a58a65fe43e0cbc36fc46a", "score": "0.63603663", "text": "def retrieve_categories\n @categories = Category.order(:name)\n end", "title": "" }, { "docid": "a1bd6afccceb6fc610d9bd69a7f76d12", "score": "0.6358373", "text": "def list_categories\n self.form(:id=>\"displayprofilesection_form_basic\").button(:text=>\"List categories\").click\n self.wait_for_ajax(3)\n self.class.class_eval { include AddRemoveCategories }\n end", "title": "" }, { "docid": "8f4553c12e9d8c7a46a48397ea4f6a02", "score": "0.6356989", "text": "def index\n # Scope the categories down to the user that is logged in\n @categories = Category.paginate(page: params[:page], per_page: 9)\n end", "title": "" }, { "docid": "f76a2c568dd2bd99e3d8152d2677207b", "score": "0.63558155", "text": "def show\n @course = Course.find(params[:id])\n @take = Take.find_by_course_id_and_user_id(@course.id, current_user.id)\n authorize! :read, @course\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @categories }\n end\n end", "title": "" }, { "docid": "da826d7241d6dae71487e5338194d8b9", "score": "0.6350872", "text": "def categories\n \t@categories = Category.all\n end", "title": "" }, { "docid": "da826d7241d6dae71487e5338194d8b9", "score": "0.6350872", "text": "def categories\n \t@categories = Category.all\n end", "title": "" }, { "docid": "36cfcc0cffc0b23294bd0a863fe0d8a2", "score": "0.6348493", "text": "def categories\n Category.all\n end", "title": "" }, { "docid": "fd086d1f03cd988720d2183ef8e4781a", "score": "0.6337999", "text": "def get_categories(params)\n check_params params\n\n params = params.load_params\n\n RequestBuilder.new(@user_key, @alternate_url + CATEGORIES_ENDPOINT,\n @http_client, BINDING_VERSION, params, @url_parameters)\n .send_post_request\n end", "title": "" }, { "docid": "a3ba4406a807764976d8c6c10b83e338", "score": "0.6334767", "text": "def categories\n connection.get(\"/categories\").body.spot_categories\n end", "title": "" }, { "docid": "a3ba4406a807764976d8c6c10b83e338", "score": "0.6334767", "text": "def categories\n connection.get(\"/categories\").body.spot_categories\n end", "title": "" }, { "docid": "fa1337abcee2973d41d11b527dccaa95", "score": "0.6320824", "text": "def index\n @admin_categories = Admin::Category.all\n end", "title": "" }, { "docid": "fa1337abcee2973d41d11b527dccaa95", "score": "0.6320824", "text": "def index\n @admin_categories = Admin::Category.all\n end", "title": "" }, { "docid": "81e6663fa0ddaabe6186ac0c3aaaea58", "score": "0.6319942", "text": "def index\n @categories = Category.toplevel ## NOTA: no se paginan arboles (de momento)\n end", "title": "" }, { "docid": "f8a2f1aa35b94de433b5fcf5907d8c9a", "score": "0.6317435", "text": "def index\n @api_v1_categories = Api::V1::Category.all\n end", "title": "" }, { "docid": "9a4371d57b112af7f91cfea9b72f182d", "score": "0.6316528", "text": "def index\n\t@categories = Category.all\nend", "title": "" }, { "docid": "96812dbf6f81e3d84a1bce4153f13b2f", "score": "0.6310958", "text": "def index\n @categories = ForumCategory.accessible_by(current_ability).order('position ASC')\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @forums }\n end\n end", "title": "" }, { "docid": "cc572f4c65b0027b39c908b2f3310064", "score": "0.6310589", "text": "def category\n\n end", "title": "" }, { "docid": "6597781dc6165b866043f101abb1377b", "score": "0.6306619", "text": "def getCategories\n\t\t@categories = Category.all\n\t\t@ilist = @categories.map do |i| {\n\t\t\t:id => i.id,\n\t\t\t:name => i.name\n\t\t}\n\t\tend\n\t\trespond_to do |format|\n\t\tformat.json { render :json => @ilist.to_json }\n\t\tformat.html { render :json => @ilist.to_json }\n\t\tend\n\tend", "title": "" }, { "docid": "6d5b618561b2b98fba6c65fa96e7e2a5", "score": "0.63056105", "text": "def show\n @categories = ClassifiedCategory.all\n end", "title": "" }, { "docid": "f568ab4efc63c59ed1b32f025462e214", "score": "0.6302054", "text": "def list\n #get_category_list\n @categories_list = Category.sort_by_ancestry(Category.all).paginate(:page => params[:page], :per_page => 10)\n end", "title": "" }, { "docid": "01f2fc5f3299a36a5f51ccba2ca4d1f8", "score": "0.62906384", "text": "def index\n @categories = Categories.all\n end", "title": "" }, { "docid": "3a2c61e87ecc67a32ec8155f33d9e62e", "score": "0.6286865", "text": "def category\n end", "title": "" }, { "docid": "7bca939e9716efb7011ff6e270386dd8", "score": "0.6285695", "text": "def load_categories\n @categories = Category.all\n end", "title": "" }, { "docid": "291c3ac012820b20ee940e983fbcd6be", "score": "0.6285668", "text": "def categories\n category\n end", "title": "" }, { "docid": "49b6267d96c46c301947d3badacc38bd", "score": "0.6281592", "text": "def index\n #@categories = @categorizable.categories\n if params[:cat]\n @categories = Category.where(parent_id: Category.find_by_name(params[:cat]))\n else\n @categories = Category.all\n end\n end", "title": "" }, { "docid": "c688d80d486c4434bdcf1478edc55e3d", "score": "0.627842", "text": "def index\n @resource_categories = ResourceCategory.all\n end", "title": "" }, { "docid": "4fb3cc0597fb000ddd7e9acec881c4f5", "score": "0.62776226", "text": "def index\n authorize Tag\n @tags = @category.tags.all\n render\n end", "title": "" }, { "docid": "599f02126071efb458b18b47d148c956", "score": "0.62662196", "text": "def get_all_categories\n @all_categories = Category.all\n end", "title": "" }, { "docid": "f5c7d6be0d170294621fcfbf12e1a96a", "score": "0.6266061", "text": "def get_categories\n get_sub_categories(nil)\n end", "title": "" }, { "docid": "f5c7d6be0d170294621fcfbf12e1a96a", "score": "0.6266061", "text": "def get_categories\n get_sub_categories(nil)\n end", "title": "" }, { "docid": "42e94208fab28c393980cbdd551bc5ca", "score": "0.62635756", "text": "def index\n @acticle_categories = ActicleCategory.all\n end", "title": "" }, { "docid": "0c7e3efb8f80632cd925cc7f32aeaf19", "score": "0.6263062", "text": "def categories\n @persistence.categories\n end", "title": "" }, { "docid": "2c699e821d924a55e3b474af78def75b", "score": "0.62595683", "text": "def index\n @categories = collections_config.values\n end", "title": "" }, { "docid": "d7c8cd6c8a1110ff8f2b56c5ef0d6a52", "score": "0.62587196", "text": "def index\n #@item_subcategories = ItemSubcategory.all\n\n\n #Get API from Product information management\n @category_list = ItemSubcategory.get_category\n \n\n\n\n end", "title": "" }, { "docid": "6294e4646c61fdd8a7332529afd46807", "score": "0.6254721", "text": "def show_categories\n @category = Category.find(params[:id])\n #@category = Category.find(params[:id], :include => :recipes_active)\n #@category.recipes_active\n logger.debug(\"-----------------------------------\");\n #logger.debug(\"length = \" + @category.length.to_s)\n #@category.length.times do |i|\n # logger.debug(i.to_s + \" -> \" + @category[i].to_s)\n # logger.debug(\"-=-=-=-\" + @category[i].name + \"-=-=-=-\")\n # @category[i].recipes.each do |r|\n # logger.debug(r.name)\n # end\n # logger.debug(\"-=-=-=-\" + @category[i].name + \"-=-=-=-\")\n #end\n logger.debug(\"-=-=-=-\" + @category.name + \"-=-=-=-\")\n @category.recipes do |r|\n logger.debug(r.name)\n end\n \n #logger.debug(@category)\n logger.debug(\"-----------------------------------\");\n #@category = Category.find(:all)\n end", "title": "" }, { "docid": "628c3cf2424d363b8902aa77e904fbcb", "score": "0.6253643", "text": "def index\n @categories = Category.select('id, name, parent_id, ancestry').page params[:page]\n respond_with @categories\n end", "title": "" }, { "docid": "a45760c1e0cb4c327225a64cefb65480", "score": "0.62477505", "text": "def index\n @all_categories = Category.all\n end", "title": "" }, { "docid": "5af0f9bfd11a1dfbeeb007be39c88f81", "score": "0.6236508", "text": "def index\n authorize! :index, @user, :message => 'Not authorized as an administrator.'\n @categories = Category.nested_set.select(:id, :title, :content, :secret_field, :parent_id, :lft, :rgt, :depth).paginate(:page => params[:page]).order('id DESC')\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @categories }\n format.xml { render xml: Category.all }\n end\n end", "title": "" } ]
9826f0916dc6beb6a58b153b2ac67cdb
Convert shorthand background declarations (e.g. background: url("chess.png") gray 50% repeat fixed;) into their constituent parts. See
[ { "docid": "4adc919afe58084515a27aec29daf08d", "score": "0.7265874", "text": "def expand_background_shorthand! # :nodoc:\n return unless (declaration = declarations['background'])\n\n value = declaration.value.dup\n\n replacement =\n if value.match(CssParser::RE_INHERIT)\n BACKGROUND_PROPERTIES.map { |key| [key, 'inherit'] }.to_h\n else\n {\n 'background-image' => value.slice!(CssParser::RE_IMAGE),\n 'background-attachment' => value.slice!(CssParser::RE_SCROLL_FIXED),\n 'background-repeat' => value.slice!(CssParser::RE_REPEAT),\n 'background-color' => value.slice!(CssParser::RE_COLOUR),\n 'background-size' => extract_background_size_from(value),\n 'background-position' => value.slice!(CssParser::RE_BACKGROUND_POSITION)\n }\n end\n\n declarations.replace_declaration!('background', replacement, preserve_importance: true)\n end", "title": "" } ]
[ { "docid": "ab7cc5423206696e44f89c374ae9ae8b", "score": "0.7427288", "text": "def expand_background_shorthand! # :nodoc:\n return unless @declarations.has_key?('background')\n\n value = @declarations['background'][:value]\n\n if value =~ CssParser::RE_INHERIT\n BACKGROUND_PROPERTIES.each do |prop|\n split_declaration('background', prop, 'inherit')\n end\n end\n\n split_declaration('background', 'background-image', value.slice!(Regexp.union(CssParser::URI_RX, CssParser::RE_GRADIENT, /none/i)))\n split_declaration('background', 'background-attachment', value.slice!(CssParser::RE_SCROLL_FIXED))\n split_declaration('background', 'background-repeat', value.slice!(CssParser::RE_REPEAT))\n split_declaration('background', 'background-color', value.slice!(CssParser::RE_COLOUR))\n split_declaration('background', 'background-size', extract_background_size_from(value))\n split_declaration('background', 'background-position', value.slice(CssParser::RE_BACKGROUND_POSITION))\n\n @declarations.delete('background')\n end", "title": "" }, { "docid": "a75398d5a89ea5167e3cd63b3d8771aa", "score": "0.7042139", "text": "def create_background_shorthand! # :nodoc:\n # When we have a background-size property we must separate it and distinguish it from\n # background-position by preceding it with a backslash. In this case we also need to\n # have a background-position property, so we set it if it's missing.\n # http://www.w3schools.com/cssref/css3_pr_background.asp\n if (declaration = declarations['background-size']) && !declaration.important\n declarations['background-position'] ||= '0% 0%'\n declaration.value = \"/ #{declaration.value}\"\n end\n\n create_shorthand_properties! BACKGROUND_PROPERTIES, 'background'\n end", "title": "" }, { "docid": "f9c27fc8b9c931bf5a3798ed11b23314", "score": "0.6859473", "text": "def create_background_shorthand! # :nodoc:\n # When we have a background-size property we must separate it and distinguish it from\n # background-position by preceeding it with a backslash. In this case we also need to\n # have a background-position property, so we set it if it's missing.\n # http://www.w3schools.com/cssref/css3_pr_background.asp\n if @declarations.has_key?('background-size') and not @declarations['background-size'][:is_important]\n unless @declarations.has_key?('background-position')\n @declarations['background-position'] = {:value => 'initial'}\n end\n\n @declarations['background-size'][:value] = \"/ #{@declarations['background-size'][:value]}\"\n end\n\n create_shorthand_properties! BACKGROUND_PROPERTIES, 'background'\n end", "title": "" }, { "docid": "76558a2515f51a70f64208407f479661", "score": "0.6174319", "text": "def background(*values)\n wrap_with_sgr(Color.build(:background, values).codes)\n end", "title": "" }, { "docid": "706973be7c949f6eefe25d360c700004", "score": "0.6144135", "text": "def to_css\n css_parts = []\n background = [flattened[:background_color].to_s, flattened[:background].to_s].join(\" \").strip\n css_parts.push(\"background: #{background}\") if background && (background != \"\")\n css_parts.push(\"color: #{flattened[:color]}\") if flattened[:color]\n css_parts.join(\"; \")\n end", "title": "" }, { "docid": "7b5c27ca7d4f48e0ed2f51c3e376a61e", "score": "0.5717027", "text": "def generate_background\n background = MiniMagick::Image.open(@config['background'])\n\n if background.height != screenshot.size[1]\n background.resize(\"#{screenshot.size[0]}x#{screenshot.size[1]}^\") # `^` says it should fill area\n background.merge!([\"-gravity\", \"center\", \"-crop\", \"#{screenshot.size[0]}x#{screenshot.size[1]}+0+0\"]) # crop from center\n end\n background\n end", "title": "" }, { "docid": "8df8147f7219d4b74d4616e3b7ce4131", "score": "0.563598", "text": "def image_dimensions_background_css_rule(input) \n dims=_dimensions(input);\n w = dims[0]\n h = dims[1]\n \"background-size: #{w.ceil}px #{h.ceil}px;\"\n end", "title": "" }, { "docid": "d0294b0904b0c91833465e535afb337f", "score": "0.5624201", "text": "def create_background\n # OpenGL sometimes uses colors in float values, this converts a hex into such color arrays.\n @bg_c = 0xFF_00ff00 # starts as a hex value, gets converted for OpenGL usage.\n # convert background color into color float:\n # [red, green, blue, alpha] = 0xalpha_redgreenblue\n colors = @bg_c.to_s(16) # turn int into hex string\n colors = colors.scan(/.{2}/) # split hex string by color segments\n i = 0 # turn the provided hex color into an int value array\n @bg_c = [] # convert color value variable into storage object for ranges.\n colors.each do |color|\n # ranges 0.0 <-> 1.0\n if i > 0 # is red green or blue value\n color_range = color.to_i(16) / 255.to_f\n @bg_c.push(color_range)\n end\n i += 1\n end\n # add alpha to end: [1.0, 1.0, 1.0, 0.0] == 0x00_ffffff\n @bg_c.push(colors.first.to_i(16) / 255.to_f)\n end", "title": "" }, { "docid": "09ed6d643f4ed656e06c66a4ec296e42", "score": "0.5583406", "text": "def adapt_background(background_ast)\n adapted_background = {}\n\n # Saving off the original data and removing parsed data for child elements in order to avoid duplicating data\n save_original_data(adapted_background, background_ast)\n clear_child_elements(adapted_background, [[:background, :steps]])\n\n adapted_background['type'] = 'Background'\n adapted_background['keyword'] = background_ast[:background][:keyword]\n adapted_background['name'] = background_ast[:background][:name]\n adapted_background['description'] = background_ast[:background][:description] || ''\n adapted_background['line'] = background_ast[:background][:location][:line]\n adapted_background['column'] = background_ast[:background][:location][:column]\n\n adapted_background['steps'] = adapt_steps(background_ast[:background])\n\n adapted_background\n end", "title": "" }, { "docid": "bef0a62a8d121cfa62eb90c0edbe0d87", "score": "0.5558505", "text": "def background\n @background ||= Background.escape_sequence(attributes[:background])\n end", "title": "" }, { "docid": "44a6c4618ab19ffcde09546083382c54", "score": "0.54986745", "text": "def custom_background\n css = \"\"\n css += \"background-color: #{self.background_color};\" unless self.background_color.blank?\n if self.background_image_file_name.blank?\n css += \"background-image: none; \"\n else\n css += \"background-image: url('#{self.background_image.url(\"original\", false)}'); \"\n css += \"background-position: center top; \"\n css += \"background-repeat: repeat-y; \"\n end\n css\n end", "title": "" }, { "docid": "44a6c4618ab19ffcde09546083382c54", "score": "0.54986745", "text": "def custom_background\n css = \"\"\n css += \"background-color: #{self.background_color};\" unless self.background_color.blank?\n if self.background_image_file_name.blank?\n css += \"background-image: none; \"\n else\n css += \"background-image: url('#{self.background_image.url(\"original\", false)}'); \"\n css += \"background-position: center top; \"\n css += \"background-repeat: repeat-y; \"\n end\n css\n end", "title": "" }, { "docid": "44a6c4618ab19ffcde09546083382c54", "score": "0.54986745", "text": "def custom_background\n css = \"\"\n css += \"background-color: #{self.background_color};\" unless self.background_color.blank?\n if self.background_image_file_name.blank?\n css += \"background-image: none; \"\n else\n css += \"background-image: url('#{self.background_image.url(\"original\", false)}'); \"\n css += \"background-position: center top; \"\n css += \"background-repeat: repeat-y; \"\n end\n css\n end", "title": "" }, { "docid": "f8785f8460e5b78ad80ce7896b912a4e", "score": "0.5491607", "text": "def compose_quick(fg, bg)\n return fg if opaque?(fg) || fully_transparent?(bg)\n return bg if fully_transparent?(fg)\n \n a_com = int8_mult(0xff - a(fg), a(bg))\n new_r = int8_mult(a(fg), r(fg)) + int8_mult(a_com, r(bg))\n new_g = int8_mult(a(fg), g(fg)) + int8_mult(a_com, g(bg))\n new_b = int8_mult(a(fg), b(fg)) + int8_mult(a_com, b(bg))\n new_a = a(fg) + a_com\n rgba(new_r, new_g, new_b, new_a)\n end", "title": "" }, { "docid": "54e51e952edf04c0085562576106119e", "score": "0.5449433", "text": "def compose_quick(fg, bg); end", "title": "" }, { "docid": "8127ecf8cd05bddc88c523f59a9d91a5", "score": "0.5422911", "text": "def background_images\n # works only with embedded style attr\n @page.css('[style]').map { |e| e.attr(:style)[/url\\((.+)\\)/, 1] }.compact\n .select { |link| image? link }\n end", "title": "" }, { "docid": "6b4384d957dfd96a374d13aa217e0685", "score": "0.5377856", "text": "def named\n [\"\\e[\", background_codes[colour], 'm'].join\n end", "title": "" }, { "docid": "4e03f33a4585f4665ed4cbee367682d4", "score": "0.5331828", "text": "def hex(string, background = false)\n string.tr! '#',''\n rgb(\n *(if string.size == 6\n # string.chars.each_cons(2).map{ |hex_color| hex_color.join.to_i(16) }\n [string[0,2].to_i(16), string[2,2].to_i(16), string[4,2].to_i(16)]\n else\n string.chars.map{ |hex_color_half| (hex_color_half*2).to_i(16) }\n end + [background]) # 1.8 workaround\n )\n end", "title": "" }, { "docid": "bca85865427cdb8d3546340426c98f8e", "score": "0.5295677", "text": "def style_for_backgound_image(url)\n \"background-image: url(#{url});\"\n end", "title": "" }, { "docid": "c9bd7c0a83c09137da0444226d63af1e", "score": "0.52841336", "text": "def background!\n normal = find_highlight(:Normal)\n return @background = 'dark' unless normal && normal.guibg\n @background = normal.guibg[1..-1].to_i(16) < 8421504 ? 'dark' : 'light'\n end", "title": "" }, { "docid": "2f15cfe02cdca98971d3017993c431b0", "score": "0.5273895", "text": "def shorten_colors(style)\n # rgb(50,101,152) to #326598\n style = style.gsub(/rgb\\s*\\(\\s*([0-9,\\s]+)\\s*\\)/) do |match|\n out = '#'\n $1.split(',').each do |num|\n out += '0' if num.to_i < 16\n out += num.to_i.to_s(16) # convert to hex\n end\n out\n end\n # #AABBCC to #ABC, keep if preceed by a '='\n style = style.gsub(/([^\\\"'=\\s])(\\s*)#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])/) do |match|\n out = match\n if ($3.downcase == $4.downcase) and ($5.downcase == $6.downcase) and ($7.downcase == $8.downcase)\n out = $1 + '#' + $3.downcase + $5.downcase + $7.downcase\n end\n out\n end\n # shorten several names to numbers\n style.gsub!(/:[\\s]*white[\\s]*;/, ':#fff;')\n style.gsub!(/:[\\s]*white[\\s]*\\}/, ':#fff}')\n style.gsub!(/:[\\s]*black[\\s]*;/, ':#000;')\n style.gsub!(/:[\\s]*black[\\s]*\\}/, ':#000}')\n # shotern several numbers to names\n style.gsub!(/:[\\s]*#([fF]00|[fF]{2}0000);/, ':red;')\n style.gsub!(/:[\\s]*#([fF]00|[fF]{2}0000)\\}/, ':red}')\n style\n end", "title": "" }, { "docid": "3a64eb1be25c9933e97b79737fcfb0ae", "score": "0.523436", "text": "def draw_background(source)\n file = File.open(source)\n file.pos = 10\n file.pos = file.read(4).unpack(\"b*\").join.reverse.to_i(2)\n pixel = {}\n 60.times do |y|\n 80.times do |x|\n pixel[:blue] = file.read(1).unpack(\"H*\")[0].to_i(16)\n pixel[:green] = file.read(1).unpack(\"H*\")[0].to_i(16)\n pixel[:red] = file.read(1).unpack(\"H*\")[0].to_i(16)\n @font.draw_solid_utf8(@screen, AcBlock, x * Charw, (59 - y) * Charh,\n pixel[:red], pixel[:green], pixel[:blue])\n end\n end\n @screen.update_rect(0,0,0,0)\n end", "title": "" }, { "docid": "cf18048cebe92d71ba44e3ad95844689", "score": "0.5232899", "text": "def revcontent_background_img(i)\n\treturn CGI::parse(i[/\\((.*?)\\)/m, 1])[\"http://img.revcontent.com/?url\"][0]\nend", "title": "" }, { "docid": "98b9efd45f0207a8cabf824b3540586f", "score": "0.52304274", "text": "def background(*color)\n color = color.first if color.size == 1\n wrap_with_code(get_color_code(color, :background))\n end", "title": "" }, { "docid": "3eb2073523d0f4e279046a9481b04440", "score": "0.5226302", "text": "def load_background\n @backgrounds = [\n Carbuncle::Plane.new(@textures[:bg1]),\n Carbuncle::Plane.new(@textures[:bg2]),\n Carbuncle::Plane.new(@textures[:bg3]),\n Carbuncle::Plane.new(@textures[:bg4]),\n Carbuncle::Plane.new(@textures[:bg5])\n ]\n # We scale our backgrounds to double in size. As our screen resolution are twice the size of our images.\n @backgrounds.each { |bg| bg.scale.set(2, 2) }\n end", "title": "" }, { "docid": "1a5996160009ef8727939c76c140bcd8", "score": "0.52086455", "text": "def convert_zass_functions!(css)\n keys_regex = /(zass-darken|zass-lighten)/\n\n substitution_hash = {\n 'zass-darken' => 'darken',\n 'zass-lighten' => 'lighten'\n }\n\n css.gsub!(keys_regex, substitution_hash)\n end", "title": "" }, { "docid": "a543add1c2349aa8fb66ee4e65c39e42", "score": "0.5197829", "text": "def background\n return @background if @background\n photo_background # modifies the background option\n @background = @options[:processor].new(:color => @options[:background], :width => @options[:width], :height => @options[:height])\n @background.crop_to_fit(@options[:width], @options[:height])\n end", "title": "" }, { "docid": "9f102875c86a16b6f0e36464c2080607", "score": "0.5163456", "text": "def create_coloured_image\n exec %Q{\n I 5 6\n L 2 1 A\n V 2 3 6 W\n H 3 5 2 Z\n F 4 4 T\n S\n X\n }\nend", "title": "" }, { "docid": "9d7ec602c5df398e5199def900a5e2e9", "score": "0.5159149", "text": "def hathitrust_background_thumbnail(document, **kw)\n namespace = document.fetch('ht_namespace')\n tn = \"style=\\'background: url(\\\"\"\n if namespace == 'fake'\n tn += \"#{image_url(\"fake_image.png\")}\"\n else\n tn += \"#{hathitrust_thumbnail_src(document, **kw)}\"\n end\n tn += \"\\\") top left no-repeat;\\'\"\n tn.html_safe\n end", "title": "" }, { "docid": "d1942c35dbe440e7698acb15380816ab", "score": "0.515614", "text": "def extract_background_color(image)\n rgb = image.get_pixels[0][0]\n Color.rgb_to_hex(rgb)\n end", "title": "" }, { "docid": "557c2333b93df86a94b7c0d271dc50ff", "score": "0.5153422", "text": "def background(*color)\n wrap_with_code(AnsiColor.new(:background, *color).code)\n end", "title": "" }, { "docid": "13a642bafbb98f5a2ee98806ebee1293", "score": "0.5148528", "text": "def backgrounds\n feature.backgrounds\n end", "title": "" }, { "docid": "3b885a7168b8d3b04ce9979c025e7189", "score": "0.51430124", "text": "def expand_dimensions_shorthand! # :nodoc:\n DIMENSIONS.each do |property, (top, right, bottom, left)|\n next unless (declaration = declarations[property])\n\n value = declaration.value.dup\n\n # RGB and HSL values in borders are the only units that can have spaces (within params).\n # We cheat a bit here by stripping spaces after commas in RGB and HSL values so that we\n # can split easily on spaces.\n #\n # TODO: rgba, hsl, hsla\n value.gsub!(RE_COLOUR) { |c| c.gsub(/(\\s*,\\s*)/, ',') }\n\n matches = split_value_preserving_function_whitespace(value)\n\n case matches.length\n when 1\n values = matches.to_a * 4\n when 2\n values = matches.to_a * 2\n when 3\n values = matches.to_a\n values << matches[1] # left = right\n when 4\n values = matches.to_a\n else\n raise ArgumentError, \"Cannot parse #{value}\"\n end\n\n replacement = [top, right, bottom, left].zip(values).to_h\n\n declarations.replace_declaration!(property, replacement, preserve_importance: true)\n end\n end", "title": "" }, { "docid": "b18e498134efbfaa0fc86ef9db381e97", "score": "0.5140449", "text": "def white_bg\n return colorize(47)\n end", "title": "" }, { "docid": "0ce524b51eb12f6f1af1d6136b60b75e", "score": "0.5132566", "text": "def decompose_alpha_components(color, mask, bg); end", "title": "" }, { "docid": "2a34a766020a3f889e4e50c238a25902", "score": "0.5129631", "text": "def green_bg\n return colorize(42)\n end", "title": "" }, { "docid": "3ff937fe0bb354e74accab558f1b456d", "score": "0.5126436", "text": "def im_background(color)\n @image_magick_strings << \"-background #{color} -alpha remove\" \n end", "title": "" }, { "docid": "716b16ea01e4ad4b57a31820a63c720c", "score": "0.512493", "text": "def render_background\n case @theme_options[:background_colors]\n when Array\n @base_image = render_gradiated_background(*@theme_options[:background_colors])\n when String\n @base_image = render_solid_background(@theme_options[:background_colors])\n else\n @base_image = render_image_background(*@theme_options[:background_image])\n end\n end", "title": "" }, { "docid": "c83ee9e10c3f73baacf258ce895430bb", "score": "0.5106169", "text": "def interpolate_quick(fg, bg, alpha); end", "title": "" }, { "docid": "1bae7b44bcf2d3a462cf1cdb9a4f8f99", "score": "0.51018846", "text": "def bg_colors\n {\n black: \"\\e[40m\",\n red: \"\\e[41m\",\n green: \"\\e[42m\",\n yellow: \"\\e[43m\",\n blue: \"\\e[44m\",\n magenta: \"\\e[45m\",\n cyan: \"\\e[46m\",\n white: \"\\e[47m\",\n }\n end", "title": "" }, { "docid": "1bae7b44bcf2d3a462cf1cdb9a4f8f99", "score": "0.51018846", "text": "def bg_colors\n {\n black: \"\\e[40m\",\n red: \"\\e[41m\",\n green: \"\\e[42m\",\n yellow: \"\\e[43m\",\n blue: \"\\e[44m\",\n magenta: \"\\e[45m\",\n cyan: \"\\e[46m\",\n white: \"\\e[47m\",\n }\n end", "title": "" }, { "docid": "3697bf031000b38ecd0b88f72533998c", "score": "0.5094559", "text": "def compose_precise(fg, bg); end", "title": "" }, { "docid": "67c5826991b60a5052fea769eae5f88b", "score": "0.50631183", "text": "def offsetrules(sheet, emotes, flip)\n emotes.each_index do |index|\n elist = []\n elist << emotes[index][0].split(\".\")[0]\n if(emotes[index][1].length != 0)\n emotes[index][1].each_index do |ealias|\n elist << emotes[index][1][ealias]\n end\n end\n if(flip)\n rlist = []\n elist.each do |name|\n rlist << \"r\" + name\n end\n elist = elist.zip(rlist).flatten!\n end\n elist.each_index do |index|\n print selectorize(elist[index])\n if(index < (elist.length - 1))\n print \", \"\n end\n end\n print \" { background-position: \"\n print \"-\" + emotes[index][3][0].to_s + \"px \"\n print \"-\" + emotes[index][3][1].to_s + \"px;\"\n puts \" }\"\n end\n puts\nend", "title": "" }, { "docid": "db31561b88860488adb606f06cb04539", "score": "0.5051901", "text": "def to_s\n foreground + background\n end", "title": "" }, { "docid": "2c3009da563dcc785c7c0a5c9cffc145", "score": "0.50438756", "text": "def background(value = nil)\n return options[:background] unless value\n\n bg = Vedeu::Colours::Background.coerce(value)\n\n options[:background] = colour_attributes(background: bg)\n .fetch(:background)\n end", "title": "" }, { "docid": "bdb9e71c17da8c795abd45562020a58e", "score": "0.50429416", "text": "def replace_css_images!(options={})\n options[:prefix] ||= ''\n # adapted from https://github.com/blakink/asset_id\n data.gsub! /url\\((?:\"([^\"]*)\"|'([^']*)'|([^)]*))\\)/mi do |match|\n begin\n # $1 is the double quoted string, $2 is single quoted, $3 is no quotes\n uri = ($1 || $2 || $3).to_s.strip\n uri.gsub!(/^\\.\\.\\//, '/')\n\n # Remove substr after ? if any. There is trailing ? in the fonts, for example.\n uri = uri.split('?')[0]\n \n # if the uri appears to begin with a protocol then the asset isn't on the local filesystem\n if uri =~ /[a-z]+:\\/\\//i\n \"url(#{uri})\"\n else\n asset = Asset.new(uri)\n # TODO: Check the referenced asset is in the asset_paths\n puts \" - Changing CSS URI #{uri} to #{options[:prefix]}#{asset.fingerprint}\" if @@debug\n \"url(#{options[:prefix]}#{asset.fingerprint})\"\n end\n rescue Errno::ENOENT => e\n puts \" - Warning: #{uri} not found\" if @@debug\n \"url(#{uri})\"\n end\n end\n end", "title": "" }, { "docid": "de8343b550484344f9383850fb50247b", "score": "0.5028206", "text": "def background\n @background ||= if colour && present?(colour.background)\n colour.background\n\n elsif named_colour?\n named_colour.background\n\n elsif parent? && present?(parent.background)\n parent.background\n\n else\n Vedeu::Colours::Background.new\n\n end\n end", "title": "" }, { "docid": "6e3d749443c87584d532405d786e10ac", "score": "0.50263196", "text": "def to_color!(background, intensity: 1.0)\n if background\n background.each_with_index do |color, index|\n state = @states[index]\n next unless state.i > 0\n\n color_full = @palette[state.p]\n i = state.i * intensity * @intensity\n\n color.r = color_full.r * i + color.r * (1 - i)\n color.g = color_full.g * i + color.g * (1 - i)\n color.b = color_full.b * i + color.b * (1 - i)\n end\n else\n to_color intensity: intensity\n end\n end", "title": "" }, { "docid": "6bec57130ae342b47d1622293f822cf5", "score": "0.5008437", "text": "def posterize_colors_in_flash_xml(contents)\n contents.split(\"\\n\").map do |line|\n if /\\<SolidColor color\\=/.match line\n line.gsub!(/color\\=\\\"#(.*)\\\"/) { |c| \"color=\\\"\\##{posterize_color($1)}\\\"\" }\n end\n line\n end.join \"\\n\"\nend", "title": "" }, { "docid": "8e39b167a9568406c09df44837d7e56a", "score": "0.500835", "text": "def background_codes\n Esc.codes.inject({}) { |h, (k, v)| h.merge(k => v + 10) }\n end", "title": "" }, { "docid": "4b793e0cce418169d97c867d33bdfc29", "score": "0.49949872", "text": "def compose(fg, bg); end", "title": "" }, { "docid": "4af71b502ed36e2d9dc9fedbeb895b55", "score": "0.49882045", "text": "def reduceAlpha(factor)\n for i in 0...3\n @sprites[\"bg#{i}\"].color.alpha -= factor\n end\n end", "title": "" }, { "docid": "17bab61994c8995afff4fe6a91de57ed", "score": "0.49823195", "text": "def print_background_palette(image_file)\n image = Image.read(image_file).first\n image_file_name = File.basename(image_file, File.extname(image_file))\n\n image[:Label] = image_file_name\n image_inside = image.clone\n image_inside.resize_to_fit!(image.rows - 10)\n\n image.composite!(image_inside, CenterGravity, DstOutCompositeOp)\n\n print_palette image\nend", "title": "" }, { "docid": "e1782c9c6dabcb091667b0e294d581cf", "score": "0.49766728", "text": "def hex_code(string, background=false)\n string.tr!('#','')\n x = (string.size == 6 ? 2 : 1)\n r, g, b = [0,1,2].map{ |i| string[i*x,2].to_i(16) }\n rgb_code(r, g, b, background)\n end", "title": "" }, { "docid": "a965d4dea64834d16d76c2e0495ee8ea", "score": "0.49732396", "text": "def get_css_for(ingredient)\n Sass::Script::String.new(\"url(#{filename}) no-repeat #{full_offset_string(ingredient)}\")\n end", "title": "" }, { "docid": "86d296aef7a70d5ed6f9f97c3b4e8ead", "score": "0.49712348", "text": "def background; end", "title": "" }, { "docid": "86d296aef7a70d5ed6f9f97c3b4e8ead", "score": "0.49712348", "text": "def background; end", "title": "" }, { "docid": "5e52a84b33153ec7d8492fd956a13887", "score": "0.49633768", "text": "def tint_background\n if ($args.state.tick_count % 10).zero?\n color = $color_shift[element = rand(3)] # ... and I did that too for the big finish\n $color_shift[element] = (rand < 0.5 ? color + 2 : color - 2).clamp(128, 255)\n end\n $args.outputs.primitives << [$menu_edge, 0, 1280 - $menu_edge, 719,\n 'sprites/background.png',\n 0, 255, *$color_shift].sprites\nend", "title": "" }, { "docid": "cac513a952059041841c3a5c259a579a", "score": "0.49521455", "text": "def html_to_pixels(html, css, cols, fg, bg)\n rows = []\n\n html.each_with_progress do |file|\n colorstack = [ { fg: fg, bg: bg}.merge(css.fetch(lang_css(nil), {})) ]\n\n file.lines do |line|\n colors = []\n without_entities(line.chomp).split(%r{(<[^>]+>)}).each do |part|\n case part\n when '<pre>'\n # nothing\n when /<(\\w+) [^>]*class=\"([^\"]+)\">/\n tag, cls = [$1, $2]\n prior = colorstack.last\n newcss = prior.merge(css.fetch(cls, {}))\n colorstack.push(newcss)\n colorstack[0] = newcss if tag == 'div' # div sets defaults\n when %r{</(span|div)}\n colorstack.pop\n else\n part.chars.each do |c|\n colors.push(colorstack.last[c =~ /\\S/ ? :fg : :bg])\n end\n end\n end\n\n next if line == '</pre></div>' # Don't output Pygments per-file footer\n\n rows << padded(colors, cols, colorstack.first[:bg])\n end\n end\n rows\nend", "title": "" }, { "docid": "b008ae1fe772644863f262bcaf40d820", "score": "0.49267372", "text": "def create_background_image\n # Minh changed, due to ios 8.0 difference\n screen_scale = 1.0 # UIScreen.mainScreen.scale\n\n frame_size = CGSizeMake(frame.size.width / screen_scale, frame.size.height / screen_scale)\n UIGraphicsBeginImageContextWithOptions(frame_size, true, 0.0) #frame.size, true, 0.0)\n context = UIGraphicsGetCurrentContext()\n\n setup_context(context)\n if @background != nil\n @background.set\n end\n CGContextFillRect(context, CGRectMake(0, 0, frame_size.width, frame_size.height)) #size.width-100, size.height-100))\n\n if @backgroundImageURL != nil\n textureImage = UIImage.imageNamed(@backgroundImageURL)\n textureImage.drawAtPoint(CGPointZero)\n end\n if @edges != nil\n @edges.each do |edge|\n edge.colour.set\n # circles\n case edge\n when CirclePart\n width = edge.radius * 2 / screen_scale\n CGContextFillEllipseInRect(context, CGRectMake(edge.left / screen_scale, edge.top / screen_scale, width, width))\n when PointsPart\n if edge.points.length == 1\n line_size = ToyTemplate::TOY_LINE_SIZE/4\n sole_point = edge.points[0]\n scaled_sole_point = CGPointMake(sole_point.x - line_size/2, sole_point.y - line_size/2) / screen_scale\n CGContextFillEllipseInRect(context, CGRectMake(*scaled_sole_point, #CGRectMake(sole_point.x - line_size/2, sole_point.y - line_size/2,\n line_size / screen_scale, line_size / screen_scale))\n else\n draw_path_of_points(context, edge.points)\n end\n end\n end\n end\n background = SKSpriteNode.spriteNodeWithTexture(SKTexture.textureWithImage(UIGraphicsGetImageFromCurrentImageContext()))\n\n UIGraphicsEndImageContext()\n background.position = CGPointMake(size.width/2, size.height/2)\n background.blendMode = SKBlendModeReplace # background image doesn't need any alpha\n addChild(background)\n end", "title": "" }, { "docid": "469eed7d472afe16071fff888079e1e8", "score": "0.49148488", "text": "def create_shorthand!\n create_background_shorthand!\n create_dimensions_shorthand!\n # border must be shortened after dimensions\n create_border_shorthand!\n create_font_shorthand!\n create_list_style_shorthand!\n end", "title": "" }, { "docid": "469eed7d472afe16071fff888079e1e8", "score": "0.49148488", "text": "def create_shorthand!\n create_background_shorthand!\n create_dimensions_shorthand!\n # border must be shortened after dimensions\n create_border_shorthand!\n create_font_shorthand!\n create_list_style_shorthand!\n end", "title": "" }, { "docid": "d6808e41c7c0d160ba0a3e182f24d456", "score": "0.49037698", "text": "def create_background\n @background = Sprite.new\n @background = Cache.picture(\"fond_ecran_titre\")\n @background.opacity = 255\n @background.x = 0\n @background.y = 0\n @background.z = -1\n end", "title": "" }, { "docid": "1811f4a456e02a14a0bc78b7af16f077", "score": "0.48983482", "text": "def set_background\n @background = BACKGROUNDS.sample\n end", "title": "" }, { "docid": "e2c4aaa8e505f9d039f14ff0b7999a2b", "score": "0.48967656", "text": "def yellow_bg\n return colorize(43)\n end", "title": "" }, { "docid": "e8a4aa85a609912948be00fc2ffa79aa", "score": "0.48949137", "text": "def document_background_thumbnail(document, **kw)\n namespace = document.fetch('volume_identifier').split('.').first\n tn = \"style=\\'background: url(\\\"\"\n if namespace == 'fake'\n tn += \"#{image_url(\"fake_image.png\")}\"\n else\n tn += \"#{document_thumbnail_src(document, **kw)}\"\n end\n tn += \"\\\") top left no-repeat;\\'\"\n tn.html_safe\n end", "title": "" }, { "docid": "d4af5d2142115d331bb81d2414021cfb", "score": "0.48943648", "text": "def make_bg_image(w, h)\r\n bgimg = Image.new(w, h, C_WHITE)\r\n c0 = [224, 224, 224]\r\n dw = 4\r\n d = dw\r\n dws = dw - 1\r\n 0.step(h-1, dw) do |y|\r\n 0.step(w-1, dw * 2) do |x|\r\n bgimg.boxFill(x + d, y, x + d + dws, y + dws, c0)\r\n end\r\n d = (d == dw)? 0 : dw\r\n end\r\n return bgimg\r\n end", "title": "" }, { "docid": "246ae0935f3a806edf60459dfe36d689", "score": "0.4883832", "text": "def bg(c)\n get_color('AB',c) if c\n end", "title": "" }, { "docid": "74bd40c1f905e991e2d2a2ed3e001390", "score": "0.48696786", "text": "def background_images\n return [] unless @page\n\n # super slow :/\n # elems = @page.find_elements(css: '*')\n # .select { |e| e.css_value('background-image') != 'none' }\n # .map do |e|\n # e.css_value('background-image')[/url\\([\"'](.+)[\"']\\)/, 1]\n # end.compact.uniq\n\n # faster with JS\n script = <<-JS\n return (function() {\n var arrr = [];\n var list = document.getElementsByTagName('*');\n for (var i = 0; i < list.length; i++) {\n var tmp = window.getComputedStyle(list[i])['background-image'];\n if(tmp != 'none'){ arrr.push(tmp); }\n }\n return arrr;\n })()\n JS\n script.gsub! \"\\n\", ''\n img_links = @page.execute_script(script) || []\n img_links.map { |link| link[/url\\([\"'](.+)[\"']\\)/, 1] }\n .compact.uniq\n .select { |link| image? link } # skip binary image data\n end", "title": "" }, { "docid": "54b02e7bd128c61717c7d98e1de58f33", "score": "0.48415256", "text": "def with_alpha(alpha, color, background)\n rgb_string(\n rgb_integers(color).zip(rgb_integers(background))\n .map { |c, b| (alpha * c) + ((1 - alpha) * b) }\n .map(&:round),\n )\nend", "title": "" }, { "docid": "149499ed65b9285b15c3f05f01a56761", "score": "0.48338968", "text": "def pre_format_css\n\n\t\tcss = @raw_css\n\n\t\t#Removes comments\n\t\tcss.gsub!(/\\/\\*[^\\*]*\\*+([^\\/\\*][^\\*]*\\*+)*\\//m, \"\")\n\t\tcss.gsub!(/\\n|\\t/, \"\")\n\n\t\t#Splits at each }\n\t\tcss = css.scan(/[^}]*}/)\n\n\t\t\t# check for media query formating \n\t\t\t# adds } to the previous line\n\t\tfor i in 0..css.length \n\t\t\tif css[i] == \"}\"\n\t\t\t\tcss.delete_at(i)\n\t\t\t\tcss[i-1] << \"}\"\n\t\t\tend\n\t\tend\n\n\t\t#multiple formatting conditions handled here\n\t\tcss.each_with_index{ |c,i|\n\n\t\t\t#check for single at-rule formatting\n\t\t\tif get_rule_type(c) == \"single\"\n\t\t\t\tcss.delete_at(i)\n\t\t\t\tc = c.split(\";\")\n\t\t\t\tc.each_with_index{|n, k| \n\t\t\t\t\tif (get_rule_type(n) == \"single\")\n\t\t\t\t\t\tn << \";\"\n\t\t\t\t\tend\n\t\t\t\t\tcss.insert(i+k,n)\n\t\t\t\t}\n\t\t\tend\n\t\t\t#checks for missing final ;\n\t\t\t# elsif get_rule_type(c) == \"selector\"\n\t\t\t#kind of brute forces it, could be done better\n\t\t\tif c[-2..-1] == \"}}\"\n\t\t\t\tif c[-3] != \";\"\n\t\t\t\t\tc.insert(-3, \";\")\n\t\t\t\tend\n\t\t\telsif c[-1] == \"}\"\n\t\t\t\tif c[-2] != \";\"\n\t\t\t\t\tc.insert(-2, \";\")\n\t\t\t\tend\n\t\t\tend\n\n\t\t}\n\t\t@formatted_css = css\n\t\treturn @formatted_css\n\tend", "title": "" }, { "docid": "8a5efeda0dbd7391f04e286172f291b5", "score": "0.48220214", "text": "def popup_style(e, pr)\n unless e.img_dimensions.blank?\n pr = pr.round\n @width = e.img_dimensions.first.to_i/2\n @height = e.img_dimensions.last.to_i/2\n url = ((pr > 1.5) ? e.img.url(:compressed) : e.img.url(:half))\n \"background-image: url(#{url}); background-size: cover; background-position: center center; width:#{@width}px; height:#{@height}px;\"\n else\n \"background: url(#{e.img.url}) center center no-repeat; background-size: cover;\"\n end\n end", "title": "" }, { "docid": "d7032c024e8a98e289c08104751670a9", "score": "0.4820877", "text": "def render_gradiated_background(top_color, bottom_color)\n Image.new(@columns, @rows,\n GradientFill.new(0, 0, 100, 0, top_color, bottom_color))\n end", "title": "" }, { "docid": "76f4980bcdba1042cccbfbc943d5ffd9", "score": "0.48141208", "text": "def background\n fetch('dnd.backgrounds')\n end", "title": "" }, { "docid": "5d7d6beabaf39c3d32c47a68cfe06b07", "score": "0.48139456", "text": "def render_gradiated_background(top_color, bottom_color)\n Image.new(@columns, @rows, \n GradientFill.new(0, 0, 100, 0, top_color, bottom_color))\n end", "title": "" }, { "docid": "805a0b1d8cd93e4f1a4e360e04762b83", "score": "0.4813538", "text": "def block_thumbnail_div_background_style block\n block.thumbnail? ? \"background-image: url(#{ block.thumbnail.small.url })\" : ''\n end", "title": "" }, { "docid": "40933ef78e5e82dd757f8c306a307a79", "score": "0.4813046", "text": "def main_background\n sprites = @components.select{|component| component.is_background?}\n sprite = sprites.sort{|a,b| b.z <=> a.z}.first\n sprite ? sprite.picture : nil\n end", "title": "" }, { "docid": "479f161a89972faffc8908f055126cea", "score": "0.48122165", "text": "def get_background_image(orig, width, height, x, y, w, h)\n cropped = orig.crop(x, y, w, h)\n one_px = cropped.scale(1,1)\n background = one_px.scale(width, height)\n cropped.destroy!\n one_px.destroy!\n return background\n end", "title": "" }, { "docid": "07f4cb2201f2c4848e079b3c599b4012", "score": "0.48040083", "text": "def black_bg\n return colorize(40)\n end", "title": "" }, { "docid": "8049fb510307ffb560c2749967486246", "score": "0.48015934", "text": "def reset_background\n self.board_bg = board_array.map.with_index do |row, row_index|\n self.class.row_background(row, row_index)\n end\n self.board_fg = board_array.map { |row| row.map { CConf::PIECE_COLOR } }\n end", "title": "" }, { "docid": "7c98274861269299f5cac562ffbfaf65", "score": "0.4797276", "text": "def adapt_background!(parsed_background)\n # Saving off the original data\n parsed_background['cuke_modeler_parsing_data'] = Marshal::load(Marshal.dump(parsed_background))\n\n # Removing parsed data for child elements in order to avoid duplicating data\n parsed_background['cuke_modeler_parsing_data'][:steps] = nil\n\n parsed_background['type'] = parsed_background.delete(:type).to_s\n parsed_background['keyword'] = parsed_background.delete(:keyword).to_s\n parsed_background['name'] = parsed_background.delete(:name)\n parsed_background['description'] = parsed_background.delete(:description) || ''\n parsed_background['line'] = parsed_background.delete(:location)[:line]\n\n parsed_background['steps'] = []\n parsed_background[:steps].each do |step|\n adapt_step!(step)\n end\n parsed_background['steps'].concat(parsed_background.delete(:steps))\n end", "title": "" }, { "docid": "9202f11e3024a8332839774f0b9bfb98", "score": "0.47904608", "text": "def op_bg_transition(args)\n expect_arg_count(args, 5)\n fade_time, a1, a2, mask_fn, fn = args\n (1..2).each { |i| expect_arg(args, i, 0) }\n\n @out << {'op' => 'img', 'layer' => 'bg', 'fn' => get_img_file(\"#{fn}.png\")}\n end", "title": "" }, { "docid": "c11ab97026e5a285cf831cb80024d9b5", "score": "0.47899672", "text": "def create_background\n add_background(BACKGROUND).set_z(1)\n end", "title": "" }, { "docid": "ff0c893fa1a75b7e7bc9cda6dd653070", "score": "0.478001", "text": "def background=(value)\n @background = Vedeu::Colours::Background.coerce(value)\n end", "title": "" }, { "docid": "3f61b8bd3284867bb247614f4756f241", "score": "0.4776365", "text": "def expand_dimensions_shorthand! # :nodoc:\n {'margin' => 'margin-%s',\n 'padding' => 'padding-%s',\n 'border-color' => 'border-%s-color', \n 'border-style' => 'border-%s-style', \n 'border-width' => 'border-%s-width'}.each do |property, expanded|\n\n next unless @declarations.has_key?(property)\n \n value = @declarations[property][:value]\n\n # RGB and HSL values in borders are the only units that can have spaces (within params).\n # We cheat a bit here by stripping spaces after commas in RGB and HSL values so that we \n # can split easily on spaces.\n #\n # TODO: rgba, hsl, hsla\n value.gsub!(RE_COLOUR) { |c| c.gsub(/[\\s]+/, '') }\n\n matches = value.strip.split(/[\\s]+/)\n\n t, r, b, l = nil\n\n case matches.length\n when 1\n t, r, b, l = matches[0], matches[0], matches[0], matches[0]\n when 2\n t, b = matches[0], matches[0]\n r, l = matches[1], matches[1]\n when 3\n t = matches[0]\n r, l = matches[1], matches[1]\n b = matches[2]\n when 4\n t = matches[0]\n r = matches[1]\n b = matches[2]\n l = matches[3]\n end\n\n split_declaration(property, expanded % 'top', t)\n split_declaration(property, expanded % 'right', r)\n split_declaration(property, expanded % 'bottom', b)\n split_declaration(property, expanded % 'left', l)\n\n @declarations.delete(property)\n end\n end", "title": "" }, { "docid": "0a4ce73f6a1145d91002da7b713a682b", "score": "0.47747588", "text": "def gr_display_background()\n @background = Sprite.new(@viewport)\n @background.z = 0\n @background.bitmap = RPG::Cache.battleback(Battle::Visual.allocate.send(:background_name))\n end", "title": "" }, { "docid": "f39a3fcc50ceb311a719fae865b89cc3", "score": "0.4770236", "text": "def background\n get_or_inherit_color(:background, Cura::Color.black)\n end", "title": "" }, { "docid": "d6486b3fd723aa47f713068a67cd2c46", "score": "0.47691917", "text": "def transform_css(css)\n css.gsub(CSS_URL_REGEXP) do\n matches = Regexp.last_match\n \"url(#{matches[:quote]}#{generate_url(matches[:url])}#{matches[:quote]})\"\n end\n end", "title": "" }, { "docid": "66aa6a440d17036a57d8040b4753e4a8", "score": "0.4762717", "text": "def red_bg\n return colorize(41)\n end", "title": "" }, { "docid": "b05ba740b6d1f1b0fb3f67a8e859d325", "score": "0.47521237", "text": "def blend(fg, bg); end", "title": "" }, { "docid": "0e3c6b69fec51d90c77f38ffcb483538", "score": "0.47513643", "text": "def create_background_bitmap\n @background.bitmap = Bitmap.new(@width, @height)\n @background.bitmap.fill_rect(0, 0, @width, @height, BORDER_COLOR)\n @background.bitmap.fill_rect(1, 1, @width - 2, @height - 2, BACK_COLOR)\n end", "title": "" }, { "docid": "b51b513e322546fa233efa984475dc45", "score": "0.47497618", "text": "def create_background\n add_background(BACKGROUND).set_z(1)\n end", "title": "" }, { "docid": "831f4e101b6d730a8d3ff9e9bac6a141", "score": "0.47450534", "text": "def to_ultisnips(format)\n lines = expand(format).map{|h| ultisnip_block(h) }\n lines.unshift(extend_css(-50)) if format == :scss\n lines.join(\"\\n\\n\")\n end", "title": "" }, { "docid": "fcc4e97d7076bb2ba51346f47d11aefd", "score": "0.47377715", "text": "def background=(value)\n @background = colour.background = value\n @_colour = @colour = colour\n end", "title": "" }, { "docid": "9c25f8b86c5f0000553a3865174d4282", "score": "0.47360146", "text": "def background(value = nil)\n @background = value unless value.nil?\n @background ||= self.first\n end", "title": "" }, { "docid": "44e0122e86a21258a444da182061763b", "score": "0.473227", "text": "def generate_background_sprite\n bitmap = Bitmap.new(@tips_window.width, @tips_window.height)\n bitmap.fill_rect(0, 0, @tips_window.width, @tips_window.height, Color.new(0, 0, 0))\n bitmap\n end", "title": "" }, { "docid": "09cde1900179189f3def08a1da77e9d9", "score": "0.4722852", "text": "def multicolor_preview\n tab = []\n 40.times do |i|\n if i.even?\n color1 = \"ffff00ff\".to_i(16)\n color2 = \"00ff00ff\".to_i(16)\n else\n color1 = \"ff0000ff\".to_i(16)\n color2 = \"0000ffff\".to_i(16)\n end\n tab << [color1]*180 + [color2]*180\n end\n tab\n end", "title": "" }, { "docid": "605b3e22929790fb0d9751032faedec4", "score": "0.47177583", "text": "def decompose_alpha_component(channel, color, mask, bg); end", "title": "" }, { "docid": "1f6c0e39ebbfad4dc031c3c33702155e", "score": "0.47154647", "text": "def create_background\n @background_sprite = Sprite.new\n @background_sprite.bitmap = Cache.background(\"Quest_BG\")\n end", "title": "" }, { "docid": "8c7bdfb9c6dd9c6934648476f3387892", "score": "0.4699557", "text": "def to_json_compatible\n json_background = {}\n json_background[:id] = @identifier\n\n json_background[:image_name] = @background_image\n\n json_background[:parts] = []\n @parts.each do |part|\n json_background[:parts] << part.to_json_compatible\n end\n json_background\n end", "title": "" } ]
a66991c4518e79b8522508f147b11bd7
Then ask them for add or multiply Add or multiply all the numbers from one up to the number
[ { "docid": "d963064c7503f53d165beb3694d2cac4", "score": "0.0", "text": "def number\n puts \"Enter a number between 1 and 25\"\n @chosen_number = gets.chomp.strip.to_i\n if @chosen_number > 0 && @chosen_number < 26\n add_multiply\n else\n puts \"That is not a valid entry.\"\n number\n end\nend", "title": "" } ]
[ { "docid": "e3f5de15c6b234613711004897bbaf0b", "score": "0.680455", "text": "def sum_or_product\n puts \"Please enter a number greater than 0\"\n number = gets.chomp.to_i\n puts \"Would you like to multiply or add these numbers? Type 'p' to multiply and 's' to add\"\n operator = gets.chomp.to_s\n\n product = (1..number).inject(:*)\n sum = (1..number).inject(:+)\n\n if operator == \"s\"\n puts \"The sum of numbers between 1 and #{number} is #{sum}.\"\n elsif operator == \"p\"\n puts \"The product of numbers between 1 and #{number} is #{product}.\"\n end\nend", "title": "" }, { "docid": "9587a61faf60a264f29ca70fe1e6af13", "score": "0.6720943", "text": "def mult_then_add(n_1, n_2, n_3)\n\tn_1 * n_2 + n_3\nend", "title": "" }, { "docid": "f5feaabf0ec1253349a8575aba0d15c4", "score": "0.6655209", "text": "def multiply()\n\t\tputs\"enter 2 numbers to multiply\"\n\t\ta=gets.to_i\n\t\tb=gets.to_i\n\t\tm=a*b\n\t\tputs m\n\tend", "title": "" }, { "docid": "5e57b0f1c26cb108e80cf8af8b4d00db", "score": "0.66132617", "text": "def multiply(number)\n\tnumber * number\nend", "title": "" }, { "docid": "55898ef6576b5df04dddb9192cc3da38", "score": "0.6612282", "text": "def multiply *nums\nif nums.length < 2\n\"please enter at least two numbers.\"\nelse\nnums.reduce(:*)\nend\nend", "title": "" }, { "docid": "5d91efee11263c1e1600dceb38fbc6d2", "score": "0.65967166", "text": "def compute_product(chosen_number)\n total = 1\n 1.upto(chosen_number) { |value| total *= value}\nend", "title": "" }, { "docid": "3fcf8ebceb39135756bb8dd743fa814c", "score": "0.6560748", "text": "def mult_operation(result)\n begin\n number = gets.chomp\n result *= number.to_i \n rescue StandardError => e\n print_error_message \"Invalid number. Ending multiply operation.\\n#{e.message}\"\n end \n return result\n end", "title": "" }, { "docid": "1e26c08836d7a362864e65dacdc5a8fb", "score": "0.6555119", "text": "def math_method\n\tputs \"\\n\"\n\tprint \"Would you like to add or multiply all the number up to your number (+ or *)? \"\n\t@math = gets.chomp.strip\n\n\tif @math != \"+\" && @math != \"*\"\n\t\tputs \"\\n\"\n\t\tputs \"wrong math input.\"\n\t\tmath_method()\n\tend\nend", "title": "" }, { "docid": "8dfd9c8986ae903b4f11ad8a87ce03b4", "score": "0.6547555", "text": "def multiply(add, subtract)\n add * subt\nend", "title": "" }, { "docid": "7183123a6d96a4324b5597a1496fecd2", "score": "0.6544159", "text": "def multiply(*numbers)\n sum = 1\n numbers.each do |num|\n sum = sum * num\n end\n sum\nend", "title": "" }, { "docid": "3ef62368dfec386a37e7f66e1d7ce109", "score": "0.6532266", "text": "def multiply(number1, number2)\n number1 + number2\nend", "title": "" }, { "docid": "368623596ebcde8d0aafb291f7ee2a44", "score": "0.6524676", "text": "def problem_1\n sum_of_multiplies(999)\nend", "title": "" }, { "docid": "b0779e575e55c9c1ffcc5c74db7a7541", "score": "0.6517121", "text": "def mul_numbers(c, d, e)\n add_numbers(c, d) * e\nend", "title": "" }, { "docid": "a706f8fa35dedf11ae738ce17912da02", "score": "0.65046555", "text": "def s_p\n puts 'Please enter an integer greater than 0'\n integer = gets.chomp.to_i\n puts \"Enter 's' to compute the sum, 'p' to compute the product.\"\n operation = gets.chomp\n operation == 's' ? puts(1.upto(integer).reduce(:+)) : puts(1.upto(integer).reduce(:*))\nend", "title": "" }, { "docid": "4e5b384cfa6ebd3b170125dfd5c96685", "score": "0.6503689", "text": "def multiply(number1, number2) \n number1 * number2 \n end", "title": "" }, { "docid": "ed77fad5b80c60a670a580c08510ab30", "score": "0.65006346", "text": "def multiply (first_number, second_number)\n\tfirst_number * second_number\nend", "title": "" }, { "docid": "8a9bbf6c84e3006fc5d82fcf16bc0f0a", "score": "0.6470324", "text": "def basic_calc\n print \"(a)dd, (s)ubtract, (m)ultiply, (d)ivide: \"\n choice = get_user_input\n\n puts \"What numbers do you wish to #{choice}?\"\n n = get_multiple_numbers\n\n case choice\n when \"a\" \n puts add(n)\n when \"s\" \n \tputs subtract(n)\n when \"m\" \n \tputs multiply(n)\n when \"d\" \n puts divide(n)\n else\n \tputs \"Not an option. Resubmit.\"\n \tchoice = get_user_input\n end\n\nend", "title": "" }, { "docid": "5f6aede223e185c1133308df01dccd25", "score": "0.6454023", "text": "def multiply(num1, num2, *numbers)\n product = num1 * num2\n numbers.each do |number|\n product *= number\n end\n product\nend", "title": "" }, { "docid": "bf18d5e41a5310a65de378bd86541ecd", "score": "0.64510906", "text": "def multiply_numbers(fnum, snum, tnum)\n\tproduct = fnum*snum*tnum\n\treturn product\nend", "title": "" }, { "docid": "60b0dfea9efc8719b423a413e6ad287a", "score": "0.6446489", "text": "def multiply()\n puts \"What numbers would you like to multiply\"\n print \"number 1? \"\n a = gets.chomp\n print \"number 2? \"\n b = gets.chomp\n puts a.to_f * b.to_f\nend", "title": "" }, { "docid": "f2d1f53662072f0c04ba6fd345d82d57", "score": "0.64447796", "text": "def multiple\n # Ask for some inputs, after some text\n # Turn those inputs into a float, and saves it in some variable\n print \"What is your first number? \"\n first_number = gets.to_f\n\n print \"What is your second number? \"\n second_number = gets.to_f\n\n # Add the two inputs give together and save the result\n result = first_number * second_number\n\n # Print these things out to the screen\n puts \"The result is #{result}\"\n\nend", "title": "" }, { "docid": "67e6233aac6ed29dd81046feea308c41", "score": "0.6442936", "text": "def multiplication\n puts \"Pick your first number.\"\n a = gets.chomp \n puts \"Pick your second number.\"\n b = gets.chomp\n a.to_i * b.to_i\nend", "title": "" }, { "docid": "83816ac40ade2166d215cdb1b617558a", "score": "0.64170784", "text": "def sum_or_product\n puts \"Please enter an integer greather than 0:\" \n int = gets.to_i\n puts \"Enter 's' to compute the sum, 'p' to compute the produce.\"\n op = gets.chomp\n\n case op\n when 's'\n puts \"The sum of integers between 1 and #{int} is #{(1..int).reduce(&:+)}.\"\n when 'p'\n puts \"The product of integers between 1 and #{int} is #{(1..int).reduce(&:*)}.\"\n else\n puts \"not a recognized operation.\"\n end\nend", "title": "" }, { "docid": "3552d59b32dc7a3bbf4b4d06b974adc0", "score": "0.6407065", "text": "def multiply(numbers)\n product = 1\n numbers.each do |number|\n product = product * number\n end\n product\nend", "title": "" }, { "docid": "862e5ca12e15cabf6dd59c2214852470", "score": "0.64019245", "text": "def plus\n \tget_nums do |n1, n2| \n \t\t@result = n1 + n2\n \t\t@calculator << @result \n \tend\n end", "title": "" }, { "docid": "284ae202b23dc7d05ddc3478d31a023a", "score": "0.6392526", "text": "def multiplication (first_number, second_number)\nanswer = first_number * second_number\nanswer\nend", "title": "" }, { "docid": "349b7a17174370fdc4681ac7323fafb4", "score": "0.6392247", "text": "def multiple(first_number, second_number, third_number=1)\n #multiply the two numbers together\n x=first_number.to_i\n y=second_number.to_i\n z=third_number.to_i\n x*y*z\nend", "title": "" }, { "docid": "298411cb9929cdaa3c284b3d26f75193", "score": "0.63777345", "text": "def option_add()\n print \"What's the first number you want to add? \"\n first_number = gets.to_i\n print \"What's the second number you want to add? \"\n second_number = gets.to_i\n puts \"The answer to #{first_number} + #{second_number} is #{add(first_number, second_number)}\"\nend", "title": "" }, { "docid": "ae87016afc38ab930029a3afa1d91891", "score": "0.63694733", "text": "def multiply(number_1, number_2)\n\tnumber_1 * number_2\nend", "title": "" }, { "docid": "8587c71f723963da94e7fe2b4302fb9b", "score": "0.63644016", "text": "def multiply(*numbers)\n product = 1\n numbers.each { |number| product *= number }\n product\nend", "title": "" }, { "docid": "7993c6b5468822278bd319bfea443653", "score": "0.63620627", "text": "def multiply()\n puts \"Please enter first number to be multiplied\"\n num1 = gets.chomp\n puts num1.to_s + \" will be mulitplied by, enter second number: \"\n num2 = gets.chomp\n puts \"The result is: \" \n p num1.to_i * num2.to_i \nend", "title": "" }, { "docid": "20baf40a7cec76dc8cf7108f24e17b90", "score": "0.6359506", "text": "def calculate\n loop do\n\n #Get user input for numbers\n puts \"Enter first number\"\n @num1 = gets.chomp.to_i\n puts \"Enter second number\"\n @num2 = gets.chomp.to_i\n\n #User makes calculation selection and corresponding method performed.\n puts 'Would you like to add [+], subtract [-], multiply [*], or exit [e]?'\n input = gets.chomp\n case input\n when '+'\n add\n when '-'\n subtract\n when '*'\n multiply\n when 'e'\n exit\n else\n puts \"Please select [+], [-], or [x]\"\n end\n end\n end", "title": "" }, { "docid": "44c76b317efd74934c90f48369233828", "score": "0.6339932", "text": "def multiply(first_num, second_num)\n first_num * second_num\nend", "title": "" }, { "docid": "beafb5ba41ba057ce50ff982294efda8", "score": "0.633302", "text": "def multiply(num, num1)\n num * num1\nend", "title": "" }, { "docid": "00a956534f53ec7b6de8bb12d53fbb4a", "score": "0.6327316", "text": "def multiply(*number)\n\tresult = 1\n\tnumber.each {|n| result = result * n}\n\tresult\nend", "title": "" }, { "docid": "4ee137afcfa451dd2e8aa1dd383bc5f8", "score": "0.63257056", "text": "def multiply(*numbers)\n product = 1\n numbers.each { |num| product *= num }\n product\nend", "title": "" }, { "docid": "e273138d511993be9384153d3979c000", "score": "0.6325323", "text": "def add_mul\n\t\tpos = 0\n\t\twhile pos < @instructions.length - 6\n\t\t\tsix = @instructions[pos, 6]\n\t\t\tif six.map { |instr| instr[:type] } == CONST_MULT &&\n\t\t\t\t\t[six[0][1], six[0][2], six[1][1], six[4][1]].uniq.length == 4 &&\n\t\t\t\t\t[six[0][2], six[2][1], six[2][1]].uniq.length == 1 &&\n\t\t\t\t\tsix[4][1] == six[5][1] &&\n\t\t\t\t\tsix[3][2] == -2 && six[5][2] == -5\n\t\t\t\t@instructions[pos] = {:type => :mul, 1 => six[0][1], 2 => six[4][1], 3 => six[1][1]}\n\t\t\t\t@instructions[pos + 1] = {:type => :cpy, 1 => 0, 2 => six[2][1]}\n\t\t\t\t@instructions[pos + 2] = {:type => :cpy, 1 => 0, 2 => six[4][1]}\n\t\t\t\t((pos + 3)..(pos + 5)).each do |i|\n\t\t\t\t\t@instructions[i] = {:type => :none}\n\t\t\t\tend\n\t\t\tend\n\t\t\tpos += 1\n\t\tend\n\tend", "title": "" }, { "docid": "3da9a965474f0f669eb87a826187aac5", "score": "0.6325315", "text": "def add(num)\n if num == 0\n @product = [1]\n else\n @product << @product[-1] * num\n end\n end", "title": "" }, { "docid": "5687287e0224e9509cf447f9c353e5b2", "score": "0.6315639", "text": "def multiply(*numbers)\n result = 1\n numbers.each do |num|\n result *= num\n end\n result\nend", "title": "" }, { "docid": "5687287e0224e9509cf447f9c353e5b2", "score": "0.6315639", "text": "def multiply(*numbers)\n result = 1\n numbers.each do |num|\n result *= num\n end\n result\nend", "title": "" }, { "docid": "d3145d13aaa7e904a7c01f2c59d21508", "score": "0.6313896", "text": "def multiply\n\t22*44\nend", "title": "" }, { "docid": "6cb426406fb70861d7875e65120712eb", "score": "0.6312821", "text": "def multiply(num1, num2)\n return num1 if num2 == 1\n\n if num2 < 0\n -(num1 + multiply(num1, (-num2) - 1))\n else\n num1 + multiply(num1, num2 - 1)\n end\n\nend", "title": "" }, { "docid": "dffd7ba96a6a78bc311030878e6add04", "score": "0.630894", "text": "def multiply(first_number , second_number)\n return first_number * second_number\nend", "title": "" }, { "docid": "aa286da68871b081483ec7b4ad3e8b89", "score": "0.6305065", "text": "def multiply(number_one,number_two)\n number_one * number_two\nend", "title": "" }, { "docid": "76dbc62e07e553c85a8463cccdb69c49", "score": "0.6294742", "text": "def multiply num1, num2\n product = 0\n\n num1.times do\n product += num2\n end\n\n product\nend", "title": "" }, { "docid": "84606bf9121995079005025d3724322d", "score": "0.6275269", "text": "def indice_of_number\n\n puts \"Number: \"\n user_number = gets.chomp\n puts \"Indice: \"\n user_indice = gets.chomp\n\n answer = Integer(user_number) ** Integer(user_indice)\n puts answer\n\n answer_if_restart\n\nend", "title": "" }, { "docid": "fbfe564214d333990eb8d5ac8b02501d", "score": "0.62744117", "text": "def multiply(*numbers)\n numbers.reduce(:*)\n end", "title": "" }, { "docid": "feba6f51d65b3d22f85eb2671842bafd", "score": "0.6269453", "text": "def multiply(num_one, num_two)\n num_one * num_two\nend", "title": "" }, { "docid": "feba6f51d65b3d22f85eb2671842bafd", "score": "0.6269453", "text": "def multiply(num_one, num_two)\n num_one * num_two\nend", "title": "" }, { "docid": "feba6f51d65b3d22f85eb2671842bafd", "score": "0.6269453", "text": "def multiply(num_one, num_two)\n num_one * num_two\nend", "title": "" }, { "docid": "feba6f51d65b3d22f85eb2671842bafd", "score": "0.6269453", "text": "def multiply(num_one, num_two)\n num_one * num_two\nend", "title": "" }, { "docid": "feba6f51d65b3d22f85eb2671842bafd", "score": "0.6269453", "text": "def multiply(num_one, num_two)\n num_one * num_two\nend", "title": "" }, { "docid": "feba6f51d65b3d22f85eb2671842bafd", "score": "0.6269453", "text": "def multiply(num_one, num_two)\n num_one * num_two\nend", "title": "" }, { "docid": "feba6f51d65b3d22f85eb2671842bafd", "score": "0.6269453", "text": "def multiply(num_one, num_two)\n num_one * num_two\nend", "title": "" }, { "docid": "35c0983c2f67e51f0b841a4216b39d6c", "score": "0.62685704", "text": "def mult(number)\n 1.upto(number).select { |n| n % 3 == 0 || n % 5 == 0 }.reduce(:+)\nend", "title": "" }, { "docid": "97f7a7a88cfd9de1975c901926fa36f2", "score": "0.62633646", "text": "def MultiplicativePersistence(num)\n mult_pers = 0\n until num < 10\n num = num.digits.inject(:*)\n mult_pers += 1\n end\n mult_pers\nend", "title": "" }, { "docid": "ab1974df23853abd110cb0f29b7237ef", "score": "0.625807", "text": "def multiply(*nums)\n total = 1\n nums.each { |x| \n total *= x\n }\n return total\nend", "title": "" }, { "docid": "0b5bf1db469d243aba223613e55e1574", "score": "0.62569886", "text": "def multiply(number_1, number_2)\n number_1 * number_2\nend", "title": "" }, { "docid": "86559d10c5995af9130af24c33f20170", "score": "0.6256716", "text": "def multiply(num1, num2)\n return 0 if num1 == 0 || num2 == 0\n return num2 if num1 == 1\n return 0 - multiply(num1.abs, num2) if num1 < 0\n num2 + multiply(num1 - 1, num2)\nend", "title": "" }, { "docid": "bb4d0541837d92fe2da87db788132127", "score": "0.6251918", "text": "def multiply(number)\n number * 2\n end", "title": "" }, { "docid": "5abd5a37ae0d690588a4fea627a35a48", "score": "0.62443274", "text": "def multiple(num1,num2)\n num1*num2\nend", "title": "" }, { "docid": "612bd2eac436e411234cce1bcbb723e1", "score": "0.6243833", "text": "def MultiplicativePersistence(num)\n\n new = num.to_s.split('').map {|x| x.to_i}\n \n pers = new.size == 1 ? 0 : 1\n sum = new.reduce(:*)\n new = sum.to_s.split('').map { |x| x.to_i }\n \n until sum < 10 \n p sum = new.reduce(:*)\n p pers += 1\n new = sum.to_s.split('').map { |x| x.to_i }\n end\n \n # code goes here\n return pers \n \nend", "title": "" }, { "docid": "d7e37e0d76ccc800e3b5d0d3a61646ca", "score": "0.62423074", "text": "def multiply_six(number)\n number * 6\n number + 4\nend", "title": "" }, { "docid": "6e1003a8440814228b78a6bff56dcb8d", "score": "0.6226914", "text": "def extra_numbers\n puts \"How many numbers would you like in your calculation (1-8 extra numbers)(starts at 2)\"\n iterator = 0\nn3 = gets.chomp.to_f\n break if iterator = 1\nn4 = gets.chomp.to_f\n break if iterator = 2\nn5 = gets.chomp.to_f\n break if iterator = 3\nn6 = gets.chomp.to_f\n break if iterator = 4\nn7 = gets.chomp.to_f\n break if iterator = 5\nn8 = gets.chomp.to_f\n break if iterator = 6\nn9 = gets.chomp.to_f\n break if iterator = 7\nn10 = gets.chomp.to_f\n break if iterator = 8\nelse\n puts \"Please only put (1-8)\"\n sleep(1)\n puts calculator\nend", "title": "" }, { "docid": "fe8976c6c4aa65ce12e1f11cc0ef7704", "score": "0.62184787", "text": "def num_sum\n\tputs \"Pick a number...\"\n\tnum = gets.chomp.to_i\n\tputs \"Would you like the sum or the product\"\n\tchoice = gets.chomp.downcase\n\n\tif choice == \"sum\"\n\t\tcounter = (1..num)\n\t\t\tnew_num = 0\n\t\t\tcounter.each do |num|\n\t\t\tnew_num = new_num + num\n\t\tend\n\telsif choice == \"product\"\n\t\tcounter = (1..num)\n\t\t\tnew_num = 1\n\t\t\tcounter.each do |num|\n\t\t\tnew_num = new_num * num\n\t\tend\n\telse\n\t\tputs \"That wasn't an option\"\n\tend\nputs new_num\nend", "title": "" }, { "docid": "0fef9ce109d88160d618790841b1a5f7", "score": "0.6216919", "text": "def adding_factorial()\n\tn=1\n\ttotal=0\n\tnumber=gets.chomp.to_i\n\tfor i in 1 .. number\n\t\tn=n*i\n\t\ttotal=total+n\n\tend\n\tputs total\nend", "title": "" }, { "docid": "2aef38647d25208a6281b2f86eab8de1", "score": "0.62140954", "text": "def multiply(num1, num2)\n num1 * num2\n end", "title": "" }, { "docid": "2aef38647d25208a6281b2f86eab8de1", "score": "0.62140954", "text": "def multiply(num1, num2)\n num1 * num2\n end", "title": "" }, { "docid": "2aef38647d25208a6281b2f86eab8de1", "score": "0.62140954", "text": "def multiply(num1, num2)\n num1 * num2\n end", "title": "" }, { "docid": "03fb0cdbfc5922fe5cb2b73d495929ca", "score": "0.6213284", "text": "def multiply number, second_number\n number * second_number\nend", "title": "" }, { "docid": "4ee5924509b7c5939aaa0352e51f26b6", "score": "0.6207192", "text": "def multiply(number1, number2)\n number1 * number2\nend", "title": "" }, { "docid": "4ee5924509b7c5939aaa0352e51f26b6", "score": "0.6207192", "text": "def multiply(number1, number2)\n number1 * number2\nend", "title": "" }, { "docid": "4ee5924509b7c5939aaa0352e51f26b6", "score": "0.6207192", "text": "def multiply(number1, number2)\n number1 * number2\nend", "title": "" }, { "docid": "4ee5924509b7c5939aaa0352e51f26b6", "score": "0.6207192", "text": "def multiply(number1, number2)\n number1 * number2\nend", "title": "" }, { "docid": "4ee5924509b7c5939aaa0352e51f26b6", "score": "0.6207192", "text": "def multiply(number1, number2)\n number1 * number2\nend", "title": "" }, { "docid": "4ee5924509b7c5939aaa0352e51f26b6", "score": "0.6207192", "text": "def multiply(number1, number2)\n number1 * number2\nend", "title": "" }, { "docid": "4ee5924509b7c5939aaa0352e51f26b6", "score": "0.6207192", "text": "def multiply(number1, number2)\n number1 * number2\nend", "title": "" }, { "docid": "4ee5924509b7c5939aaa0352e51f26b6", "score": "0.6207192", "text": "def multiply(number1, number2)\n number1 * number2\nend", "title": "" }, { "docid": "4ee5924509b7c5939aaa0352e51f26b6", "score": "0.6207192", "text": "def multiply(number1, number2)\n number1 * number2\nend", "title": "" }, { "docid": "bcac620eb853e6fdedafeaf753293141", "score": "0.62062216", "text": "def multiply(*num)\n\tresult = 1\n\tnum.each {|x| result = result * x}\n\tresult\nend", "title": "" }, { "docid": "70c45229aa75fbc9b65484d0a739061c", "score": "0.62036777", "text": "def basic_or_advanced\n puts \"If you wish to do basic math (+,-,*,/) enter 1, for advanced math (exponents, square, cube, square roots) enter 2\"\n gets.chomp.to_i\nend", "title": "" }, { "docid": "57fac4eddab771dd44acd50e1ba23863", "score": "0.6196406", "text": "def multiply (number1, number2)\n number1 * number2\nend", "title": "" }, { "docid": "47bbce96a9aae1c9bea7b49d21178277", "score": "0.61923796", "text": "def multiply(num1, num2)\n return 0 if num2 == 0\n if num2 > 0\n sum = num1 + multiply(num1, num2 - 1)\n else\n sum = -(num1 + multiply(num1, -(num2) - 1))\n end\n sum\nend", "title": "" }, { "docid": "c85cda5c00de3aeaa4fa1cdc8ea75df7", "score": "0.61890316", "text": "def add()\n\t\tputs \"please enter 3 numbers to add\"\n\ta=gets.to_i\n\tb=gets.to_i\n\tc=gets.to_i\n\tm=a+b+c\n\tputs m\n\tend", "title": "" }, { "docid": "0b4cc64e7ca911eac59977d8762e6985", "score": "0.6188922", "text": "def multiply (num_1, num_2)\n num_1 * num_2\nend", "title": "" }, { "docid": "0203f150e789c30c1348407188f9f257", "score": "0.618564", "text": "def multiply(number1, number2)\n number1*number2\nend", "title": "" }, { "docid": "17b0de7459a21daab9b09fdf4c2cb3da", "score": "0.6184275", "text": "def multiply(num_1,num_2)\n if num_2 == 0\n return 0\n end\n \n if num_2 < 0\n -(num_1 + multiply(num_1, -(num_2) - 1))\n else\n num_1 + multiply(num_1, num_2 - 1)\n end\n\nend", "title": "" }, { "docid": "ba7dda9497c102aed98b8701db95ce66", "score": "0.61840796", "text": "def multiply(*num)\n result = 1\n num.each {|n| result *= n}\n result\nend", "title": "" }, { "docid": "06aaf91dd6e0a4fda7f8c7175d94d5b4", "score": "0.6181668", "text": "def multiply(num1, num2)\n\tnum1 * num2\nend", "title": "" }, { "docid": "06aaf91dd6e0a4fda7f8c7175d94d5b4", "score": "0.6181668", "text": "def multiply(num1, num2)\n\tnum1 * num2\nend", "title": "" }, { "docid": "06aaf91dd6e0a4fda7f8c7175d94d5b4", "score": "0.6181668", "text": "def multiply(num1, num2)\n\tnum1 * num2\nend", "title": "" }, { "docid": "2c49abd24988a0d8408fb2752df882da", "score": "0.61810774", "text": "def calculation(number, operation)\n if operation == 's'\n (1..number).inject { |sum, n| sum + n }\n else\n (1..number).inject { |product, n| product * n }\n end\nend", "title": "" }, { "docid": "b2c643d2f0f4103592da0f7314912be1", "score": "0.61807877", "text": "def multiply(num_1, num_2)\n num_1 * num_2\nend", "title": "" }, { "docid": "b2c643d2f0f4103592da0f7314912be1", "score": "0.61807877", "text": "def multiply(num_1, num_2)\n num_1 * num_2\nend", "title": "" }, { "docid": "b2c643d2f0f4103592da0f7314912be1", "score": "0.61807877", "text": "def multiply(num_1, num_2)\n num_1 * num_2\nend", "title": "" }, { "docid": "63c856f8f8fb79e975fdad9a193feafa", "score": "0.6180777", "text": "def calculate\n add_integers = [a \"+\" b]\n sub_integers = [c \"-\" d]\n div_integers = [e \"/\" f]\n mult_integers = [g \"*\" h]\nend", "title": "" }, { "docid": "76455f23516e1d2aa37298a4f16a09ca", "score": "0.6179457", "text": "def addition\n\tprint \"Please enter a number\"\n\tnumber = gets.to_i\n\tprint \" Please eneteranother number?\"\n\tnumber2 = gets.to_i ##########Extension########\n\tnumberx = \"a\" # \"a\" can be anything - DEFINE THE VARIABLE TO USER LATER\n\t\tnumbers = Array.new # WILL STOIRE OR TEH ADDITIONAL NUMBER THE USER ENTER\n\twhile !numberx.empty? # WHILE THE NUMBER USER PUT IS NOT EMPTY WILL KEEP GOING\n\t\tprint \"Enter any addition number?\"\n\t\tnumberx = gets.chomp \n numberx.to_i # TURN VARIABLE INTO INTENGER\n\t\tnumbers.push(numberx)# push inside array\n\n\tend\n\n number_inter = numbers.map(&:to_i)# sintax to convert all variables inside an array to integer\n sum = number_inter.inject(0, &:+)#inject = arraay sintax for add value adding all the variables inside the array, u must put 0\n add = number + number2 + sum \n\n# A user should be shown the result\n\tputs \"the result is #{add}\" # U have to use it in ruby\nend", "title": "" }, { "docid": "cfdb61ef196f5666dd4dcc8abb55cfec", "score": "0.61787677", "text": "def multiply(num1,num2)\r\n num1 * num2\r\nend", "title": "" }, { "docid": "ebafaf275c24b1fe9590adac5442d32a", "score": "0.6177875", "text": "def multiply num1, num2\n num1 * num2\nend", "title": "" }, { "docid": "45c47b5c0863cde94d75130a1695f59a", "score": "0.6169367", "text": "def sum_or_product\n puts \"Please enter an integer greater than 0:\"\n num = gets.chomp.to_i\n\n puts \"Enter 's' to compute the sum, 'p' to compute the product.\"\n choice = gets.chomp.downcase\n\n if choice == \"s\"\n sum = (1..num).to_a.sum\n puts \"The sum of the integers between 1 and #{num} is #{sum}.\"\n elsif choice == \"p\"\n product = (1..num).to_a.reduce { |total, n| total * n }\n puts \"The product of the integers between 1 and #{num} is #{product}.\"\n else\n puts \"Invalid choice!\"\n end\nend", "title": "" }, { "docid": "9a5138c6005ec34e75981228b72418ec", "score": "0.6165197", "text": "def multiply(num1,num2)\n num1 * num2\nend", "title": "" } ]
89e949c0fdec8922183fd0f8fc2d6924
PUT /gerente_comercials/1 PUT /gerente_comercials/1.json
[ { "docid": "2692145ef696b696ee335c5cb187a8f6", "score": "0.7119172", "text": "def update\n @gerente_comercial = GerenteComercial.find(params[:id])\n\n respond_to do |format|\n if @gerente_comercial.update_attributes(params[:gerente_comercial])\n format.html { redirect_to @gerente_comercial, notice: 'Gerente comercial was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @gerente_comercial.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
[ { "docid": "8d4903a8a69bc15233ed1de55096d8f3", "score": "0.6700567", "text": "def update\n respond_to do |format|\n if @centroscomercial.update(centroscomercial_params)\n format.html { redirect_to @centroscomercial, notice: 'Centroscomercial was successfully updated.' }\n format.json { render :show, status: :ok, location: @centroscomercial }\n else\n format.html { render :edit }\n format.json { render json: @centroscomercial.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3eeada2a66f5b60ca71aca81ef05eab7", "score": "0.64321136", "text": "def update\n @composante = Composante.find(params[:id])\n\n respond_to do |format|\n if @composante.update_attributes(params[:composante])\n format.html { redirect_to @composante, notice: 'Composante was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @composante.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0e49af1e85df3a00461e7f3c33899bcb", "score": "0.6349287", "text": "def update\n @coment = current_user.coments.find(params[:id]) # busca solo en sitios asociados a current_user\n # @coment = Coment.find(params[:id])\n\n respond_to do |format|\n if @coment.update_attributes(params[:coment])\n format.html { redirect_to @coment, notice: 'Coment was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @coment.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d502001b1e5c6b2cf942f68ae1b84f52", "score": "0.6306855", "text": "def create\n @gerente_comercial = GerenteComercial.new(params[:gerente_comercial])\n\n respond_to do |format|\n if @gerente_comercial.save\n format.html { redirect_to @gerente_comercial, notice: 'Gerente comercial was successfully created.' }\n format.json { render json: @gerente_comercial, status: :created, location: @gerente_comercial }\n else\n format.html { render action: \"new\" }\n format.json { render json: @gerente_comercial.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "345429e660064de00e64e3cb9856eb63", "score": "0.629461", "text": "def update\n respond_to do |format|\n if @comercio.update(comercio_params)\n format.html { redirect_to @comercio, notice: \"Comercio was successfully updated.\" }\n format.json { render :show, status: :ok, location: @comercio }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @comercio.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2941a61ad482b2a78e7d4de019a49811", "score": "0.6244356", "text": "def update\n @rola = find_rola\n\n if (params[:comercializable][:impuesto_ids] == nil)\n params[:comercializable][:impuesto_ids] = []\n end\n\n if (params[:comercializable][:promocion_ids] == nil)\n params[:comercializable][:promocion_ids] = []\n end\n @come = @rola.rolarticulos.find(params[:id])\n\n respond_to do |format|\n if @come.update_attributes(params[:comercializable])\n format.html { redirect_to @rola, :notice => 'Comercializable was successfully updated.' }\n format.json { render json: @rola }\n else\n format.html { render :action => \"edit\" }\n format.json { render json: @come.errors }\n end\n end\n end", "title": "" }, { "docid": "ba59683735b81bcde641fa7eb15984dd", "score": "0.62169224", "text": "def update\n @comune = Comune.find(params[:id])\n\n respond_to do |format|\n if @comune.update_attributes(params[:comune])\n format.html { redirect_to @comune, notice: 'Comune was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @comune.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5a58f1581e8d5f1206d2981288a62f1c", "score": "0.6176526", "text": "def update\n @clientes = Cliente.all\n @sucursales = @direccion.cliente.sucursals.order(:nombre)\n\n respond_to do |format|\n if @direccion.update(direccion_params)\n #@direccion.cliente_id =params[:direccion][:cliente_id]\n #@direccion.sucursal_id =params[:direccion][:sucursal_id]\n @direccion.save!(validate:false)\n format.html { redirect_to @direccion, notice: 'Direccion was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit', :layout => \"layout_2\" }\n format.json { render json: @direccion.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "64ce879addd071d59ae13f38513da9ea", "score": "0.61515677", "text": "def centroscomercial_params\n params.require(:centroscomercial).permit(:nome, :cidade_id)\n end", "title": "" }, { "docid": "5dd0e50dcd0760ebccbdbf103c1d0b72", "score": "0.6148882", "text": "def set_centroscomercial\n @centroscomercial = Centroscomercial.find(params[:id])\n end", "title": "" }, { "docid": "beb7c42f4e330af7eb9d4f7e3485a526", "score": "0.6107484", "text": "def update\n @comida = Comida.find(params[:id])\n\n respond_to do |format|\n if @comida.update_attributes(params[:comida])\n format.html { redirect_to @comida, notice: 'Comida was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @comida.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "81b03d04785cac0002028296e8c7a1e5", "score": "0.60866517", "text": "def update\n respond_to do |format|\n if @comida.update(comida_params)\n format.html { redirect_to @comida, notice: 'Comida was successfully updated.' }\n format.json { render :show, status: :ok, location: @comida }\n else\n format.html { render :edit }\n format.json { render json: @comida.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "17418b748f1574e04c61e115103d190e", "score": "0.6081371", "text": "def update\n respond_to do |format|\n @comunity.slug=nil\n if @comunity.update(comunity_params)\n format.html { redirect_to @comunity, notice: 'Comunidad actualizada exitosamente.' }\n format.json { render :show, status: :ok, location: @comunity }\n else\n format.html { render :edit }\n format.json { render json: @comunity.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1aa7da3b07b7ff034cee05ae499ea499", "score": "0.60680026", "text": "def update\n @coment = Coment.find(params[:id])\n\n respond_to do |format|\n if @coment.update_attributes(params[:coment])\n format.html { redirect_to @coment, notice: 'Coment was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @coment.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9a98e3eee48ac35cd8cdffff699f7faf", "score": "0.60517055", "text": "def update\n respond_to do |format|\n if @comision.update(comision_params)\n format.html { redirect_to @comision, notice: 'Comisión actualizada correctamente.' }\n format.json { render :show, status: :ok, location: @comision }\n else\n format.html { render :edit }\n format.json { render json: @comision.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c15efe0cb29b503e6e15abf79ae41fc4", "score": "0.60468113", "text": "def update\n @gasto.company_id = 1\n \n respond_to do |format|\n if @gasto.update(gasto_params)\n format.html { redirect_to @gasto, notice: 'Gasto was successfully updated.' }\n format.json { render :show, status: :ok, location: @gasto }\n else\n format.html { render :edit }\n format.json { render json: @gasto.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "38da9a15bfb9dd9c71601fc2d6f10fcd", "score": "0.60318315", "text": "def update\n @comite = Comite.find(params[:id])\n\n respond_to do |format|\n if @comite.update_attributes(params[:comite])\n format.html { redirect_to @comite, notice: 'Comite was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @comite.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "11d1296f2445b492259c638b6f1eefc7", "score": "0.60252154", "text": "def create\n @centroscomercial = Centroscomercial.new(centroscomercial_params)\n\n respond_to do |format|\n if @centroscomercial.save\n format.html { redirect_to @centroscomercial, notice: 'Centroscomercial was successfully created.' }\n format.json { render :show, status: :created, location: @centroscomercial }\n else\n format.html { render :new }\n format.json { render json: @centroscomercial.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9cddf5d87d73a64a6a1c9abb1519245c", "score": "0.5996215", "text": "def update\n @competence.update!(competence_params)\n render json: {status: :ok}\n end", "title": "" }, { "docid": "cd5ec69818fb736dc9ad35e548891ed1", "score": "0.5993438", "text": "def update\n respond_to do |format|\n if @servicio_contratado.update(servicio_contratado_params)\n format.html { redirect_to @servicio_contratado, notice: 'Servicio contratado was successfully updated.' }\n format.json { render :show, status: :ok, location: @servicio_contratado }\n else\n format.html { render :edit }\n format.json { render json: @servicio_contratado.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "20d2d83ca4421ab0a22c63aaa9bbee92", "score": "0.59925634", "text": "def create\n #@cliente = Cliente.new(params[:cliente])\n \n @cliente = Cliente.new(params[:cliente].update(:empresa_id => current_company.id))\n\n respond_to do |format|\n if @cliente.save\n format.html { redirect_to(@cliente, :notice => 'Cliente was successfully created.') }\n format.xml { render :xml => @cliente, :status => :created, :location => @cliente }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @cliente.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5ba559dceb577568b88c1f4316e0f956", "score": "0.59906435", "text": "def update\n\n @company = Company.find(1)\n @proyecto_minero = @company.get_proyecto_minero()\n\n respond_to do |format|\n if @contactopm.update(contactopm_params)\n format.html { redirect_to @contactopm, notice: 'Contacto was successfully updated.' }\n format.json { render :show, status: :ok, location: @contactopm }\n else\n format.html { render :edit }\n format.json { render json: @contactopm.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2114acc5e74f8f729650a4f11d378e85", "score": "0.5988238", "text": "def update\n\n @cliente = find_cliente\n @descuento_cliente = @cliente.descuento_clientes.find(params[:id])\n\n respond_to do |format|\n\n if @descuento_cliente.update_attributes(params[:descuento_cliente])\n #format.html { redirect_to redirigir(@contelefono), :notice => 'El telefono fue actualizado correctamente.' }\n format.json { render json: @descuento_cliente }\n else\n #format.html { render :action => \"edit\" }\n format.json { render json: @descuento_cliente.errors }\n end\n\n end\n\n end", "title": "" }, { "docid": "0dd2c7833fc52df4d70ed5786f56672a", "score": "0.59874606", "text": "def update\n respond_to do |format|\n if @est_comentario.update(est_comentario_params)\n format.html { redirect_to @est_comentario, notice: 'Est comentario was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @est_comentario.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "21705f3bad91c51b4564a20a93a8d665", "score": "0.59686846", "text": "def update\n respond_to do |format|\n if @servicio_de_cinerario.update(servicio_de_cinerario_params)\n format.html { redirect_to @servicio_de_cinerario, notice: 'Servicio de cinerario was successfully updated.' }\n format.json { render :show, status: :ok, location: @servicio_de_cinerario }\n else\n format.html { render :edit }\n format.json { render json: @servicio_de_cinerario.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bb6fe213e4a30eb01572f99a0fdef4be", "score": "0.59667283", "text": "def update\n respond_to do |format|\n if @comision_registro.update(comision_registro_params)\n format.html { redirect_to @comision_registro, notice: 'La comisión revisora de tesis se actualizó correctamente.' }\n format.json { render :show, status: :ok, location: @comision_registro }\n else\n format.html { render :edit }\n format.json { render json: @comision_registro.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7afd419c3eaf890fddc6817940a7e291", "score": "0.5956298", "text": "def update\n respond_to do |format|\n if @compania_seguro.update(compania_seguro_params)\n format.html { redirect_to @compania_seguro, notice: 'Compania seguro was successfully updated.' }\n format.json { render :show, status: :ok, location: @compania_seguro }\n else\n format.html { render :edit }\n format.json { render json: @compania_seguro.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3490ff4af115453bb52696d2741d5b66", "score": "0.5947294", "text": "def update\n respond_to do |format|\n if @compra_venta_especial.update(compra_venta_especial_params)\n format.html { redirect_to @compra_venta_especial, notice: 'Compra venta especial was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @compra_venta_especial.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "470369b7ff586fc5881b51a88bb20440", "score": "0.5945955", "text": "def update\n authorize! :update, CompetenceType\n @competence_type.update!(competence_type_params)\n render json: {status: :ok}\n end", "title": "" }, { "docid": "401906ed139d0fe0db1049449623a40b", "score": "0.59384155", "text": "def destroy\n @gerente_comercial = GerenteComercial.find(params[:id])\n @gerente_comercial.destroy\n\n respond_to do |format|\n format.html { redirect_to gerente_comercials_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2025243aa7304fcd76794f137206367f", "score": "0.5932713", "text": "def update\n #params[:os][:pagamentos_attributes].each do |pagamento|\n # currency_to_number pagamento[1][\"valor\"]\n #end\n\n params[:os][:itens_attributes].each do |item|\n currency_to_number item[1][\"desconto\"]\n currency_to_number item[1][\"acrescimo\"]\n end\n \n #params[:os][:pagamentos_attributes][\"0\"][:cliente_id] = params[:os][:cliente_id]\n \n @os = Os.find(params[:id])\n\n respond_to do |format|\n if @os.update_attributes(params[:os])\n format.html { redirect_to @os, notice: 'Ordem de Serviço atualizada com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @os.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d6ba9801d0bd610855addc7994509a53", "score": "0.59326893", "text": "def update\n respond_to do |format|\n if @informacioncomercialcliente.update(informacioncomercialcliente_params)\n format.html { redirect_to @informacioncomercialcliente, notice: 'Informacioncomercialcliente was successfully updated.' }\n format.json { render :show, status: :ok, location: @informacioncomercialcliente }\n else\n format.html { render :edit }\n format.json { render json: @informacioncomercialcliente.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "430842534fceef03677864775fa5f217", "score": "0.59311163", "text": "def update\n respond_to do |format|\n if @tipo_comida.update(tipo_comida_params)\n format.html { redirect_to @tipo_comida, notice: 'Tipo comida was successfully updated.' }\n format.json { render :show, status: :ok, location: @tipo_comida }\n else\n format.html { render :edit }\n format.json { render json: @tipo_comida.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ed093135e70231a48bfa3e5e7bf11017", "score": "0.5930039", "text": "def update\n @equipo_y_cuerpo_tecnico = EquipoYCuerpoTecnico.find(params[:id])\n @clubes = Club.all\n\n \n respond_to do |format|\n if @equipo_y_cuerpo_tecnico.update_attributes(params[:equipo_y_cuerpo_tecnico])\n format.html { redirect_to @equipo_y_cuerpo_tecnico, notice: 'Equipo y cuerpo tecnico fue modificado adecuadamente.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @equipo_y_cuerpo_tecnico.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cc2237a9f60a8558ac428c883b0d3d6c", "score": "0.5925383", "text": "def update\n respond_to do |format|\n if @com_compra.update(com_compra_params)\n format.html { redirect_to @com_compra, notice: 'Compra actualizado correctamente.' }\n format.json { render :show, status: :ok, location: @com_compra }\n else\n format.html { render :edit }\n format.json { render json: @com_compra.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "430945b2b82498b1bd0d4a9e0b26b5a7", "score": "0.5913535", "text": "def update\n @ventas_cliente = Ventas::Cliente.find(params[:id])\n\n respond_to do |format|\n if @ventas_cliente.update_attributes(params[:ventas_cliente])\n format.html { redirect_to @ventas_cliente, notice: 'Cliente was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @ventas_cliente.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "504bcbbf7653b1901ee5b3c2ddda2318", "score": "0.59059215", "text": "def update\n respond_to do |format|\n if @colegio.update(colegio_params)\n format.html { redirect_to @colegio, notice: 'Colegio was successfully updated.' }\n format.json { render :show, status: :ok, location: @colegio }\n else\n format.html { render :edit }\n format.json { render json: @colegio.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "504bcbbf7653b1901ee5b3c2ddda2318", "score": "0.59059215", "text": "def update\n respond_to do |format|\n if @colegio.update(colegio_params)\n format.html { redirect_to @colegio, notice: 'Colegio was successfully updated.' }\n format.json { render :show, status: :ok, location: @colegio }\n else\n format.html { render :edit }\n format.json { render json: @colegio.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "caf41179c4cbff0602c1a281c336832a", "score": "0.5904966", "text": "def update\n respond_to do |format|\n if @comarca.update(comarca_params)\n format.html { redirect_to @comarca, notice: 'Comarca foi atualizado(a) com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @comarca.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f6384e129b47f13f09fc03a1df86aa20", "score": "0.5902793", "text": "def update\n @commune = Commune.find(params[:id])\n\n respond_to do |format|\n if @commune.update_attributes(params[:commune])\n format.html { redirect_to @commune, notice: 'Commune was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @commune.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2432187b8706e0ca08d76d100df3b690", "score": "0.5901468", "text": "def update\n respond_to do |format|\n if @curso.update(curso_params)\n format.html { redirect_to descricao_path(id: @curso.id), notice: 'Curso atualizado com sucesso!' }\n format.json { render :show, status: :ok, location: cursos_path }\n else\n format.html { render :edit}\n format.json { render json: @curso.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9abf9f4c8e384eee5acffc93aed4a2ac", "score": "0.58977276", "text": "def update\n respond_to do |format|\n if @competencias_empresa.update(competencias_empresa_params)\n format.html { redirect_to @competencias_empresa, notice: 'Competencias empresa was successfully updated.' }\n format.json { render :show, status: :ok, location: @competencias_empresa }\n else\n format.html { render :edit }\n format.json { render json: @competencias_empresa.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1006ae544309c3e2bf5c1d006eb2768c", "score": "0.58976984", "text": "def update\n @comunity = Comunity.find(params[:id])\n\n respond_to do |format|\n if @comunity.update_attributes(params[:comunity])\n format.html { redirect_to(@comunity, :notice => 'Comunity was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @comunity.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8f3e19f0c6598a59b92476ae15785370", "score": "0.5895178", "text": "def update\n cliente_viejo = @cliente.dup\n respond_to do |format|\n if @cliente.update(cliente_params)\n Auditorium.GenerarAuditoria(\"Modifiacion de Cliente\", current_user.email, cliente_viejo, @cliente)\n format.html { redirect_to @cliente, notice: 'Cliente was successfully updated.' }\n format.json { render :show, status: :ok, location: @cliente }\n else\n format.html { render :edit }\n format.json { render json: @cliente.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b6a8c0c133c61ab479d7390ac40785d6", "score": "0.58926195", "text": "def update\n\n respond_to do |format|\n if @compet.update(compet_params)\n format.html { redirect_to compets_path(@compet, egresso_id: @compet.egresso_id), notice: 'Competência adicional atualizada com sucesso.' }\n format.json { render :show, status: :ok, location: compets_path }\n else\n format.html { render :edit }\n format.json { render json: @compet.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d92168c26c8efa46bb4c1b94d0973266", "score": "0.58834594", "text": "def update\n respond_to do |format|\n if @commitee.update(commitee_params)\n format.html { redirect_to @commitee, notice: 'Commitees was successfully updated.' }\n format.json { render :show, status: :ok, location: @commitee }\n else\n format.html { render :edit }\n format.json { render json: @commitee.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "339cecdb809c5f9e224092fc3299133c", "score": "0.58819115", "text": "def update\n respond_to do |format|\n if @newcomer.update(newcomer_params)\n format.html { redirect_to @newcomer, notice: 'Bixe foi atualizado com sucesso.' }\n format.json { render :show, status: :ok, location: @newcomer}\n else\n format.html { render :edit }\n format.json { render json: @newcomer.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e53d7d24662a57ee3c233f575648dc17", "score": "0.58796775", "text": "def update\n respond_to do |format|\n if @cambio_comite_registro.update(cambio_comite_registro_params)\n format.html { redirect_to @cambio_comite_registro, notice: 'Cambio comite registro was successfully updated.' }\n format.json { render :show, status: :ok, location: @cambio_comite_registro }\n else\n format.html { render :edit }\n format.json { render json: @cambio_comite_registro.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8728282391de2104b2c5376c99a4dcda", "score": "0.58763236", "text": "def update\n respond_to do |format|\n if @registro_cliente_servicio.update(registro_cliente_servicio_params)\n format.html { redirect_to @registro_cliente_servicio, notice: 'Cliente servicio was successfully updated.' }\n format.json { render :show, status: :ok, location: @registro_cliente_servicio }\n else\n format.html { render :edit }\n format.json { render json: @registro_cliente_servicio.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a5d287d72ba5f4e2910c4cb2ecdf63ea", "score": "0.58731914", "text": "def update\r\n respond_to do |format|\r\n if @sivic_curso.update(sivic_curso_params)\r\n format.html { redirect_to @sivic_curso, notice: 'Registro alterado com sucesso.' }\r\n format.json { head :no_content }\r\n else\r\n format.html { render action: 'edit' }\r\n format.json { render json: @sivic_curso.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "title": "" }, { "docid": "91c9633e53fc1ccf6d496965b3e3be4b", "score": "0.586644", "text": "def update\n @cli= @factura.cliente\n\n respond_to do |format|\n if @factura.update(factura_params)\n format.html { redirect_to cliente_path(@cli), notice: 'La factura fue actualizada exitosamente.' }\n format.json { render :show, status: :ok, location: @factura }\n else\n format.html { render :edit }\n format.json { render json: @factura.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cfa4fe6cddc70be535318355a1216613", "score": "0.58652437", "text": "def update\n respond_to do |format|\n if @comprobantecredito.update_attributes(params[:comprobantecredito])\n format.html { redirect_to([@cliente, @comprobantecredito], :notice => t('flash.actions.update.notice', :resource_name => comprobantecredito.model_name.human)) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @comprobantecredito.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3feb332e8b28c8f3ec06255d55146bb0", "score": "0.586493", "text": "def update\n respond_to do |format|\n if @proyecto.update(proyecto_params)\n\n cc = []\n if params[:proyecto][:caracteristicas]\n params[:proyecto][:caracteristicas].each do |key,value|\n cc.push(key)\n end\n end\n\n CaracteristicasProyecto.where(cod_proyecto: @proyecto.id).each do |caracteristica|\n x = CaracteristicasProyecto.find(caracteristica.id)\n estado = nil\n ccp = cc.select {|item|caracteristica.cod_caracteristica == item}\n \n if ccp.count > 0\n cc = cc.select {|item|caracteristica.cod_caracteristica != item}\n if caracteristica.estado == 'I'\n estado = 'A'\n end\n else\n estado = 'I'\n end\n if estado\n x.update(cod_proyecto:@proyecto.id, cod_caracteristica: caracteristica.cod_caracteristica, estado: estado, usu_crea: nil, fec_crea: nil)\n end\n end\n\n cc.each do |value|\n CaracteristicasProyecto.create(cod_proyecto:@proyecto.id, cod_caracteristica: value, estado: 'A', usu_crea: nil, fec_crea: nil)\n end\n\n format.html { redirect_to @proyecto, notice: 'Proyecto was successfully updated.' }\n format.json { render :show, status: :ok, location: @proyecto }\n else\n format.html { render :edit }\n format.json { render json: @proyecto.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "09b0944b82ac186818ef1731590eac46", "score": "0.5863835", "text": "def update\n @gerencia = Gerencia.find(params[:id])\n\n respond_to do |format|\n if @gerencia.update_attributes(params[:gerencia])\n format.html { redirect_to @gerencia, notice: 'Gerencia was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @gerencia.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1199911e0288c4bc1d958bcad8d02bb8", "score": "0.5863775", "text": "def update\n respond_to do |format|\n if @conteo.update(conteo_params)\n format.html { redirect_to @conteo, notice: 'Conteo was successfully updated.' }\n format.json { render :show, status: :ok, location: @conteo }\n else\n format.html { render :edit }\n format.json { render json: @conteo.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "46e2681e86ee8a88a26010cf49a1e7be", "score": "0.5858886", "text": "def comunity_params\n params.require(:comunity).permit(:rif, :cod_registro, :nombre, :direccion, :parish_id, :catastro, :sector)\n end", "title": "" }, { "docid": "6d086432fed94a0d606c08aa8916b459", "score": "0.5857742", "text": "def update\n @formation_of_competence = FormationOfCompetence.find(params[:id])\n\n respond_to do |format|\n if @formation_of_competence.update_attributes(params[:formation_of_competence])\n format.html { redirect_to @formation_of_competence, notice: 'Запись о формировании/требовании компетенции успешно обновлена' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @formation_of_competence.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1caef5dcc3f2a47497b45d689f4eb02a", "score": "0.58511657", "text": "def update\n @parceiros = Parceiro.all \n @novidades = Novidade.order('created_at').last(6) \n \n @contato = Contato.find(params[:id])\n\n respond_to do |format|\n if @contato.update_attributes(params[:contato])\n format.html { redirect_to @contato, notice: 'Contato atualizado com sucesso' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @contato.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "acbb649d18adeab70975befda895a4c8", "score": "0.58485097", "text": "def update\n respond_to do |format|\n if @solicitacao_exclusao.update(solicitacao_exclusao_params)\n format.html { redirect_to @solicitacao_exclusao, notice: 'Solicitacao exclusao was successfully updated.' }\n format.json { render :show, status: :ok, location: @solicitacao_exclusao }\n else\n format.html { render :edit }\n format.json { render json: @solicitacao_exclusao.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ad969e420aa13b0f8581fa9217095862", "score": "0.5845289", "text": "def update\n respond_to do |format|\n if @comunidad.update(comunidad_params)\n format.html { redirect_to @comunidad, notice: 'Comunidad was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @comunidad.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "278fd026893cd253421d7a645ec404fd", "score": "0.58430976", "text": "def update\n respond_to do |format|\n if @descuento_cliente.update(descuento_cliente_params)\n format.html { redirect_to @descuento_cliente, notice: 'Descuento cliente was successfully updated.' }\n format.json { render :show, status: :ok, location: @descuento_cliente }\n else\n format.html { render :edit }\n format.json { render json: @descuento_cliente.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8a03186ca0a70eb55cd2bc3d508ce65b", "score": "0.5842566", "text": "def update\r\n respond_to do |format|\r\n if @sivic_centrocusto.update(sivic_centrocusto_params)\r\n format.html { redirect_to @sivic_centrocusto, notice: 'Registro alterado com sucesso.' }\r\n format.json { head :no_content }\r\n else\r\n format.html { render action: 'edit' }\r\n format.json { render json: @sivic_centrocusto.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "title": "" }, { "docid": "73e14c1f14f5c0a2f7d225b4265537f9", "score": "0.5839017", "text": "def update\n respond_to do |format|\n if @ventas_cliente.update(ventas_cliente_params)\n format.html { redirect_to @ventas_cliente, notice: 'Cliente was successfully updated.' }\n format.json { render :show, status: :ok, location: @ventas_cliente }\n else\n format.html { render :edit }\n format.json { render json: @ventas_cliente.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7fa0140a1e2c9103685d461982fe6c01", "score": "0.5838854", "text": "def update\n respond_to do |format|\n if @comfort_interior.update(comfort_interior_params)\n format.html { redirect_to comfort_interiors_path, notice: 'Comfort interior was successfully updated.' }\n format.json { render :show, status: :ok, location: @comfort_interior }\n else\n format.html { render :edit }\n format.json { render json: @comfort_interior.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "08e1eee08b034371ba61f3462a3d4714", "score": "0.58381546", "text": "def update\n respond_to do |format|\n if @comentario.update(comentario_params)\n format.html { redirect_to @local, notice: 'Comentario fue editado.' }\n else\n format.html { render :edit }\n end\n format.json { respond_with_bip(@comentario) }\n end\n end", "title": "" }, { "docid": "13184f110e3d81ddc3bcf6a67c9d32b1", "score": "0.58380574", "text": "def create\n @composante = Composante.new(params[:composante])\n\n respond_to do |format|\n if @composante.save\n format.html { redirect_to @composante, notice: 'Composante was successfully created.' }\n format.json { render json: @composante, status: :created, location: @composante }\n else\n format.html { render action: \"new\" }\n format.json { render json: @composante.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f69bdd9a9a88e6705db438c1bc347967", "score": "0.5835871", "text": "def update\n @caso = Caso.find(params[:id])\n\n respond_to do |format|\n if @caso.update_attributes(params[:caso])\n format.html { redirect_to @caso, notice: 'Caso was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @caso.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "40ee8fc2e0b0fefbcb44ffa4fb719629", "score": "0.58351827", "text": "def set_comercio\n @comercio = Comercio.find(params[:id])\n end", "title": "" }, { "docid": "40ee8fc2e0b0fefbcb44ffa4fb719629", "score": "0.58351827", "text": "def set_comercio\n @comercio = Comercio.find(params[:id])\n end", "title": "" }, { "docid": "675fc17d7d82fc95a1262629f8b5ec0a", "score": "0.58320653", "text": "def update\n respond_to do |format|\n if @consorcio.update(consorcio_params)\n format.html { redirect_to @consorcio, notice: 'Consorcio was successfully updated.' }\n format.json { render :show, status: :ok, location: @consorcio }\n else\n format.html { render :show }\n format.json { render json: @consorcio.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "dc58b93fdfc10652d2d1b56df7404d10", "score": "0.58305013", "text": "def update\n respond_to do |format|\n if @comando.update(comando_params)\n format.html { redirect_to @comando, notice: 'Comando was successfully updated.' }\n format.json { render :show, status: :ok, location: @comando }\n else\n format.html { render :edit }\n format.json { render json: @comando.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c21a91abbeb8436e1c7ac1cfd612e372", "score": "0.5828598", "text": "def update\n @folha_competencia = Folha::Competencia.find(params[:id])\n\n respond_to do |format|\n if @folha_competencia.update_attributes(params[:folha_competencia])\n format.html { redirect_to(@folha_competencia, :notice => 'Competencia atualizado com sucesso.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @folha_competencia.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "258eb0b6718732f803435542c9cc119d", "score": "0.5826603", "text": "def update\n @commission = Commission.find(params[:id])\n\n respond_to do |format|\n if @commission.update_attributes(params[:commission])\n format.html { redirect_to @commission, notice: 'Commission was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @commission.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ef1b4ce8c2c4209a0d44309cddd18787", "score": "0.58265823", "text": "def update\n respond_to do |format|\n if @detalle_curso.update(detalle_curso_params)\n format.html { redirect_to @detalle_curso, notice: 'Detalle curso was successfully updated.' }\n format.json { render :show, status: :ok, location: @detalle_curso }\n else\n format.html { render :edit }\n format.json { render json: @detalle_curso.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bfdc2b0a67e98985013d8cfc2881f8cc", "score": "0.5824638", "text": "def update\n @empresa = Empresa.find(params[:empresa_id])\n @consulta_cliente = @empresa.consulta_clientes.find(params[:id]) \n respond_to do |format|\n if @consulta_cliente.update(consulta_cliente_params)\n format.html { redirect_to empresa_consulta_clientes_path, notice: 'Noticium was successfully updated.' }\n format.json { render :show, status: :ok, location: @consulta_cliente }\n else\n format.html { render :edit }\n format.json { render json: @consulta_cliente.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4582e89cd16f3d40b19d64a845dafc3f", "score": "0.5822801", "text": "def ajoutProduitCageot\n\t\t#2 VARIABLES EN POST => params[:produit_vente_libre][:id] / params[:produit_vente_libre][:nombre_pack]\n\t\t#_________________\n\t\t#________________ SI CLIENT PAS CONNECTED _____________________\n\t\t#__________________\n\t\tflash[:notice]= \"\"\n\t\tif current_client.nil?\n\t\t\t#_____ SI ABONNEMENT CHOISI/ EXIST _______\n\t\t\t#_____\n\t\t\t@abonnement_exist = Abonnement.where(\"etat = 'en_cours' AND session_id = ?\", session[:abonnement_id])\n\t\t\tif @abonnement_exist.count > 0\n\t\t\t\t@abonnement = Abonnement.find(@abonnement_exist[0].id)\n\t\t\t\t@abonnement.etat = \"annule\"\n\t\t\t\t@abonnement.save\n\t\t\t\tflash[:notice] = \"Abonnement existant et supprimer. \"\n\t\t\tend\n\t\t\t\n\t\t\t@cageot = Cageot.where(\"etat='en_cours' AND session_id = ?\", session[:cageot_id])\n\t\t\t\t#________ SI CAGEOT EXISTE ________________\n\t\t\t\tif @cageot.count >0\n\t\t\t\t\t@produit_to_add = RelCageotProduit.where(\"cageot_id = ? AND produit_vente_libre_id = ?\",@cageot[0].id, params[:produit_vente_libre][:id])\n\t\t\t\t\t#________ SI PRODUIT EXISTE DEJA DANS LE CAGEOT _________\n\t\t\t\t\tif @produit_to_add.count > 0\n\t\t\t\t\t\t@produit = RelCageotProduit.find(@produit_to_add[0].id)\n\t\t\t\t\t\t@produit.nombre_pack += params[:produit_vente_libre][:nombre_pack].to_i\n\t\t\t\t\t\tif @produit.save\n\t\t\t\t\t\t\tflash[:notice] += \"Produit update\"\n\t\t\t\t\t\t\t@status_ajout = \"update\"\n\t\t\t\t\t\t respond_to do |format|\n\t\t\t\t\t\t \t\tformat.json { render :json => {:cageot => @cageot[0],:produit => @produit, :url_image => @produit.produit_vente_libre.stock.default_image, :message => flash[:notice], :statut => @status_ajout, :total => @cageot[0].total} }\n\t\t\t\t\t\t \t\tformat.html { \n\t\t\t\t\t\t\t\t\tredirect_to cageot_path(@cageot[0]) \n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t \tend\n\t\t\t\t\t\tend\n\t\t\t\t\telse\n\t\t\t\t\t\tif !params[:produit_vente_libre][:id].nil?\n\t\t\t\t\t\t\t@rel_cageot_produit = RelCageotProduit.new\n\t\t\t\t\t\t\t@rel_cageot_produit.cageot_id = @cageot[0].id\n\t\t\t\t\t\t\t@rel_cageot_produit.produit_vente_libre_id = params[:produit_vente_libre][:id]\n\t\t\t\t\t\t\t@rel_cageot_produit.nombre_pack = params[:produit_vente_libre][:nombre_pack]\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tif @rel_cageot_produit.save\n\t\t\t\t\t\t\t\tflash[:notice] += \"Produit ajouter\"\n\t\t\t\t\t\t\t\t@status_ajout = \"add\"\n\t\t\t\t\t\t\t respond_to do |format|\n\t\t\t\t\t\t\t \t\tformat.json { render :json => {:cageot => @cageot[0],:produit => @rel_cageot_produit,:url_image => @rel_cageot_produit.produit_vente_libre.stock.default_image, :message => flash[:notice], :statut => @status_ajout, :total => @cageot[0].total} }\n\t\t\t\t\t\t\t \t\tformat.html { \n\t\t\t\t\t\t\t\t\t\tredirect_to cageot_path(@cageot[0]) \n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t \tend\n\t\t\t\t\t\t\tend\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\t\t\t\t#________ SI CAGEOT N'EXISTE PAS __________\n\t\t\t\telse\n\t\t\t\t\tsession[:cageot_id] = \"#{DateTime.now.to_i}\"+(\"#{(1..100).to_a.shuffle.join}#{('a'..'z').to_a.shuffle.join}\").split('').shuffle.join #__ GENERATION ID POUR PANIER __\n\t\t\t\t\t@new_cageot = Cageot.new({:session_id => session[:cageot_id],:etat => 'en_cours'})\n\t\t\t\t\tif @new_cageot.save\n\t\t\t\t\t\t#__ SI ID PRODUIT ___\n\t\t\t\t\t\tif !params[:produit_vente_libre][:id].nil?\n\t\t\t\t\t\t\t@rel_cageot_produit = RelCageotProduit.new\n\t\t\t\t\t\t\t@rel_cageot_produit.cageot_id = @new_cageot.id\n\t\t\t\t\t\t\t@rel_cageot_produit.produit_vente_libre_id = params[:produit_vente_libre][:id]\n\t\t\t\t\t\t\t@rel_cageot_produit.nombre_pack = params[:produit_vente_libre][:nombre_pack]\n\t\t\t\t\t\t\tif @rel_cageot_produit.save\n\t\t\t\t\t\t\t\tflash[:notice] += \"Produit ajoute et panier creer (info)\"\n\t\t\t\t\t\t\t\t@status_ajout = \"add\"\n\t\t\t\t\t\t\t\trespond_to do |format|\n\t\t\t\t\t\t\t \t\tformat.json { render :json => {:cageot => @new_cageot,:produit => @rel_cageot_produit, :url_image => @rel_cageot_produit.produit_vente_libre.stock.default_image, :message => flash[:notice], :statut => @status_ajout, :total => @new_cageot.total} }\n\t\t\t\t\t\t\t \t\tformat.html { \n\t\t\t\t\t\t\t\t\t\tredirect_to cageot_path(@new_cageot) \n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t \tend\n\t\t\t\t\t\t\tend\n\t\t\t\t\t\tend\n\t\t\t\t\telse\n\t\t\t\t\t\tflash[:notice] = 'ERREUR'\n\t\t\t\t\tend\n\t\t\t\t\n\t\t\t\tend\n\t\t#_________________\n\t\t#____________________ SI CLIENT CONNECTED _________________________________________________________\n\t\t#_________________\n\t\telse\n\t\t\t#_____ SI ABONNEMENT CHOISI _______\n\t\t\t#_____\n\t\t\t@abonnement_exist = Abonnement.where(\"etat = 'en_cours' AND client_id = ?\", current_client.id)\n\t\t\tif @abonnement_exist.count > 0\n\t\t\t\t@abonnement = Abonnement.find(@abonnement_exist[0].id)\n\t\t\t\t@abonnement.etat = \"annule\"\n\t\t\t\t@abonnement.save\n\t\t\t\tflash[:notice] = \"Abonnement existant et supprimer. \"\n\t\t\tend\n\t\t\t\n\t\t\t@cageot = Cageot.where(\"etat='en_cours' AND client_id = ?\", current_client.id) #SI CAGEOT EN COURS\n\t\t\t\n\t\t\t#________ SI CAGEOT EXISTE ________________\n\t\t\tif @cageot.count >0\n\t\t\t\t@produit_to_add = RelCageotProduit.where(\"cageot_id = ? AND produit_vente_libre_id = ?\",@cageot[0].id, params[:produit_vente_libre][:id])\n\t\t\t\t#________ SI PRODUIT EXISTE DEJA DANS LE CAGEOT _________\n\t\t\t\tif @produit_to_add.count > 0\n\t\t\t\t\t@produit = RelCageotProduit.find(@produit_to_add[0].id)\n\t\t\t\t\t@produit.nombre_pack += params[:produit_vente_libre][:nombre_pack].to_i\n\t\t\t\t\tif @produit.save\n\t\t\t\t\t\tflash[:notice] = \"Produit updater\"\n\t\t\t\t\t\t@status_ajout = \"update\"\n\t\t\t\t\t\trespond_to do |format|\n\t\t\t\t\t \t\tformat.json { render :json => {:cageot => @cageot[0],:produit => @produit, :url_image => @produit.produit_vente_libre.stock.default_image, :message => flash[:notice], :statut => @status_ajout, :total => @cageot[0].total} }\n\t\t\t\t\t \t\tformat.html { \n\t\t\t\t\t\t\t\tredirect_to cageot_path(@cageot[0]) \n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\t\t\t\telse\n\t\t\t\t\t@rel_cageot_produit = RelCageotProduit.new\n\t\t\t\t\t@rel_cageot_produit.cageot_id = @cageot[0].id\n\t\t\t\t\t@rel_cageot_produit.produit_vente_libre_id = params[:produit_vente_libre][:id]\n\t\t\t\t\t@rel_cageot_produit.nombre_pack = params[:produit_vente_libre][:nombre_pack].to_i\n\t\t\t\t\tif @rel_cageot_produit.save\n\t\t\t\t\t\tflash[:notice] = \"Produit ajouter\"\n\t\t\t\t\t\t@status_ajout = \"add\"\n\t\t\t\t\t\trespond_to do |format|\n\t\t\t\t\t \t\tformat.json { render :json => {:cageot => @cageot[0],:produit => @rel_cageot_produit, :url_image => @rel_cageot_produit.produit_vente_libre.stock.default_image, :message => flash[:notice], :statut => @status_ajout, :total => @cageot[0].total} }\n\t\t\t\t\t \t\tformat.html { \n\t\t\t\t\t\t\t\tredirect_to cageot_path(@cageot[0]) \n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\t#________ SI CAGEOT N'EXISTE PAS __________\n\t\t\telse\n\t\t\t\t@new_cageot = Cageot.new({:client_id => current_client.id,:etat => 'en_cours'})\n\t\t\t\tif @new_cageot.save\n\t\t\t\t\t@rel_cageot_produit = RelCageotProduit.new\n\t\t\t\t\t@rel_cageot_produit.cageot_id = @new_cageot.id\n\t\t\t\t\t@rel_cageot_produit.produit_vente_libre_id = params[:produit_vente_libre][:id]\n\t\t\t\t\t@rel_cageot_produit.nombre_pack = params[:produit_vente_libre][:nombre_pack].to_i\n\t\t\t\t\tif @rel_cageot_produit.save\n\t\t\t\t\t\t\t\tflash[:notice] = \"Produit ajoute et panier creer (info)\"\n\t\t\t\t\t\t\t\t@status_ajout = \"add\"\n\t\t\t\t\t\t\t\trespond_to do |format|\n\t\t\t\t\t\t\t \t\tformat.json { render :json => {:cageot => @cageot[0],:produit => @rel_cageot_produit, :url_image => @rel_cageot_produit.produit_vente_libre.stock.default_image, :message => flash[:notice], :statut => @status_ajout, :total => @cageot[0].total} }\n\t\t\t\t\t\t\t \t\tformat.html { \n\t\t\t\t\t\t\t\t\t\tredirect_to cageot_path(@new_cageot) \n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\tend\n\t\t\t\telse\n\t\t\t\t\tflash[:notice] = 'ERREUR'\n\t\t\t\tend\n\t\t\tend\n\t\t\t\t\t\t\n\t\tend\n\tend", "title": "" }, { "docid": "4bb4e2622d035138139c67578b3ea121", "score": "0.581755", "text": "def update\n #raise 'An error has occured' \n respond_to do |format|\n @compuesto.nombre_producto = @compuesto.nombre_producto.strip.downcase\n \n basicos = Array.new\n if !params[:compuesto][:basico].nil?\n params[:compuesto][:basico].each do | basico |\n basicos.push(:id => basico['id'], :cantidad => basico['cantidad'])\n end\n end\n\n i = 0\n @compuesto.basico = Array.new\n @compuesto.composicion = Array.new\n\n basicos.each do | basico |\n basico_nuevo = Basico.find(basico[:id])\n @compuesto.basico.push basico_nuevo\n @compuesto.composicion[i].cantidad = basico[:cantidad]\n i = i + 1\n end\n\n parametros = compuesto_params\n parametros[:nombre_producto] = parametros[:nombre_producto].strip.downcase\n\n if @compuesto.update(parametros)\n format.html { redirect_to edit_compuesto_path(@compuesto), notice: 'Producto actualizado correctamente !' }\n format.json { render :show, status: :ok, location: @compuesto }\n else\n format.html { render :edit }\n format.json { render json: @compuesto.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d4e3aab4e9c3313b964ad298eb00e43d", "score": "0.58114314", "text": "def update\n @company = Company.find(1)\n @empleados = @company.get_employees()\n @divisions = @company.get_divisions()\n @unidads = @company.get_unidads()\n\n respond_to do |format|\n if @requerimiento.update(requerimiento_params)\n format.html { redirect_to @requerimiento, notice: 'Requerimiento was successfully updated.' }\n format.json { render :show, status: :ok, location: @requerimiento }\n else\n format.html { render :edit }\n format.json { render json: @requerimiento.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1c35f89f4e93251128bbf53c08021b3d", "score": "0.5811161", "text": "def update\n @company_id = company_params[:company_id]\n @reponse = HTTParty.put(\"https://rails-api-ipo.herokuapp.com/api/v1/companies/#{@company_id}.json\",\n :body => {:company_name => company_params[:company_name]}.to_json,\n :headers => { 'Content-Type' => 'application/json' } )\n respond_to do |format|\n format.html { redirect_to '/companies/'+(@reponse['id'].to_s), notice: 'Company was successfully created.' }\n end\n end", "title": "" }, { "docid": "b1153a711f474b4ceddaf921deaa87d4", "score": "0.58094734", "text": "def update\n respond_to do |format|\n if @dependiente.update(dependiente_params)\n format.html { redirect_to @dependiente, notice: 'Dependiente was successfully updated.' }\n format.json { render :show, status: :ok, location: @dependiente }\n else\n format.html { render :edit }\n format.json { render json: @dependiente.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "91bc97a6799ae9deb5fb31d2e1bacd31", "score": "0.5808356", "text": "def update\n respond_to do |format|\n if @com.update(com_params)\n format.html { redirect_to @com, notice: '編集しました' }\n format.json { render :show, status: :ok, location: @com }\n else\n format.html { render :edit }\n format.json { render json: @com.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e01036e4cfe953d9b0b40f87b89379c9", "score": "0.58073795", "text": "def update\n respond_to do |format|\n if @objeto.update(campo_params)\n set_redireccion\n format.html { redirect_to @redireccion, notice: 'Campo was successfully updated.' }\n format.json { render :show, status: :ok, location: @objeto }\n else\n format.html { render :edit }\n format.json { render json: @objeto.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5b704c0ec811a1ce1d9b1082e1b18643", "score": "0.5804055", "text": "def update\n respond_to do |format|\n if @cliente_juridico.update(cliente_juridico_params)\n format.html { redirect_to @cliente_juridico, notice: 'Cliente juridico was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @cliente_juridico.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "32c716155b8fbdbceb700eac67b9a31e", "score": "0.58035105", "text": "def update\n @comentarios_estrategium = ComentariosEstrategium.find(params[:id])\n\n respond_to do |format|\n if @comentarios_estrategium.update_attributes(params[:comentarios_estrategium])\n format.html { redirect_to @comentarios_estrategium, notice: 'Comentarios estrategium was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @comentarios_estrategium.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "daa9aedf1d99c558c2f439c07a332481", "score": "0.5802697", "text": "def update\n respond_to do |format|\n if @cursos_complementare.update(cursos_complementare_params)\n format.html { redirect_to @cursos_complementare, notice: 'Cursos complementare was successfully updated.' }\n format.json { render :show, status: :ok, location: @cursos_complementare }\n else\n format.html { render :edit }\n format.json { render json: @cursos_complementare.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3f1678bb8132922719f580cb786022fd", "score": "0.5801422", "text": "def update\n respond_to do |format|\n if @cliente.update(cliente_params)\n format.html { redirect_to @cliente, notice: 'Cliente atualizado com sucesso.' }\n format.json { render :show, status: :ok, location: @cliente }\n else\n format.html { render :edit }\n format.json { render json: @cliente.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3f1678bb8132922719f580cb786022fd", "score": "0.5801422", "text": "def update\n respond_to do |format|\n if @cliente.update(cliente_params)\n format.html { redirect_to @cliente, notice: 'Cliente atualizado com sucesso.' }\n format.json { render :show, status: :ok, location: @cliente }\n else\n format.html { render :edit }\n format.json { render json: @cliente.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "14ea03fadd8b8d4baf54f4dd301e0197", "score": "0.5801299", "text": "def update\n respond_to do |format|\n if @centro_de_custo.update(centro_de_custo_params)\n addlog(\"Atualizou um centro de custo\")\n format.html { redirect_to @centro_de_custo, notice: 'Centro de custo foi atualizado com sucesso.' }\n format.json { render :show, status: :ok, location: @centro_de_custo }\n else\n format.html { render :edit }\n format.json { render json: @centro_de_custo.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1790eff983a8388c7e17c072aa9972e7", "score": "0.58000195", "text": "def update\n @centro_de_custo = CentroDeCusto.find(params[:id])\n\n respond_to do |format|\n if @centro_de_custo.update_attributes(params[:centro_de_custo])\n format.html { redirect_to @centro_de_custo, notice: 'Centro de custo foi atualizado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @centro_de_custo.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e8a6c93a6241916aa6d85d5ed35fa51f", "score": "0.5799489", "text": "def update\n respond_to do |format|\n \n if @consultant.update(consultant_params)\n \n @consultant.companies_consultants.each do |companies_consultants|\n companies_consultants.destroy\n end\n\n @consultant.companies_consultants.clear\n \n @consultant.companies.each do |company|\n companies_consultants = CompaniesConsultant.create(:company => company, :consultant => @consultant)\n @consultant.companies_consultants << companies_consultants unless @consultant.companies_consultants.include?(companies_consultants) \n end\n\n format.html { redirect_to @consultant, notice: 'Consultor atualizado com sucesso.' }\n format.json { render :show, status: :ok, location: @consultant }\n else\n format.html { render :edit }\n format.json { render json: @consultant.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "de55411bdac1d71c05fafacff75a4f77", "score": "0.5798194", "text": "def update\n respond_to do |format|\n if @consultorio.update(consultorio_params)\n format.html { redirect_to @consultorio, notice: 'Consultorio was successfully updated.' }\n format.json { render :show, status: :ok, location: @consultorio }\n else\n format.html { render :edit }\n format.json { render json: @consultorio.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "884f0a0fbbd847cf98ef8e89c88209f8", "score": "0.5797997", "text": "def update\n respond_to do |format|\n if @envio_correo.update(envio_correo_params)\n format.html { redirect_to @envio_correo, notice: 'Envio correo was successfully updated.' }\n format.json { render :show, status: :ok, location: @envio_correo }\n else\n format.html { render :edit }\n format.json { render json: @envio_correo.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "dd3ccbee2d970f4bff971f6296321924", "score": "0.5796907", "text": "def create\n @inscricao_servidor = InscricaoServidor.new(inscricao_servidor_params)\n respond_to do |format|\n if @inscricao_servidor.save\n id_crypto = Digest::MD5.hexdigest(@inscricao_servidor.id.to_s)\n slug = \"#{id_crypto}_\" + remover_acentos(@inscricao_servidor.nome_completo)\n slug = slug.strip\n nome_completo = @inscricao_servidor.nome_completo.strip\n InscricaoServidor.find(@inscricao_servidor.id).update_attributes(nome_completo: nome_completo, slug: slug)\n #format.html { redirect_to selecionar_vagas_inscricao_servidors_path(inscricao_servidor_id: slug, notice: 'Cadastro realizado com sucesso. Agora você pode adicionar os cargos através do botão <b>Adicionar cargos</b> ou voltar para tela de cadastro através do botão <b>Voltar para alterar Inscrição</b>.') }\n format.html { redirect_to edit_inscricao_servidor_path(slug) }\n format.json { render :show, status: :created, location: @inscricao_servidor }\n else\n format.html { render :new }\n format.json { render json: @inscricao_servidor.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6e84d6f025911c8206c4e48d4d3fc5b5", "score": "0.57904077", "text": "def update\n @director_comercial = DirectorComercial.find(params[:id])\n\n respond_to do |format|\n if @director_comercial.update_attributes(params[:director_comercial])\n format.html { redirect_to @director_comercial, notice: 'Director comercial was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @director_comercial.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "44ebc050c47135bba64f018806b624b0", "score": "0.5788776", "text": "def update\n respond_to do |format|\n if @centro_atencion.update(centro_atencion_params)\n format.html { redirect_to @centro_atencion, notice: 'Centro atencion was successfully updated.' }\n format.json { render :show, status: :ok, location: @centro_atencion }\n else\n format.html { render :edit }\n format.json { render json: @centro_atencion.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "44ebc050c47135bba64f018806b624b0", "score": "0.5788776", "text": "def update\n respond_to do |format|\n if @centro_atencion.update(centro_atencion_params)\n format.html { redirect_to @centro_atencion, notice: 'Centro atencion was successfully updated.' }\n format.json { render :show, status: :ok, location: @centro_atencion }\n else\n format.html { render :edit }\n format.json { render json: @centro_atencion.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "91132b4d82a7f93f46d59cd054188fca", "score": "0.5787181", "text": "def update\n @cliente = Cliente.find(params[:id])\n\n respond_to do |format|\n if @cliente.update_attributes(params[:cliente])\n format.html { redirect_to @cliente, :notice => 'Cliente atualizado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @cliente.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9d30875c31720967cebafda6016dd831", "score": "0.5780406", "text": "def update\n respond_to do |format|\n if @proveedor_servicio.update(proveedor_servicio_params)\n format.html { redirect_to @proveedor_servicio, notice: 'Proveedor servicio was successfully updated.' }\n format.json { render :show, status: :ok, location: @proveedor_servicio }\n else\n format.html { render :edit }\n format.json { render json: @proveedor_servicio.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a804d99e32d26f6e5614ec531d2b30c4", "score": "0.57797366", "text": "def update\n respond_to do |format|\n if @cotizacion.update(cotizacion_params)\n format.html { redirect_to cliente_cotizacions_path(@cliente), notice: 'Cotizacion was successfully updated.' }\n format.json { render :show, status: :ok, location: @cotizacion }\n else\n format.html { render :edit }\n format.json { render json: @cotizacion.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2490c60245149a22198b7d5eb5f4e1c8", "score": "0.5777306", "text": "def update\n @agente_cargo = AgenteCargo.find(params[:id])\n\n respond_to do |format|\n if @agente_cargo.update_attributes(params[:agente_cargo])\n format.html { redirect_to @agente_cargo, notice: 'Agente cargo was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @agente_cargo.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
422c1c29ef0e2334dea04943c91373fa
GET /construction_types/1 GET /construction_types/1.json
[ { "docid": "1067c87947eb0967f9eebe937c33b496", "score": "0.7865331", "text": "def show\n @construction_type = ConstructionType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @construction_type }\n end\n end", "title": "" } ]
[ { "docid": "de2a592797a4792e1d1f46cc38bdf7e5", "score": "0.7531842", "text": "def new\n @construction_type = ConstructionType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @construction_type }\n end\n end", "title": "" }, { "docid": "56ec39ff99b0c4d5eee4ec90f18d2d24", "score": "0.7184676", "text": "def create\n @construction_type = ConstructionType.new(params[:construction_type])\n\n respond_to do |format|\n if @construction_type.save\n format.html { redirect_to @construction_type, notice: 'Construction type was successfully created.' }\n format.json { render json: @construction_type, status: :created, location: @construction_type }\n else\n format.html { render action: \"new\" }\n format.json { render json: @construction_type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cd89d6133916ee43bf16c394bab86622", "score": "0.65676653", "text": "def destroy\n @construction_type = ConstructionType.find(params[:id])\n @construction_type.destroy\n\n respond_to do |format|\n format.html { redirect_to construction_types_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "edb45b2d47244ec41fc107b36a036169", "score": "0.6537864", "text": "def index\n @constructions = Construction.all\n end", "title": "" }, { "docid": "5e44e9fe9370cb1e8b5c287cd43fde64", "score": "0.6362187", "text": "def index\n @publication_types = PublicationType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @publication_types }\n end\n end", "title": "" }, { "docid": "10e0f3bf97d9d1a9f150a2d6d807637e", "score": "0.6256199", "text": "def show\n #@publication_type = PublicationType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @publication_type }\n end\n end", "title": "" }, { "docid": "80b712cae56f29398b8eb8096127c3f4", "score": "0.62468666", "text": "def show\n @medium_construction = MediumConstruction.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @medium_construction }\n end\n end", "title": "" }, { "docid": "b7f010eda11d547844ff32e38c19d4a3", "score": "0.6243568", "text": "def create\n @construction = Construction.new(construction_params)\n\n respond_to do |format|\n if @construction.save\n format.html { redirect_to @construction, notice: 'Construction was successfully created.' }\n format.json { render :show, status: :created, location: @construction }\n else\n format.html { render :new }\n format.json { render json: @construction.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e8127f12d58dcba435773d09ae408502", "score": "0.62187123", "text": "def show\n respond_to do |format|\n format.html {}\n format.json { render :json => @competition_type }\n end\n end", "title": "" }, { "docid": "e7c9a64121dcf7414345120a84319ab6", "score": "0.6202772", "text": "def index\n @constructions = current_user.company.constructions.where(is_active: true)\n \n respond_to do |format|\n format.json { render json: @constructions.map { |c| c.as_json.merge({cover_image_key: (c.image.key rescue nil), last_change: time_ago_in_words(c.updated_at),\n spreadsheet_count: c.spreadsheets.count, cable_count: c.cables_count, elongation_count: c.elongations_count, project_count: c.projects.count}) }, status: 200 }\n format.html\n end\n end", "title": "" }, { "docid": "a954200f4fe873b79ae3627d0db40320", "score": "0.620001", "text": "def show\n @community_type = CommunityType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @community_type }\n end\n end", "title": "" }, { "docid": "d80532c1bb885021213218d7c1bec562", "score": "0.61910665", "text": "def show\n @constructed = Constructed.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @constructed }\n end\n end", "title": "" }, { "docid": "8d1735620c44145184d1ae4c71cdfda9", "score": "0.6189295", "text": "def show\n @construct_one = ConstructOne.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @construct_one }\n end\n end", "title": "" }, { "docid": "b6436acbc990d7930795581f92bfa523", "score": "0.61856675", "text": "def get_complaint_types\n\t\tcomplaint_types = ComplaintType.where(\"university_id = ?\",params[:university_id])\n\t\trender :json => [\n\t\t\t:complaint_types => complaint_types.map { |c| c.as_json(:only => [:id,:name])},\n\t\t\t:university_id => params[:university_id]\n\t\t\t].to_json\n\tend", "title": "" }, { "docid": "e65449c1135ddc6166ea325675022f29", "score": "0.6170534", "text": "def show\n @build = build_type.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @build }\n end\n end", "title": "" }, { "docid": "d83c08f38d3e155a8797fdcb78c561cb", "score": "0.61551315", "text": "def types\n if !@api_key.nil? and @api_key.api_type == \"muni\"\n params[:c] = \"forager\"\n end\n\n if params[:c].blank?\n cat_mask = array_to_mask([\"forager\",\"freegan\"],Type::Categories)\n else\n cat_mask = array_to_mask(params[:c].split(/,/),Type::Categories)\n end\n\n cfilter = \"(category_mask & #{cat_mask})>0 AND NOT pending\"\n\n @types = Type\n .where(cfilter)\n .collect { |t| { :name => t.full_name, :id => t.id } }\n .sort{ |x, y| x[:name] <=> y[:name] }\n\n log_api_request(\"api/locations/types\", @types.length)\n\n respond_to do |format|\n format.json { render json: @types }\n end\n end", "title": "" }, { "docid": "b25627406f432237b99c39b626f7dc02", "score": "0.61520815", "text": "def types\n get(\"/project/types\")[\"types\"]\n end", "title": "" }, { "docid": "83c15bd0726921cdf7a47e438fbbff2a", "score": "0.61462533", "text": "def show\n @complaint_type = ComplaintType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @complaint_type }\n end\n end", "title": "" }, { "docid": "d652150211eeea4c2bff805c36dfedbd", "score": "0.61459136", "text": "def show\n @coretype = Coretype.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @coretype }\n end\n end", "title": "" }, { "docid": "e10d010669b77410c3c8c31bbda47a32", "score": "0.6123813", "text": "def show\n @project_type = ProjectType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @project_type }\n end\n end", "title": "" }, { "docid": "d2c2b71e10983f3c2784720a78c4c820", "score": "0.6108623", "text": "def new\n #@publication_type = PublicationType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @publication_type }\n end\n end", "title": "" }, { "docid": "08a6bf2c68ba6d6e2fdec98de355a6c9", "score": "0.6086151", "text": "def index\n @type_contractions = TypeContraction.all\n end", "title": "" }, { "docid": "5b2536aa74cdbcc585e9f8fba40b5120", "score": "0.6076905", "text": "def show\n @course_type = CourseType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @course_type }\n end\n end", "title": "" }, { "docid": "f79508f06c2884aee08fa0e206a89841", "score": "0.6053487", "text": "def new\n @medium_construction = MediumConstruction.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @medium_construction }\n end\n end", "title": "" }, { "docid": "5d264faacfd3f99f7de4906e227e2f76", "score": "0.60526735", "text": "def index\n @institution_types = InstitutionType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @institution_types }\n end\n end", "title": "" }, { "docid": "b14b2c913edadeca6df4d7de52c5d09e", "score": "0.6042072", "text": "def new\n @construct_one = ConstructOne.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @construct_one }\n end\n end", "title": "" }, { "docid": "bf6c986947d1d080b7d3f4addb641337", "score": "0.60357845", "text": "def show\n @projecttype = Projecttype.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @projecttype }\n end\n end", "title": "" }, { "docid": "0dd66f58a15f9ac835b7a28168cd7863", "score": "0.6033269", "text": "def index\n @type_conges = TypeConge.all\n end", "title": "" }, { "docid": "bf049b10fcc76a1a16f807dd419545b5", "score": "0.6031913", "text": "def show\n @construction = Construction.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @construction }\n end\n end", "title": "" }, { "docid": "9f565e14c6f5a711bad73999f4fed31b", "score": "0.60285795", "text": "def show\n @institution_type = InstitutionType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @institution_type }\n end\n end", "title": "" }, { "docid": "55f3c48ab45df17bfb11590f214b0091", "score": "0.6022661", "text": "def index\n if current_user.subordinate?\n params[:mode] = params[:search][:mode] if !params[:search].nil?\n if params[:mode] == 'own'\n @constructions = current_user.construction_administrations.search(params[:search]).page(params[:page])\n @mode = :own\n else\n @constructions = current_user.constructions.search(params[:search]).page(params[:page])\n @mode = :sub\n end\n else\n @constructions = instance_eval(\"Construction.search(params[:search]).page(params[:page]).#{sanitize_status}\")\n @mode = :all\n end\n respond_to do |format|\n format.html {@constructions}\n format.js {@constructions}\n end\n end", "title": "" }, { "docid": "a115aa316a8f36b250914536ab989919", "score": "0.60140806", "text": "def index\n @publication_types = PublicationType.all\n end", "title": "" }, { "docid": "30e4c0b46e73b115ef3e5085eea4a583", "score": "0.59894997", "text": "def new\n @institution_type = InstitutionType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @institution_type }\n end\n end", "title": "" }, { "docid": "2c231f19525dca4fd78aeb656389957b", "score": "0.59856814", "text": "def new\n @coretype = Coretype.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @coretype }\n end\n end", "title": "" }, { "docid": "341982657361bebf9d59165f89b68eb1", "score": "0.5977493", "text": "def getResourcesType\n type = [Announcement, Discussion, DiscussionSolution, Exam, ExamSolution, Homework, HomeworkSolution, LectureNotes, OnlineResource, Other]\n dic = {:type => type}\n respond_to do |format|\n format.json {render json: dic}\n end\n end", "title": "" }, { "docid": "3decc909f2a8043b111c08dd3376fe04", "score": "0.59744877", "text": "def index\n @course_types = CourseType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @course_types } \n end\n end", "title": "" }, { "docid": "ab18b15ac7363aa0371fd4d64e51a5ba", "score": "0.59625167", "text": "def show\n @mostsmallconstructioninfo = Mostsmallconstructioninfo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @mostsmallconstructioninfo }\n end\n end", "title": "" }, { "docid": "6c41561bbd1277323332c194d5fe3551", "score": "0.5962495", "text": "def update\n @construction_type = ConstructionType.find(params[:id])\n\n respond_to do |format|\n if @construction_type.update_attributes(params[:construction_type])\n format.html { redirect_to @construction_type, notice: 'Construction type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @construction_type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3fa959c7c110ed3e18c9f9349e6d0f05", "score": "0.595389", "text": "def show\n @scout_type = ScoutType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @scout_type }\n end\n end", "title": "" }, { "docid": "a01c78e6a366a7ca69fb9633e6b3f6dd", "score": "0.5947459", "text": "def new\n @course = Course.new\n @course_types = CourseType.all.map {|c| [c.name.capitalize, c.id]}\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @course }\n end\n end", "title": "" }, { "docid": "73826798ca549b6107b56faee359c179", "score": "0.59321666", "text": "def new\n @construction = Construction.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @construction }\n end\n end", "title": "" }, { "docid": "deaa80320263c32c761b56b3c0433b0c", "score": "0.59304994", "text": "def show\n @effect_construction_effect = Effect::ConstructionEffect.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @effect_construction_effect }\n end\n end", "title": "" }, { "docid": "1f0362fab40d8b6e8fc0c0c0915e1199", "score": "0.59293383", "text": "def show\n @breadcrumb = 'read'\n @formality_type = FormalityType.find(params[:id])\n @formalities = @formality_type.formalities.paginate(:page => params[:page], :per_page => per_page).order(:code)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @formality_type }\n end\n end", "title": "" }, { "docid": "2f9e8055cf26d8bbd86b38bf0838365d", "score": "0.59282774", "text": "def index\n @cpn_types = CpnType.all\n end", "title": "" }, { "docid": "b254d282e9aa9461ab4e8cfdc77d226c", "score": "0.59202236", "text": "def new\n @build = build_type.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @build }\n end\n end", "title": "" }, { "docid": "72425e3fa7a29a91f78ebdfe21600689", "score": "0.5906478", "text": "def show\n @crime_type = CrimeType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @crime_type }\n end\n end", "title": "" }, { "docid": "df6e735436b184bd65ad28246dc28641", "score": "0.5906118", "text": "def new\n @project_type = ProjectType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project_type }\n end\n end", "title": "" }, { "docid": "b74305b53fa3efd4735f958203d3b6ea", "score": "0.59008616", "text": "def show\n @type = Type.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @type }\n end\n end", "title": "" }, { "docid": "faa9528a46580cab5b199a27ef8b07bc", "score": "0.58933884", "text": "def new\n @scout_type = ScoutType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @scout_type }\n end\n end", "title": "" }, { "docid": "ea17baa55b6ea97d4e4f74889362ed6c", "score": "0.58930784", "text": "def index\n @projecttypes = current_user.organization.projecttypes\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projecttypes }\n end\n end", "title": "" }, { "docid": "87a01a1e88a06d8da9468531bf544338", "score": "0.58892775", "text": "def index\n @school_types = SchoolType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @school_types }\n end\n end", "title": "" }, { "docid": "d83f01e9654d1a8b70447d0a9ba3f756", "score": "0.588541", "text": "def new\n @community_type = CommunityType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @community_type }\n end\n end", "title": "" }, { "docid": "99541f01527561183c6e6bb490980b36", "score": "0.58786505", "text": "def show\n @construct_two = ConstructTwo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @construct_two }\n end\n end", "title": "" }, { "docid": "106298108582c9c3e615573c970fc08e", "score": "0.58754426", "text": "def new\n @mostsmallconstructioninfo = Mostsmallconstructioninfo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @mostsmallconstructioninfo }\n end\n end", "title": "" }, { "docid": "50df02604c6fcc667f6ab217fc5278bf", "score": "0.5866587", "text": "def show\n @company_type = CompanyType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @company_type }\n end\n end", "title": "" }, { "docid": "3ad9f0359ada5d3fa63cc3441ccd678e", "score": "0.5860753", "text": "def new\n @projecttype = Projecttype.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @projecttype }\n end\n end", "title": "" }, { "docid": "ccd4bc6f6628260172fbd93d870ea696", "score": "0.5855997", "text": "def index\n authorize! :index, Type, :message => 'Acceso denegado.'\n @types = @university.types\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @types }\n format.js\n end\n end", "title": "" }, { "docid": "7d4640a665ee0b7d44ea03aac5aa3e25", "score": "0.5852242", "text": "def show\n render json: @specification_type, serializer: Website::V1::SpecificationTypeSerializer\n end", "title": "" }, { "docid": "0528dd483bf93b6d1cea5639c036e7ce", "score": "0.5844816", "text": "def index\n @type_contracts = TypeContract.all\n end", "title": "" }, { "docid": "f5bedbb1fba2eaf814d84e01b5765bec", "score": "0.5844446", "text": "def show\n @division_type = DivisionType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @division_type }\n end\n end", "title": "" }, { "docid": "6451ac6ee60b088419381ac77df57fe2", "score": "0.5841023", "text": "def new\n @breadcrumb = 'create'\n @contract_type = ContractType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @contract_type }\n end\n end", "title": "" }, { "docid": "62149dd4848e36653f33c9b534107e2a", "score": "0.5839718", "text": "def show\n @discrimination_type = DiscriminationType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @discrimination_type }\n end\n end", "title": "" }, { "docid": "1b77431c6d1997cf5f09ac97fbe60589", "score": "0.58378947", "text": "def types\n @types = Tournament.tournament_types.keys.to_a\n respond_to do |format|\n format.json { render json: @types }\n end\n end", "title": "" }, { "docid": "2017cf92404e5bedd3db85c37f49ab12", "score": "0.58320993", "text": "def show\n @organisation_type = OrganisationType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @organisation_type }\n end\n end", "title": "" }, { "docid": "d26cb122875f462c39772f216a7bb4d0", "score": "0.5823145", "text": "def index\n @organisation_types = OrganisationType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @organisation_types }\n end\n end", "title": "" }, { "docid": "4390141803eee49197b0d2d1b27f1518", "score": "0.58182025", "text": "def show\n @characterization_type = CharacterizationType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @characterization_type }\n end\n end", "title": "" }, { "docid": "80fc9142e2af171e5d9b9b67616e6fc9", "score": "0.58140504", "text": "def index\n @constructional_levels = ConstructionalLevel.all\n end", "title": "" }, { "docid": "fe7c54f07c881ad63ad032cf40b84d42", "score": "0.5809698", "text": "def show\n @cost_type = CostType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cost_type }\n end\n end", "title": "" }, { "docid": "c6006328690467090d008be0fdca44c5", "score": "0.58091843", "text": "def index\n @types = Type.all\n json_response(@types)\n end", "title": "" }, { "docid": "05a23d7ce6e183ccc8dffe943d498e5b", "score": "0.5804947", "text": "def show\n @institutions_type = InstitutionsType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @institutions_type }\n end\n end", "title": "" }, { "docid": "b88ae89bbc3dda4a15668540eb0907bf", "score": "0.58047634", "text": "def new\n @schedtype = Schedtype.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @schedtype }\n end\n end", "title": "" }, { "docid": "6b7759be087c6531d5fb1f8f9a12b869", "score": "0.58044064", "text": "def index\n @building_types = BuildingType.all\n end", "title": "" }, { "docid": "6239eb7cadc58098cb08bcb420bc1786", "score": "0.5799476", "text": "def show\n @breadcrumb = 'read'\n @contract_type = ContractType.find(params[:id])\n @workers = @contract_type.workers.paginate(:page => params[:page], :per_page => per_page).order('worker_code')\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @contract_type }\n end\n end", "title": "" }, { "docid": "f0d582536e8c427a3bcc85b46dd6472b", "score": "0.57968706", "text": "def show\n @school_type = SchoolType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @school_type }\n end\n end", "title": "" }, { "docid": "fe2419b918d5920a50c369ab7915c8d8", "score": "0.57962173", "text": "def show\n @capital_type = CapitalType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @capital_type }\n end\n end", "title": "" }, { "docid": "c0c892cd55bb2f26e9a98a6b0488be06", "score": "0.57935786", "text": "def index\n @community_types = CommunityType.all\n end", "title": "" }, { "docid": "495dc3d4aa9476a42c7d52c3d2bd7d0b", "score": "0.57900655", "text": "def new\n @specificity = Specificity.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @specificity }\n end\n end", "title": "" }, { "docid": "fe8c005ea3bd15d027d434e5a8cc8060", "score": "0.5786056", "text": "def set_construction\n @construction = Construction.find(params[:id])\n end", "title": "" }, { "docid": "fe8c005ea3bd15d027d434e5a8cc8060", "score": "0.5786056", "text": "def set_construction\n @construction = Construction.find(params[:id])\n end", "title": "" }, { "docid": "f55aba78b60a793331618eba805c25a3", "score": "0.5784239", "text": "def index\n @competition_types = CompetitionType.all\n end", "title": "" }, { "docid": "0e3b94111161d197a24c4354d02116fe", "score": "0.5783647", "text": "def index\n @type_publications = TypePublication.all\n end", "title": "" }, { "docid": "6bd4be057040fd7b10f43481ae047e83", "score": "0.5780877", "text": "def show\n @creation = Creation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @creation }\n end\n end", "title": "" }, { "docid": "eb0da08da829761381d739807550959f", "score": "0.57785213", "text": "def show\n @breadcrumb = 'read'\n @contracting_request_type = ContractingRequestType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @contracting_request_type }\n end\n end", "title": "" }, { "docid": "7328933f169a24ffd77666792e06b209", "score": "0.57773256", "text": "def new\n @organisation_type = OrganisationType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @organisation_type }\n end\n end", "title": "" }, { "docid": "b41b4fb640f56aa7d257e53451cd30c4", "score": "0.57751244", "text": "def show\n @correspondence_type = CorrespondenceType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @correspondence_type }\n end\n end", "title": "" }, { "docid": "285b14e010eb1c19b45a21372e99c73a", "score": "0.5772752", "text": "def new\n @effect_construction_effect = Effect::ConstructionEffect.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @effect_construction_effect }\n end\n end", "title": "" }, { "docid": "1bc54deaf5d0141a9bbccd0da6329649", "score": "0.5768409", "text": "def index\n @type_resources = TypeResource.all\n end", "title": "" }, { "docid": "86630052954bd7afe0bcabb230761d59", "score": "0.5763779", "text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @type }\n end\n end", "title": "" }, { "docid": "68a1ea8517b0cb82948da7762262290c", "score": "0.57619697", "text": "def show\n render json: @domicile_type\n end", "title": "" }, { "docid": "4f3ba8648b6231d894ac1f05312ddd8e", "score": "0.57571775", "text": "def index\n @license_types = LicenseType.all\n end", "title": "" }, { "docid": "a48fbe1698af337d584a12f5e579538b", "score": "0.57464486", "text": "def new\n @type = Type.new \n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @type }\n end\n end", "title": "" }, { "docid": "33a420f4a2a30981a171735fa9a490dc", "score": "0.57451", "text": "def index\n @schedtypes = Schedtype.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @schedtypes }\n end\n end", "title": "" }, { "docid": "b02456ae24aeed1f3234ffbf6b13b8e1", "score": "0.5741917", "text": "def show\n @component_type = ComponentType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @component_type }\n end\n end", "title": "" }, { "docid": "22f6eafb710f2a221818017609751537", "score": "0.57413733", "text": "def new\n @school_type = SchoolType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @school_type }\n end\n end", "title": "" }, { "docid": "adefb13555986c9e3af14c09c3c47c71", "score": "0.5737784", "text": "def index\n @institutions_types = InstitutionsType.order(\"id\").all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @institutions_types }\n end\n end", "title": "" }, { "docid": "2e12b5b5fe87b664f1b6e6244876a3b1", "score": "0.57365286", "text": "def new\n @type = Type.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @type }\n end\n end", "title": "" }, { "docid": "2e12b5b5fe87b664f1b6e6244876a3b1", "score": "0.57365286", "text": "def new\n @type = Type.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @type }\n end\n end", "title": "" }, { "docid": "922652205a3b7cd068821a9be31d6ff9", "score": "0.5732006", "text": "def show\n @nature_of_problem_type = NatureOfProblemType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @nature_of_problem_type }\n end\n end", "title": "" }, { "docid": "cf31864b9f5e1e7182a868645beb6c57", "score": "0.57306767", "text": "def index\n @discrimination_types = DiscriminationType.sorted\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @discrimination_types }\n end\n end", "title": "" }, { "docid": "73d4734275b338bba187b873d08e969a", "score": "0.5729852", "text": "def create\n @construction = Construction.new(params[:construction])\n\n respond_to do |format|\n if @construction.save\n format.html { redirect_to(@construction, :notice => 'Construction was successfully created.') }\n format.xml { render :xml => @construction, :status => :created, :location => @construction }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @construction.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" } ]
cc2636a64a822123c1b2d811afc36c04
Reset all configuration options to defaults
[ { "docid": "17ce1028342ee6879ee02af52d30b8e8", "score": "0.0", "text": "def reset\n self.commission = DEFAULT_COMMISSION\n self.key = nil\n self.secret = nil\n self\n end", "title": "" } ]
[ { "docid": "f7f53da1f46a861e95c806d02ee5380e", "score": "0.89287955", "text": "def reset!\n # Vedeu::Log.logger.debug('Resetting configuration.')\n\n @options = defaults\n end", "title": "" }, { "docid": "1ff19118d89155119e24fbe12bca0882", "score": "0.8617408", "text": "def reset_defaults\n @options = {}\n end", "title": "" }, { "docid": "dfeae341532e332e7d1a2a9e0c6b8af8", "score": "0.86169964", "text": "def reset!\n @options = defaults\n end", "title": "" }, { "docid": "4ddcf3448adff129517ce195f7697161", "score": "0.8562677", "text": "def reset_defaults\n @options = @default_options.dup\n end", "title": "" }, { "docid": "2ed07d2e5c30285a9e638b1781ec16f0", "score": "0.8269907", "text": "def reset\n DEFAULT_OPTIONS.each do |k, v|\n send(\"#{k}=\", v)\n end\n end", "title": "" }, { "docid": "01a62cf3dd95fd1bbb8deec4415f07f7", "score": "0.82507056", "text": "def reset!\n initialize_default_options\n\n self\n end", "title": "" }, { "docid": "3aeee93afcebb4ef26079b0806586e90", "score": "0.8227479", "text": "def reset\n VALID_CONFIG_KEYS.each do |k, v|\n send(\"#{k}=\".to_sym, v)\n end\n\n options\n end", "title": "" }, { "docid": "7b1d8d2b7b97416255b1d0a32822710e", "score": "0.8200688", "text": "def reset\n @config = nil\n @explicitly_set = nil\n options.each do |opt|\n self.config[opt.name] = opt.initialized\n end\n end", "title": "" }, { "docid": "1bed64c10e5e5c675a156876e4d3a105", "score": "0.81777567", "text": "def reset_configuration!\n set_default_configuration\n end", "title": "" }, { "docid": "39e8a8383b10066db6065b014bf56716", "score": "0.81491554", "text": "def reset\n DEFAULTS.each do |option, default|\n self.send(\"#{option}=\".to_sym, default)\n end\n end", "title": "" }, { "docid": "39e8a8383b10066db6065b014bf56716", "score": "0.81491554", "text": "def reset\n DEFAULTS.each do |option, default|\n self.send(\"#{option}=\".to_sym, default)\n end\n end", "title": "" }, { "docid": "2a2b00deae5ad9273027747c09118584", "score": "0.81363255", "text": "def reset!\n DEFAULTS_CONFIGS.each { |k, v| send(\"#{k}=\", v) }\n end", "title": "" }, { "docid": "85bd41da2512397e9c5dbb1d93bad409", "score": "0.8077232", "text": "def reset_config!\n configure do |c|\n c.from_h(defaults)\n end\n end", "title": "" }, { "docid": "60139de7e8c38ddeec469a20f2a68535", "score": "0.78777826", "text": "def reset_to_defaults!\n @settings = default_settings\n end", "title": "" }, { "docid": "e70a7202e9a135fa58cb7507262c67d9", "score": "0.78775305", "text": "def reset_config!(options = T.unsafe(nil)); end", "title": "" }, { "docid": "cee552909ae92f301083208d24d61885", "score": "0.7853128", "text": "def reset\n self.options = nil\n self.option_processors = nil\n end", "title": "" }, { "docid": "355ab540ed6750741e150c0e8aaa15b0", "score": "0.78523284", "text": "def reset\n settings.replace(defaults)\n end", "title": "" }, { "docid": "f639b39d9aec86570c3622cf98ef43f3", "score": "0.7844709", "text": "def reset\n settings.replace(defaults)\n end", "title": "" }, { "docid": "f9c42426ac397314652949312c4ac485", "score": "0.78136873", "text": "def reset!\n settings.replace(defaults)\n end", "title": "" }, { "docid": "75cd447221f61b79694e1c3eb4f726e0", "score": "0.76955974", "text": "def reset!\n Ivapi::Configuration.each_key do |key|\n instance_variable_set(:\"@#{key}\", Ivapi::Default.options[key])\n end\n self\n end", "title": "" }, { "docid": "85be77671d2122bf4f86b9938b4e24c1", "score": "0.76940686", "text": "def reset\n init_config(true)\n end", "title": "" }, { "docid": "85be77671d2122bf4f86b9938b4e24c1", "score": "0.76940686", "text": "def reset\n init_config(true)\n end", "title": "" }, { "docid": "4f51e28362b7151aeb1faaf3bddecace", "score": "0.76781374", "text": "def reset\n SETTINGS.each { |key| send(\"#{key}=\", nil) }\n OPTIONS.each { |key| send(\"#{key}=\", SponsorPay::Configuration.const_get(\"DEFAULT_#{key.upcase}\"))}\n end", "title": "" }, { "docid": "75b95cf2ca956d731d01137b12ce2bdc", "score": "0.7673012", "text": "def reset!\n Ivapi::Configuration.keys.each do |key|\n instance_variable_set(:\"@#{key}\", Ivapi::Default.options[key])\n end\n self\n end", "title": "" }, { "docid": "51bd776e799c7c61ff033dda559547d1", "score": "0.76479924", "text": "def reset_defaults; end", "title": "" }, { "docid": "51bd776e799c7c61ff033dda559547d1", "score": "0.76479924", "text": "def reset_defaults; end", "title": "" }, { "docid": "c400a69ce6d195c13677b25ba566420f", "score": "0.76311845", "text": "def reset\n @defaults = Defaults.new\n end", "title": "" }, { "docid": "518006b1e4567bdfaf70791d276eb1da", "score": "0.7575491", "text": "def reset!\n @options = nil\n @option_parser = nil\n end", "title": "" }, { "docid": "518006b1e4567bdfaf70791d276eb1da", "score": "0.7575491", "text": "def reset!\n @options = nil\n @option_parser = nil\n end", "title": "" }, { "docid": "b8d1be2ebc2f209276a1c93dcffc15e9", "score": "0.75752324", "text": "def reset_configuration!\n @resolver = nil\n @default_configuration = nil\n end", "title": "" }, { "docid": "c1bc844e865ed942dc5cb3e983f39228", "score": "0.7546136", "text": "def reset!\n @defaults.each do |k, v|\n instance_variable_set(k, v)\n end\n end", "title": "" }, { "docid": "23865ac518806e0b5cbad1ab23880366", "score": "0.7545253", "text": "def reset!\n @defaults.each do |k, v|\n instance_variable_set(k, v)\n end\n end", "title": "" }, { "docid": "4d14aee091a64a5be37709b40f0be199", "score": "0.75391877", "text": "def reset!\n init_config(true)\n end", "title": "" }, { "docid": "c53dd83ef08581d87df7daae3e5d4592", "score": "0.75252837", "text": "def reset!\n @defaults.each { |key, value| instance_variable_set(key, value) }\n end", "title": "" }, { "docid": "c53dd83ef08581d87df7daae3e5d4592", "score": "0.75252837", "text": "def reset!\n @defaults.each { |key, value| instance_variable_set(key, value) }\n end", "title": "" }, { "docid": "0a4d100c089b454260256c7947eeea3e", "score": "0.75176346", "text": "def reset!\n @options = {}\n self.client_id = DEFAULT_CLIENT_ID\n self.client_secret = DEFAULT_CLIENT_SECRET\n self.adapter = DEFAULT_ADAPTER\n self.endpoint = DEFAULT_ENDPOINT\n self.user_agent = DEFAULT_USER_AGENT\n self.token_type = DEFAULT_TOKEN_TYPE\n self.debug = ENV['DEBUG']\n self\n end", "title": "" }, { "docid": "c225b5b377726fe93fd2650161246a3d", "score": "0.7501616", "text": "def reset!\n @defaults.each do |k,v|\n instance_variable_set(k,v)\n end\n end", "title": "" }, { "docid": "dd99032446216b209aa37f078e88a177", "score": "0.7492868", "text": "def reset_config; end", "title": "" }, { "docid": "6e7ceec640b36fee8d82a98525741f7c", "score": "0.7488897", "text": "def reset_config_to_default!\n @config = Config.new\n end", "title": "" }, { "docid": "6e7ceec640b36fee8d82a98525741f7c", "score": "0.7488897", "text": "def reset_config_to_default!\n @config = Config.new\n end", "title": "" }, { "docid": "087c62f5d597cdbcb8cd1cefe18852f5", "score": "0.7453062", "text": "def reset_config\n @config = {}\n end", "title": "" }, { "docid": "087c62f5d597cdbcb8cd1cefe18852f5", "score": "0.7453062", "text": "def reset_config\n @config = {}\n end", "title": "" }, { "docid": "087c62f5d597cdbcb8cd1cefe18852f5", "score": "0.7453062", "text": "def reset_config\n @config = {}\n end", "title": "" }, { "docid": "fd1834900990e346d64ff2e32450d940", "score": "0.7433896", "text": "def reset_defaults\n\t\t@configuration = Hash.new\n\t\t@global_configuration = @configuration\n\n\t\t@configuration[:core] = Hash.new\n\t\t@configuration[:core][:loaded_connectors] = Hash.new\n\t\t@configuration[:core][:scheduler] = Hash.new\n\t\t@configuration[:core][:scheduler][:sleep_low] = 300\n\t\t@configuration[:core][:scheduler][:sleep_normal] = 60\n\t\t@configuration[:core][:scheduler][:sleep_high] = 10\n\t\t@configuration[:core][:scheduler][:last_low] = nil\n\t\t@configuration[:core][:scheduler][:last_normal] = nil\n\t\t@configuration[:core][:scheduler][:last_high] = nil\n\t\t@configuration[:global] = Hash.new\n\t\t@configuration[:global][:loglevel] = Logger::DEBUG\n\t\t@configuration[:global][:nodename] = \"battery\"\n\t\t@configuration[:global][:stats] = Hash.new\n\t\t@configuration[:global][:stats][:messages] = 0\n\t\t@configuration[:global][:stats][:startups] = 0\n\t\t@configuration[:global][:stats][:totaluptime] = 0\n\t\t@configuration[:connectors] = Hash.new\n\tend", "title": "" }, { "docid": "9bd4b84004573c6b19c84c8c1e66e2ca", "score": "0.7408301", "text": "def reset\n reset_adapters\n reset_config\n reset_handlers\n reset_hooks\n end", "title": "" }, { "docid": "36a6fb33110c543358a620213f777a58", "score": "0.7400419", "text": "def reset!\n Liefery::Configurable.keys.each do |key|\n send(:\"#{key}=\", Liefery::Default.options[key])\n end\n self\n end", "title": "" }, { "docid": "196a282fe659e7f2205939a8afb8bdfa", "score": "0.7386575", "text": "def reset_config\n @configuration = nil\n reset\n end", "title": "" }, { "docid": "fc7c499d77879fd6ddf768ab972e294f", "score": "0.73830575", "text": "def reset!\n vars = instance_variables.map(&:to_sym)\n vars = vars - [ :'@config', :'@default_config' ]\n vars.each { |var| instance_variable_set(var, nil) }\n end", "title": "" }, { "docid": "006b390e4d549bf966c57ed0dfc3678c", "score": "0.7373957", "text": "def reset_options!\n @_options[:root_name] = nil\n @_options[:read_multi] = false\n @_options[:scope] = context_scope\n end", "title": "" }, { "docid": "55510c1c88cdbcd00a3b45b7c66ddde2", "score": "0.7371861", "text": "def reset!(options = {})\n default_class = module_defaults || class_defaults\n Api::Configurable.keys.each do |key|\n value = options[key] || default_class.options[key] || Api::Default.options[key]\n instance_variable_set(:\"@#{key}\", value)\n end\n self\n end", "title": "" }, { "docid": "f8e8cd84a7c435f71fd59aae7bd4ca47", "score": "0.7360014", "text": "def reset_configuration!\n @configuration = nil\n @client = nil\n end", "title": "" }, { "docid": "c5d6f600ca12be258d36dbd46105c5d0", "score": "0.7346913", "text": "def reset_config!\n @log = nil\n @logger = nil\n @log_level = nil\n end", "title": "" }, { "docid": "c5e64054aada230bca73c8abf5b863b5", "score": "0.7334465", "text": "def reset_defaults!\n @@enabled = true\n @@logger = nil\n @@storage = nil\n @@limits_config = nil\n\n # Internal variables\n @@instances = {}\n @@config = nil\n end", "title": "" }, { "docid": "ef4eab9b7425e6343e5527938f596e6f", "score": "0.7321944", "text": "def reset_config\n @config = nil\n end", "title": "" }, { "docid": "741bf8e4762103f4e3dd5901a27479e5", "score": "0.7316204", "text": "def reset_config!\n @config = nil\n end", "title": "" }, { "docid": "456ab55ce48960b84654e6f10b2a92b9", "score": "0.7310848", "text": "def clear_defaults!\n defaults.reset!\n end", "title": "" }, { "docid": "456ab55ce48960b84654e6f10b2a92b9", "score": "0.7310848", "text": "def clear_defaults!\n defaults.reset!\n end", "title": "" }, { "docid": "456ab55ce48960b84654e6f10b2a92b9", "score": "0.7308434", "text": "def clear_defaults!\n defaults.reset!\n end", "title": "" }, { "docid": "9fbee5daff141ac826266815fbfba19a", "score": "0.72929215", "text": "def defaults\n @options[:app] = false\n @options[:verbose] = false\n @options[:logging] = false\n @options[:confdir] = nil\n end", "title": "" }, { "docid": "4967bc8ff6334635461617eec14fb548", "score": "0.7292896", "text": "def reset!\n @given_options = nil\n end", "title": "" }, { "docid": "35b686cad3f21f31850282a25f818934", "score": "0.72738516", "text": "def reset\n @configuration = Configuration.new\n end", "title": "" }, { "docid": "35b686cad3f21f31850282a25f818934", "score": "0.72738516", "text": "def reset\n @configuration = Configuration.new\n end", "title": "" }, { "docid": "81c11fbdb14d99bbb364240c348e9456", "score": "0.72681993", "text": "def reset!\n Karatekit::Configurable.keys.each do |key|\n instance_variable_set(:\"@#{key}\", Karatekit::Default.options[key])\n end\n self\n end", "title": "" }, { "docid": "0b2c8304329684c9446475bca0b7b81a", "score": "0.72412896", "text": "def reset!\n Artifactory::Configurable.keys.each do |key|\n instance_variable_set(:\"@#{key}\", Defaults.options[key])\n end\n self\n end", "title": "" }, { "docid": "5b14759528d0f7a74953ab66371927b9", "score": "0.7238297", "text": "def reset_configuration\n @configuration = nil\n end", "title": "" }, { "docid": "88c6af899a02af0f21b6407c47f81649", "score": "0.723086", "text": "def clear\n @configure_hash = nil\n @configuration_files = nil\n @defaults = nil\n reload\n end", "title": "" }, { "docid": "8b3a50274ab610188a9a4b50ba0a8c85", "score": "0.7230049", "text": "def reset\n @config_file = nil\n set_defaults\n load_from_file if config_file\n end", "title": "" }, { "docid": "9cdc8af27b3a7b1e77233c64f82f708d", "score": "0.72280216", "text": "def clear_options\n @options = nil\n end", "title": "" }, { "docid": "9cdc8af27b3a7b1e77233c64f82f708d", "score": "0.72280216", "text": "def clear_options\n @options = nil\n end", "title": "" }, { "docid": "c8c58cc71825ef514eaca00f28b922fd", "score": "0.72250634", "text": "def reset\n reset_config\n reset_driver\n end", "title": "" }, { "docid": "c096ae8989accce70ea74dfb9026ea7e", "score": "0.7219922", "text": "def reset_configuration!\n @configuration = nil\n end", "title": "" }, { "docid": "a2bd7583ad1851876f977704646b5caf", "score": "0.72174805", "text": "def reset_config!\n self.log = nil\n self.logger = nil\n self.log_level = nil\n self.log_filter = nil\n self.raise_errors = nil\n self.soap_version = nil\n self.env_namespace = nil\n self.soap_header = nil\n end", "title": "" }, { "docid": "380303fe56a0b3b1d59095cedd5d0691", "score": "0.72095644", "text": "def reset!\n # Vedeu::Log.logger.debug('Resetting configuration.')\n\n instance.reset!\n end", "title": "" }, { "docid": "709b3490cc907c51b75c297d509d0de4", "score": "0.72065574", "text": "def reset!\n BaseApi::Configurable.keys.each do |key|\n instance_variable_set(:\"@#{key}\", BaseApi::Default.options[key])\n end\n self\n end", "title": "" }, { "docid": "60e4b952489bab357fd86183ab30edba", "score": "0.7203012", "text": "def reset\n @options, @aliases = {}, {}\n end", "title": "" }, { "docid": "60e4b952489bab357fd86183ab30edba", "score": "0.7203012", "text": "def reset\n @options, @aliases = {}, {}\n end", "title": "" }, { "docid": "f33beae35ec162ea2fbee5b32a651be5", "score": "0.719577", "text": "def reset\n self.adapter = DEFAULT_ADAPTER\n self.connection_options = DEFAULT_CONNECTION_OPTIONS\n self.api_token = DEFAULT_API_TOKEN\n self.user_agent = DEFAULT_USER_AGENT\n self\n end", "title": "" }, { "docid": "078c1e0c465fd78958075f0d188a3e3f", "score": "0.7189642", "text": "def reset\n @config = nil\n end", "title": "" }, { "docid": "081b66b90fd1f7e5fc4bc8fde9fd8279", "score": "0.71779543", "text": "def reset\n self.adapter = DEFAULT_ADAPTER\n self.api_type = DEFAULT_API_TYPE\n self.host_type = DEFAULT_HOST_TYPE\n self.key = DEFAULT_KEY\n self.password = DEFAULT_PASSWORD\n self.user_agent = DEFAULT_USER_AGENT\n self.format = DEFAULT_FORMAT\n self.log_enabled = false\n end", "title": "" }, { "docid": "2ecbb261aa33725f67c2b7c997d0c3e8", "score": "0.7177021", "text": "def reset\n DEFAULTS.each do |key, val|\n send(key + \"=\", val)\n end\n end", "title": "" }, { "docid": "4400062cca734dfe8babac5a55d4c7ec", "score": "0.71748066", "text": "def reset_config!\n @configuration = Configuration.new\n end", "title": "" }, { "docid": "c602679070b024ee4b37c3bf4c0c55f7", "score": "0.7174774", "text": "def reset_config!\n @configuration = {\n severity_tags: {},\n severities: {},\n matchers: {},\n silencers: []\n }\n self\n end", "title": "" }, { "docid": "a909e0b9e831f4b38a9da3f5a2603f0e", "score": "0.71660054", "text": "def reset\n @config = nil\n end", "title": "" }, { "docid": "b85e216828da17ca2b9ce596e6f184cb", "score": "0.7165652", "text": "def reset_config\n self.configuration = Squall::Config.new\n end", "title": "" }, { "docid": "61d9aa2d83aed02c0075decec2f2a8eb", "score": "0.7163476", "text": "def reset!\n @config = nil\n end", "title": "" }, { "docid": "61d9aa2d83aed02c0075decec2f2a8eb", "score": "0.7163476", "text": "def reset!\n @config = nil\n end", "title": "" }, { "docid": "cb9cfd43a039920d33acf749d23618ce", "score": "0.7157505", "text": "def reset!\n Hyperkit::Configurable.keys.each do |key|\n instance_variable_set(:\"@#{key}\", Hyperkit::Default.options[key])\n end\n self\n end", "title": "" }, { "docid": "cb9cfd43a039920d33acf749d23618ce", "score": "0.7157505", "text": "def reset!\n Hyperkit::Configurable.keys.each do |key|\n instance_variable_set(:\"@#{key}\", Hyperkit::Default.options[key])\n end\n self\n end", "title": "" }, { "docid": "a8c2a34f70bedbb14ce796eee345579c", "score": "0.7153793", "text": "def reset!\n Ark::Configurable.keys.each do |key|\n instance_variable_set(:\"@#{key}\", Ark::Default.options[key])\n end\n self\n end", "title": "" }, { "docid": "7cf6aeeb143ee433be2a224783b6acc1", "score": "0.713973", "text": "def reset_configs\n @configs = nil\n end", "title": "" }, { "docid": "5c6ba3190466e58f1183329e1224488b", "score": "0.7133187", "text": "def reset!\n PactasItero::Configurable.keys.each do |key|\n send(:\"#{key}=\", PactasItero::Default.options[key])\n end\n self\n end", "title": "" }, { "docid": "d38b879f4b2f77eee74578d2f5c2fdcb", "score": "0.7129854", "text": "def reset_config\n configure do |config|\n config.ahamove_api_key = nil\n config.ahamove_config_path = nil\n end\n end", "title": "" }, { "docid": "6114528f22b02b189a7271decdd3ed1b", "score": "0.71268624", "text": "def reset\n self.adapter = DEFAULT_ADAPTER\n self.endpoint = DEFAULT_ENDPOINT\n self.api_key = DEFAULT_API_KEY\n self.api_secret = DEFAULT_API_SECRET\n self.developer = DEFAULT_DEVELOPER\n self.container_id = DEFAULT_CONTAINER_ID\n self.avatar_size = DEFAULT_AVATAR_SIZE\n self.color = DEFAULT_COLOR\n self.default_tab = DEFAULT_DEFAULT_TAB\n self.hide_avatars = DEFAULT_HIDE_AVATARS\n self.hide_mods = DEFAULT_HIDE_MODS\n self.num_items = DEFAULT_NUM_ITEMS\n self.show_powered_by = DEFAULT_SHOW_POWERED_BY\n self.orientation = DEFAULT_ORIENTATION\n self.format = DEFAULT_FORMAT\n self.proxy = DEFAULT_PROXY\n self.user_agent = DEFAULT_USER_AGENT\n self\n end", "title": "" }, { "docid": "61138e46d538e79bb38ac7b0c4bdd7a0", "score": "0.71261007", "text": "def reset!\n Nuorder::Configurable.keys.each do |key|\n instance_variable_set(:\"@#{key}\", Nuorder::Default.options[key])\n end\n self\n end", "title": "" }, { "docid": "76c4327917f31c83c468fafe2a3952fa", "score": "0.7125147", "text": "def reset!\n default_tags.clear\n adapters.clear\n groups.clear\n metrics.clear\n collectors.clear\n configurators.clear\n instance_variable_set(:@configured_by, nil)\n end", "title": "" }, { "docid": "0f95dfe32a2edf0d2364f47d00340018", "score": "0.7122566", "text": "def reset!\n Nearmiss::Configurable.keys.each do |key|\n instance_variable_set(:\"@#{key}\", Nearmiss::Default.options[key])\n end\n self\n end", "title": "" }, { "docid": "056e5609f15d1e86b59c9102684378f8", "score": "0.71195626", "text": "def reset_configuration!\n @_configuration = nil\n end", "title": "" }, { "docid": "056e5609f15d1e86b59c9102684378f8", "score": "0.71195626", "text": "def reset_configuration!\n @_configuration = nil\n end", "title": "" }, { "docid": "b81a619df58e7e840872b78f767f6c51", "score": "0.7116956", "text": "def reset!\n @opts = []\n\n self\n end", "title": "" }, { "docid": "0f50fd88b3b2030173510f8b9873d33f", "score": "0.7115233", "text": "def reset\n self.user_agent = DEFAULT_USER_AGENT\n self.api_version = DEFAULT_API_VERSION\n self.server_url = DEFAULT_SERVER_URL\n self.client_name = DEFAULT_CLIENT_NAME\n self.client_key = DEFAULT_CLIENT_KEY\n self.connection_options = DEFAULT_CONNECTION_OPTIONS\n self.middleware = DEFAULT_MIDDLEWARE\n self\n end", "title": "" }, { "docid": "2e559592290e5a3974afc829214d3b99", "score": "0.7107994", "text": "def reset\n self.adapter = DEFAULT_ADAPTER\n self.api_version = DEFAULT_API_VERSION\n self.user_agent = DEFAULT_USER_AGENT\n self.timeout = DEFAULT_TIMEOUT\n self.open_timeout = DEFAULT_TIMEOUT\n self.api_key = nil\n self.proxy = nil\n end", "title": "" } ]
9455aa4a0654b0d5acf80498359251db
Test 4: Clear cookies, do not login, search for a member
[ { "docid": "f3ca88fd6dbb5563fd6eea6ac3f5ff33", "score": "0.7845149", "text": "def test04_member_search_logged_out_TC_24434\n\t\t#no login\n\t\t$browser.cookies.clear\n\t\t$browser.goto($patch)\n\t\t$search_text_field.when_present.set(\"User 70\")\n\t\t$search_button.click\n\t\tsleep 4\n\t\t$user_70.click\n\t\tsleep 2\n\t\t\n\t\tbegin\n\t\tassert $browser.text.include? \"User 70\"\n\t\trescue => e\n\t\t\tputs e\n\t\tputs \"GS2_T4: FAILED! Logged out user unable to find user.\"\n\t\tend\n\tend", "title": "" } ]
[ { "docid": "d8c676841854dba1379d0a5c9ff39711", "score": "0.77848136", "text": "def test04_member_search_logged_out_TC_24434\n\t\t#no login\n\t\t$browser.cookies.clear\n\t\t$browser.goto($patch)\n\t\t$search_text_field.when_present.set(\"User 70\")\n\t\t$search_button.click\n\t\t$user_70.when_present.click\n\t\tsleep 2\n\t\t\n\t\tassert $browser.text.include? \"User 70\"\n\tend", "title": "" }, { "docid": "416f6d2a3389a86dc5807f34b39f229a", "score": "0.7524372", "text": "def test05_member_search_logged_in_TC_24435\n\t\tlogin $user_1_email, $master_password\n\t\t\n\t\t$browser.goto($patch)\n\t\t$search_text_field.when_present.set(\"The Fighting Mongooses\")\n\t\t$search_button.click\n\t\tsleep 4\n\t\t$fighting_mongooses.click\n\t\tsleep 2\n\t\t\n\t\tassert $browser.text.include? \"The Fighting Mongooses\"\n\tend", "title": "" }, { "docid": "9297bf3af2ab53186cc23309aac39087", "score": "0.7186273", "text": "def test05_member_search_logged_in_TC_24435\n\t\tloginGroup\n\t\t\n\t\t$browser.goto($patch)\n\t\tsleep 4\n\t\t$search_text_field.set(\"The Fighting Mongooses\")\n\t\t$search_button.click\n\t\tsleep 4\n\t\t$fighting_mongooses.click\n\t\tsleep 2\n\t\t\n\t\tbegin\n\t\tassert $browser.text.include? \"The Fighting Mongooses\"\n\t\trescue => e\n\t\t\tputs e\n\t\tputs \"GS2_T5: FAILED! Logged out user unable to find group.\"\n\t\tend\n\tend", "title": "" }, { "docid": "6b50e168b4daba29e5f06864cf79d1f0", "score": "0.68216866", "text": "def test02_group_search_logged_out_TC_24434\n\t\t#no login\n\t\t$browser.cookies.clear\n\t\t$browser.goto($patch)\n\t\t$search_text_field.when_present.set(\"the fighting mongooses\")\n\t\t$search_button.click\n\t\t$fighting_mongooses.when_present.click\n\t\tsleep 2\n\t\t\n\t\tassert $browser.text.include? \"The Fighting Mongooses\"\n\tend", "title": "" }, { "docid": "bfd6f6313ff6600d96ff93035c632697", "score": "0.67333376", "text": "def test_001\n test_000\n login(\"root\",\"root\")\n open_pj_member_page(SAMPLE_PU, SAMPLE_PJ)\n ## assert all members's names are available on the registered member list\n all_members = @selenium.get_select_options($link_texts[\"pj_user\"][\"member\"])\n assert_not_equal all_members.index(USER_LAST_NAME),nil\n logout\n end", "title": "" }, { "docid": "3321aee24016f54a5a71774197a180ac", "score": "0.6720007", "text": "def test03_directory_group_search_logged_out_TC_24434\n\t\t#no login\n\t\t$browser.cookies.clear\n\t\t$browser.goto($patch)\n\t\tsleep 4\n\t\t$search_text_field.set(\"Flatiron Lounge\")\n\t\t$search_button.click\n\t\t$flatiron_business.when_present.click\n\t\tsleep 2\n\t\t\n\t\tassert $browser.text.include? \"Flatiron Lounge\"\n\tend", "title": "" }, { "docid": "7c8520228f95f8700cb964814a7408e4", "score": "0.6619439", "text": "def test_005\n test_000\n login(\"root\",\"root\")\n ## add user \"pj_member\" to administrator list.\n add_pj_admin\n wait_for_button_enable($xpath[\"pj_user\"][\"add_user_pj\"])\n ## remove user \"pj_member\" from administrator list.\n remove_pj_admin\n wait_for_button_enable($xpath[\"pj_user\"][\"remove_user_pj\"])\n ## user \"pj_member\" will be on PJ member list side\n all_members = @selenium.get_select_options(\"members[]\")\n assert_not_equal all_members.index(USER_LAST_NAME),nil\n logout\n end", "title": "" }, { "docid": "75b9713b13dd27d5baea719cc93da33d", "score": "0.65551203", "text": "def test02_group_search_logged_out_TC_24434\n\t\t#no login\n\t\t$browser.cookies.clear\n\t\t$browser.goto($patch)\n\t\tsleep 4\n\t\t$search_text_field.set(\"the fighting mongooses\")\n\t\t$search_button.click\n\t\t$fighting_mongooses.when_present.click\n\t\tsleep 2\n\t\t\n\t\tbegin\n\t\tassert $browser.text.include? \"The Fighting Mongooses\"\n\t\trescue => e\n\t\t\tputs e\n\t\tputs \"GS2_T2: FAILED! Logged out user unable to find group.\"\n\t\tend\n\tend", "title": "" }, { "docid": "a0aaf245ef152b7dc5d58b5707cad26c", "score": "0.65097624", "text": "def login_test(login)\n\ttmp = login.dup\n>>>>>>> 94045ba708cc6a5c6cb130d3b71d32605273daa2\n\tid = Client.users_search(user: tmp)[:members][0][:id]\n\tputs id\nend", "title": "" }, { "docid": "288c3234bd2df2ce344a487befe7145c", "score": "0.6491643", "text": "def test03_directory_group_search_logged_out_TC_24434\n\t\t#no login\n\t\t$browser.cookies.clear\n\t\t$browser.goto($patch_flatiron)\n\t\tsleep 4\n\t\t$search_text_field.set(\"Flatiron Lounge\")\n\t\t$search_button.click\n\t\tsleep 4\n\t\t$flatiron_business.click\n\t\tsleep 2\n\t\t\n\t\tbegin\n\t\tassert $browser.text.include? \"Flatiron Lounge\"\n\t\trescue => e\n\t\t\tputs e\n\t\tputs \"GS2_T3: FAILED! Logged out user unable to find directory group.\"\n\t\tend\n\tend", "title": "" }, { "docid": "2317a537216f3d215acbb6d0b3404563", "score": "0.642946", "text": "def test_handle_deleted_authentication_cookie\n @request.cookies[\"authentication_token\"] = ''\n get :login_simple, {:user => {:login => 'cch1'}}\n assert @controller.send(:logged_in?), \"User should be logged in.\"\n assert cookies[\"authentication_token\"] == \"\" || cookies[\"authentication_token\"].nil?\n end", "title": "" }, { "docid": "afaf12e762f10d9b13fbc44ba242de9a", "score": "0.6374469", "text": "def test_001\n test_000\n login(\"root\",\"root\")\n ## open default pu \"SamplePU1\".\n open_pu_member_page(SAMPLE_PU)\n ## user pj_member has been added in fixtures.\n all_members = @selenium.get_select_options($link_texts[\"pu_user\"][\"member\"])\n assert_not_equal all_members.index(USER_LAST_NAME),nil\n logout\n end", "title": "" }, { "docid": "2bf2dd0b3e3afa45c71afdf052b88353", "score": "0.6367652", "text": "def test_003\n test_000\n login(\"root\",\"root\")\n all_members_of_pu = PusUsers.find_all_by_pu_id(PU_ID)\n assert_not_equal all_members_of_pu,[]\n delete_pu\n all_members_of_pu = PusUsers.find_all_by_pu_id(PU_ID)\n assert_equal all_members_of_pu,[]\n logout\n end", "title": "" }, { "docid": "1e384effa096fd230dc420f9f4de973f", "score": "0.6357129", "text": "def test_002\n test_000\n login(\"root\",\"root\")\n open_pj_member_page(SAMPLE_PU, SAMPLE_PJ)\n ## remove user \"pj_member\" from pj member list\n @selenium.add_selection $link_texts[\"pj_user\"][\"member\"], \"label=#{USER_LAST_NAME}\"\n @selenium.click($xpath[\"pj_user\"][\"remove_user_pj\"])\n sleep WAIT_TIME\n all_non_members = @selenium.get_select_options($link_texts[\"pj_user\"][\"non_member\"])\n assert_not_equal all_non_members.index(USER_LAST_NAME),nil\n logout\n end", "title": "" }, { "docid": "a4cc77e68d4f2a525ca9a5fd2f0f1e4b", "score": "0.6314397", "text": "def get_new_members\n index\n login\n\n @known_users_changed = false\n \n cookies = \"session_id=#{@session_id}\"\n headers = {'Cookie'=>\"#{cookies}\", 'Content-Type'=>'application/x-www-form-urlencoded'}\n Net::HTTP.start(RAPID_BOARDS) do |http|\n response = http.post('/index.php?',\n \"act=Members&s=&name_box=all&name=&filter=ALL&sort_key=joined&sort_order=desc&max_results=10\",\n headers)\n \n get_member_details response.body\n\n# uid = get_last_user\n uid = @known_users[-1].uid\n \n @users.each do |user|\n# @log.info \"looking at user #{user.name}(#{user.uid}) compared to last known user #{@known_users[-1].name}(#{uid})\"\n break if (uid.to_i < user.uid.to_i)\n break if (uid.to_i == user.uid.to_i) && (user.name == @known_users[uid.to_i].name) # same id && same name\n @log.info \"User #{@known_users[uid.to_i].name} has been deleted, removing from user list\"\n @known_users.delete_at( uid.to_i )\n while (@known_users[uid.to_i].nil?)\n uid = (uid.to_i - 1).to_s\n end\n# @log.info \"last user id is now #{uid}\"\n# uid = @known_users[-1].uid\n @known_users_changed = true\n break if uid == user.uid\n end\n \n @users.reverse_each do |user|\n begin\n puts \"Looking at #{user.name}\"\n if user.uid.to_i > uid.to_i\n @log.info \"new: find member #{user.name}(#{user.uid})...\"\n user = find_member user\n @known_users[user.uid.to_i] = user\n @log.info \"#{user.name}(#{user.uid}), email: #{user.email}, ip: #{user.ip}\"\n if user.spammer?\n @log.info \"! #{user.name} is a known spammer!\"\n emailbody =<<END_OF_BODY\n Border Collie Rescue Boards: Spammer Alert !\n The newly registered user #{user.name} has been identified to be a forum spammer! Please take the following action:\n\nEND_OF_BODY\n emailbody << EMAIL_END\n @emailprops['emailbody'] = emailbody\n sm = SendMail.new( @emailprops['emailhost'], @emailprops['emailport'] )\n sm.send_email( @emailprops, \"#{@emailprops['emailuser']}@#{@emailprops['emailhost']}\", \"Admins and Moderators\", 'Spammer Alert' )\n\n edit user # set indefinite moderating\n report_spammer user\n end\n uid = user.uid\n set_last_user uid\n @known_users_changed = true\n end\n rescue Exception => e\n puts \"Oops:\\n #{e}\"\n @log.error \"Check for #{user.name} failed !\\n#{$!}\\n#{e.backtrace.join(\"\\n\")}\"\n end\n end\n end\n logout\n File.open( USERS_FILE, 'w' ) {|f| YAML.dump(@known_users, f) } if @known_users_changed\n end", "title": "" }, { "docid": "544a83cfe7e281229f98801022d5ee50", "score": "0.63080317", "text": "def log_in\n visit($cas ? CASLogin : Login)do |log_in|\n log_in.username.set @user_name\n log_in.login\n end\n visit Researcher\n end", "title": "" }, { "docid": "906c99f379ceba2db0911675a6d4591d", "score": "0.6289683", "text": "def test_loggedin\n\n end", "title": "" }, { "docid": "a4460b91e240e28857491da9529235e6", "score": "0.627073", "text": "def test_logged_in_user_access_to_userland_approved\n # first log in\n get '/login' # need to do this to set up the form container.\n post '/login', { :username => GOOD_USERNAME, :password => GOOD_PASSWORD }\n\n # then specifically request the index page in userland\n get '/in/index'\n assert last_response.ok?\n assert last_response.body.include?('You are logged in as') \n assert last_response.body.include?(GOOD_USERNAME) \n end", "title": "" }, { "docid": "62007d41792fb0c7362f6c158246fef0", "score": "0.6270262", "text": "def login\n if TestChamber.user_cookies\n refresh_browser_cookies\n else\n ui_login\n end\n end", "title": "" }, { "docid": "7dec52f659f64578b7e6daddebd3c29d", "score": "0.61550385", "text": "def test_072\n test_000\n login(PJ_MEMBER_ID, PJ_MEMBER_PASSWORD)\n wait_for_element_present($xpath[\"user\"][\"user_infor\"])\n @selenium.click($xpath[\"user\"][\"user_infor\"])\n wait_for_element_present($xpath[\"user\"][\"update_user\"])\n @selenium.type \"user_password\", \"\"\n @selenium.click($xpath[\"user\"][\"update_user\"])\n sleep WAIT_TIME\n wait_for_text_present($messages[\"update_user_passed\"])\n logout\n end", "title": "" }, { "docid": "7de35fd203099b8adadc4dbab1411ad7", "score": "0.615123", "text": "def query\n page = login\n\n # A way to check if the login failed is if the page simply has a logout link.\n if parse_text(page.at('#mydom-nav-menu li:nth-child(3) a')) == 'Sign Out'\n analyze_account(page)\n ''\n else\n '--> Something went wrong! Maybe check your credentials?'\n end\n end", "title": "" }, { "docid": "a88b777c0d55301690221dec3945be9d", "score": "0.61491054", "text": "def test_logged_in_user_access_to_registration_form_skipped\n # first log in\n post '/login', { :username => GOOD_USERNAME, :password => GOOD_PASSWORD }\n\n get '/register'\n assert last_response.ok?\n assert last_response.body.include?('You are already logged in')\n end", "title": "" }, { "docid": "a2d3d7cd8f6577c9e2e6557fac539591", "score": "0.614753", "text": "def test_065\n test_000\n login(PJ_MEMBER_ID, PJ_MEMBER_PASSWORD)\n @selenium.open($xpath[\"index_page\"])\n wait_for_element_present($xpath[\"user\"][\"user_infor\"])\n @selenium.click($xpath[\"user\"][\"user_infor\"])\n wait_for_text_present($window_titles[\"update_user_information\"])\n wait_for_text_present($link_texts[\"pu_user\"][\"pu_user_list_table\"][1])\n wait_for_text_present($link_texts[\"pu_user\"][\"pu_user_list_table\"][2])\n logout\n end", "title": "" }, { "docid": "368d9e08e74ef1d519a49eb4f70605d2", "score": "0.6139899", "text": "def test_002\n test_000\n login(\"root\",\"root\")\n ## open default pu \"SamplePU1\".\n open_pu_member_page(SAMPLE_PU)\n ## remove user pj_member\n @selenium.add_selection $link_texts[\"pu_user\"][\"member\"], \"label=#{USER_LAST_NAME}\"\n @selenium.click($xpath[\"pu_user\"][\"remove_user_pu\"])\n sleep WAIT_TIME\n all_non_members = @selenium.get_select_options($link_texts[\"pu_user\"][\"non_member\"])\n assert_not_equal all_non_members.index(USER_LAST_NAME),nil\n logout\n end", "title": "" }, { "docid": "4eeb2cd030969147a6f93c3c93262cd2", "score": "0.6134649", "text": "def do_login\n cookies[:auth_token] = users(:testuser).auth_token\n end", "title": "" }, { "docid": "bc9628620056abed6e99f07357421465", "score": "0.61236787", "text": "def test_should_be_able_to_login_when_first_user\n UbiquoUser.destroy_all\n post :create, :login => 'josep', :password => 'test'\n assert session[:ubiquo][:ubiquo_user_id]\n assert_response :redirect\n end", "title": "" }, { "docid": "89a6a03340a020f62071fef5e07e9dbb", "score": "0.61198664", "text": "def login\n @con.get_page_by_post('/Customer/check.asp', {'email' => 'dan@gradientblue.com', 'PWord' => 'test', 'redir' => 'Default', 'submit.x' => '33', 'submit.y' => '7'})\n end", "title": "" }, { "docid": "a0dbaa504aa6266421e70d12d2c3408d", "score": "0.61089", "text": "def login_from_cookie\n \n end", "title": "" }, { "docid": "0fb700f96ef0a9f03b568500acf8c5db", "score": "0.607035", "text": "def test_logged_in_user_access_to_userland_approved\n # first log in\n post '/login', { :username => GOOD_USERNAME, :password => GOOD_PASSWORD }\n\n # then specifically request the index page in userland\n get '/in/index'\n assert last_response.ok?\n assert last_response.body.include?('Welcome root.') \n end", "title": "" }, { "docid": "6e7c5d70f068e3b30a730d365648808f", "score": "0.60646594", "text": "def test_logged_in_user_access_to_registration_form_skipped\n # first log in\n get '/login' # need to do this to set up the form container.\n post '/login', { :username => GOOD_USERNAME, :password => GOOD_PASSWORD }\n\n get '/register'\n assert last_response.ok?\n assert last_response.body.include?('You are already logged in')\n end", "title": "" }, { "docid": "a1a813d099fb0cb6b60aaa2549029d69", "score": "0.605182", "text": "def login(cookie)\r\n\t\t# Send a request to the login page so we can obtain some hidden values needed for login\r\n\t\turi = \"#{@base}wikka.php?wakka=UserSettings\"\r\n\t\tres = send_request_raw({\r\n\t\t\t'method' => 'GET',\r\n\t\t\t'uri' => uri,\r\n\t\t\t'cookie' => cookie\r\n\t\t})\r\n\r\n\t\t# Extract the hidden fields\r\n\t\tlogin = {}\r\n\t\tif res and res.body =~ /\\<div id\\=\\\"content\\\"\\>.+\\<fieldset class\\=\\\"hidden\\\"\\>(.+)\\<\\/fieldset\\>.+\\<legend\\>Login\\/Register\\<\\/legend\\>/m\r\n\t\t\tfields = $1.scan(/\\<input type\\=\\\"hidden\\\" name\\=\\\"(\\w+)\\\" value\\=\\\"(\\w+)\\\" \\/>/)\r\n\t\t\tfields.each do |name, value|\r\n\t\t\t\tlogin[name] = value\r\n\t\t\tend\r\n\t\telse\r\n\t\t\traise RuntimeError, \"#{@peer} - Unable to find the hidden fieldset required for login\"\r\n\t\tend\r\n\r\n\t\t# Add the rest of fields required for login\r\n\t\tlogin['action'] = 'login'\r\n\t\tlogin['name'] = datastore['USERNAME']\r\n\t\tlogin['password'] = datastore['PASSWORD']\r\n\t\tlogin['do_redirect'] = 'on'\r\n\t\tlogin['submit'] = \"Login\"\r\n\t\tlogin['confpassword'] = ''\r\n\t\tlogin['email'] = ''\r\n\r\n\t\tport = (rport.to_i == 80) ? \"\" : \":#{rport}\"\r\n\t\tres = send_request_cgi({\r\n\t\t\t'method' => 'POST',\r\n\t\t\t'uri' => uri,\r\n\t\t\t'cookie' => cookie,\r\n\t\t\t'headers' => { 'Referer' => \"http://#{rhost}#{port}#{uri}\" },\r\n\t\t\t'vars_post' => login\r\n\t\t})\r\n\r\n\t\tif res and res.headers['Set-Cookie'] =~ /user_name/\r\n\t\t\tuser = res.headers['Set-Cookie'].scan(/(user_name\\@\\w+=\\w+);/)[0] || \"\"\r\n\t\t\tpass = res.headers['Set-Cookie'].scan(/(pass\\@\\w+=\\w+)/)[0] || \"\"\r\n\t\t\tcookie_cred = \"#{cookie}; #{user}; #{pass}\"\r\n\t\telse\r\n\t\t\tcred = \"#{datastore['USERNAME']}:#{datastore['PASSWORD']}\"\r\n\t\t\traise RuntimeError, \"#{@peer} - Unable to login with \\\"#{cred}\\\"\"\r\n\t\tend\r\n\r\n\t\treturn cookie_cred\r\n\tend", "title": "" }, { "docid": "616dc29e92633abc9c79bb8a087de092", "score": "0.6049307", "text": "def test_006\n\n # log in by PJ member authority.\n open \"/auth/login\"\n type \"login\", \"pj_member\"\n type \"password\", \"pj_member\"\n click \"commit\"\n\n #Find a PU\n @@pu = Pu.find_by_name('SamplePU1')\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n @@pj = Pj.find_by_name('SamplePJ1')\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n assert !60.times{ break if (is_text_present(_(\"Analysis Task Administration\")) rescue false); sleep 1 }\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n click $xpath[\"task\"][\"main_area_td4\"]\n assert !60.times{ break if (is_text_present(_(\"Registration of an Analysis Task\")) rescue false); sleep 1 }\n assert_equal [@individual], get_select_options(\"analyze_type\")\n # logout\n logout\n\n end", "title": "" }, { "docid": "b29b8ea6f9e7d80b32e3235e54b6e5bf", "score": "0.60325366", "text": "def test_004\n test_000\n login(\"root\",\"root\")\n ## open pu-admin page for default pu \"SamplePU1\".\n open_pu_admin_page(SAMPLE_PU)\n ## add user \"pj_member\" to administrator list.\n @selenium.add_selection $link_texts[\"pu_user\"][\"member\"],\"label=#{USER_LAST_NAME}\"\n @selenium.click($xpath[\"pu_user\"][\"add_user_pu\"])\n sleep WAIT_TIME\n ## user \"pj_member\" will be on manager list.\n all_managers = @selenium.get_select_options($link_texts[\"pu_user\"][\"manager\"])\n assert_not_equal all_managers.index(USER_LAST_NAME),nil\n logout\n end", "title": "" }, { "docid": "7623977712089f99183ff35606dc7e66", "score": "0.6019796", "text": "def test_073\n test_000\n login(PJ_MEMBER_ID, PJ_MEMBER_PASSWORD)\n wait_for_element_present($xpath[\"user\"][\"user_infor\"])\n @selenium.click($xpath[\"user\"][\"user_infor\"])\n wait_for_element_present($xpath[\"user\"][\"update_user\"])\n @selenium.type \"user_password_confirmation\", \"\"\n @selenium.click($xpath[\"user\"][\"update_user\"])\n sleep WAIT_TIME\n wait_for_text_present($messages[\"update_user_passed\"])\n logout\n end", "title": "" }, { "docid": "973c2069b2fa673a1d657412c1d1ac75", "score": "0.6013655", "text": "def test_login\r\n open_session do |sess|\r\n # first hit to get a session and anon token\r\n get home_url\r\n\r\n # remember the relevant values\r\n orig_sess = cookies[SESSION_KEY]\r\n orig_toke = cookies[ANON_TOKEN_COOKIE_NAME]\r\n\r\n user = users(:user1_lower_case)\r\n https!\r\n assert_no_difference \"AnonymousToken.count\" do\r\n post '/user_session', :loginId => user.screen_name, :logonPassword => 'f00bar'\r\n end\r\n assert_response_r :redirect\r\n\r\n # make sure nothing changed\r\n assert_equal id_for(orig_sess), id_for(cookies[SESSION_KEY])\r\n assert_equal orig_toke, cookies[ANON_TOKEN_COOKIE_NAME]\r\n assert_token_values cookies[ANON_TOKEN_COOKIE_NAME], cookies[SESSION_KEY], user.id\r\n end\r\n end", "title": "" }, { "docid": "c454660a086e6e890fdb553ee2e42221", "score": "0.6007474", "text": "def test_users_preferences\n # first log in\n get '/login' # need to do this to set up the form container.\n post '/login', { :username => GOOD_USERNAME, :password => GOOD_PASSWORD }\n\n # the show user page dumps all of the preferences.\n get '/profile'\n assert last_response.ok?\n assert last_response.body.include?( GOOD_PREFERENCE_TOKEN) \n assert last_response.body.include?( GOOD_PREFERENCE_VALUE) \n assert !last_response.body.include?( BAD_PREFERENCE_TOKEN) \n\n end", "title": "" }, { "docid": "4ce0b9a25d41f202984d1510584d95cf", "score": "0.6004088", "text": "def test_logged_in_user_access_to_registration_form_skipped\n # first log in\n get '/login' # need to do this to set up the form container.\n post '/login', { :username => GOOD_USERNAME, :password => GOOD_PASSWORD }\n\n get '/register'\n post '/registration', { :username => \"anyuser\", :password => \"anypass\", :terms => 'true', :locale => 'en', :email => \"any@any.any\" }\n assert last_response.ok?\n assert last_response.body.include?('You are already logged in')\n end", "title": "" }, { "docid": "bebff849a729209fb27a21b34d9eafb1", "score": "0.600174", "text": "def index\n puts \"SESSSSSSSSIOOOOOOOOOON\"\n puts session[:admin]\n puts session[:current_user]\n if params[:query].present?\n @members = Member.search(params[:query])\n else\n @members = Member.all\n end\n end", "title": "" }, { "docid": "cdf5cc92093c7f740c25932b0053d0de", "score": "0.59965444", "text": "def test_074\n test_000\n login(PJ_MEMBER_ID, PJ_MEMBER_PASSWORD)\n wait_for_element_present($xpath[\"user\"][\"user_infor\"])\n @selenium.click($xpath[\"user\"][\"user_infor\"])\n wait_for_element_present($xpath[\"user\"][\"update_user\"])\n @selenium.type \"user_password\", PJ_MEMBER_PASSWORD\n @selenium.type \"user_password_confirmation\", WRONG_PASSWORD\n @selenium.click($xpath[\"user\"][\"update_user\"])\n sleep WAIT_TIME\n wait_for_text_present($messages[\"update_user_passed\"])\n logout\n end", "title": "" }, { "docid": "535c11f72d7a813018b323ae06f4437b", "score": "0.59816116", "text": "def test_logged_in_user_access_to_registration_form_skipped\n # first log in\n post '/login', { :username => GOOD_USERNAME, :password => GOOD_PASSWORD }\n\n post '/registration', { :username => \"any\", :password => \"any\", :email => \"any@any.any\" }\n assert last_response.ok?\n assert last_response.body.include?('You are already logged in')\n end", "title": "" }, { "docid": "273d68a05c98c43b431e2df010d370c1", "score": "0.59573376", "text": "def test_010\n test_000\n login(\"root\",\"root\")\n open_pu_member_page(SAMPLE_PU)\n ## remove user \"pj_member\" from pu member list\n @selenium.add_selection $link_texts[\"pu_user\"][\"member\"], \"label=#{USER_LAST_NAME}\"\n @selenium.click($xpath[\"pu_user\"][\"remove_user_pu\"])\n sleep WAIT_TIME\n @selenium.add_selection $link_texts[\"pu_user\"][\"non_member\"], \"label=#{USER_LAST_NAME}\"\n @selenium.click($xpath[\"pu_user\"][\"add_user_pu\"])\n assert !@selenium.is_editable($xpath[\"pu_user\"][\"add_user_pu\"])\n sleep WAIT_TIME\n logout\n end", "title": "" }, { "docid": "86f97054592c16457a1534ac67f3e819", "score": "0.59521663", "text": "def test_071\n test_000\n login(PJ_MEMBER_ID, PJ_MEMBER_PASSWORD)\n sleep WAIT_TIME\n @selenium.click($xpath[\"user\"][\"user_infor\"])\n sleep WAIT_TIME\n @selenium.type \"user_password\", \"\"\n @selenium.type \"user_password_confirmation\", \"\"\n @selenium.click($xpath[\"user\"][\"update_user\"])\n sleep WAIT_TIME\n wait_for_text_present($messages[\"update_user_passed\"])\n logout\n login(PJ_MEMBER_ID, PJ_MEMBER_PASSWORD)\n assert @selenium.is_element_present(\"link=#{$link_texts[\"toscana_management\"]}\")\n logout\n end", "title": "" }, { "docid": "5f2e133f54891eb3cfffd01df15aa030", "score": "0.5944467", "text": "def test_do_login_invalid_password\n\t\txhr :post, :do_login, :login=>'user1', :password=>'user1', :autologin=>nil, :only_add=>nil\n\t\tassert_select_rjs :replace_html, :warning, 'UserID or Password is incorrect.'\n\t\tassert_nil @request.session[:user]\n assert_nil @request.session[:user_id]\n\t\tassert_nil cookies['user']\n\t\tassert_nil cookies['autologin']\n\t\tassert_nil cookies['only_add']\n end", "title": "" }, { "docid": "81e2f3ae30842a805051c2191e62d3fe", "score": "0.5944217", "text": "def clear_login_data\r\n session[:edit_mode] = 0\r\n session[:user_id] = nil\r\n session[:user_name] = nil\r\n set_default_guest_user_role\r\n cookies.delete :remember_me\r\nend", "title": "" }, { "docid": "0faf0af90ef3819509ece57f26dde6eb", "score": "0.5940913", "text": "def test_list_instr_valid\r\n @request.session[:user] = User.find(users(:superadmin).id)\r\n roleid = User.find(users(:superadmin).id).role_id\r\n Role.rebuild_cache\r\n Role.find(roleid).cache[:credentials]\r\n @request.session[:credentials] = Role.find(roleid).cache[:credentials]\r\n AuthController.set_current_role(roleid,@request.session)\r\n \r\n post :list_instructors\r\n assert_response :success \r\n end", "title": "" }, { "docid": "75f2d1f8259b0fab724b7f5bbe899a49", "score": "0.59399384", "text": "def login ; end", "title": "" }, { "docid": "e82653393d57f8e1c5660368569f42bc", "score": "0.59387434", "text": "def test_012\n pu = Pu.find(:first)\n open_pj_registration_page(pu.id)\n wait_for_text_present(_(\"Administrator and member\"))\n wait_for_text_present(_(\"Analysis tool setting.\"))\n logout\n end", "title": "" }, { "docid": "a251949932122a5cccb3a9f96e635ae8", "score": "0.5932058", "text": "def test_008\n test_000\n login(\"root\",\"root\")\n ## open SamplePJ1 member page\n open_pj_member_page(SAMPLE_PU,SAMPLE_PJ)\n @selenium.add_selection $link_texts[\"pj_user\"][\"member\"], \"label=#{USER_LAST_NAME}\"\n @selenium.click($xpath[\"pj_user\"][\"remove_user_pj\"])\n sleep WAIT_TIME\n @selenium.add_selection $link_texts[\"pj_user\"][\"non_member\"], \"label=#{USER_LAST_NAME}\"\n @selenium.click($xpath[\"pj_user\"][\"add_user_pj\"])\n assert !@selenium.is_editable($xpath[\"pj_user\"][\"add_user_pj\"])\n sleep WAIT_TIME\n logout\n end", "title": "" }, { "docid": "acd09d125633df4f934eaf5869a04481", "score": "0.592437", "text": "def check_login web\n url = 'https://www.flickr.com/people/me'\n web.get url\n m = web.current_url.match(/login\\.yahoo\\.com/)\n return unless m\n\n puts 'Please log in to Flickr'\n\n wait = Selenium::WebDriver::Wait.new(timeout: 900)\n wait.until { web.current_url.match(%r{flickr\\.com/people}) }\nend", "title": "" }, { "docid": "422c05e843bfec1c923702b17234e67e", "score": "0.5923364", "text": "def test_004\n test_000\n login(\"root\",\"root\")\n ## add user \"pj_member\" to pu admin list\n add_pu_admin\n ## open pj admin page\n open_pj_admin_page(SAMPLE_PU,SAMPLE_PJ)\n begin\n assert_equal [\"#{USER_LAST_NAME}\"], @selenium.get_select_options($link_texts[\"pj_user\"][\"admin\"])\n rescue Test::Unit::AssertionFailedError\n printf \"This Test Fail!\\n\"\n @verification_errors << $!\n end\n logout\n end", "title": "" }, { "docid": "e427250b85170742d0a050ee2e6d3c8a", "score": "0.5915394", "text": "def test_should_not_delete_token_on_logout\n login_as :quentin\n get :logout\n assert_nil @response.cookies[\"auth_token\"]\n end", "title": "" }, { "docid": "dbd9e029d6c5ed49253938a390fe158f", "score": "0.59096617", "text": "def test_defaults_get_users_by_cookie_id\n # Step 1\n @user = setup_user\n\n # Step 2\n get \"/usr/#{@user.cookie_id}\", {}\n assert_response(@response, :success)\n assert_equal(@user.cookie_id, @parsed_response['cookie_id'], @parsed_response)\n\n # Step 3\n USER_KEYS.each do |field|\n refute_nil(@parsed_response[field], @parsed_response) if @parsed_response[field]\n end\n end", "title": "" }, { "docid": "31bfe0ab6218c05b061066e0d3390d78", "score": "0.59025705", "text": "def test_007\n test_000\n login(\"root\",\"root\")\n ## open SamplePJ1 member page\n open_pj_member_page(SAMPLE_PU,SAMPLE_PJ)\n @selenium.add_selection $link_texts[\"pj_user\"][\"member\"], \"label=#{USER_LAST_NAME}\"\n @selenium.click($xpath[\"pj_user\"][\"remove_user_pj\"])\n assert !@selenium.is_editable($xpath[\"pj_user\"][\"remove_user_pj\"])\n sleep WAIT_TIME\n logout\n end", "title": "" }, { "docid": "ec573bf12bd816260afe139ef4a2a9af", "score": "0.5899474", "text": "def login_on_the_current_page(options = {})\n user(options)\n fill_in \"Username\", :with => @user.username\n unless options[:blank_password]\n fill_in \"Password\", :with => @user.password\n end\n click_button \"Login\"\n unless options[:blank_password]\n response.should contain(\"Welcome, #{@user.username}\")\n response.should contain(\"Logout\")\n end\nend", "title": "" }, { "docid": "eb5062042ed621ac5af75444d28be06a", "score": "0.5898138", "text": "def test_login_should_set_session\n\t\t\n\t\tactual = $zapi.login\n\t\tassert_not_equal(actual, nil)\n\n\tend", "title": "" }, { "docid": "f2ff0d65b51b637b9b05a26e574c9e29", "score": "0.5897693", "text": "def login\n clear_session\n end", "title": "" }, { "docid": "4e07e01183dddf753a3748cefadd83ad", "score": "0.5886686", "text": "def incorrent_login_test\n # password_nil\n # email_nil\n if (signin_password_idx_tmp == 0) and (signin_email_idx_tmp == 0) then\n p 'Im loged in ||| Email and password is correct'\n signin_login_button\n elsif (signin_password_idx_tmp == 1) and (signin_email_idx_tmp == 0) then\n p 'Im not loged in ||| Password is empty'\n elsif (signin_email_idx_tmp == 2) and (signin_password_idx_tmp == 0) then\n p 'Im not loged in ||| Email is empty'\n end\n end", "title": "" }, { "docid": "19aed7f84ae0b380afd6c419d5e389f1", "score": "0.5871095", "text": "def clear_cookies; end", "title": "" }, { "docid": "be8b8eedae38fc33bf9b2ae1aed1adc9", "score": "0.58518076", "text": "def member_login\n if params[:loginname] =~ /\\A([^@\\s]+)@((?:[-a-z0-9]+\\.)+[a-z]{2,})\\z/i\n @user = User.find_by_email(params[:loginname])\n judge_user(\"email\")\n else\n @user = User.find_by_username(params[:loginname])\n if @user.nil?\n @user = User.find_by_domain(params[:loginname])\n judge_user(\"domain\")\n elsif @user.passwd == Digest::SHA1.hexdigest(params[:passwd])\n login_now\n else\n @user = User.find_by_domain(params[:loginname])\n if @user.nil?\n flash[:error] = t'login.username_exist_password_wrong'\n go_redirect\n elsif @user.passwd == Digest::SHA1.hexdigest(params[:passwd])\n login_now\n else\n flash[:error] = t'login.user_exist_password_wrong'\n go_redirect\n end\n end\n end\n end", "title": "" }, { "docid": "096656013ed38b7b1dbeeac711e44c18", "score": "0.583267", "text": "def login; end", "title": "" }, { "docid": "096656013ed38b7b1dbeeac711e44c18", "score": "0.583267", "text": "def login; end", "title": "" }, { "docid": "096656013ed38b7b1dbeeac711e44c18", "score": "0.583267", "text": "def login; end", "title": "" }, { "docid": "096656013ed38b7b1dbeeac711e44c18", "score": "0.583267", "text": "def login; end", "title": "" }, { "docid": "096656013ed38b7b1dbeeac711e44c18", "score": "0.583267", "text": "def login; end", "title": "" }, { "docid": "096656013ed38b7b1dbeeac711e44c18", "score": "0.583267", "text": "def login; end", "title": "" }, { "docid": "096656013ed38b7b1dbeeac711e44c18", "score": "0.583267", "text": "def login; end", "title": "" }, { "docid": "c6149105d4a03e5719874a769c7f4e44", "score": "0.5831393", "text": "def login\n @mecha.get(@base_url) do |page|\n signout_link = page.search(\"//a[text()='Sign Out']/@href\")\n if signout_link.empty?\n login_result = page.form_with(:name => 'appleConnectForm') do |login|\n login.theAccountName = @username\n login.theAccountPW = @password\n end.submit\n\n raise 'login failed' if login_result.search(\"//a[text()='Sign Out']/@href\").empty?\n\n yield login_result\n else\n yield page\n end\n end\n end", "title": "" }, { "docid": "91c7c2667b0fc72f16c4a2af995ccc90", "score": "0.5830645", "text": "def page_after_login\n agent = Mechanize.new\n page = agent.get('http://godville.net/login')\n form = page.forms.first\n form['username'] = 'lordlenoks@rambler.ru'\n form['password'] = 'orochimaru'\n pp page = agent.submit(form, form.buttons.first)\n pp page = agent.get('http://godville.net/login')\n\n end", "title": "" }, { "docid": "5d0fee0fc9b7fadbeb5baa4f532c11ea", "score": "0.5829079", "text": "def index\n ck = cookies[:admin]\n if ck!=User.find(1).cookie\n render nothing: true, status: :unauthorized \n else \n @users = User.all \n end \n\n end", "title": "" }, { "docid": "09d1ecaa03e3a6577e31deb02d4ac078", "score": "0.582757", "text": "def test_006\n test_000\n login(\"root\",\"root\")\n open_pu_member_page(SAMPLE_PU)\n ## remove admin and pj member\n @selenium.add_selection $link_texts[\"pu_user\"][\"member\"], \"label=#{USER_LAST_NAME}\"\n @selenium.add_selection $link_texts[\"pu_user\"][\"member\"], \"label=#{MANAGER}\"\n @selenium.click($xpath[\"pu_user\"][\"remove_user_pu\"])\n ## create 5 new users\n create_many_user(5)\n ## add 5 users to pu member list\n add_many_pu_mem(SAMPLE_PU)\n ## add 5 users to pj member list\n add_many_pj_mem(SAMPLE_PU,SAMPLE_PJ )\n ## add 1 users to pj admin list\n add_a_pj_admin(SAMPLE_PU,SAMPLE_PJ )\n open_pj_member_page(SAMPLE_PU,SAMPLE_PJ)\n (1..5).each do |i|\n @selenium.add_selection $link_texts[\"pj_user\"][\"member\"], \"label=new#{i}\"\n end\n @selenium.click($xpath[\"pj_user\"][\"remove_user_pj\"])\n sleep WAIT_TIME\n all_members = @selenium.get_select_options($link_texts[\"pj_user\"][\"member\"])\n (1..5).each do |i|\n if !all_members.include?(\"new#{i}\")\n assert true\n end\n end\n @selenium.click($xpath[\"pj\"][\"pj_registration_administrator\"])\n sleep WAIT_TIME\n all_admins = @selenium.get_select_options($link_texts[\"pj_user\"][\"admin\"])\n (1..5).each do |i|\n if !all_admins.include?(\"new#{i}\")\n assert true\n end\n end\n logout\n end", "title": "" }, { "docid": "850ec4f98edf0b4e82c546edb8fc590a", "score": "0.58241075", "text": "def test_026\n test_000\n login(\"root\",\"root\")\n privilege_users_of_pj = PrivilegesUsers.find_all_by_pj_id(PJ_ID)\n assert_not_equal privilege_users_of_pj,[]\n delete_pj\n privilege_users_of_pj = PrivilegesUsers.find_all_by_pj_id(PJ_ID)\n assert_equal privilege_users_of_pj,[]\n logout\n end", "title": "" }, { "docid": "14bf7600a0959fdf96c5c084d61e8bd2", "score": "0.5820973", "text": "def verify_credentials\n \tfill_in('identifier', :with => \"test36650@gmail.com\")\n \tfind('#identifierNext').click\n \tfill_in('password', :with => \"tester123\")\n \tfind('#passwordNext').click\n\n \t# Below will be neccesary when logging in for the first time, as Google won't recognise your computer\n \t# fill_in('knowledgeLoginLocationInput', :with => \"London\")\n \t# find('#next').click\n end", "title": "" }, { "docid": "39a14c11d3ca3ff87a9af30f3dbad9f9", "score": "0.5818933", "text": "def login!\n session[:member_id] = @member.id\n end", "title": "" }, { "docid": "7869bdd04b6558448a3e2c2d0017a12c", "score": "0.5811413", "text": "def test_autologin; end", "title": "" }, { "docid": "ae0cad149532c2a255f07bbc0a7bf969", "score": "0.57970375", "text": "def test_should_allow_post_if_logged_in\n login_as :trevor\n get :show, :id => 1\n assert_response :success\n assert_select \"span#reply\"\n end", "title": "" }, { "docid": "d898e22fc77b59fe967cc92a435ef496", "score": "0.57956576", "text": "def index\n @projects = Project.all\n if params[:m]==\"clear\"\n puts 'Clearring Cookie'\n \n if cookies[:webcookie]\n puts cookies[:webcookie].size\n cookies.delete :webcookie\n #reset_session\n else\n puts \"No cookie\"\n end\n # puts cookies.signed[:a]\n end\n\n end", "title": "" }, { "docid": "2bb51878884ee366e096e463999a9c47", "score": "0.5794836", "text": "def login_yahoo(username, password)\n click_link('Sign in') if page.has_link?('Sign in')\n find('#login-username').set(username)\n find('#login-signin').click\n find('#login-passwd').set(password)\n find('#login-signin').click\n click_link('Cancel') if page.has_link?('Cancel') # Sometimes Yahoo will ask to secure your account, so we skip this.\n find('.skip-now').click if page.has_text?('secure my account') # Sometimes Yahoo will ask to add a phone number, so we skip this.\nend", "title": "" }, { "docid": "a7b304ba52da479442e79f7ec3d0413f", "score": "0.5793194", "text": "def test_login_with_lapsed_account\n \n end", "title": "" }, { "docid": "98b2a34181b4bfa9682039cf881d392b", "score": "0.57927525", "text": "def test_054\n test_000\n login(\"root\",\"root\")\n ## add user \"pj_member\" to SamplePU1 admin list\n add_pu_admin\n wait_for_button_enable($xpath[\"pu_user\"][\"add_user_pu\"])\n all_pjs_users = PjsUsers.find_all_by_user_id(USER_ID)\n assert_not_equal all_pjs_users,[]\n ## delete user \"pj_member\"\n delete_user_sample\n sleep 10\n all_pjs_users = PjsUsers.find_all_by_user_id(USER_ID)\n assert_equal all_pjs_users,[]\n logout\n end", "title": "" }, { "docid": "b74a7c832c2f475dfc8fc3ac41ccc634", "score": "0.5788992", "text": "def check_cookie\n return if session[:user_id]\n \n if cookies[:_gawkk_login] and action_name != 'forget_token'\n user = User.find_by_slug(cookies[:_gawkk_login].split('&')[0])\n return unless user\n cookie_hash = Digest::MD5.hexdigest(cookies[:_gawkk_login].split('&')[1] + user.salt)\n if user.cookie_hash == cookie_hash\n session[:user_id] = user.id\n user.register_login!\n end\n end\n end", "title": "" }, { "docid": "a1e78022b1b83de99a54fcb95d3d4958", "score": "0.57851315", "text": "def login_from_cookie\n member = cookies[:auth_token] && Member.find_by_remember_token(cookies[:auth_token])\n if member && member.remember_token?\n cookies[:auth_token] = { :value => member.remember_token, :expires => member.remember_token_expires_at }\n self.current_member = member\n end\n end", "title": "" }, { "docid": "ff71887c6340c68ac9d1b8225162ec77", "score": "0.57843375", "text": "def test_list_instr_invalid\r\n @request.session[:user] = User.find(users(:student1).id)\r\n \r\n roleid = User.find(users(:student1).id).role_id\r\n Role.rebuild_cache\r\n Role.find(roleid).cache[:credentials]\r\n AuthController.set_current_role(roleid,@request.session)\r\n \r\n @settings = SystemSettings.find(system_settings(:first).id)\r\n \r\n post :list_instructors\r\n assert_redirected_to '/denied' \r\n end", "title": "" }, { "docid": "c49e8f95d9adb683e1656f8b4642a9d6", "score": "0.5783167", "text": "def find_member user\n admin_login if @adsess.nil?\n\n headers = {'Content-Type'=>'application/x-www-form-urlencoded'}\n Net::HTTP.start(RAPID_BOARDS) do |http|\n response = http.post(\"/admin.php?adsess=#{@adsess}\",\n \"adsess=#{@adsess}&code=stepone&act=mem&USER_NAME=#{user.name}\",\n headers)\n case response\n when Net::HTTPSuccess\n m = />\\d+ Search Results<\\/div>(.*?)<\\/div>/m.match(response.body)\n if m.nil? || m.size < 2\n @log.warn \"Member lookup failed for #{user.name}\"\n break\n end\n table = m[1]\n r = /<tr>(.*?)<\\/tr>/mi\n s = table\n loop do\n m = r.match( s )\n break if m.nil?\n row = m[1]\n m2 = />(\\d+\\.\\d+\\.\\d+\\.\\d+)<.*>(.+?@.+?)</mi.match( row )\n user.ip, user.email = m2[1], m2[2] if m2\n s = m.post_match\n end\n else\n @log.error \"find member response was #{response.code}: #{response.message}\"\n exit\n end\n end\n user\n end", "title": "" }, { "docid": "f96f47743719d8510a1f3f905f4dc112", "score": "0.57812095", "text": "def test_should_logout\n login_as :quentin\n @request.cookies[:open_id] = 'http://fred.openid.org'\n @request.env['HTTP_REFERER'] = '/data_files'\n get :destroy\n assert_nil session[:user_id]\n assert_nil cookies[:open_id]\n assert_response :redirect\n end", "title": "" }, { "docid": "8fedfb602fd42a66ddfc4219e938b385", "score": "0.5778934", "text": "def log_out\n set_cookies nil\n @modhash = nil\n @userid = nil\n @username = nil\n end", "title": "" }, { "docid": "ad8ea62f2bee4fa3796722c98f3fcff0", "score": "0.57786", "text": "def test_users_preferences\n # first log in\n post '/login', { :username => GOOD_USERNAME, :password => GOOD_PASSWORD }\n\n # the show user page dumps all of the preferences.\n get '/in/show_user'\n assert last_response.ok?\n assert last_response.body.include?( GOOD_PREFERENCE_TOKEN) \n assert last_response.body.include?( GOOD_PREFERENCE_VALUE) \n assert !last_response.body.include?( BAD_PREFERENCE_TOKEN) \n\n end", "title": "" }, { "docid": "1351b4f6f0fe2e231aeeed6f84626ffb", "score": "0.57784796", "text": "def test_logout\r\n post :login, :login => {:name => users(:superadmin).name, :password => users(:superadmin).name}\r\n post :logout\r\n assert_redirected_to '/'\r\n end", "title": "" }, { "docid": "04f90d5569b92d1698671a33bffd21c0", "score": "0.57772034", "text": "def login_all user, pass\r\n\t\t@logged_in_wikis = []\r\n\t\tputs 'logging in... (wait)'\r\n\t\t@sf.each_with_index do |kv, i|\r\n\t\t\twiki, s = *kv\r\n\t\t\ts.login user, pass\r\n\t\t\t\r\n\t\t\tprint \"#{i+1}/#{@sf.length}\\r\"\r\n\t\t\t@logged_in_wikis << wiki\r\n\t\tend\r\n\t\t\r\n\t\t@logged_in_wikis.sort!; @logged_in_wikis.uniq!\r\n\t\treturn true\r\n\tend", "title": "" }, { "docid": "d9fba7f6b164e74eccc072ce0fabf5b0", "score": "0.57770205", "text": "def test_025\n test_000\n login(\"root\",\"root\")\n all_pj_mem = PjsUsers.find_all_by_pj_id(PJ_ID)\n assert_not_equal all_pj_mem, []\n delete_pj\n all_pj_mem = PjsUsers.find_all_by_pj_id(PJ_ID)\n begin\n assert_equal all_pj_mem, []\n rescue Test::Unit::AssertionFailedError\n @verification_errors << $!\n end\n logout\n end", "title": "" }, { "docid": "73b608f3255690849cb1b2e008535db3", "score": "0.57727635", "text": "def log_out\n\t\tsession.delete(:member_id)\n\t\t@current_member = nil\n\tend", "title": "" }, { "docid": "087a1fe11a3a0b2db6f67f7af4ea058a", "score": "0.57726705", "text": "def log_out\r\n session.delete(:member_id)\r\n @current_member = nil\r\n end", "title": "" }, { "docid": "84c297936e0ba29c2336fe4d9cf0c559", "score": "0.5768289", "text": "def index\n status_code = isMemberLoggedIn(false)\n if status_code == false\n flash[:notice] = \"Please login before you continue\"\n render members_signin_path and return\n end\n @members = Member.all\n end", "title": "" }, { "docid": "0c41201ea9b1bd181dfeeb49c6cb0bf1", "score": "0.57638633", "text": "def test_004\n test_000\n login(\"root\",\"root\")\n all_pj_mem = PjsUsers.find_all_by_pj_id(PJ_ID)\n sleep WAIT_TIME\n assert_not_equal all_pj_mem, []\n delete_pu\n pj_mem = PjsUsers.find_all_by_pj_id(PJ_ID)\n sleep WAIT_TIME\n begin\n assert_equal pj_mem, []\n rescue Test::Unit::AssertionFailedError\n @verification_errors << $!\n end\n logout\n end", "title": "" }, { "docid": "c6ab3ec588f51cd81ed971cdb20de4d9", "score": "0.5755972", "text": "def login\n unless @logged_in\n page = @agent.get 'https://www.fitbit.com/login'\n \n form = page.forms.first\n form.email = @email\n form.password = @pass\n \n page = @agent.submit(form, form.buttons.first)\n \n @userId = page.search(\"//div[@class='accountLinks']\").search(\"a\")[0]['href'].gsub('/user/','')\n # @agent.cookie_jar.jar[\"www.fitbit.com\"]['/']['uid'].value\n # @agent.cookie_jar.jar[\"www.fitbit.com\"]['/']['sid'].value\n\n @logged_in = true\n end\n end", "title": "" }, { "docid": "cc0db7ecd7bdd8770c9768e3f321182d", "score": "0.5751339", "text": "def test_auth()\n raise \"subclass must implement test_cookie to return true or false if login successful\"\n end", "title": "" }, { "docid": "67a1b793342cb8f95de51b39c61f3117", "score": "0.5744583", "text": "def login=(_); end", "title": "" }, { "docid": "78da9c0732aba2ad97c3a55b59ae8293", "score": "0.57424915", "text": "def logged_in=(_arg0); end", "title": "" }, { "docid": "efd0440d91e7538502dc76f73ac89932", "score": "0.5741888", "text": "def log_out\n session.delete(:member_id)\n @current_member = nil\n end", "title": "" }, { "docid": "80f6178896b9df569cdb3a04c321a146", "score": "0.5740336", "text": "def login\n \n end", "title": "" }, { "docid": "5545e7f1e8be303dcdca598b0a8ec837", "score": "0.5738415", "text": "def test_009\n test_000\n login(\"root\",\"root\")\n open_pu_member_page(SAMPLE_PU)\n @selenium.add_selection $link_texts[\"pu_user\"][\"member\"], \"label=#{USER_LAST_NAME}\"\n @selenium.click($xpath[\"pu_user\"][\"remove_user_pu\"])\n assert !@selenium.is_editable($xpath[\"pu_user\"][\"remove_user_pu\"])\n sleep WAIT_TIME\n logout\n end", "title": "" } ]
bcf63fedffa08d799535f6d0e8ea9b1c
Produces a name of a science You can optionally filter by specifying one or more of the following: `:empirical, :formal, :natural, :social, :basic, :applied`
[ { "docid": "373e5c562374b08b515ac47d2eb0f3c0", "score": "0.6118595", "text": "def science(*branches)\n selected = BRANCHES.values.flatten.uniq\n branches.each do |branch|\n selected &= BRANCHES[branch] if BRANCHES.key? branch\n end\n\n raise ArgumentError, 'Filters do not match any sciences' if selected.empty?\n\n sciences = []\n selected.each do |branch|\n sciences += translate(\"faker.science.branch.#{branch}\")\n end\n\n sample(sciences)\n end", "title": "" } ]
[ { "docid": "1462579cb9dd03b6c7b98e7534660027", "score": "0.6385301", "text": "def name\n if self[:category] == 'Fiction'\n if self[:year] > 2005\n 'The Paragraphe Hugh MacLennan Prize for Fiction'\n elsif self[:year] > 1990\n 'The Hugh MacLennan Prize for Fiction'\n else\n 'The QSPELL Prize for Fiction'\n end\n elsif self[:category] == 'Non-Fiction'\n if self[:year] > 1997\n 'The Mavis Gallant Prize for Non-Fiction'\n else\n 'The QSPELL Prize for Non-Fiction'\n end\n elsif self[:category] == 'Poetry'\n if self[:year] > 1991\n 'The A.M. Klein Prize for Poetry'\n else\n 'The QSPELL Prize for Poetry'\n end\n elsif self[:category] == 'First-Book'\n if self[:year] > 2010\n 'Concordia University First Book Prize'\n elsif self[:year] == 2010\n 'QWF First Book Prize'\n elsif self[:year] > 2001\n 'McAuslan First Book Prize'\n else\n 'First Book Prize'\n end\n elsif self[:category] == \"Children’s & Y.A. Lit.\"\n \"The QWF Prize for Children’s and Young Adult Literature\"\n elsif self[:category] == \"Playwriting\"\n \"The QWF Prize for Playwriting\"\n else\n 'QWF Translation Prize'\n end\n\n end", "title": "" }, { "docid": "574060d972a7fd314419e103836099c8", "score": "0.6385089", "text": "def display_name\n \"#{Institution.find(institution_id).name} #{gender}'s #{sport_name}\"\n end", "title": "" }, { "docid": "d42618f77626347e51debbc44cefaa5c", "score": "0.63825077", "text": "def science\n if @authors.size > 4\n authors = rev_name(@authors[0]) + \" et al.\"\n else\n authors = @authors.collect {|name| rev_name(name)}.join(', ')\n end\n page_from, = @pages.split('-')\n \"#{authors}, #{@journal} #{@volume} #{page_from} (#{@year}).\"\n end", "title": "" }, { "docid": "ae01040f87764e3bfdef5be3d92eba61", "score": "0.6346769", "text": "def official_title(filter)\n if filter == \"2013_africa_final\"\n return \"Provisional African Elephant Population Estimates: update to 31 Dec 2013\"\n end\n return nil\n end", "title": "" }, { "docid": "f52db8d1b1fdba6be2531bb224d5de86", "score": "0.6261759", "text": "def name\n \t'Study of '+studyable.name\n end", "title": "" }, { "docid": "c904f2fd894a023b0836c396da0c63c9", "score": "0.6094598", "text": "def science(name, opts = {})\n Scientist.run(name, opts) do |experiment|\n experiment.context(default_scientist_context)\n\n yield experiment\n end\n end", "title": "" }, { "docid": "2ed3de46b27f05685859e3526f4be897", "score": "0.59639937", "text": "def display_name\n name.familiar\n end", "title": "" }, { "docid": "012932ff6c26caea354343127932cd0f", "score": "0.5857142", "text": "def professional_name\n \"#{title.humanize} #{name}\"\n end", "title": "" }, { "docid": "ef604b40e289cc07f23a2e098dad23f9", "score": "0.58477634", "text": "def display_name\n species_name\n end", "title": "" }, { "docid": "f26daa58d3a28133164408028fa399b0", "score": "0.5845112", "text": "def scientificname(genus,epithet,author_year)\n if genus.nil? or epithet.nil?\n scientificname = nil\n else #\n if author_year.nil?\n scientificname = (genus + \" \" + epithet)\n else\n scientificname = (genus + \" \" + epithet + \" \" + author_year) \n end #end if has at least partial name\n end #if \n end", "title": "" }, { "docid": "47c0967d4372aef481b95de97c2021f7", "score": "0.5786688", "text": "def titled_name\n @honorific ||= 'Esteemed'\n titled_name = \"#{@honorific} #{@name}\"\n end", "title": "" }, { "docid": "f448eea270d0f4c39fdc9665ddd75e58", "score": "0.5774793", "text": "def text_search_filter_field_label\r\n params[:article_type] == 'qa' ? 'Question' : 'Title'\r\n end", "title": "" }, { "docid": "20373e004f0b420c06d40dd0a767e9e1", "score": "0.5750631", "text": "def display_species()\n @species == \"Other\" ? \"pet\" : @species\n end", "title": "" }, { "docid": "5a6d6dd457cff6505431fb7b6fc8ce37", "score": "0.57291794", "text": "def name\n self.formal_name.blank? ? self.informal_name : self.formal_name\n end", "title": "" }, { "docid": "4dbd809fa21e4e269e12bc86613e2fde", "score": "0.5717937", "text": "def getname\n \n @bestcsiinternationalstudentseventhost = Institute.where(\"name like ?\", \"#{params[:name]}\").first\n end", "title": "" }, { "docid": "00731d4f1ef693b832cc74d7a627d63c", "score": "0.5715985", "text": "def rules_regional_er_uisp\n @title = @season.get_full_name\n end", "title": "" }, { "docid": "84af280315fce97dfa364df28bc7a070", "score": "0.5695203", "text": "def salesman_name\n \"the #{powerful}#{fuel_efficient}#{name}\" # common pattern to write smaller methods\n # like powerful and fuel_efficient\n # and refer to them in a main method\n # rather than having lots of logic in one method\n end", "title": "" }, { "docid": "dc4908439d170c55138f00c2b33c66d8", "score": "0.56892985", "text": "def name_with_partitive_article\n partitive_article + translated_name.capitalize\n end", "title": "" }, { "docid": "15e2e126ed530b2e6c058204b5587051", "score": "0.5685681", "text": "def thesis_search_string\n search_string = \"PREFIX dc: <http://purl.org/dc/elements/1.1/>\n SELECT ?record\n WHERE {\n {\n ?record dc:type ?type .\n ?record dc:type 'http://purl.org/eprint/type/Thesis'\n OPTIONAL\n { ?record dc:publisher ?publisher . }\n FILTER regex (?type, 'aster')\n FILTER (!regex(?publisher,'oxford','i'))\n }UNION{\n ?record dc:type ?type .\n ?record dc:type 'Theses'.\n OPTIONAL\n {?record dc:publisher ?publisher .}\n FILTER regex (?type, 'aster')\n FILTER (!regex(?publisher,'oxford','i'))\n }UNION{\n ?record dc:type ?type .\n ?record <info:fedora/fedora-system:def/model#hasModel> <info:fedora/york:CModel-Thesis>\n FILTER regex (?type, 'aster')\n }\n }\"\n search_string\nend", "title": "" }, { "docid": "c9467cd57faa3a70e3dfa933ebcb3eed", "score": "0.56217283", "text": "def category_name\n Participant::FILTER_CATEGORIES[category.to_sym] if category\n end", "title": "" }, { "docid": "4735b94171f8a683c1bd22aff2f7d929", "score": "0.5610287", "text": "def strain_name\n strain.present? ? strain.name : \"\"\n end", "title": "" }, { "docid": "51324ff6a5c6e6dbfbfd777915bfbf23", "score": "0.56036997", "text": "def research_centre_title\n if self.research_centre\n return self.research_centre.title\n else\n return \"Undefined\"\n end\n end", "title": "" }, { "docid": "01037e8a80e34cdfaa1c07fb53fe55da", "score": "0.5594444", "text": "def organism_name\n return \"#{self.organism.species}\"\n end", "title": "" }, { "docid": "1f99ed4cba625e7945675f81e724d209", "score": "0.5582142", "text": "def name_seo_display\n self.name_seo[I18n.locale].parameterize\n end", "title": "" }, { "docid": "1f99ed4cba625e7945675f81e724d209", "score": "0.5582142", "text": "def name_seo_display\n self.name_seo[I18n.locale].parameterize\n end", "title": "" }, { "docid": "785031465c7fd837bbbcb608abbba59c", "score": "0.5581163", "text": "def name\n\t\t\"#{(salulation ? salulation.name : \"\")} #{first_name} #{last_name}\"\n\tend", "title": "" }, { "docid": "c3800c82e10cf477de39cb2b1567492d", "score": "0.5580953", "text": "def render_filter_name(name, opt = nil)\n return ''.html_safe if name.blank?\n shc_set(opt)\n text = t('blacklight.search.filters.label', label: name)\n css_class = shc_opt[:name_class] || 'filter-name'\n render_item(text, class: css_class)\n end", "title": "" }, { "docid": "6637d7d22ef39c55d01e1ef8160048a8", "score": "0.55663586", "text": "def short_name\n alt_names.map { |n| self.class.filter_ccss_standards(n, subject) }.compact.try(:first) || name\n end", "title": "" }, { "docid": "29cf83d882ea89246e4b7dc51d44e20d", "score": "0.5563403", "text": "def name\n return I18n.t('activerecord.attributes.research.' + symbol)\n end", "title": "" }, { "docid": "5fcb1f4d1be8971621eab3bdc28675f2", "score": "0.5562914", "text": "def search_title\n information_collection_request && information_collection_request.agency ? \"<b>#{title}</b> from #{information_collection_request.agency.fullname}\".html_safe : \"<b>#{title}</b>\".html_safe\n end", "title": "" }, { "docid": "8339f4738879be047f88128b64001665", "score": "0.55603474", "text": "def word_filter\n [\n { part_of_speech: :noun },\n { part_of_speech: :adjective, subclass: :na_adjective }\n ]\n end", "title": "" }, { "docid": "ad0042d496456bf33f69c1a17124a93f", "score": "0.5553844", "text": "def to_s\r\n\t\treturn \"#{@name.capitalize} is a #{@species} who #{can_fly? ? \"can\" : \"cannot\"} fly, described as #{@description}.\"\r\n\tend", "title": "" }, { "docid": "410385041cf7ae53f11cba44063b72c4", "score": "0.5552806", "text": "def name(options={})\n defaults = {:title => false, :middle => true}\n options = defaults.merge(options).symbolize_keys\n \n result = []\n result << self.academic_title.to_s if options[:title] && self.academic_title\n result << self.first_name\n result << self.middle_name if options[:middle]\n result << self.last_name\n result.compact.map {|m| m.to_s.strip}.reject {|i| i.empty?}.join(' ')\n end", "title": "" }, { "docid": "9071db766abc56fbfa03a9e6d8e201ef", "score": "0.5530573", "text": "def getname\n @name = params[:name]\n @studentmaxpublishing = Institute.where(\"name like ?\", \"%#{@name}%\").first\n end", "title": "" }, { "docid": "acb1c3fbdd23ce0f40e9c798f8fd1f3c", "score": "0.55304605", "text": "def name\n self.cached_name = \"Criterion #{criterion.try(:number)}\"\n self.cached_name << \" - #{locale}\"\n self.cached_name << \" - #{description}\"\n end", "title": "" }, { "docid": "4c70a71d39a0bcff4fc29745a448519f", "score": "0.5528007", "text": "def display_name_without_user_filter(name)\n name[:display_name]\n end", "title": "" }, { "docid": "6bf4ae40aa27a2823d43fbefd24ee59a", "score": "0.55241096", "text": "def formal_name \n salutation = self.company.salutation_types.find_by_id(self.salutation_id).try(:alvalue)\n format_full_name(salutation || \"\" , self.first_name, self.middle_name, self.last_name, self.nickname ,\"formal\")\n end", "title": "" }, { "docid": "695fc6c9cd19c987f075a973d2001df7", "score": "0.5521883", "text": "def calculate_filter_names(tag)\n categories = Classification.categories.collect { |c| c if c.show }.compact\n tag_val = \"\"\n categories.each do |category|\n entries = {}\n category.entries.each do |entry|\n entries[entry.description] = entry.tag.name # Get the fully qual tag name\n if tag == entry.tag.name\n tag_val = \"#{category.description}: #{entry.description}\"\n end\n end\n end\n tag_val\n end", "title": "" }, { "docid": "6918925bc2a96cbaeb31ffd91bb8d169", "score": "0.5513312", "text": "def text_filter\n case properties[:filter]\n when 'markdown': RDiscount\n when 'textile': RedCloth\n when 'none': nil\n else\n RDiscount\n end\n end", "title": "" }, { "docid": "adebbf4546da4453843af21c57e2ffd2", "score": "0.5511481", "text": "def display_course_name\n mini_text = self.mini == \"Both\" ? \"\" : self.mini\n result = self.short_or_full_name + self.semester + mini_text + self.year.to_s\n result.gsub(\" \", \"\")\n end", "title": "" }, { "docid": "e2c648271aa7d98085fab1670fba1946", "score": "0.5508918", "text": "def salutation(options={})\n return self.academic_title.name if self.academic_title\n return \"Mr\".t if self.gender == 'm' \n return \"Ms\".t if self.gender == 'f' \n end", "title": "" }, { "docid": "b454d391323142c1fa45699fb11bf98d", "score": "0.5507199", "text": "def singular_possessive\n if self.sex == \"Male\"\n return \"his\"\n elsif self.sex == \"Female\"\n return \"her\"\n end\n end", "title": "" }, { "docid": "0d9a8b49d9885dd9c8504448dfa4cc49", "score": "0.55048496", "text": "def scientist\n fetch('science.scientist')\n end", "title": "" }, { "docid": "0d9a8b49d9885dd9c8504448dfa4cc49", "score": "0.55048496", "text": "def scientist\n fetch('science.scientist')\n end", "title": "" }, { "docid": "bed080a1f9f8d33339a7fdaf1d31a321", "score": "0.5500035", "text": "def gen_term_restriction(admin_info, year_id)\n season = admin_info[2]\n year_abbrev = (year_id + 1990).to_s.slice(2, 3) + '-' +\n (year_id + 1 + 1990).to_s.slice(2, 3)\n if (admin_info[1] == 'sg')\n terms = \" \"\n else\n if (season == 'fall')\n terms = \" AND (terms.abbreviation = 'S1') \"\n else\n terms = \" AND (terms.abbreviation = 'S2' or \" +\n \"terms.abbreviation = '#{year_abbrev}') \"\n end\n end\n return terms\nend", "title": "" }, { "docid": "e622fcaae50a2fbd7d93300d4eea42f7", "score": "0.5493905", "text": "def rules_regional_er_csi\n @title = I18n.t('championships.rules') + ' ' + @season.get_full_name\n end", "title": "" }, { "docid": "51f215d3359052711877a483751baa29", "score": "0.5490144", "text": "def idea_by_category(category)\n category_obj = Category.where(name: category).first\n company_name = category_obj.companies.sample.name\n audience_name = @audiences.sample.name\n \"It's like #{company_name} for #{audience_name}\"\n end", "title": "" }, { "docid": "f410aa1b761271e63b105c3a410cdf55", "score": "0.5488748", "text": "def team_name(team)\n suffix = team.is_exhibition ? \" Exhibition #{team.id}\" : \"\"\n team.school.name + suffix\n end", "title": "" }, { "docid": "1e965d9eb3cd3ffc3cb423788ed53e14", "score": "0.54627955", "text": "def name\n (default_name if default_name.present?) || \n (iso_639_code if iso_639_code.present?) || \n (id ? UNKNOWN_LANGUAGE % id : \"\")\n end", "title": "" }, { "docid": "4539f2745b109e286c233963e9d9ad34", "score": "0.54460573", "text": "def name_with_any_as_default\n name_without_any_as_default || self.class.localized_facets_without_base(:name).map {|m| send(m)}.compact.first\n end", "title": "" }, { "docid": "4539f2745b109e286c233963e9d9ad34", "score": "0.54460573", "text": "def name_with_any_as_default\n name_without_any_as_default || self.class.localized_facets_without_base(:name).map {|m| send(m)}.compact.first\n end", "title": "" }, { "docid": "4539f2745b109e286c233963e9d9ad34", "score": "0.54460573", "text": "def name_with_any_as_default\n name_without_any_as_default || self.class.localized_facets_without_base(:name).map {|m| send(m)}.compact.first\n end", "title": "" }, { "docid": "112a6c8b1fc9493970bef1b2595880c4", "score": "0.54426163", "text": "def definitely\r\n ((proper_named? or definite_article == '') ? '' : \"#{definite_article} \") + name.to_s\r\n end", "title": "" }, { "docid": "5e7147b4d70cb01071fb323b87d31c63", "score": "0.5434402", "text": "def school_name\n school ? school.name : \"None\"\n end", "title": "" }, { "docid": "360bc0cdaaab935d316d2a35fd240aa9", "score": "0.5432178", "text": "def weather_description(description)\n # Add other sanitization things here if necessary\n # This one gets rid of \"Sky Is Clear\" which looks kinda weird\n description.downcase.gsub('sky is ', '').titleize\n end", "title": "" }, { "docid": "c222ef70d8ab349c97c4eb5e5096ed18", "score": "0.5412918", "text": "def title\n result = name.to_s.titleize\n result << \" (#{scoping.titleize})\" if scoping.is_a?(String)\n result\n end", "title": "" }, { "docid": "0ae7dfce9e4b1c4b9550700005915005", "score": "0.5407661", "text": "def salutations(persons_name, title = \"Baron\")\n \"It is an honor to meet the #{title} #{persons_name}\"\nend", "title": "" }, { "docid": "93f34dfd953aa7258fb79e28c2b31fc5", "score": "0.53940356", "text": "def name\n if @name == \"\"\n @article + \" \" + @generic\n else\n @name\n end\n end", "title": "" }, { "docid": "a511d0bcde2109b7959e96839f045e16", "score": "0.538395", "text": "def display_name\n name and name.downcase.titleize\n end", "title": "" }, { "docid": "5d10900ea70b068a6f3cf47371386aa8", "score": "0.53806347", "text": "def display_topic_filter_title\n if current_page?(subtopic_path(@city, @lets_talk, @help_out)) || current_page?(subtopic_path(@city, @lets_talk, @business_buzz)) || current_page?(subtopic_path(@city, @lets_talk, @grinds_gears)) || current_page?(subtopic_path(@city, @lets_talk, @sports))\n return \"<i class='fas fa-bullhorn'></i> Let's Talk\".html_safe\n elsif current_page?(subtopic_path(@city, @city_affairs, @ballots)) || current_page?(subtopic_path(@city, @city_affairs, @city_improvements)) || current_page?(subtopic_path(@city, @city_affairs, @events)) || current_page?(subtopic_path(@city, @city_affairs, @schools))\n return \"<i class='fas fa-gavel'></i> City Affairs\".html_safe\n elsif current_page?(subtopic_path(@city, @good_vibes, @good_news)) || current_page?(subtopic_path(@city, @good_vibes, @city_snaps)) || current_page?(subtopic_path(@city, @good_vibes, @furry_friends)) || current_page?(subtopic_path(@city, @good_vibes, @local_historian))\n return \"<i class='fas fa-hand-peace'></i> Good Vibes\".html_safe\n else\n end\n end", "title": "" }, { "docid": "64d9715f2ae8324e8e63997507c23db6", "score": "0.53718007", "text": "def name\n return \"Set Residential Furnace\"\n end", "title": "" }, { "docid": "ca84a5737bb2aa3a6cbe3ab7da002a8a", "score": "0.5369746", "text": "def label\n ((id == 5) || (code == 'SCI-ENG')) ? 'Brown Sci. Eng.' : name\n end", "title": "" }, { "docid": "a18fb0f1c2ded30b986b33aabb8afc15", "score": "0.53564996", "text": "def get_research_name\n return I18n.transliterate(self.content.to_s.strip)\n end", "title": "" }, { "docid": "8b0a0f7b19a809952dc25147ec5efef6", "score": "0.5355944", "text": "def full_subject(title)\n \"[Visualize the World] #{ title }\"\n end", "title": "" }, { "docid": "bb2b25b2379e5b1acccaac90bfc14c0d", "score": "0.5348298", "text": "def oopsla(year); inproceedings(Name.new('Object-Oriented Programming, Systems, Languages, and Applications', 'OOPSLA'), year) end", "title": "" }, { "docid": "00a5f317570c1ac073ef856ad6058072", "score": "0.53463954", "text": "def descriptive_text(format = :text)\n has_common_name = !common_name.blank?\n has_scientific_name = !scientific_name.blank?\n\n cn = common_name ? common_name.capitalize : ''\n sn = scientific_name ? scientific_name.capitalize : ''\n \n if has_common_name && has_scientific_name\n sprintf(format == :html ? '%s (<i>%s</i>)' : '%s (%s)', cn, sn)\n elsif has_common_name\n cn\n elsif has_scientific_name\n format == :html ? \"<i>#{sn}</i>\" : sn\n else\n # Fallback to description\n description\n end\n end", "title": "" }, { "docid": "bc3d08692e83e722b693a95dbe2888cb", "score": "0.5341787", "text": "def semester_word\n case semester\n when :SP\n \"Spring\"\n when :FA\n \"Fall\"\n when :SU\n \"Summer\"\n end\n end", "title": "" }, { "docid": "e342d5098e10d1e633281747e3f223f1", "score": "0.5332866", "text": "def american\n puts \"Let's explore American whiskies\"\n #call method to list whiskies for this particular type\n whisky_list('c/33/american-whiskey?filter=true&rfdata=~size.76#productlist-filter')\n end", "title": "" }, { "docid": "6695d0415d8c2c949d02392cb279186e", "score": "0.53260154", "text": "def display_name\n\t\t\"#{city.titleize} #{name.titleize}\"\n\tend", "title": "" }, { "docid": "698e833b1483b904195d120d8d931899", "score": "0.5321381", "text": "def do_titles\n @series_name = build_title(lime_survey).map{|k,v|\"#{k}(#{v})\"}.join(', ')\n @unfiltered_series_name = build_title(lime_survey_unfiltered).map{|k,v|\"#{k}(#{v})\"}.join(', ')\n end", "title": "" }, { "docid": "aa3544731afc6998b96435069d33cccb", "score": "0.53192073", "text": "def student_interests_proper(name,*int) \n \"#{name.capitalize} is interested in #{int}.\" # \n end", "title": "" }, { "docid": "488cb60fc14e963d7900ebea92680db1", "score": "0.5314335", "text": "def name_and_institution\n if institution\n return \"#{name} (#{institution})\"\n else\n return name\n end\n end", "title": "" }, { "docid": "0dc52d01fec5c5b1d4ce7898d83d7220", "score": "0.5314161", "text": "def name\n expert.try(:to_s)\n end", "title": "" }, { "docid": "db07a2a421633a36b23b43fe2493acdb", "score": "0.5312494", "text": "def filter_by_cohort\n puts \"Which cohort would you like to filter by?\"\n filter = gets.chomp.capitalize.to_sym\n puts \"The students in #{filter} cohort are:\"\n selected = @students.select do |student|\n if student[:cohort] == filter\n puts \"#{student[:name]}\"\n end\n end\n puts selected\nend", "title": "" }, { "docid": "08d20c0e7e1465ef2a4ca95a91733dc6", "score": "0.53085285", "text": "def index\n if params[:search]\n @theories = policy_scope(Theory).where(\"lower(name) LIKE ?\", \"%#{params[:search][:name].downcase}%\").order(name: :asc)\n else\n @theories = policy_scope(Theory).order(name: :asc)\n end\n end", "title": "" }, { "docid": "6d9e97cb665d0ef653ef93e5b44bdcf4", "score": "0.53074545", "text": "def report_name(name_type)\n case name_type\n when \"common_name\"\n common_name\n else\n species_code\n end\n end", "title": "" }, { "docid": "c1e2b07c4d885b27f925ebce39e2ee6a", "score": "0.5307377", "text": "def resourceType\n 'ImagingStudy'\n end", "title": "" }, { "docid": "3794439583ed83c6cf6a4497da2a9675", "score": "0.53046674", "text": "def name_with_profession\n \"#{profession.name}: #{name}\"\n end", "title": "" }, { "docid": "aafc05d966ae7f94e99b33ae8d71ed54", "score": "0.5304299", "text": "def generate_rapper_name\n\n all_salutations = %w(Sir Ma'am Mr Ms Missus DJ) #1\n all_actions = %w(Pop Mix Lift Flip Dance Twist Shake Bop Crank Sink Clean) #2\n all_articles = %w(the a 'em it my an) #3\n all_objects = %w(Trunk Burger Lamp Cannister Glass Bass Keys Synth Beat Rhythm)#4\n\n salutation = all_salutations.sample #5\n action = all_actions.sample #6\n article = all_articles.sample #7\n object = all_objects.sample #8\n\n puts \"My name is: #{salutation} #{action} #{article} #{object}\" #9-10\nend", "title": "" }, { "docid": "ada6d9e2266908f7fa42fcab2ec5a9e6", "score": "0.5302578", "text": "def text_name\n summary.to_s\n end", "title": "" }, { "docid": "39d2fdf3a7b0508d1fef3d4285f001f5", "score": "0.53013957", "text": "def name\n if artist and title\n \"#{artist} - #{title}\"\n elsif artist\n \"#{artist}\"\n elsif title\n \"#{title}\"\n else\n \"#{filename}\"\n end\n end", "title": "" }, { "docid": "614361b8fac2c9546d3593eedd90ec27", "score": "0.5288466", "text": "def name\n self.gender.name == \"Male\" ? gender = \"Men\" : gender = \"Women\" \n \"#{self.division.name}-#{self.age_class.name}-#{gender}\"\n end", "title": "" }, { "docid": "1c1d4057bee192b70a3a40e60234ae0c", "score": "0.52844644", "text": "def full_name\n CATEGORIES[name]\n end", "title": "" }, { "docid": "4e48e5ef46f05735550d118b10b1a0e9", "score": "0.5283199", "text": "def get_politics(politics)\n case politics\n when \"t\"\n politics = \"Tea Party\"\n when \"c\"\n politics = \"Conservative\"\n when \"n\"\n politics = \"Neutral\"\n when \"l\"\n politics = \"Liberal\"\n when \"s\"\n politics = \"Socialist\"\n end\n politics\nend", "title": "" }, { "docid": "7c0ba888c58b1faf8af3256c4cd96c06", "score": "0.52811694", "text": "def name(toy)\n toy[\"title\"]\n end", "title": "" }, { "docid": "1b88cb4c332779178b3f9ea7e92e1cbb", "score": "0.5278267", "text": "def searchable_name\n \"#{product.name} - #{short_desc}\"\n end", "title": "" }, { "docid": "ccf2bc9196ddee21d43658a269522030", "score": "0.52780294", "text": "def nice_title\n (title || works[0].nice_title) + \n \" (#{publisher.name}, #{year})\"\n end", "title": "" }, { "docid": "7b1b04d33d4b77065f9ca44130bd9e0c", "score": "0.52725756", "text": "def display_name\n if self.name == \"(region)\"\n # \"Region\"\n \"\"\n elsif self.name == \"(section)\"\n # \"Section\"\n \"\"\n else\n self.name\n end\n end", "title": "" }, { "docid": "e4819c68bdbe99b9fec64d8cf9231314", "score": "0.52681106", "text": "def to_s\n \"#{year_of_study.titleize}\"\n end", "title": "" }, { "docid": "48c935f4d3771a5b82daed8d30d5a623", "score": "0.52676606", "text": "def name\r\n return \"AedgSmallToMediumOfficeRoofConstruction\"\r\n end", "title": "" }, { "docid": "6e670ebc98d71eb5a2b2001907c08b33", "score": "0.526294", "text": "def nice_title\n (title || work[0].nice_title) + \" (#{publisher.name}, #{year})\"\n end", "title": "" }, { "docid": "a342e4ad780e150f43e8cd79b8adc5c2", "score": "0.52593714", "text": "def homework_cheater (name, title, person, gender, place, topic, date, thesis statment)\n\tif (gender == \"female\")\n\t\treturn\n\t\t\t\"#{title} by #{name}\n\t\t\t #{person} was the most important person of her time. She was very well known with #{topic} in #{date}. \n\t\t\t #{thesis statment}. When #{person} was in #{place}, she contributed greatly. I'm glad I got the opportunity to learn about #{person}.\"\n\n\telse\n\t\treturn\n\t\t\t\"#{title} by #{name} \n\t\t\t#{person} was the most important person of his time. He was very well known with #{topic} in #{date}. \n\t\t\t#{thesis statment}. When #{person} was in #{place}, he contributed greatly. I'm glad I got the opportunity to learn about #{person}.\"\n\t\t\t\n\tend\nend", "title": "" }, { "docid": "fd5861acbc320d74eb56d8a7205abdb4", "score": "0.5249471", "text": "def title\n @title = @title.capitalize.split(' ').map { |x| ([\"the\", \"a\", \"an\", \"and\", \"in\", \"of\"].include? x) ? x : x.capitalize }.join(' ')\nend", "title": "" }, { "docid": "5130fc4ade33daee3e24b78efd37e0bd", "score": "0.52488273", "text": "def name\n headline\n end", "title": "" }, { "docid": "5130fc4ade33daee3e24b78efd37e0bd", "score": "0.52488273", "text": "def name\n headline\n end", "title": "" }, { "docid": "0e764b03f852eb4574f4335b3c8a64f3", "score": "0.52486116", "text": "def title\n\t\treturn @title.split.each_with_index{|word, index| word.capitalize! unless (([\"the\", \"and\", \"over\", \"a\", \"an\", \"of\", \"in\"].include?(word)) && index != 0)}.join(\" \")\n\tend", "title": "" }, { "docid": "9fb7784754aa838dbb487ca66ae61537", "score": "0.52454495", "text": "def titlieze(title)\t\n\t\tstop_words = %w(and in the of a an)\n\t\ttitle.capitalize.split.map{|w| stop_words.include?(w) ?w : w.capitalize}.join(' ')\n\tend", "title": "" }, { "docid": "b6fcd73b9b376ee852d7896f8b698048", "score": "0.5241319", "text": "def formulations\n @generic = (params[:generic] || '')\n @concept_ids = Core::ConceptName.find_all_by_name(@generic).map{|c| c.concept_id}\n render :text => \"\" and return if @concept_ids.blank?\n search_string = (params[:search_string] || '').upcase\n @drugs = Core::Drug.find(:all,\n :select => \"name\",\n :conditions => [\"concept_id IN (?) AND name LIKE ?\", @concept_ids, '%' + search_string + '%'])\n render :text => \"<li>\" + @drugs.map{|drug| drug.name }.join(\"</li><li>\") + \"</li>\"\n end", "title": "" }, { "docid": "79d24710d674a73954c989add3aa088a", "score": "0.5236799", "text": "def description\n if definition[:operator] == \"is\"\n return \"is a #{definition[:value]}\" if [\"male\", \"female\"].include?(definition[:value])\n return \"has a neutral gender\" if \"neutral\" == definition[:value]\n return \"has an unknown gender\" if \"unknown\" == definition[:value]\n end\n \n if definition[:operator] == \"is_not\"\n return \"is not a #{definition[:value]}\" if [\"male\", \"female\"].include?(definition[:value])\n return \"does not have a neutral gender\" if \"neutral\" == definition[:value]\n return \"does not have an unknown gender\" if \"unknown\" == definition[:value]\n end\n\n \"has an unknown rule\"\n end", "title": "" }, { "docid": "32f3ba1b947de31bcba7b4ce0bf7c34f", "score": "0.5236467", "text": "def essay_writer title, topic, date, thesis_statement, pronoun\n first_name=topic.split(' ').last \n last_name=topic.split(' ').first\n if pronoun == \"male\" then pronoun_first = \"He\"\n else pronoun_first = \"She\"\n end\n if pronoun == \"male\" then pronoun_second = \"him\"\n else pronoun_second = \"her\"\n end\n return \"#{title}\n #{first_name} #{last_name} was an important person in #{date}. #{pronoun_first} did a lot. I want to learn more about #{pronoun_second}. #{thesis_statement} #{last_name}'s contribution is important.\"\nend", "title": "" } ]
d0b2dc7f71c33e696c61424d6eb79663
This navigate to given url
[ { "docid": "4ca84b835d84d5eb33785606df4cef03", "score": "0.0", "text": "def go_to(url)\n visit url\n el = first('#modal_overlay', wait: 0)\n\n within(el) do\n find('a.close-reveal-modal.button', wait: 0).click\n end unless el.nil?\n end", "title": "" } ]
[ { "docid": "544751240c1f35ac14210244bd42eb3c", "score": "0.79453844", "text": "def navigate_to(url)\n\t\t@@browser.goto url\n\tend", "title": "" }, { "docid": "89eac8517f42a87cb9150ef6f3f68d1a", "score": "0.78886694", "text": "def goto_url(url)\r\n @browser.goto url\r\n end", "title": "" }, { "docid": "aa105a3fca32c78167402eec980f03d6", "score": "0.7728098", "text": "def goto(url)\r\n @@browser.goto url\r\n end", "title": "" }, { "docid": "4042938cc6d8a17e61cff15244a0ef59", "score": "0.7648955", "text": "def direct_url url\n define_method(\"goto\") do\n @browser.goto url\n end\n end", "title": "" }, { "docid": "4042938cc6d8a17e61cff15244a0ef59", "score": "0.76484764", "text": "def direct_url url\n define_method(\"goto\") do\n @browser.goto url\n end\n end", "title": "" }, { "docid": "0e17cae85c22c2cf5c4b2e1f6c6aadfc", "score": "0.7644821", "text": "def get(url)\n @subject.navigate.to(url)\n end", "title": "" }, { "docid": "9fa932266fb23c63da2d32aab482efd6", "score": "0.76284176", "text": "def navigateto(url)\r\n @driver.navigate.to url\r\n end", "title": "" }, { "docid": "f4a75bdecd5d3cc15cc968d1dabc1576", "score": "0.762228", "text": "def goto(url)\n super(Rails.url(url))\n end", "title": "" }, { "docid": "ed3aed16aa1ab23859d79ac08636a414", "score": "0.75338465", "text": "def goto(url)\n @browser.goto(url)\n end", "title": "" }, { "docid": "53a36b6367ffa002472f6b22e3bfe4d0", "score": "0.7502941", "text": "def go_to_url(url)\n visit url\n end", "title": "" }, { "docid": "70499512ad9a840e9f94c29b39f7203e", "score": "0.7488274", "text": "def go_to\n @mech.get(@mech.current_page.uri)\n end", "title": "" }, { "docid": "5b0f2cc745e06952899047ad1146f383", "score": "0.7479155", "text": "def go_to_url(url)\n evaluate_script(\"Router.go('#{url}')\")\n end", "title": "" }, { "docid": "d86e7a79cad3b8f2cf8cfe8901b04da7", "score": "0.74554956", "text": "def go_to(url)\n @driver.get(url)\n end", "title": "" }, { "docid": "11b7c3ed47ccd55d8df774645bc35c48", "score": "0.73907053", "text": "def navigate_to url\n driver.goto url\n end", "title": "" }, { "docid": "0531eaf6dd06d71dbda95f6c442e2b4c", "score": "0.7327003", "text": "def get(url)\n navigate.to(url)\n end", "title": "" }, { "docid": "ee28f9fb24a7fbf04e15ee6f77ada8af", "score": "0.7286625", "text": "def goto_page(url)\n @browser.navigate.to url\n puts \"Moved TO #{url}\"\n end", "title": "" }, { "docid": "b4975f4b1348f0e0bdb86bdf58b74400", "score": "0.7283581", "text": "def open(url)\r\n @browser.navigate.to \"#{url}\"\r\n end", "title": "" }, { "docid": "15cf4ca0462ceb9df970835f5822ab08", "score": "0.7269512", "text": "def go_to(url)\n driver.get url\n end", "title": "" }, { "docid": "84ebcac419183d014f4e2fb4e47d797c", "score": "0.72690004", "text": "def redirect(url); end", "title": "" }, { "docid": "b8ed21e49cdf7ea99fb02cbccc8c5136", "score": "0.72554064", "text": "def goto_url(url)\r\n @driver.get(url)\r\n newUrl = log_current_url()\r\n end", "title": "" }, { "docid": "8553e4758f94e21d394fb0dc9a8c01a3", "score": "0.7219035", "text": "def visit url\n @url = url\n end", "title": "" }, { "docid": "1f56a221fdd39d3da78adb39dfbfd8a7", "score": "0.7215109", "text": "def gotToPage(url)\n @browser.goto(url)\nend", "title": "" }, { "docid": "cbe1bbb587fe41a8521eeea69fd02cfe", "score": "0.7206861", "text": "def visit(url)\n \n end", "title": "" }, { "docid": "991905f973d28b152b359810de09875e", "score": "0.7143085", "text": "def page_url(url)\n define_method(\"goto\") do\n lookup = url.kind_of?(Symbol) ? self.send(url) : url\n erb = ERB.new(%Q{#{lookup}})\n merged_params = self.class.instance_variable_get(\"@merged_params\")\n params = merged_params ? merged_params : self.class.params\n platform.navigate_to erb.result(binding)\n end\n end", "title": "" }, { "docid": "8436929f412d57346345188f2c423890", "score": "0.7133629", "text": "def navigate\n\t\t\tFeed.parse_url(self[1],browser)\n\t\t\tend", "title": "" }, { "docid": "bcb562fd261c44a89c8be5c3a7eec8c6", "score": "0.7062337", "text": "def get_page(url)\n @browser.get url\n Log.step \"Going to '#{url}' url\"\n end", "title": "" }, { "docid": "6a05cec8a70e8eb78196447f0add4443", "score": "0.7014757", "text": "def go(url)\n self.url.parse(url)\n end", "title": "" }, { "docid": "9e2f476d928ceab24968987cf208c926", "score": "0.7009039", "text": "def open\n @browser.goto URL\n end", "title": "" }, { "docid": "b3e54c32c400a73fb5fa6f7a3ab29c93", "score": "0.69876367", "text": "def go(url)\n self.url.parse(url)\n end", "title": "" }, { "docid": "11f28b9fc1a0c3d70181734731eb1562", "score": "0.6977186", "text": "def navigate(url)\n driver.navigate.to(url)\n return self\n end", "title": "" }, { "docid": "ee6efca5662831d55f2352dc4f873ee2", "score": "0.6968127", "text": "def visit\n return if @config[:url].nil?\n @browser.goto(@config[:url])\n end", "title": "" }, { "docid": "74871bfd7de66a36741acb9a25b8d83a", "score": "0.6939459", "text": "def url\n location.href\n end", "title": "" }, { "docid": "7454461e2df1dce983825b3ddae6df79", "score": "0.6914758", "text": "def to(url); end", "title": "" }, { "docid": "c07b002f88883e8c6dbf7e1e232f1027", "score": "0.6874328", "text": "def goto\n @site.goto self.class.url\n end", "title": "" }, { "docid": "c07b002f88883e8c6dbf7e1e232f1027", "score": "0.6874328", "text": "def goto\n @site.goto self.class.url\n end", "title": "" }, { "docid": "a024abf7712f33bf0f44c638b6ad4f26", "score": "0.6857751", "text": "def navigate_to(url, force_reload=false)\n execute_step(\"_sahi._navigateTo(\\\"\" + url + \"\\\", \"+ (force_reload.to_s()) +\")\");\n end", "title": "" }, { "docid": "a024abf7712f33bf0f44c638b6ad4f26", "score": "0.6857751", "text": "def navigate_to(url, force_reload=false)\n execute_step(\"_sahi._navigateTo(\\\"\" + url + \"\\\", \"+ (force_reload.to_s()) +\")\");\n end", "title": "" }, { "docid": "e3c3414b5571079c8977dfad05373a15", "score": "0.680147", "text": "def goto( url )\n @ie.navigate(url)\n waitForIE()\n #sleep 3\n end", "title": "" }, { "docid": "9e791584362563ada7f1a2c1912211df", "score": "0.67954445", "text": "def visit\n @browser.goto(URL)\n end", "title": "" }, { "docid": "f32097de77c74b3ae568f9a10af58fce", "score": "0.6794339", "text": "def load_url(url)\n if @current_url != url\n @current_url = url\n @driver.navigate.to url\n sleep 0.5\n end\n end", "title": "" }, { "docid": "5b4bfab7ff93b3c98da409428457531d", "score": "0.6782276", "text": "def url(url)\n\tbegin\n\t\tputs \"* navigating to\" + url\n\t\t#$ie.goto(url)\n\t\t$ie.link(:url, url).click\n\trescue\n\t\tputs \">>>ERROR\"\n\telse\n\t\tputs \" ok, link exists and destination loads\"\n\tend\n\tif $ie.url() == url\n\t\tputs \" ok, I stayed at the destination url\"\n\telse\n\t\tputs \" warning: rewriting or redirection took effect\"\n\tend\nend", "title": "" }, { "docid": "4c0bc96a0981dc8c3b0a41594dbd60e2", "score": "0.6737126", "text": "def go_to(uri)\n\t\t\t\tlog(\"Accessing #{uri}\")\n\t\t\t\turl=URI.parse(uri)\n\t\t\t\t@last_response=nil\n\t\t\t\tNet::HTTP.start(url.host,url.port) {|http|\n\t\t\t\t\tpath=\"/\"\n\t\t\t\t\tpath=url.path unless url.path==''\n\t\t\t\t\treq = Net::HTTP::Get.new(path)\n\t\t\t\t\t#\t\t\t\t\treq.basic_auth user,pass unless user.nil?\n\t\t\t\t\t@last_response = http.request(req)\n\t\t\t\t}\n\t\t\t\t@current_location=url.to_s\n\t\t\t\tif status/10==30 && headers['location']\n\t\t\t\t\tlog(\"Following redirection (code: #{status}) to #{headers['location']}\")\n\t\t\t\t\tgo_to(headers['location'].first)\n\t\t\t\tend\n\t\t\tend", "title": "" }, { "docid": "074f97750666e828b493440f5fe2cef7", "score": "0.66915333", "text": "def nav_to uri\r\n begin\r\n page = @agent.get uri\r\n rescue Mechanize::ResponseReadError => e\r\n page = e.force_parse\r\n end\r\n end", "title": "" }, { "docid": "ae6390dda0a332e5608c2d6340ddc14c", "score": "0.66752267", "text": "def goto(url)\n begin\n _old_goto(url)\n rescue => e\n e.message << \"\\nURL: #{url}\"\n raise e\n end\n end", "title": "" }, { "docid": "fce324fc3f21f18f0e2be1608fab4cb3", "score": "0.6662277", "text": "def navigate_to(path, method = :get, params = nil)\n self.send method, path, params || {}\n follow_redirect! while response.redirect?\n end", "title": "" }, { "docid": "dde32c7287a8ef25d4c40c75f850e929", "score": "0.66620696", "text": "def get_page(target_url); end", "title": "" }, { "docid": "dde32c7287a8ef25d4c40c75f850e929", "score": "0.66620696", "text": "def get_page(target_url); end", "title": "" }, { "docid": "dde32c7287a8ef25d4c40c75f850e929", "score": "0.66620696", "text": "def get_page(target_url); end", "title": "" }, { "docid": "dde32c7287a8ef25d4c40c75f850e929", "score": "0.66620696", "text": "def get_page(target_url); end", "title": "" }, { "docid": "dde32c7287a8ef25d4c40c75f850e929", "score": "0.66620696", "text": "def get_page(target_url); end", "title": "" }, { "docid": "dde32c7287a8ef25d4c40c75f850e929", "score": "0.66620696", "text": "def get_page(target_url); end", "title": "" }, { "docid": "dde32c7287a8ef25d4c40c75f850e929", "score": "0.66620696", "text": "def get_page(target_url); end", "title": "" }, { "docid": "dde32c7287a8ef25d4c40c75f850e929", "score": "0.66620696", "text": "def get_page(target_url); end", "title": "" }, { "docid": "dde32c7287a8ef25d4c40c75f850e929", "score": "0.66620696", "text": "def get_page(target_url); end", "title": "" }, { "docid": "dde32c7287a8ef25d4c40c75f850e929", "score": "0.66620696", "text": "def get_page(target_url); end", "title": "" }, { "docid": "dde32c7287a8ef25d4c40c75f850e929", "score": "0.66620696", "text": "def get_page(target_url); end", "title": "" }, { "docid": "dde32c7287a8ef25d4c40c75f850e929", "score": "0.66620696", "text": "def get_page(target_url); end", "title": "" }, { "docid": "dde32c7287a8ef25d4c40c75f850e929", "score": "0.66620696", "text": "def get_page(target_url); end", "title": "" }, { "docid": "dde32c7287a8ef25d4c40c75f850e929", "score": "0.66620696", "text": "def get_page(target_url); end", "title": "" }, { "docid": "dde32c7287a8ef25d4c40c75f850e929", "score": "0.66620696", "text": "def get_page(target_url); end", "title": "" }, { "docid": "dde32c7287a8ef25d4c40c75f850e929", "score": "0.66620696", "text": "def get_page(target_url); end", "title": "" }, { "docid": "dde32c7287a8ef25d4c40c75f850e929", "score": "0.66620696", "text": "def get_page(target_url); end", "title": "" }, { "docid": "dde32c7287a8ef25d4c40c75f850e929", "score": "0.66620696", "text": "def get_page(target_url); end", "title": "" }, { "docid": "dde32c7287a8ef25d4c40c75f850e929", "score": "0.66620696", "text": "def get_page(target_url); end", "title": "" }, { "docid": "dde32c7287a8ef25d4c40c75f850e929", "score": "0.66620696", "text": "def get_page(target_url); end", "title": "" }, { "docid": "dde32c7287a8ef25d4c40c75f850e929", "score": "0.6660869", "text": "def get_page(target_url); end", "title": "" }, { "docid": "dde32c7287a8ef25d4c40c75f850e929", "score": "0.6660869", "text": "def get_page(target_url); end", "title": "" }, { "docid": "dde32c7287a8ef25d4c40c75f850e929", "score": "0.6660869", "text": "def get_page(target_url); end", "title": "" }, { "docid": "dde32c7287a8ef25d4c40c75f850e929", "score": "0.6660869", "text": "def get_page(target_url); end", "title": "" }, { "docid": "dde32c7287a8ef25d4c40c75f850e929", "score": "0.6660869", "text": "def get_page(target_url); end", "title": "" }, { "docid": "dde32c7287a8ef25d4c40c75f850e929", "score": "0.6660869", "text": "def get_page(target_url); end", "title": "" }, { "docid": "dde32c7287a8ef25d4c40c75f850e929", "score": "0.6660869", "text": "def get_page(target_url); end", "title": "" }, { "docid": "dde32c7287a8ef25d4c40c75f850e929", "score": "0.6660869", "text": "def get_page(target_url); end", "title": "" }, { "docid": "dde32c7287a8ef25d4c40c75f850e929", "score": "0.6660869", "text": "def get_page(target_url); end", "title": "" }, { "docid": "dde32c7287a8ef25d4c40c75f850e929", "score": "0.6660869", "text": "def get_page(target_url); end", "title": "" }, { "docid": "dde32c7287a8ef25d4c40c75f850e929", "score": "0.6660869", "text": "def get_page(target_url); end", "title": "" }, { "docid": "dde32c7287a8ef25d4c40c75f850e929", "score": "0.6660869", "text": "def get_page(target_url); end", "title": "" }, { "docid": "dde32c7287a8ef25d4c40c75f850e929", "score": "0.6660869", "text": "def get_page(target_url); end", "title": "" }, { "docid": "dde32c7287a8ef25d4c40c75f850e929", "score": "0.6660869", "text": "def get_page(target_url); end", "title": "" }, { "docid": "dde32c7287a8ef25d4c40c75f850e929", "score": "0.6660869", "text": "def get_page(target_url); end", "title": "" }, { "docid": "dde32c7287a8ef25d4c40c75f850e929", "score": "0.6660869", "text": "def get_page(target_url); end", "title": "" }, { "docid": "dde32c7287a8ef25d4c40c75f850e929", "score": "0.6660869", "text": "def get_page(target_url); end", "title": "" }, { "docid": "dde32c7287a8ef25d4c40c75f850e929", "score": "0.6660869", "text": "def get_page(target_url); end", "title": "" }, { "docid": "dde32c7287a8ef25d4c40c75f850e929", "score": "0.6660869", "text": "def get_page(target_url); end", "title": "" }, { "docid": "dde32c7287a8ef25d4c40c75f850e929", "score": "0.6660869", "text": "def get_page(target_url); end", "title": "" }, { "docid": "dde32c7287a8ef25d4c40c75f850e929", "score": "0.6660869", "text": "def get_page(target_url); end", "title": "" }, { "docid": "dde32c7287a8ef25d4c40c75f850e929", "score": "0.6660869", "text": "def get_page(target_url); end", "title": "" }, { "docid": "dde32c7287a8ef25d4c40c75f850e929", "score": "0.6660869", "text": "def get_page(target_url); end", "title": "" }, { "docid": "dde32c7287a8ef25d4c40c75f850e929", "score": "0.6660869", "text": "def get_page(target_url); end", "title": "" }, { "docid": "dde32c7287a8ef25d4c40c75f850e929", "score": "0.6660869", "text": "def get_page(target_url); end", "title": "" }, { "docid": "dde32c7287a8ef25d4c40c75f850e929", "score": "0.6660869", "text": "def get_page(target_url); end", "title": "" }, { "docid": "dde32c7287a8ef25d4c40c75f850e929", "score": "0.6660869", "text": "def get_page(target_url); end", "title": "" }, { "docid": "dde32c7287a8ef25d4c40c75f850e929", "score": "0.6660867", "text": "def get_page(target_url); end", "title": "" }, { "docid": "dde32c7287a8ef25d4c40c75f850e929", "score": "0.6660867", "text": "def get_page(target_url); end", "title": "" }, { "docid": "dde32c7287a8ef25d4c40c75f850e929", "score": "0.6660867", "text": "def get_page(target_url); end", "title": "" }, { "docid": "dde32c7287a8ef25d4c40c75f850e929", "score": "0.6660867", "text": "def get_page(target_url); end", "title": "" }, { "docid": "dde32c7287a8ef25d4c40c75f850e929", "score": "0.6660867", "text": "def get_page(target_url); end", "title": "" }, { "docid": "dde32c7287a8ef25d4c40c75f850e929", "score": "0.6660867", "text": "def get_page(target_url); end", "title": "" }, { "docid": "dde32c7287a8ef25d4c40c75f850e929", "score": "0.6660867", "text": "def get_page(target_url); end", "title": "" }, { "docid": "dde32c7287a8ef25d4c40c75f850e929", "score": "0.6660867", "text": "def get_page(target_url); end", "title": "" }, { "docid": "dde32c7287a8ef25d4c40c75f850e929", "score": "0.6660867", "text": "def get_page(target_url); end", "title": "" } ]
c3871d5222723b5d7f73ef24ab11e035
Add more helper methods to be used by all tests here...
[ { "docid": "f35c1a50f235934537a25b804b443081", "score": "0.0", "text": "def disable_optional_module(user, optional_module, name)\n old_controller = @controller\n sign_in user\n @controller = Admin::OptionalModulesController.new\n patch :update, params: { id: optional_module, optional_module: { enabled: '0' } }\n assert_equal name, assigns(:optional_module).name\n assert_not assigns(:optional_module).enabled, 'Module should be disabled'\n assert_redirected_to admin_optional_module_path(assigns(:optional_module))\n sign_out user\n ensure\n @controller = old_controller\n end", "title": "" } ]
[ { "docid": "e708ad90e8ce43e3a3a3a99c57b26047", "score": "0.7330966", "text": "def test_legacy_helpers\n assert_equal @patron.primary_phone, @patron.primary_address_phone\n assert_equal @patron.secondary_phone, @patron.secondary_address_phone\n assert_nil @patron.primary_address_mobile_phone\n assert_nil @patron.secondary_address_mobile_phone\n end", "title": "" }, { "docid": "62158baafece84b452b305badc5dd98c", "score": "0.701972", "text": "def helpers; end", "title": "" }, { "docid": "62158baafece84b452b305badc5dd98c", "score": "0.701972", "text": "def helpers; end", "title": "" }, { "docid": "62158baafece84b452b305badc5dd98c", "score": "0.701972", "text": "def helpers; end", "title": "" }, { "docid": "20eee1803dc33c3ccfc6a8680fd523f5", "score": "0.6772961", "text": "def my_tests\n end", "title": "" }, { "docid": "8fbc98d9068bd9c82033a031286f0a1e", "score": "0.6679903", "text": "def tests; end", "title": "" }, { "docid": "8fbc98d9068bd9c82033a031286f0a1e", "score": "0.6679903", "text": "def tests; end", "title": "" }, { "docid": "35a51327dd0b5c9a884bb0e6f7155697", "score": "0.6583205", "text": "def testing\n # ...\n end", "title": "" }, { "docid": "69183812dabe6ebac3d8677793cde36c", "score": "0.65507036", "text": "def test_legacy\n # Set up legacy handlers\n setup_legacy_handling\n\n common_tests\n end", "title": "" }, { "docid": "171bfbcb531c5e13322384224eba1358", "score": "0.6377433", "text": "def test_method\n end", "title": "" }, { "docid": "cea60b0acdb7de568a5c50ae7b273ca6", "score": "0.63762784", "text": "def define_helpers; end", "title": "" }, { "docid": "e5678489698697cac867eefa3107f325", "score": "0.632961", "text": "def test_defaults\n end", "title": "" }, { "docid": "b4151c446130d8bada93b3f12a97c3e7", "score": "0.6280821", "text": "def self_test; end", "title": "" }, { "docid": "b4151c446130d8bada93b3f12a97c3e7", "score": "0.6280821", "text": "def self_test; end", "title": "" }, { "docid": "a9f4c2a19b80ba89e2afaa1cdd14095b", "score": "0.6249786", "text": "def test_case; end", "title": "" }, { "docid": "3c56049dd66f1032f1691f17f56e4323", "score": "0.6142927", "text": "def default_test; end", "title": "" }, { "docid": "e0f668536718fe84c2cc973adb16180b", "score": "0.6137607", "text": "def default_test\r\n end", "title": "" }, { "docid": "1630b8218c41f859a281c2cd83c785cf", "score": "0.6121912", "text": "def default_test\n end", "title": "" }, { "docid": "1a6186064d8218f9aa0c8b82bcc4fdae", "score": "0.6108209", "text": "def __dummy_test__\n end", "title": "" }, { "docid": "1e20b1e88eb6d79a135f027c2a8502e5", "score": "0.60972595", "text": "def test_added_methods\r\n assert_respond_to @default_user, :roles\r\n assert_respond_to @default_user, :has_role?\r\n \r\n assert_respond_to @default_user, :permissions\r\n assert_respond_to @default_user, :has_static_permission?\r\n end", "title": "" }, { "docid": "6d38da185911f6d09c6d530dc9bd6275", "score": "0.60949636", "text": "def test_nothing\n end", "title": "" }, { "docid": "b6a34c1cdc4af361a5503050daa524bc", "score": "0.6085482", "text": "def default_test\n end", "title": "" }, { "docid": "8f1c94592f39e6f7649463118849a3c2", "score": "0.6077252", "text": "def test_cases; end", "title": "" }, { "docid": "45492bf33d5cf4794ffea9eaaed11a44", "score": "0.60748607", "text": "def test_users_searches\n do_users_all\n do_simple_query\n do_tag_query\n do_profile_query\n end", "title": "" }, { "docid": "0ed5036e40dc2ffbabaa5175a4fecb06", "score": "0.603319", "text": "def stest_method_1(test); end", "title": "" }, { "docid": "f29131d9d58f129251021071e5c0e919", "score": "0.60055846", "text": "def test_should_eat()\n yay_or_nay = should_eat(\"ice cream\", \"winter\")\n assert_equal(\"False\", should_eat)\n end", "title": "" }, { "docid": "07657037551d95ae713a97cd33441602", "score": "0.60010356", "text": "def test_nothing\n end", "title": "" }, { "docid": "e72416c568ecd0002ea352c070ac9587", "score": "0.59755695", "text": "def should; super end", "title": "" }, { "docid": "154f5c1f18576f3da8e2e0aa4e6600d9", "score": "0.5975158", "text": "def before_test(test); end", "title": "" }, { "docid": "154f5c1f18576f3da8e2e0aa4e6600d9", "score": "0.5975158", "text": "def before_test(test); end", "title": "" }, { "docid": "072514f3348fe62556dcdfd4b06e3d08", "score": "0.5973282", "text": "def spec; end", "title": "" }, { "docid": "072514f3348fe62556dcdfd4b06e3d08", "score": "0.5973282", "text": "def spec; end", "title": "" }, { "docid": "739a08b50dfbd16cb7de69fa33dddb13", "score": "0.59555405", "text": "def test_entry_attrs\n raise \"Implement this method in your test class\"\n end", "title": "" }, { "docid": "f214afe7d254939af21d017373a66df1", "score": "0.59167516", "text": "def test_get_content_for\n end", "title": "" }, { "docid": "0d4b620075906cbc657bf6965cdeaf0c", "score": "0.59057903", "text": "def test\n end", "title": "" }, { "docid": "0d4b620075906cbc657bf6965cdeaf0c", "score": "0.59057903", "text": "def test\n end", "title": "" }, { "docid": "0d4b620075906cbc657bf6965cdeaf0c", "score": "0.59057903", "text": "def test\n end", "title": "" }, { "docid": "66275d321a819c38ced54a528b4a350e", "score": "0.5894578", "text": "def test_hack\n assert(true)\n end", "title": "" }, { "docid": "c0c51b279cb409d89ddbae43f0a391e0", "score": "0.5886192", "text": "def test_pet_shop_name # this uses a function calles pet_shop_name ans passes in the argument @petshop (which contains the list of pets and admin info)\n name = pet_shop_name(@pet_shop) # the function should pull out the the name:\n assert_equal(\"Camelot of Pets\", name) # should return Camelot of pets\n end", "title": "" }, { "docid": "7545a391a5ee3a4356d9df2fd2e8a4f7", "score": "0.58858806", "text": "def test \n end", "title": "" }, { "docid": "ffc850710186fcd9239eacdea566962f", "score": "0.5885474", "text": "def test_nothing; end", "title": "" }, { "docid": "c0f6608b3c4fd4851a29319d6766ea3c", "score": "0.58805525", "text": "def test_entry_attrs\n raise 'Implement the method \"test_entry_attrs\" in your test class'\n end", "title": "" }, { "docid": "e9748b85ddb9d5afe3a6b48a9795e53c", "score": "0.5860731", "text": "def test\n\n end", "title": "" }, { "docid": "4064f9752c2291871c38289ab3c1a85e", "score": "0.5860412", "text": "def compare_tests(test_a, test_b); end", "title": "" }, { "docid": "4064f9752c2291871c38289ab3c1a85e", "score": "0.5860412", "text": "def compare_tests(test_a, test_b); end", "title": "" }, { "docid": "1ea0145f1766317f8875773e74bd2a56", "score": "0.584998", "text": "def assertions; end", "title": "" }, { "docid": "1ea0145f1766317f8875773e74bd2a56", "score": "0.584998", "text": "def assertions; end", "title": "" }, { "docid": "5a628fb61130e971532ad3ae10b6ec45", "score": "0.58033717", "text": "def test_setup\r\n \r\n end", "title": "" }, { "docid": "40198eea5846f44a3e00ab2743b45786", "score": "0.5794802", "text": "def test_truth\n end", "title": "" }, { "docid": "a2bb500f32bca367ac2d11bf188f9fae", "score": "0.5785648", "text": "def build_test_helper \n \n return if skip_method(__method__)\n \n puts \"build Rails test helper for #{model_name} in test/helpers\"\n filename = \"#{plural_table_name}_helper_test.rb\"\n\n template = File.read(template(\"rails/test/helper_test.rb\"))\n # #text = ERB.new(template, nil, '-').result(binding)\n text = Erubis::Eruby.new(template).evaluate( self )\n\n path = namespaced_path(\"test/helpers\",filename)\n write_artifact(path,text) \n end", "title": "" }, { "docid": "18938862ec170ba5111841b2b09d0cb0", "score": "0.57691133", "text": "def make_assertions_on_tests( tests, method )\n assert_equal false, tests[:bad].__send__( method )\n assert_equal true, tests[:good].__send__( method )\n assert_equal true, tests[:extra_good].__send__( method )\n end", "title": "" }, { "docid": "45c7bac950ebb553e47fe97772c22279", "score": "0.57356757", "text": "def default_test\n end", "title": "" }, { "docid": "45c7bac950ebb553e47fe97772c22279", "score": "0.57356757", "text": "def default_test\n end", "title": "" }, { "docid": "cdcf7041167fe38d20eca416cb788b46", "score": "0.5733712", "text": "def test_entry\n raise \"Implement this method in your test class\"\n end", "title": "" }, { "docid": "6e899f20472b59b187c8e96210ea6877", "score": "0.5718457", "text": "def helper_method(*methods); end", "title": "" }, { "docid": "2016220e624ab162601ef3d40450afc7", "score": "0.569885", "text": "def integration_test()\n return [\"all\"]\n end", "title": "" }, { "docid": "943cf9af522cfe9eb55e77c85fcac501", "score": "0.5686251", "text": "def test_entry\n raise 'Implement the method \"test_entry\" in your test class'\n end", "title": "" }, { "docid": "169182cdb78de5f4c93943de92b336c4", "score": "0.56847906", "text": "def test_order; end", "title": "" }, { "docid": "50252b7dd2edb74d755ef9e13380be6a", "score": "0.56680214", "text": "def test_nothing\n return true\n end", "title": "" }, { "docid": "e55af74cbc0d30871ab8268ce13af376", "score": "0.5660432", "text": "def test_a\n end", "title": "" }, { "docid": "40d2e64548af47364f7f86ee0cf0c3b9", "score": "0.56465375", "text": "def test_frameworks; end", "title": "" }, { "docid": "faa2c5a9488752f24dd0c080cfb70e0d", "score": "0.5645647", "text": "def prepare_helpers\n base = File.join(config[:test_base_path], \"helpers\")\n\n helper_files.each do |src|\n dest = File.join(sandbox_suites_dir, src.sub(\"#{base}/\", \"\"))\n FileUtils.mkdir_p(File.dirname(dest))\n FileUtils.cp(src, dest, preserve: true)\n end\n end", "title": "" }, { "docid": "3aaa68cd8ecc624e36ded9d607808521", "score": "0.5644992", "text": "def smoke_test ()\n\n smoke_test = [\"rest_get\"]\n return smoke_test\n end", "title": "" }, { "docid": "99076923bb0cf0291fefbfddc9b54200", "score": "0.56355596", "text": "def add_testing\n setup_rspec\n setup_rspec_generators\n setup_rails_helper\n setup_factories_file\nend", "title": "" }, { "docid": "e2d5a5adc18a4aa0cfe383b18c5433f0", "score": "0.5591017", "text": "def testHelper arr, description, expected\n\tresult = leastOccuringValueInArray(arr)\n\tString resultType = result.class\n\t \n\tString testStatus = \"Failed\"\n\tif (leastOccuringValueInArray(arr).class == expected.class)\n\t\t(leastOccuringValueInArray(arr) == expected)? testStatus = \"Passed\" : testStatus = \"Failed\"\n\tend\n\t\n\t# Print test results\n\tputs \"| \" + testStatus + \" | \" + description + \", expected: \" + expected.to_s + \"(\" + expected.class.to_s + \")\" + \", actual: \" + result.to_s + \"(\" + resultType.to_s + \")\"\nend", "title": "" }, { "docid": "528fe3d9847b83794281c6b3c530d2a4", "score": "0.55830294", "text": "def test_respond_to\n assert_respond_to system_wide, :role\n assert_respond_to system_wide, :role=\n assert_respond_to system_wide, :inspect\n assert_respond_to system_wide, :object_id\n end", "title": "" }, { "docid": "8c368e3c13ebb7f555d9fa1697745567", "score": "0.5579137", "text": "def final_test_methods\n return []\n end", "title": "" }, { "docid": "fc89b8569cbe9cb2fde989a0b13686d6", "score": "0.55729306", "text": "def tests=(_arg0); end", "title": "" }, { "docid": "fc89b8569cbe9cb2fde989a0b13686d6", "score": "0.55729306", "text": "def tests=(_arg0); end", "title": "" }, { "docid": "b58cbce0e86395667aaeb65004559c80", "score": "0.5563504", "text": "def running_test_case; end", "title": "" }, { "docid": "74e67bf962c06c9877d177931c1a9fd0", "score": "0.555469", "text": "def test\n return \"\ndef test_#{@test_name}\n assert_nothing_raised(#{self.class.name}) do\n #{@method} :#{@action}, #{@params.inspect}, #{@session.inspect}, #{@flash.inspect}\n end\nend\n\"\n end", "title": "" }, { "docid": "7ffdde7d615aec4261d2758a95b8a514", "score": "0.55488664", "text": "def smoke_test()\n return [\"case_aaaa\"]\n end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.5540873", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.5540873", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.5540873", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.5540873", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.5540873", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.5540873", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.5540873", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.5540873", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.5540873", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.5540873", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.5540873", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.5540873", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.5540873", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.5540873", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.5540873", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.5540873", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.5540873", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.5540873", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.5540873", "text": "def setup; end", "title": "" }, { "docid": "8196f9f7adcc90f7493f0b9d8511e1da", "score": "0.55373555", "text": "def test_guest_name\n assert_equal('Peter', @guest1.return_guest_name)\n end", "title": "" }, { "docid": "5079bbbac6e291869785ee0f784bba94", "score": "0.5536957", "text": "def test_truth\n april = riders(:rider_1)\n assert_equal \"April Jones\", april.name\n trigger = horses(:horse_1)\n assert_equal \"Trigger\", trigger.name\n event2 = events(:event_2)\n assert_equal \"5 Horse Scramble\", event2.name\n \n end", "title": "" }, { "docid": "10809c6585f3f74041754b3d096c52ff", "score": "0.55365646", "text": "def generate_alltest\n\n end", "title": "" }, { "docid": "2fcde6dd78e2b7209b46d1a510f85f14", "score": "0.5536232", "text": "def test_camel_case\n raise NotImplementedError, 'Undecided as to whether to check camel case or not'\n end", "title": "" }, { "docid": "6a44c53137afdab36159f012159d9eeb", "score": "0.5533716", "text": "def test_find_single_item\n\n result=find_single_item(@warehouse_data, :b7)\n assert_equal(\"bath fizzers\",result)\n \nend", "title": "" }, { "docid": "9bef334f7de83d1e4caa736a7e66c862", "score": "0.5533225", "text": "def test_autocomplete_searches\n do_find_all\n do_autocomplete_query\n end", "title": "" }, { "docid": "14a52ea465414e26f1454b5d1aebe967", "score": "0.5530253", "text": "def my_array_splitting_method(source)\n source # This line is here to make sure all tests initially fail. Delete it when you begin coding.\nend", "title": "" }, { "docid": "14a52ea465414e26f1454b5d1aebe967", "score": "0.5530253", "text": "def my_array_splitting_method(source)\n source # This line is here to make sure all tests initially fail. Delete it when you begin coding.\nend", "title": "" }, { "docid": "14a52ea465414e26f1454b5d1aebe967", "score": "0.5530253", "text": "def my_array_splitting_method(source)\n source # This line is here to make sure all tests initially fail. Delete it when you begin coding.\nend", "title": "" }, { "docid": "14a52ea465414e26f1454b5d1aebe967", "score": "0.5530253", "text": "def my_array_splitting_method(source)\n source # This line is here to make sure all tests initially fail. Delete it when you begin coding.\nend", "title": "" } ]
bfbcddcc918ef40f76e5014276919dbc
Preview this email at
[ { "docid": "9eacc7bcad3f3294072da5ebf5470f4a", "score": "0.0", "text": "def reset_password\n user = User.first\n ticket = user.tickets.create(\n name: 'Réinitialiser le mot de passe',\n action: '/password_resets/%{token}/edit',\n duree: 2.days\n )\n UserMailer.reset_password(user, ticket)\n end", "title": "" } ]
[ { "docid": "947d18f31928dcf9761bdcbda7f18565", "score": "0.71475905", "text": "def preview\n @email = Email.find(params[:id])\n render :text => @email.body\n end", "title": "" }, { "docid": "f9cb02c07e98bbf5e69bcea1540cfe24", "score": "0.71186084", "text": "def preview\n @email = DirectEmail.find(params[:id])\n render :text => @email.body\n end", "title": "" }, { "docid": "cfa890b6d466c510d70096cccac1e22e", "score": "0.70552814", "text": "def preview\n @email = EventEmail.find(params[:id])\n render :text => @email.body\n end", "title": "" }, { "docid": "399ec3d4549775637e15238af0eed745", "score": "0.6985626", "text": "def preview_email\r\n invitation = Invitation.new(:user => current_user, :code => Code.new)\r\n mail = Mailers::Debate.create_invitation(current_user, @resource, invitation)\r\n @mail_body = mail.body.sub('No message provided', 'YOUR PERSONALIZED NOTE GOES HERE')\r\n\r\n render :inline => %Q{<%= simple_format(@mail_body, {:style => 'margin: 8px 0px'}) %>}\r\n end", "title": "" }, { "docid": "4136cc43de5e2f980372df7c52fd8390", "score": "0.6848472", "text": "def demo\n preview(DemoMailer.demo)\n end", "title": "" }, { "docid": "4136cc43de5e2f980372df7c52fd8390", "score": "0.6848472", "text": "def demo\n preview(DemoMailer.demo)\n end", "title": "" }, { "docid": "3fcdd82c9b9d1d4a5f90ec312cc78fec", "score": "0.6832406", "text": "def call(email, params = {})\n preview = new(params)\n message = preview.public_send(email)\n inform_preview_interceptors(message)\n message\n end", "title": "" }, { "docid": "d25c17f86292996607615eb9c054e84f", "score": "0.6663229", "text": "def call(email)\n preview = self.new\n preview.public_send(email)\n end", "title": "" }, { "docid": "25526d92f2d792b00fba757f6e52ea9d", "score": "0.64324814", "text": "def preview_newsletter\n @newsletter = @structure.newsletters.friendly.find params[:id]\n\n # Send email to no recipients to generate mail object\n mail = NewsletterMailer.send_newsletter(@newsletter, nil)\n @body = MailerPreviewer.preview(mail)\n\n render layout: false\n end", "title": "" }, { "docid": "f6daaf5ce5da705a1f0c58ee118a56be", "score": "0.631654", "text": "def preview\n task = MailTasks::Task.new( params[:task] )\n recipient = StoreUser.find( params[:id], :include => \"customer\", :readonly => true )\n mail = task.generate_mails( [recipient], false, mail_layout_options ).first\n render :text => mail.content_with_layout( mail_layout_options ), :layout => false\n # rescue => exception\n # headers[\"Content-Type\"] = \"text/plain\"\n # render :text => exception.to_yaml, :layout => false\n end", "title": "" }, { "docid": "f3feebb8ac9011091d0c03d87246f6b4", "score": "0.6304366", "text": "def preview_to(recipient)\n @newsletter = build_newsletter\n mail = build_mail\n mail.to = recipient.email\n replace_and_send_mail_safely(mail, recipient)\n end", "title": "" }, { "docid": "76953f45debf48c9e7371550fcd9058c", "score": "0.6181875", "text": "def show_body\n I18n.with_locale @email_locale do\n @mail_body = mail_body(@preview, @part_type)\n render :show_body, layout: 'rails_email_preview/email'\n end\n end", "title": "" }, { "docid": "937b6e006d361021f25250b7f6680735", "score": "0.6167911", "text": "def process_explanation_mail\n petition = Petition.where(status: 'live').first\n PetitionMailer.process_explanation_mail(Petition.live.first)\n end", "title": "" }, { "docid": "be065275a3b971f9bb4fbcb157cafe64", "score": "0.61338973", "text": "def content_for_preview( layout_options )\r\n content = self.body.dup\r\n content.gsub!( /<%=\\s?(@[^%]+)\\s?%>/, '<code>\\1</code>' )\r\n mail = Mail.new( :token => \"\" )\r\n mail.content = Render::Base.new( content ).mail_content\r\n template = IO.read(\"#{RAILS_ROOT}/app/views/mail_tasks/mailer/this_mail.text.html.rhtml\")\r\n \r\n render = Render::Base.new( template, layout_options.merge( :mail => mail ) )\r\n render.mail_content\r\n end", "title": "" }, { "docid": "92fb1acb57f276be09e4ebb46a761957", "score": "0.61305445", "text": "def preview\n frm.button(:value=>\"Preview\").click\n PreviewAnnouncements.new(@browser)\n end", "title": "" }, { "docid": "7ae21dffe5e7792b0592c5bbeca1b150", "score": "0.6115152", "text": "def compose_email\n @title = t 'conclusion_draft_review.send_by_email'\n end", "title": "" }, { "docid": "25f93f20195d3fd35daedad7f5b0c09f", "score": "0.61100966", "text": "def preview\n end", "title": "" }, { "docid": "25f93f20195d3fd35daedad7f5b0c09f", "score": "0.61100966", "text": "def preview\n end", "title": "" }, { "docid": "be43f96a8dd3cca39895a87d47c5936c", "score": "0.60882556", "text": "def show\n @decrypted = @autocrypt.decrypt(@email)\n @reply_params = {\n to: @email.from,\n subject: 'Re: ' + @email.subject,\n body: (@decrypted || @email.body).gsub(/^/, '> ')\n }\n end", "title": "" }, { "docid": "aee89e53bc24ff5ac3a96a712fc63cf9", "score": "0.60132533", "text": "def preview\n attachments.first.file.url(:preview)\n rescue StandardError => exc\n logger.error(\"Message for the log file while retrieving preview #{exc.message}\")\n 'empty_file.png'\n end", "title": "" }, { "docid": "3e9e2e5f2a8b2767d177e2e244ba5a61", "score": "0.5982547", "text": "def preview\n redirect_to preview_url\n end", "title": "" }, { "docid": "3235c3be8b0de0d3d9598bb515fee81f", "score": "0.5970752", "text": "def preview\n @text = params[:deliverable][:description]\n render :partial => 'common/preview'\n end", "title": "" }, { "docid": "1e621d31e4b9dc856fe583ad3633c697", "score": "0.5921947", "text": "def preview_announcement(subject)\n frm.link(:text=>subject).click\n PreviewAnnouncements.new(@browser)\n end", "title": "" }, { "docid": "ef1d7504ad9e83acf74c10bd2036205b", "score": "0.5854165", "text": "def show\n if @sent_email.photo.nil?\n @display_name = ''\n @title = ''\n @flickr_url = ''\n else\n @display_name = @sent_email.photo.member.display_name\n @title = @sent_email.photo.title\n @flickr_url = @sent_email.photo.get_flickr_url\n end\n end", "title": "" }, { "docid": "8436fcb400ee3b0b42fb243a53f203ca", "score": "0.58256847", "text": "def preview\n frm.button(:value=>\"Preview\").click\n AssignmentsPreview.new(@browser)\n end", "title": "" }, { "docid": "8436fcb400ee3b0b42fb243a53f203ca", "score": "0.58256847", "text": "def preview\n frm.button(:value=>\"Preview\").click\n AssignmentsPreview.new(@browser)\n end", "title": "" }, { "docid": "be55982891d3c20940f89ed974693386", "score": "0.5801412", "text": "def send_preview(recipients, personalize=\"fallback\")\n options = { :body => {\n :PreviewRecipients => recipients.kind_of?(String) ? [ recipients ] : recipients,\n :Personalize => personalize }.to_json }\n response = post \"sendpreview\", options\n end", "title": "" }, { "docid": "8e8c77456b41c90c6a30477dc6b60cef", "score": "0.5798907", "text": "def create\n @mail = Mail.new(params[:mail])\n @mail.user = current_user\n \n if params[:preview_button] || !@mail.save\n render :action => \"new\"\n else\n flash[:notice] = 'Mail was successfully created.'\n redirect_to(@mail)\n end\n end", "title": "" }, { "docid": "a3057edf44e98379313914ffd39cab0a", "score": "0.57861274", "text": "def last_message_preview=(value)\n @last_message_preview = value\n end", "title": "" }, { "docid": "3ce41c67cbeb41328de97dbb15e9c9b8", "score": "0.5756108", "text": "def edit\n yield @editor\n @mail = @editor.mail\n @message = @mail.to_s\n end", "title": "" }, { "docid": "ad9d02befc3ec49a25ddc6547336e150", "score": "0.57435614", "text": "def preview_text\n return @preview_text\n end", "title": "" }, { "docid": "a181145e8cec601ac2e00de53e8e75a9", "score": "0.57311475", "text": "def preview_text\n return @preview_text\n end", "title": "" }, { "docid": "b9155eb9fccadbed9d4e6611c4f78a0d", "score": "0.5694853", "text": "def preview\n return @preview\n end", "title": "" }, { "docid": "7cff05e4d56a4add09f527ea9d13745c", "score": "0.5693586", "text": "def inspect\n \"#<Envelope::Message to=#{formatted_to} from=#{formatted_from} cc=#{formatted_cc} bcc=#{formatted_bcc} reply_to=#{formatted_reply_to} subject=\\\"#{subject}\\\" text_part=\\\"#{preview = (text_part || html_part); (preview && preview.gsub(/\\s+/, ' ') || 'No preview available')[0..50]}...\\\">\"\n end", "title": "" }, { "docid": "cc58e50ca7927ae842b43887dbce74f4", "score": "0.56733876", "text": "def petition_announcement_mail\n petition = Petition.where(status: 'live').first\n PetitionMailer.petition_announcement_mail(Petition.live.first)\n end", "title": "" }, { "docid": "44ea80774c61b90bcaba6d74ea0f29c1", "score": "0.56689703", "text": "def preview\n frm.link(:text=>\"Preview\").click\n PreviewOverview.new(@browser)\n end", "title": "" }, { "docid": "4780c2ddba600a03a929dee685e8b015", "score": "0.5667859", "text": "def preview() @page.find(input_elements[:preview]) end", "title": "" }, { "docid": "b7098c738ed638b436322a9d40e3ecbe", "score": "0.56230783", "text": "def preview(channel_id, msg_id, data)\n channel_config, message_config, text =\n prepare_message(channel_id, msg_id, data)\n chats = channel_config.chat_ids\n connector = channel_config.connector\n\n if message_allowed?(message_config, data)\n connector.preview(chats, text, message_config)\n else\n puts \"No message sent beacuse it's not allowed\"\n end\n end", "title": "" }, { "docid": "85d24641107b7b8928c8c435c956a8fc", "score": "0.5584482", "text": "def improve_and_reopen_mail\n petition = Petition.where(status: 'live').first\n PetitionMailer.improve_and_reopen_mail(Petition.live.first)\n end", "title": "" }, { "docid": "515f5e02d444f2f84027a0eb1fb3f65b", "score": "0.5580056", "text": "def hand_over_to_office_mail\n petition = Petition.where(status: 'live').first\n PetitionMailer.hand_over_to_office_mail(Petition.live.first)\n end", "title": "" }, { "docid": "85b4c928c0ba3aacc501a9e99a3cc205", "score": "0.556691", "text": "def content_preview\n self.send(content_preview_method)\n end", "title": "" }, { "docid": "ca1e7164ea8ab78b9e43aad8b22e4545", "score": "0.5565034", "text": "def write_about_hand_over_mail\n petition = Petition.where(status: 'live').first\n PetitionMailer.write_about_hand_over_mail(Petition.live.first)\n end", "title": "" }, { "docid": "7777b0e3d4437d15e372573f9b615042", "score": "0.553256", "text": "def preview\n order = current_user.orders.find_by_cookbook_id(params[:id])\n @cookbook = (order) ? order.cookbook : current_cookbook\n preview_path = \"#{PDF_PREVIEW_FOLDER}/preview_cookbook-#{@cookbook.id}_#{Time.now.to_i}.pdf\"\n session[:preview_filename] = preview_path\n preview = CookbookPreviewWorker.new(\n cookbook: @cookbook, \n filename: preview_path\n )\n preview.cookbook\n render \"previews/preview\"\n end", "title": "" }, { "docid": "47e9746a0d7aa24dae93513b9ea87cdd", "score": "0.55282027", "text": "def preview=(value)\n @preview = value\n end", "title": "" }, { "docid": "837df6d80885ad46a0b74133f6087495", "score": "0.5521174", "text": "def preview_path_for_attachment(attachment)\n preview_attachment_path(id: attachment.attachment_data.id, file: attachment.filename.split('.').first, extension: attachment.file_extension)\n end", "title": "" }, { "docid": "131f5be72d8d91fe8bc37cf6065d9caf", "score": "0.55182135", "text": "def preview(attachment, options)\n Rails.application.routes.url_helpers.rails_representation_path(attachment.preview(options), only_path: true)\n end", "title": "" }, { "docid": "a402fe821ec91701ed326fbd0764a589", "score": "0.54865557", "text": "def preview_doc\n @tpl = Template.find(params[\"template_id\"]) \n output = @tpl.render_by_model_id(params[:id], 'print', 'www.freightoperations.com:8080')\n render(:text => output, :layout => false) \n end", "title": "" }, { "docid": "cbfaf93e8dfde016fae0186e7ae256c8", "score": "0.54802716", "text": "def preview\n frm.button(:value=>\"Preview\").click\n @@file_number=0\n AssignmentStudentPreview.new(@browser)\n end", "title": "" }, { "docid": "cbfaf93e8dfde016fae0186e7ae256c8", "score": "0.54802716", "text": "def preview\n frm.button(:value=>\"Preview\").click\n @@file_number=0\n AssignmentStudentPreview.new(@browser)\n end", "title": "" }, { "docid": "ce0420b839abc3e50bdf50191e695a8e", "score": "0.5475045", "text": "def last_message_preview\n return @last_message_preview\n end", "title": "" }, { "docid": "207003d7d67001c459baabf0e9d19e9c", "score": "0.54698133", "text": "def preview\n @preview ||= Preview.new(self) #if has_preview?\n end", "title": "" }, { "docid": "d3ce0e7b5424ee8198e95867bdc90c6d", "score": "0.5462231", "text": "def tweet_reviewed_by_influencer(tweet)\n @tweet = tweet\n\n set_attachments\n\n mail(to: tweet.campaign.advertiser.user.email, subject: \"Notificaciones @ Social Target - Uno de tus tweets fue revisado/modificado por una empresa\")\n end", "title": "" }, { "docid": "6e3ce3bdf7eacbf8e674728ff677facc", "score": "0.54592174", "text": "def body_preview=(value)\n @body_preview = value\n end", "title": "" }, { "docid": "e40396d2558c1fea1c4d90a72d8d8442", "score": "0.5457588", "text": "def preview\n content[0..19]\n end", "title": "" }, { "docid": "42ab4468d345170000831d9ba7465e19", "score": "0.54561025", "text": "def view(review, recipient)\n @review = review\n\n mail(to: recipient.email, subject: \"#{@review.review_type == \"cto\" ? @review.booking.user.first_name : @review.booking.offer.user.first_name} vous a laissé un commentaire\")\n end", "title": "" }, { "docid": "c4c37923101690b48dd5cd062638893b", "score": "0.5434102", "text": "def new_review_email (review)\n\t@book = review.book\n\t@review = review\n\tmail :to => @book.readers.collect{|r| r.email},\n\t :subject=>\"New review for #{@book.title}\"\n end", "title": "" }, { "docid": "9d624b12ffbb4af4c239d1019d26e46c", "score": "0.54326165", "text": "def preview(element_key)\n parameter = { basic_auth: @auth }\n self.class.get(\"/elements/#{element_key}/preview\", parameter)\n end", "title": "" }, { "docid": "cf0eb44e46cee82a1b7bbf6ab2ff3b4c", "score": "0.5418592", "text": "def open\n mail = MailTasks::Mail.find_by_token( params[:id] )\n raise ActiveRecord::RecordNotFound unless mail # raise 404 if mail is not found\n \n options = {\n :post_back_url => url_for( :controller => \"/email\", :action => \"red_logo\" ),\n :base => [request.protocol, request.host].join\n }\n render :text => mail.content_with_layout( options ), :layout => false\n end", "title": "" }, { "docid": "62bd768124f0313fbd9acb10c1209f13", "score": "0.5416024", "text": "def emailOnMetareview(revieweeId)\r\n puts \"in Metareview\"\r\n participant = Participant.find_by_id(revieweeId).user_id\r\n asstId = Participant.find_by_id(revieweeId).parent_id\r\n user=User.find_by_id(participant)\r\n assignment=Assignment.find_by_id(asstId).name\r\n partialName=\"email_on_review_of_review\"\r\n if(user.email_on_review_of_review)\r\n email(user.email,\"Metareview\",ApplicationHelper::get_user_first_name(user),assignment,partialName)\r\n end\r\n end", "title": "" }, { "docid": "8fbeed6160ee7e6af2037cefa910dfb3", "score": "0.5406969", "text": "def body_preview\n return @body_preview\n end", "title": "" }, { "docid": "3fdb9c215087cddd044f2340b4eba2e6", "score": "0.5398783", "text": "def preview(*)\n nil\n end", "title": "" }, { "docid": "3fdb9c215087cddd044f2340b4eba2e6", "score": "0.5398783", "text": "def preview(*)\n nil\n end", "title": "" }, { "docid": "fdfcbe3610cfa8224f917b59dddbafc2", "score": "0.5390498", "text": "def preview\n preview_path = \"#{PDF_PREVIEW_FOLDER}/preview_extra_page-#{@extra_page.id}_#{Time.now.to_i}.pdf\"\n session[:preview_filename] = preview_path\n preview = CookbookPreviewWorker.new(\n cookbook: current_cookbook, \n filename: preview_path\n )\n preview.extra_page @extra_page.id\n render \"previews/preview\"\n end", "title": "" }, { "docid": "be508d8b4d84cb2bd833578681e0bf51", "score": "0.53865004", "text": "def reference_number_mail\n petition = Petition.where(status: 'live').first\n PetitionMailer.reference_number_mail(Petition.live.first)\n end", "title": "" }, { "docid": "414474b38e420837642cf2579ef32e12", "score": "0.53677875", "text": "def ask_office_for_answer_mail\n petition = Petition.where(status: 'live').first\n PetitionMailer.ask_office_for_answer_mail(Petition.live.first)\n end", "title": "" }, { "docid": "6102b6f6a972c86b604e972311e79902", "score": "0.5354904", "text": "def show\n set_retail\n end", "title": "" }, { "docid": "c00a4693591df8e04c8fbca6364ed0fe", "score": "0.53483963", "text": "def preview_name\n name.sub(/Preview$/, '').underscore\n end", "title": "" }, { "docid": "efcd8ffd2e7c2dc73fb83da98c33dfc6", "score": "0.53450906", "text": "def preview\n mixpanel_tab_event(\"View Item\", \"Get Preview URL\")\n begin\n embed_url = user_client.embed_url(params[:id])\n redirect_to embed_url\n rescue\n redirect_to no_support_url\n end\n\n end", "title": "" }, { "docid": "3074296a2ff72bb66da9a7bb8568ed7c", "score": "0.53428084", "text": "def blog_preview\n object._challenge\n end", "title": "" }, { "docid": "c06fad84c7c10288e46a5d75386ce367", "score": "0.5339015", "text": "def show\n session[:applicant_token] = params[:id] unless current_user\n @email = ERB.new(Settings.email_template).result(get_binding)\n p EMAIL: @email\n end", "title": "" }, { "docid": "fb50bbbe1204cb01132d2a9fe0325eda", "score": "0.5331245", "text": "def ping_reviewer(review)\n\n to_list = [review[:user].email]\n cc_list = []\n subject = 'Your unresolved Design Review(s)'\n\n @user = review[:user]\n @result = review[:results]\n \n if review[:urgent]\n attachments.inline['warning.png'] = File.read('app/assets/images/warning.png')\n headers['Importance'] = 'high'\n headers['X-Priority'] = '1'\n headers['X-MSMail-Priority'] = 'High'\n end\n\n mail( :to => to_list,\n :subject => subject,\n :cc => cc_list,\n ) \n end", "title": "" }, { "docid": "5fe896585d56f93e4b1078a4d359035d", "score": "0.5324016", "text": "def preview_text(maxlength = 30)\n return \"\" if description.blank?\n my_contents = description[\"contents\"]\n return \"\" if my_contents.blank?\n content_flagged_as_preview = my_contents.select { |a| a[\"take_me_for_preview\"] }.first\n if content_flagged_as_preview.blank?\n content_to_take_as_preview = my_contents.first\n else\n content_to_take_as_preview = content_flagged_as_preview\n end\n preview_content = self.contents.select { |content| content.name == content_to_take_as_preview[\"name\"] }.first\n return \"\" if preview_content.blank? || preview_content.essence.blank?\n text = preview_content.essence.preview_text(maxlength)\n text.size > maxlength ? \"#{text[0..maxlength]}...\" : text\n end", "title": "" }, { "docid": "8971287d85c4a67d05edc63669cee900", "score": "0.5320464", "text": "def link_to_preview(text, type_id, *args)\n link_to_function text, \"CCPEVE.showPreview(#{type_id.inspect})\", *args\n end", "title": "" }, { "docid": "f7cbe4cacb239c4e62807a8e8f70554a", "score": "0.52986485", "text": "def preview_text=(value)\n @preview_text = value\n end", "title": "" }, { "docid": "57dda273af8ce37db824f6e8a355fccb", "score": "0.52971554", "text": "def preview_text=(value)\n @preview_text = value\n end", "title": "" }, { "docid": "33f30c36b8434cb9483b295c3c23ff6b", "score": "0.52956325", "text": "def resume_confirm(email, username, filename)\n subject 'You have uploaded your resume to YouIntern'\n recipients email\n from 'support@youintern.com'\n sent_on Time.now\n \n body :username => username, :filename => filename\n end", "title": "" }, { "docid": "a7c3bcda25e3b266b7c19afab0b2f06a", "score": "0.52885884", "text": "def preview_text(max_length = 30)\n attachment&.name.to_s[0..max_length - 1]\n end", "title": "" }, { "docid": "32ef780c226a0ab69d1e9a2a61d72d39", "score": "0.52866477", "text": "def display_resume\n\t profile_resume = Profile.find_by_id(params[:id]).resume\n send_data(profile_resume.attachment_binary.data,\n\t\t\t\t :filename => profile_resume.name,\n\t\t\t\t :type => profile_resume.content_type,\n\t\t\t\t :disposition => \"attachment\"\n\t\t\t\t )\n end", "title": "" }, { "docid": "7aea9837feceef6a2ad67d23d180c6b7", "score": "0.52858466", "text": "def generate_complete_timeline_preview_url(given_timeline_id)\n tl_entry_to_use = Timeline.find(given_timeline_id)\n target_page_path = timeline_path(tl_entry_to_use)\n \n protocol_host_port = \"#{request.protocol}#{request.host_with_port}\"\n main_url = \"#{protocol_host_port}#{target_page_path}?preview=true\"\n \n url_to_return = URI::encode(main_url)\n return url_to_return\n end", "title": "" }, { "docid": "034d10eecb1ebdd9ac4f4a14ef8b2ff6", "score": "0.52848935", "text": "def preview(article)\n unless article.published_at.nil?\n article_path(article)\n else\n preview_path(article.preview_hash)\n end\n end", "title": "" }, { "docid": "cb866029fcefd35d9383e54ca4e4dd20", "score": "0.5274558", "text": "def post_edit_email\n NotificationMailer.post_edit_email('default@email.com')\n end", "title": "" }, { "docid": "069b315cfe8b01984d499b1e1e3b95d0", "score": "0.52651525", "text": "def reviewed(inquiry)\n @inquiry = inquiry\n mail to: inquiry.email, subject: 'Verteo Biopharma Inquiry Reviewed'\n end", "title": "" }, { "docid": "f030b4ea755409bf7b9c62a082f9e69d", "score": "0.5261375", "text": "def update\n @mail = Mail.find(params[:id]) \n if !@mail.update_attributes(params[:mail]) || params[:preview_button]\n \n render :action => \"edit\"\n else\n flash[:notice] = 'Mail was successfully updated.'\n redirect_to(@mail)\n end\n end", "title": "" }, { "docid": "1f0e33bcf0f6ac679c8ec963d923c539", "score": "0.5255958", "text": "def to_s\n \"Last Modified: #{@modifiedAt}\\nStatus: #{@status}\\nAssigned to: #{@owner}\\nSubject: #{@subject}\\n#{@preview}\"\n end", "title": "" }, { "docid": "2824abf78fd4e809d7020175fdea2e8d", "score": "0.52543974", "text": "def show\n #TRACKER.track(current_user['email'], \"READ_EMAIL\", {\"email_id\" => @email.id, \"email_reference\" => @email.reference_id})\n TRACKER.track(current_user['email'], \"READ_EMAIL\", @email.id, @email.reference_id)\n end", "title": "" }, { "docid": "43284e15765583c535f857b69ca558f0", "score": "0.52372897", "text": "def preview!(purchase)\n post(purchase, \"#{collection_path}/preview\")\n end", "title": "" }, { "docid": "43284e15765583c535f857b69ca558f0", "score": "0.52372897", "text": "def preview!(purchase)\n post(purchase, \"#{collection_path}/preview\")\n end", "title": "" }, { "docid": "c782fe5e890df603c62a1f32c300c088", "score": "0.5235101", "text": "def preview\n begin\n page = Comatose::Page.new(params[:page])\n page.author = current_user\n if params.has_key? :version\n content = page.to_html( {'params'=>params.stringify_keys, 'version'=>params[:version]} )\n else\n content = page.to_html( {'params'=>params.stringify_keys} )\n end\n rescue SyntaxError\n content = \"<p>There was an error generating the preview.</p><p><pre>#{$!.to_s.gsub(/\\</, '&lt;')}</pre></p>\"\n rescue\n content = \"<p>There was an error generating the preview.</p><p><pre>#{$!.to_s.gsub(/\\</, '&lt;')}</pre></p>\"\n end\n render :text=>content, :layout => false\n end", "title": "" }, { "docid": "9af4abe1963e30baafd6e6e3bbb8e3c2", "score": "0.522828", "text": "def show\n # notification_email\n end", "title": "" }, { "docid": "15236c07265aee4e1299ca4ad3dffdca", "score": "0.5226132", "text": "def preview\n self.content.split(' ')[0...5].join(' ') + '...'\n end", "title": "" }, { "docid": "dd3065c591c32ee4f93a476ae2bae578", "score": "0.5213765", "text": "def apply(interviewee,interviewer)\n @interviewee = interviewee\n @interviewer = interviewer\n mail(to: @interviewee.email + \",\" + @interviewer.email, subject: '面接日程承認のお知らせ')\n end", "title": "" }, { "docid": "b8fa2eca8e24308e2bcc4efb374ddb4a", "score": "0.52118236", "text": "def to_s\n '#<Twilio::REST::Preview>'\n end", "title": "" }, { "docid": "b8fa2eca8e24308e2bcc4efb374ddb4a", "score": "0.52118236", "text": "def to_s\n '#<Twilio::REST::Preview>'\n end", "title": "" }, { "docid": "b98334216c08d78c5cc3d1d7b98f05fc", "score": "0.52064675", "text": "def email_approved_proposal\n ProposalMailer.email_approved_proposal\n end", "title": "" }, { "docid": "917e336afdd971a52e5df18b5619ae3d", "score": "0.5192629", "text": "def preview_submit\n @story = Story.find(params[:submission])\n @story_slam_preview = true # to hide/show certain things in the header\n end", "title": "" }, { "docid": "019d3b1c252f15862bb20487a7ecd029", "score": "0.5186882", "text": "def set_preview\n @preview = Preview.find(params[:id])\n end", "title": "" }, { "docid": "fb12b21c47bd0006a0b23bad7a15e5b0", "score": "0.5167913", "text": "def preview_msg(msg_params_with_name)\n uri = 'cgi-bin/operate_appmsg?sub=preview&t=ajax-appmsg-preview'\\\n \"&type=10&token=#{@token}&lang=zh_CN\"\n headers = {\n referer: 'https://mp.weixin.qq.com/cgi-bin/appmsg?t=media/appmsg_edit'\\\n \"&action=edit&type=10&isMul=0&isNew=1&lang=zh_CN&token=#{@token}\",\n host: 'mp.weixin.qq.com',\n x_requested_with: 'XMLHttpRequest'\n }\n resource = RestClient::Resource.new(@home_url, headers: headers, cookies: @cookies)\n\n res = resource[uri].post msg_params_with_name\n # \"ret\":\"0\", \"msg\":\"preview send success!\", \"appMsgId\":\"201796045\", \"fakeid\":\"\"\n JSON.parse res.to_s\n end", "title": "" }, { "docid": "05e99304889d55cece6f7911122bc70a", "score": "0.51622766", "text": "def review_posted(email,permalink) \n @service_permalink = permalink \n subject = \"A review was posted for your service\"\n setup_email(email, subject)\n end", "title": "" }, { "docid": "5a3872d692c85c96c63f3ad80805c443", "score": "0.5158241", "text": "def preview_cover\n preview_path = \"#{PDF_PREVIEW_FOLDER}/preview_cover-#{current_cookbook.id}_#{Time.now.to_i}.pdf\"\n session[:preview_filename] = preview_path\n preview = CookbookPreviewWorker.new(\n cookbook: current_cookbook, \n filename: preview_path\n )\n preview.cover\n render \"previews/preview\"\n end", "title": "" }, { "docid": "4e50ac125a87b4a7bd70b94bcda6b571", "score": "0.515572", "text": "def emailOnReview(revieweeId)\r\n puts \"we are in email on review\"\r\n @team_member = TeamsUser.find_all_by_team_id(revieweeId)\r\n asstId = Team.find_by_id(revieweeId).parent_id\r\n assignment=Assignment.find_by_id(asstId).name\r\n partialName=\"email_on_review\"\r\n @team_member.each do |team_Member|\r\n # get parameters for sending mail\r\n user=User.find_by_id(team_Member.user_id)\r\n puts \"teammate name = #(user.name)\"\r\n if(user.email_on_review)\r\n email(user.email,\"Review\",ApplicationHelper::get_user_first_name(user),assignment,partialName)\r\n end\r\n end\r\n end", "title": "" }, { "docid": "435ff6d2704e1c69b788d5731bb60ea7", "score": "0.5152641", "text": "def preview_edit\n\n layout_style = nil\n if (params[:layout])\n layout_style = params[:layout]\n end\n\n\n begin\n @bulletin = Bulletin.find(params[:id])\n @bulletin_layout = @bulletin.layout_for_editing(layout_style, self)\n headers[\"Content-Type\"] = @bulletin_layout.filetype + \"; charset=\" + @bulletin_layout.charset\n render :text => @bulletin_layout.rendered, :layout => 'bulletin'\n return\n rescue SyntaxError\n @error = _('A fatal error has occurred while compiling the temlpate!') + \n '<br /><br />ERROR: '+$!\n end\n render :action => 'error', :layout => 'bulletin'\n end", "title": "" } ]
cf8baaa57a028973d183b201253b5fe8
DELETE /myimages/1 DELETE /myimages/1.xml
[ { "docid": "0e0a39a4c4f32dcf3373c74a09606c7b", "score": "0.0", "text": "def destroy\n @sharedimage = Sharedimage.get(params[:id])\n ext_name_up = File.extname(@sharedimage.image_filename_encoded)\n filename = @sharedimage.image_filename_encoded.gsub(ext_name_up,\"\")\n \n if ext_name_up == \".eps\" or ext_name_up == \".pdf\"\n ext_name = \".png\"\n else\n ext_name = \".jpg\"\n end\n \n if File.exist?(@sharedimage.image_path + @sharedimage.image_filename_encoded)\n \t File.delete(@sharedimage.image_path + @sharedimage.image_filename_encoded) #original image file\n File.delete(@sharedimage.image_path + \"Thumb/\" + filename + ext_name) #thumbnail image file \t \n File.delete(@sharedimage.image_path + \"Preview/\" + filename + ext_name) #thumbnail image file \t \n \tend\n \t\n @sharedimage.destroy\n\n @menu = \"myimage\"\n @board = \"myimage\"\n @section = \"index\"\n \n # @sharedimages = Sharedimage.all(:common => true, :order => [:created_at.desc])\n # @total_count = @sharedimages.count\n # @exts = repository(:default).adapter.select('SELECT distinct type FROM myimages where common = \\'t\\'')\n \n redirect_to '/admin/myimages'\n end", "title": "" } ]
[ { "docid": "e33f242b37af43369183ed6142762c65", "score": "0.7528143", "text": "def destroy\n @image = Image.find(params[:id])\n @image.destroy\n @image.delete_img(@image.name)\n \n respond_to do |format|\n format.html { redirect_to(images_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "a5fffbb6673f06399416006c4837be58", "score": "0.7145374", "text": "def destroy\n @image = Image.find(params[:id])\n begin\n File.delete(Rails.root.join('public', 'images', @image.name))\n rescue\n logger.warning \"Unable to delete file @{image.name}\"\n end\n @image.destroy\n\n respond_to do |format|\n format.html { redirect_to(images_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "e0f0485a7dd0b1b473758f019f0d45d9", "score": "0.7112642", "text": "def destroy\n @image = Image.find(params[:id])\n @image.destroy\n\n respond_to do |format|\n format.html { redirect_to(images_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "5c53bdf3f55656e01eb20b357d937459", "score": "0.70916784", "text": "def destroy\n @image = Image.find(params[:id])\n @image.destroy\n\n respond_to do |format|\n format.html { redirect_to(images_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "5c53bdf3f55656e01eb20b357d937459", "score": "0.70916784", "text": "def destroy\n @image = Image.find(params[:id])\n @image.destroy\n\n respond_to do |format|\n format.html { redirect_to(images_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "5c53bdf3f55656e01eb20b357d937459", "score": "0.70916784", "text": "def destroy\n @image = Image.find(params[:id])\n @image.destroy\n\n respond_to do |format|\n format.html { redirect_to(images_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "5c53bdf3f55656e01eb20b357d937459", "score": "0.70916784", "text": "def destroy\n @image = Image.find(params[:id])\n @image.destroy\n\n respond_to do |format|\n format.html { redirect_to(images_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "2f7830f5845c7566b9b80ae39815da8a", "score": "0.7073569", "text": "def destroy\n @myimage = Myimage.get(params[:id])\n \n if File.exist?(@myimage.image_path + @myimage.image_filename)\n \t File.delete(@myimage.image_path + @myimage.image_filename) #original image file\n File.delete(@myimage.image_path + @myimage.image_thumb_filename) #thumbnail image file \t \n \tend\n \t\n @myimage.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_myimages_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "2f7830f5845c7566b9b80ae39815da8a", "score": "0.7073569", "text": "def destroy\n @myimage = Myimage.get(params[:id])\n \n if File.exist?(@myimage.image_path + @myimage.image_filename)\n \t File.delete(@myimage.image_path + @myimage.image_filename) #original image file\n File.delete(@myimage.image_path + @myimage.image_thumb_filename) #thumbnail image file \t \n \tend\n \t\n @myimage.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_myimages_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "baf17f1e881919d804874b54d7552004", "score": "0.7062338", "text": "def destroy\n @image = Image.find(params[:id])\n \n imagen = @image.filename\n \n #function in manage_images.rb\n remove_image_file(imagen)\n\n @image.destroy\n\n respond_to do |format|\n format.html { redirect_to root_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "d56949fe7cce541b8e2f4424089f5f14", "score": "0.70494133", "text": "def destroy\n @image = @post.images.find(params[:id])\n @image.destroy\n\n respond_to do |format|\n format.html { redirect_to(images_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "96aecaa24a2cb4971df5f59226ad2420", "score": "0.7018582", "text": "def delete_image\n ext = \".\" + \"#{params[:format]}\"\n file_name = \"#{Rails.root}/public/images/#{params[:poi_id]}_images/#{params[:file_name]}#{ext}\"\n File.delete(file_name) if File.file?(file_name)\n redirect_to show_images_path(params[:poi_id])\n end", "title": "" }, { "docid": "865f089cc3b98e27a1b660e4d891a1e9", "score": "0.6984835", "text": "def destroy\n @image = Image.find(params[:id])\n\n @image.destroy\n \n respond_to do |format|\n format.html { redirect_to(params[:redirect_to] || images_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "4332904028f7741d52d317e61e2fadbf", "score": "0.6963959", "text": "def destroy\n @image = Image.find(params[:id])\n @image.destroy\n flash[:notice] = 'Image was successfully destroyed.'\n respond_to do |format|\n format.html { redirect_to my_images_url }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "6e4df85e1268f4f291f0bb5cacae3d9f", "score": "0.69063133", "text": "def delete_image\n file new_resource.target do\n action :delete\n only_if { ::File.exist? new_resource.target }\n end\n end", "title": "" }, { "docid": "8e911b1a5d8964b2e3d3b8ce2c8449be", "score": "0.6894321", "text": "def destroy\n json_respond compute().delete_image(params[:imageID])\n end", "title": "" }, { "docid": "1b9daa72f04f13ce8be46f5afa8db7af", "score": "0.68680996", "text": "def destroy\n @image = current_user.images.find(params[:id])\n @image.destroy\n\n respond_to do |format|\n format.html { redirect_to(images_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "6467f771b1373852373c5f9ad4658329", "score": "0.68592554", "text": "def destroy\n @image = @site.images.find(params[:id])\n @image.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_site_images_url(@site)) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "a15324f63aae85e0a95d110087fe9c56", "score": "0.6845593", "text": "def destroy\n Image.find(params[:id]).destroy\n render :update do |page|\n page[\"image_#{params[:id]}\"].remove\n end\n end", "title": "" }, { "docid": "4100b1ba27a9a751bb11d54b45e1aeb1", "score": "0.68427205", "text": "def delete(path);end", "title": "" }, { "docid": "4100b1ba27a9a751bb11d54b45e1aeb1", "score": "0.68427205", "text": "def delete(path);end", "title": "" }, { "docid": "8b6b5d478f2abb24a9aeb80fa5ba5f90", "score": "0.6834131", "text": "def destroy\n @item_image = ItemImage.find(params[:id])\n @item_image.destroy\n\n respond_to do |format|\n format.html { redirect_to(item_images_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "2b692e1d7731c8a4343ba849e908e488", "score": "0.6808187", "text": "def destroy\n @image_upload = ImageUpload.find(params[:id])\n @image_upload.destroy\n\n respond_to do |format|\n format.html { redirect_to(image_uploads_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "2b692e1d7731c8a4343ba849e908e488", "score": "0.6808187", "text": "def destroy\n @image_upload = ImageUpload.find(params[:id])\n @image_upload.destroy\n\n respond_to do |format|\n format.html { redirect_to(image_uploads_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "95956fb0100b6b1601f05e5e9805b413", "score": "0.67996264", "text": "def delete\n@image = Image.find(@params['id'])\n@image.destroy\nredirect :action => :index\nend", "title": "" }, { "docid": "f2540cd95fc129fceac848d00f5acbeb", "score": "0.67964375", "text": "def destroy\n @masterimage = Masterimage.find(params[:id])\n @masterimage.destroy\n\n respond_to do |format|\n format.html { redirect_to(masterimages_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "310616c9698821a7f133680ae616035c", "score": "0.6793484", "text": "def destroy\n @image = Image.find(params[:id])\n @image.destroy\n\n respond_to do |format|\n format.html { redirect_to(cloud_engine_images_url(@image.cloud_engine.id)) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "87fb40134d67cac4743609fa9148b6f8", "score": "0.6764981", "text": "def destroy\n image = Image.find_by_hash(params[:id])\n if image.nil?\n return render json: {status: \"Image Doesn't exist\"}, status: 400\n end\n image.file.purge\n image.delete\n render json: {status: \"Image deleted\"}\n end", "title": "" }, { "docid": "6143d404754635ea3d1e920cd77b25ba", "score": "0.6760405", "text": "def destroy\n File.delete(\"public/#{@image.full_path}\")\n @image.destroy\n respond_to do |format|\n format.html { redirect_to admin_images_url, notice: '画像及び画像情報は正常に削除されました。' }\n end\n end", "title": "" }, { "docid": "b06eb09aa681882302326acd3fb06b96", "score": "0.67517006", "text": "def destroy\n @imagem = Imagem.find(params[:id])\n @imagem.destroy\n\n respond_to do |format|\n format.html { redirect_to(imagems_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "28074e4e665355df9d7a3a9c1d571bd5", "score": "0.6719738", "text": "def destroy\n @title = \"Micro array image\"\n\n @micro_array_image = MicroArrayImage.find(params[:id])\n flash[:notice] = \"Deleted Microarray image: \" + @micro_array_image.verbose_me\n @micro_array_image.destroy\n\n respond_to do |format|\n format.html { redirect_to micro_array_images_path }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "c33af02bc0d4c6e827f69c38649de90b", "score": "0.67176044", "text": "def destroy\n\t\t@image = Image.find(params[:id])\n\t\t@image.destroy\n\n\t\trespond_to do |format|\n\t\t format.html { redirect_to(images_path(:type => params[:type])) }\n\t\t format.xml { head :ok }\n\t\tend\n\tend", "title": "" }, { "docid": "4216e9f9ceb01e61e2dead624049e5d7", "score": "0.6713861", "text": "def destroy\n @image = Image.find(params[:id])\n @image.destroy\n\n respond_to do |format|\n format.html { redirect_to(schedule_images_path(params[:schedule_id])) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "42333e6680168705991544b351e9b22c", "score": "0.6711628", "text": "def destroy\n @patient_image = PatientImage.find(params[:id])\n @patient_image.destroy\n\n respond_to do |format|\n format.html { redirect_to(patient_images_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "e0d5a0eeed8c6c73ae200a9436de9052", "score": "0.6707581", "text": "def delete_image\n if request.post? == false\n render :json => { :message => \"Error\" }\n return\n end\n image = Image.new\n image.byId( params[ :image_id ] )\n collection = Collection.new\n collection.byId( params[ :collection_id ] )\n collection.delete( :images, image.urn )\n render :json => { \n :message => \"Success\", \n :collection => collection.all \n }\n end", "title": "" }, { "docid": "fcabeed4e2bcd5ad254c043d540c49a0", "score": "0.67042196", "text": "def delete_image_attachment\n User.delete_image_attachment(params)\n end", "title": "" }, { "docid": "33844cdab2c5ca7a70de9701f889b459", "score": "0.66969305", "text": "def destroy\n @image_test = ImageTest.find(params[:id])\n @image_test.destroy\n\n respond_to do |format|\n format.html { redirect_to(image_tests_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "5717acdfd39e34108e37691dddc46a48", "score": "0.66886616", "text": "def destroy\n @batch_image = BatchImage.find(params[:id])\n @batch_image.destroy\n\n respond_to do |format|\n format.html { redirect_to(batch_images_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "3e8fd6cda007fc23bbf554e0b92ad3dd", "score": "0.6688058", "text": "def destroy\n @image = Image.find(params[:id])\n @image.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "64b89aa82673517f850aeea9660f502e", "score": "0.66849136", "text": "def destroy\n @image_file = ImageFile.find(params[:id])\n @image_file.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_image_files_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "ab8f156dbf003930db719e78157f3a36", "score": "0.6684791", "text": "def destroy\n @shared_image = SharedImage.find(params[:id])\n @shared_image.destroy\n\n respond_to do |format|\n format.html { redirect_to(shared_images_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "0b24cbc6495df3923ea7679acbcd8deb", "score": "0.668274", "text": "def delete_floor_plan(args = {}) \n delete(\"/files.json/floorplan/images\", args)\nend", "title": "" }, { "docid": "748b558ec7527245ab8f21a266654723", "score": "0.6682228", "text": "def delete\n data = Storm::Base::SODServer.remote_call '/Storm/Image/delete',\n :id => @id\n data[:deleted]\n end", "title": "" }, { "docid": "0d89b43e500e62da2a33d3a432b3ca58", "score": "0.6680456", "text": "def delete_images\n Image.where(id: params[:images]).destroy_all\n redirect_to root_url\n end", "title": "" }, { "docid": "0b126335d09a26d63851c78d7b29ed2c", "score": "0.66784537", "text": "def destroy\n #debugger\n @image = Image.find(params[:id])\n @image.destroy\n\n respond_to do |format|\n format.html {redirect_to new_issue_article_path(:issue_id => d(@issue.date))}\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "d8f13a92e936ff95747b46e495819c7c", "score": "0.6678189", "text": "def destroy\n# @image = Image.find(image_id)\n @image = Image.find(params[:id])\n @image.destroy\n\n respond_to do |format|\n format.html { redirect_to images_url, notice: 'Images deleted' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "359158c8563b51fd81bf36a9e804c295", "score": "0.6663575", "text": "def destroy\n @counter_images_set = CounterImagesSet.find(params[:id])\n @counter_images_set.destroy\n\n respond_to do |format|\n format.html { redirect_to(counter_images_sets_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "b75595fadcf2494b514d125e4e8d94b8", "score": "0.6629994", "text": "def destroy\n @imagen = Imagen.find(params[:id])\n @imagen.destroy\n\n respond_to do |format|\n format.html { redirect_to(imagenes_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "b2cffa3388f4068445f4d86e290f28ee", "score": "0.6628825", "text": "def destroy\n @myimage.destroy\n respond_to do |format|\n format.html { redirect_to myimages_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9b93574177e1d7fa68d16eb00585cf15", "score": "0.66167766", "text": "def destroy\n @myphoto = Myphoto.find(params[:id])\n @myphoto.destroy\n\n respond_to do |format|\n format.html { redirect_to(myphotos_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "6b5e0b29a0abfcab1caa1036c2a02d01", "score": "0.6614326", "text": "def destroy\n @image_file = ImageFile.find(params[:id])\n @image_file.destroy\n\n respond_to do |format|\n format.html { redirect_to(image_files_url) }\n format.js { render :js => \"$('#image_file_#{params[:id]}').remove();\"}\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "49f9c5252ed35b17b450673d260d025c", "score": "0.6612451", "text": "def destroy\n @image.file.clear\n @image.destroy\n render text:'Ok'\n end", "title": "" }, { "docid": "dfc5c9da57c14a866aa791542992de46", "score": "0.6611473", "text": "def destroy\n @viewimage.destroy\n # @id=@viewimage\n # @path= \"#{Rails.root}/uploads/viewimage/image/#{@id}\"\n # if File.exist?(@path)\n # File.delete(@path)\n # end\n respond_to do |format|\n format.html { redirect_to viewimages_url, notice: 'Viewimage was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9253bb05ef779bec8ba9d93c6deb7dcf", "score": "0.66113824", "text": "def destroy\n @sushi_image = SushiImage.find(params[:id])\n @sushi_image.destroy\n\n respond_to do |format|\n format.html { redirect_to(sushi_images_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "36d2ec745935a00560bef1cf92dffe28", "score": "0.6607348", "text": "def destroy\n @flat_image.destroy\n\n respond_to do |format|\n format.html { redirect_to(flat_images_url,\n :notice => I18n.t('backend.actions.success_destroy',\n :model => I18n.t('activerecord.capitalized_models.flat_image'))) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "6cc61551b7017bbf7772f9874d8fd477", "score": "0.6600673", "text": "def destroy\n @image = Image.find(params[:id])\n @image.destroy\n respond_with(@image, :status => :deleted, :location => images_path)\n end", "title": "" }, { "docid": "7f99b09f35141450cdf7339caea717cf", "score": "0.6597021", "text": "def file_delete\n @user = User.find_by username: params[:username]\n @project = Project.find_by user_id: @user.id, name: params[:project]\n file = File.join(@project.satellitedir, params[:image_name])\n FileUtils.rm(file) if File.exists?(file)\n satellite_delete(@project.satelliterepo,params[:image_name])\n @project.pushtobare\n flash[:notice] = \"#{params[:image_name]} has been deleted!\"\n redirect_to @project.urlbase\n end", "title": "" }, { "docid": "66672d128a9e6f3be7ec5fa72ca6a844", "score": "0.6594423", "text": "def delete\n @picture = Picture.find(params[:id])\n @picture.destroy\n\n respond_to do |format|\n format.html { redirect_to :action => :index }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "40591dda08bafd7df9f835ef969d69c9", "score": "0.65925384", "text": "def delete_image_folders\n id_image = id.to_s\n FileUtils.rm_rf('public/uploads/photo/image/' + id_image)\n end", "title": "" }, { "docid": "d45c331e02179a028a001820785ab377", "score": "0.65901136", "text": "def destroy\r\n @page_image = PageImage.find(params[:id])\r\n @page_image.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to(page_images_url) }\r\n format.xml { head :ok }\r\n end\r\n end", "title": "" }, { "docid": "fe2605e901b3880b7b276b473c224ec3", "score": "0.6589975", "text": "def destroy\n @az_c_image = AzCImage.find(params[:id])\n @az_c_image.destroy\n\n respond_to do |format|\n format.html { redirect_to(az_c_images_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "d7ac66d16809f7fba38c0e689179fed1", "score": "0.6577903", "text": "def destroy\n @image = Image.find(params[:id])\n @image.destroy\n\n respond_to do |format|\n format.html { redirect_to(album_url(@image.album_id)) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "d2495b694a771867e86a9064b2aed962", "score": "0.65723014", "text": "def delete_approved_image\n @poi = Poi.find(params[:id])\n \n ext = \".\" + \"#{params[:format]}\"\n file_name = \"#{Rails.root}/public/images/#{params[:id]}_images/user_images/approved/#{params[:file_name]}#{ext}\"\n File.delete(file_name) if File.file?(file_name)\n \n redirect_to show_approved_images_path(@poi), notice: ' Image was successfully removed.'\n end", "title": "" }, { "docid": "8d7a2865f05c53c1e5661485427be0cd", "score": "0.6569312", "text": "def destroy\n @banner = Banner.find(params[:id])\n file = \"#{Rails.root}/public/banners/#{params[:id]}.jpg\"\n File.delete(file) if FileTest.exist?(file)\n @banner.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_banners_url }\n end\nend", "title": "" }, { "docid": "b7dccfac5d40b7209c20023d917a773a", "score": "0.65682006", "text": "def destroy\n @imagen = Imagen.find(params[:id])\n @imagen.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_imagens_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "7f182e4ac2a27465baa951ffb075806f", "score": "0.6565869", "text": "def delete\n [filename, thumbnail_name].each do |name|\n image = \"#{DIRECTORY}/#{name}\"\n File.delete(image) if File.exists?(image)\n end\n end", "title": "" }, { "docid": "e588c257dbf8debd2274521661c2cefd", "score": "0.6559289", "text": "def destroy\n @photo = @recipe.photos.find(params[:id])\n @photo.destroy\n\n respond_to do |format|\n format.html { redirect_to recipe_url(@recipe) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "f5ca7ba6bb09997e68d2ae6fec4b56a0", "score": "0.65583885", "text": "def destroy\n authorize @image\n @image.destroy\n\n respond_to do |format|\n format.html { redirect_to(images_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "f5ca7ba6bb09997e68d2ae6fec4b56a0", "score": "0.65583885", "text": "def destroy\n authorize @image\n @image.destroy\n\n respond_to do |format|\n format.html { redirect_to(images_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "6665cd0645759f43dd3af461f2c6a83c", "score": "0.65511376", "text": "def destroy\n File.delete(\"public/img/members/#{name}\")\n @image.destroy\n redirect_to account_images_path, notice: t('notice.deleted',{model: t('activerecord.models.image')})\n end", "title": "" }, { "docid": "3938fc3fa779d66ecf893793da0b9ead", "score": "0.654886", "text": "def destroy\n File.unlink('public/images/'+@image_file.name)\n @image_file.destroy\n respond_to do |format|\n format.html { redirect_to image_files_url, notice: 'Image file was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6f7523a73f6edcfacef2ff0c2e23b5e1", "score": "0.65417296", "text": "def destroy\n @book = Book.find(params[:id])\n #画像情報の削除\n @book.images.each{|image|\n image.destroy\n }\n #ディレクトリの削除\n deleteall(\"./public/images/#{@book.id}/\") if FileTest.exist?(\"./public/images/#{@book.id}/\") == true\n #本情報の削除\n @book.destroy\n respond_to do |format|\n format.html { redirect_to books_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "5237818f7ef5aebf0e48ea9208afce3f", "score": "0.65405077", "text": "def delete_image\r\n @clinic_case = @topic.clinic_cases.find(params[:clinic_case_id])\r\n @image_id = params[:image_id].to_i\r\n respond_to do |format|\r\n if @clinic_case.images[@image_id].purge()\r\n update_hash_after_delete()\r\n format.html { redirect_to [@topic, @clinic_case], notice: 'Imagem do caso clínico foi excluído com sucesso.' }\r\n format.json { head :no_content }\r\n else\r\n format.html { redirect_to [@topic, @clinic_case] }\r\n format.json { render json: @clinic_case.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "title": "" }, { "docid": "fda6c9acf96819c96f376a0e5ffe7752", "score": "0.6539162", "text": "def delete_image_file\n File.delete(filename) if File.exists?(filename)\n end", "title": "" }, { "docid": "39cb7631cc8a24a6d0649332dde7536b", "score": "0.6537997", "text": "def delete_files(image_files)\n #image_files.each { |image_file| puts \"Deleting #{image_file}\" }\n image_files.each {|image_file| File.delete(image_file) if File.exist?(image_file)}\n end", "title": "" }, { "docid": "375b0473dd661f87996fc56687c71092", "score": "0.6537018", "text": "def destroy\n @image = Image.find(params[:id])\n @image.destroy\n\n respond_to do |format|\n format.html { redirect_to images_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "375b0473dd661f87996fc56687c71092", "score": "0.6537018", "text": "def destroy\n @image = Image.find(params[:id])\n @image.destroy\n\n respond_to do |format|\n format.html { redirect_to images_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "b0431b0eba3784096657c0bcb18ed920", "score": "0.65354764", "text": "def destroy\n @knack = Knack.find(params[:id])\n \n #delete each file\n # Photo.find_each(:knack_id => params[:id]) do |photo|\n # File.delete(photo.path)\n # end\n\n #delete whole directory\n require 'fileutils'\n filedir = \"app/assets/images/\" + params[:id]\n if Dir.exists?(filedir)\n FileUtils.rm_r filedir\n end\n\n @knack.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_knack_category_path( @category ) }\n format.json { head :no_content }\n format.js #added\n end\n end", "title": "" }, { "docid": "de20116d7f090023cd90941d0f6c9659", "score": "0.6527738", "text": "def destroy\n #expire_index_page\n\n @photo = Photo.find(params[:id])\n @photo.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_photos_path) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "d1bf143e8d2595438228d99d62b31e6d", "score": "0.6526755", "text": "def delete\n render json: Image.delete(params[\"id\"])\n end", "title": "" }, { "docid": "719065649a2a19a4419fa42c0d0d6815", "score": "0.6523145", "text": "def delete(folder, image_name)\n begin\n Rails.logger.info \"deleting #{image_name}\"\n res = File.delete(File.join(ENV[\"IMG_PATH\"], folder.name, image_name))\n if res == 1\n ## remove thumb\n File.delete(File.join(ENV[\"IMG_PATH\"], folder.name, \"thumbs\", image_name))\n ## remove from db\n img = Image.where(:name => image_name, :folder =>folder).first\n Exif.where(:image => img).destroy_all\n img.destroy\n else\n Rails.logger.error \"huh, something went wrong\"\n end\n rescue Exception => e\n Rails.logger.error \"Can't delete file\"\n Rails.logger.error e\n end\n end", "title": "" }, { "docid": "f8dade3400c5691ce65a569fa6449ffc", "score": "0.6518964", "text": "def destroy\n @image_type = ImageType.find(params[:id])\n @image_type.destroy\n\n respond_to do |format|\n format.html { redirect_to(image_types_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "d4cad81f6531309dc9e65f89d290b390", "score": "0.6514011", "text": "def destroy\n @image = Image.find(params[:id])\n @image.destroy\n\n respond_to do |format|\n format.html { redirect_to images_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d4cad81f6531309dc9e65f89d290b390", "score": "0.6514011", "text": "def destroy\n @image = Image.find(params[:id])\n @image.destroy\n\n respond_to do |format|\n format.html { redirect_to images_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d4cad81f6531309dc9e65f89d290b390", "score": "0.6514011", "text": "def destroy\n @image = Image.find(params[:id])\n @image.destroy\n\n respond_to do |format|\n format.html { redirect_to images_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d4cad81f6531309dc9e65f89d290b390", "score": "0.6514011", "text": "def destroy\n @image = Image.find(params[:id])\n @image.destroy\n\n respond_to do |format|\n format.html { redirect_to images_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d4cad81f6531309dc9e65f89d290b390", "score": "0.6514011", "text": "def destroy\n @image = Image.find(params[:id])\n @image.destroy\n\n respond_to do |format|\n format.html { redirect_to images_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d4cad81f6531309dc9e65f89d290b390", "score": "0.6514011", "text": "def destroy\n @image = Image.find(params[:id])\n @image.destroy\n\n respond_to do |format|\n format.html { redirect_to images_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d4cad81f6531309dc9e65f89d290b390", "score": "0.6514011", "text": "def destroy\n @image = Image.find(params[:id])\n @image.destroy\n\n respond_to do |format|\n format.html { redirect_to images_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d4cad81f6531309dc9e65f89d290b390", "score": "0.6514011", "text": "def destroy\n @image = Image.find(params[:id])\n @image.destroy\n\n respond_to do |format|\n format.html { redirect_to images_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d4cad81f6531309dc9e65f89d290b390", "score": "0.6514011", "text": "def destroy\n @image = Image.find(params[:id])\n @image.destroy\n\n respond_to do |format|\n format.html { redirect_to images_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d4cad81f6531309dc9e65f89d290b390", "score": "0.6514011", "text": "def destroy\n @image = Image.find(params[:id])\n @image.destroy\n\n respond_to do |format|\n format.html { redirect_to images_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d4cad81f6531309dc9e65f89d290b390", "score": "0.6514011", "text": "def destroy\n @image = Image.find(params[:id])\n @image.destroy\n\n respond_to do |format|\n format.html { redirect_to images_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "81a6970fdf085d55bc8eca2baa28b059", "score": "0.6506171", "text": "def destroy\n cleanFile(@image)\n @image.destroy\n respond_to do |format|\n format.html { redirect_to images_url, notice: 'Image was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b81775753ed9b283a0de03a911124cdc", "score": "0.6502235", "text": "def destroy\n @article = Article.get(params[:id])\n \n # 업로드된 이미지 파일 삭제 =========================================================================\n file_name = @article.image_filename\n if File.exist?(IMAGE_PATH + file_name)\n \tFile.delete(IMAGE_PATH + file_name) #original image file\n \tFile.delete(IMAGE_PATH + \"t_\" + file_name) #thumbnail file\n end\n # 업로드된 이미지 파일 삭제 =========================================================================\n @article.destroy\n\n respond_to do |format|\n format.html { redirect_to(articles_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "e63b071b032694eb7f89ea1c31242ef2", "score": "0.6500483", "text": "def delete\n if @identifier && @identifier['image_id'].present?\n connection.delete_foto(@identifier['image_id'])\n end\n end", "title": "" }, { "docid": "41e30086e3032b82db73731f2030c33e", "score": "0.6495462", "text": "def delete\n @image = find_image\n @image.destroy\n render json: { success: true }\n end", "title": "" }, { "docid": "6abaad0627132af3266101e16c33151c", "score": "0.6492519", "text": "def destroy\n @post_image = PostImage.find(params[:id])\n @post_image.destroy\n\n respond_to do |format|\n format.html { redirect_to post_path(@post) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "b282e796aa959c52dd8f6dfdf0a7c9e9", "score": "0.6490213", "text": "def destroy\n @poi.destroy\n FileUtils.remove_dir \"#{Rails.root}/public/images/#{@poi.id}_images\"\n respond_to do |format|\n format.html { redirect_to show_all_path }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "5fa7d30679cbcbcb421b0df4d95b1eab", "score": "0.6489844", "text": "def deleteimage\n hotel = Hotel.find_by_id(params[:hotel])\n count = 0\n @file = params[:file]\n hotel.images.each do |image|\n if image.file.path.split(\"/\").last == params[:file]\n break;\n end\n count = count + 1\n end\n remain_images = hotel.images # copy initial avatars\n delete_image = remain_images.delete_at(count) # delete the target image\n delete_image.try(:remove!) # delete image\n hotel.images = remain_images # re-assign back\n hotel.save\n respond_to do |format|\n format.html { redirect_to '/hotels/'+hotel.id.to_s+'/edit' }\n format.js {}\n end\n end", "title": "" }, { "docid": "41e385120d9c43623c448c599be9933a", "score": "0.6485648", "text": "def remove_images\n ExamImage.find(params[:id]).destroy\n\n render json: {}.to_json(), status: :ok\n end", "title": "" } ]
10707b0c0a10db7d995ec3c8b84f7d6d
Returns a specific commando mode transition
[ { "docid": "8a4e185785808f3bb991da59fa6ecb5c", "score": "0.52320474", "text": "def get_commandomodes_transitions_token_with_http_info(token, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CommandoModesApi.get_commandomodes_transitions_token ...'\n end\n # verify the required parameter 'token' is set\n if @api_client.config.client_side_validation && token.nil?\n fail ArgumentError, \"Missing the required parameter 'token' when calling CommandoModesApi.get_commandomodes_transitions_token\"\n end\n # resource path\n local_var_path = '/commandomodes/transitions/{token}'.sub('{' + 'token' + '}', CGI.escape(token.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body]\n\n # return_type\n return_type = opts[:debug_return_type] || 'CommandoModeTransitionResponse'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || []\n\n new_options = opts.merge(\n :operation => :\"CommandoModesApi.get_commandomodes_transitions_token\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CommandoModesApi#get_commandomodes_transitions_token\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" } ]
[ { "docid": "15b64e18677bd5c2a0c9d9aba648597f", "score": "0.6606827", "text": "def mode_transitions\n case @mode\n when START_MODE\n facing, _ = facing_node\n if facing\n @route.pop if @route[-1] == @start_node\n @target_node = @route.pop\n @target = create_tar @target_node.pos\n self.mode = NORMAL_MODE \n end\n when NORMAL_MODE\n facing, other = facing_node\n if facing.pos.dist(@pos) < ROAD_WIDTH\n @target_node = @route.pop\n @target = create_tar @target_node.pos\n if facing.neighbors.size > 2\n self.mode = INTERSECTION_MODE\n else\n self.mode = TURN_MODE\n end\n end\n when INTERSECTION_MODE, TURN_MODE\n closest = @map.closest_node @pos\n if closest.pos.dist(@pos) > ROAD_WIDTH\n self.mode = NORMAL_MODE\n end\n end\n end", "title": "" }, { "docid": "b100855d1b893fea1798fd0d5e56cc7b", "score": "0.65282726", "text": "def mode_transitions\n case @mode\n when START_MODE\n facing, _ = facing_node\n if facing\n @target = create_tar facing.pos\n self.mode = NORMAL_MODE \n end\n when NORMAL_MODE\n facing, other = facing_node\n if facing.pos.dist(@pos) < ROAD_WIDTH\n if facing.neighbors.size > 2\n self.mode = INTERSECTION_MODE\n @target = choose_tar\n else\n self.mode = TURN_MODE\n @target = create_tar((facing.neighbors - Set[other]).first.pos)\n end\n end\n when INTERSECTION_MODE, TURN_MODE\n closest = @map.closest_node @pos\n if closest.pos.dist(@pos) > ROAD_WIDTH \n self.mode = NORMAL_MODE\n end\n end\n end", "title": "" }, { "docid": "77bc1fa7f9c88568102ed5578869276a", "score": "0.5996802", "text": "def transition\n roads[0].transition\n end", "title": "" }, { "docid": "654bd21839dde85302678ac591963c2f", "score": "0.59743017", "text": "def command_mode() \n\t\tmodel.clear_selection\n\t\t@mode = 'Command' \n\tend", "title": "" }, { "docid": "0f497c8ad1765afb2dbcc46fa859983d", "score": "0.59299695", "text": "def get_mode\n @situation[:mode]\n end", "title": "" }, { "docid": "6276178591944f8c414fa6b8adaa5f01", "score": "0.5888551", "text": "def switch_info; @quest_window.switch_mode; end", "title": "" }, { "docid": "d7453660de9dbb418440b57c7c4e8866", "score": "0.568921", "text": "def get_step_mode\n send_request(FUNCTION_GET_STEP_MODE, [], '', 1, 'C')\n end", "title": "" }, { "docid": "f36039f244e85869dbfea13b435fa1f5", "score": "0.56616426", "text": "def mode_lookup(mode)\n MODES.index(mode.to_s.downcase)\n end", "title": "" }, { "docid": "950b28416a62716a3de5030f5e4b417f", "score": "0.5624279", "text": "def mode\n Constants::Modes[raw_match['game_mode']]\n end", "title": "" }, { "docid": "3cafb80ada3b6e6ae22c1a18b4d4697b", "score": "0.5613756", "text": "def current_mode\n @state.mode\n end", "title": "" }, { "docid": "6c8bfa69fcea87e9ae2113114ad5eb3b", "score": "0.5543352", "text": "def mode new_mode = nil\n data = mode_data()\n if new_mode\n data[:mode] = new_mode \n mode_data data\n end\n data[:mode]\n end", "title": "" }, { "docid": "808dc5096df08887c24722f528514141", "score": "0.5543342", "text": "def mode\n end", "title": "" }, { "docid": "bd701ec141c9615a07e65e8ae8648b04", "score": "0.5542384", "text": "def getMode\n return Mode::CONTRE_LA_MONTRE\n end", "title": "" }, { "docid": "3caa081813765e21de46f0f9cfdd1216", "score": "0.5538858", "text": "def current_mode\n @mode_stack.last\n end", "title": "" }, { "docid": "58f3f1ea959933b56f5f245118677373", "score": "0.5538846", "text": "def mode\n @mode\n end", "title": "" }, { "docid": "58f3f1ea959933b56f5f245118677373", "score": "0.5538846", "text": "def mode\n @mode\n end", "title": "" }, { "docid": "c0bc39b6c0aae9e202391297438ae181", "score": "0.55173624", "text": "def mode(mode_id)\n @modes[mode_id]\n end", "title": "" }, { "docid": "b0861fbb2817b4f6d68825c8df20a647", "score": "0.54930997", "text": "def mode\n x = REF.req_num(\"Play:\\t(1) Human Vs. Machine\\n\\t(2) Human Vs. Human\",1,2)\n if x == 1\n $P2 = Machine.new\n else\n $P2 = Human.new\n end\n x\n end", "title": "" }, { "docid": "eb53692ee01f09adb68fe6d2bdeb4b77", "score": "0.5460495", "text": "def mode\r\n depth == 0 ? :Execute : @contexts[-1][1]\r\n end", "title": "" }, { "docid": "8232f88def0bd0419eb1c300079ddbc6", "score": "0.54365796", "text": "def transition_to(desired)\n result = nil\n FSM.actions(last_action, desired).each do |transition|\n @lifecycle_hooks.run_with_hooks(transition, state_file) do\n result = send(\"#{transition}_action\")\n end\n end\n result\n end", "title": "" }, { "docid": "0a69bd374b72773b31ed00cdfafe5006", "score": "0.5426998", "text": "def mode\n @mode ||= if global_flags? then :global_flags\n elsif commands.any? then :commands\n elsif args.any? && flags.any? then :args_and_flags\n elsif args.any? then :args\n elsif flags.any? then :flags\n else\n :empty\n end\n end", "title": "" }, { "docid": "dcd82d96162b88ca007456d487ad58ec", "score": "0.5413883", "text": "def next_transition\n transition\n self\n end", "title": "" }, { "docid": "df73316ad186b6096d80342541ee9d2c", "score": "0.54096144", "text": "def current_mode\n\t\tspeed = @data.speed\n\t\tspeed = :unknown if speed == 65535\n\t\t\n\t\tduplex = case @data.duplex\n\t\t\twhen 0 then :half\n\t\t\twhen 1 then :full\n\t\t\telse :unknown\n\t\tend\n\t\t\n\t\tport = case @data.port\n\t\t\twhen 0 then 'T'\n\t\t\twhen 1 then 'AUI'\n\t\t\twhen 2 then 'MII'\n\t\t\twhen 3 then 'F'\n\t\t\twhen 4 then 'BNC'\n\t\t\twhen 255 then 'Other'\n\t\t\telse 'Unknown'\n\t\tend\n\t\t\n\t\tMode.new(speed, duplex, port)\n\tend", "title": "" }, { "docid": "df9a2bec49d4976c95fc2833e43317e8", "score": "0.539922", "text": "def current_mode_id\n if Origen.top_level && Origen.top_level.current_mode\n Origen.top_level.current_mode.id\n end\n end", "title": "" }, { "docid": "df9a2bec49d4976c95fc2833e43317e8", "score": "0.539922", "text": "def current_mode_id\n if Origen.top_level && Origen.top_level.current_mode\n Origen.top_level.current_mode.id\n end\n end", "title": "" }, { "docid": "019748a1a4f42b570fc0483d13bb7169", "score": "0.5393961", "text": "def get_command\n\t\"left\"\nend", "title": "" }, { "docid": "78935a7317dcb5b39d84fe93d774ab5d", "score": "0.5389997", "text": "def parse_mode\n mdata = /(?<=spanning-tree\\smode\\s)(\\w+)$/.match(config)\n { mode: mdata[1] }\n end", "title": "" }, { "docid": "17ffafc3ca3ea3c9e48e7fb76e1289f8", "score": "0.53829056", "text": "def battle_transition\n collection = $game_temp.trainer_battle ? TRAINER_TRANSITIONS : WILD_TRANSITIONS\n transition_class = collection[$game_variables[Yuki::Var::Trainer_Battle_ID]]\n log_debug(\"Choosen transition class : #{transition_class}\")\n return transition_class\n end", "title": "" }, { "docid": "c933a90654fab298eee4e426aa6bfa80", "score": "0.53789777", "text": "def get_mode\n @mode\n end", "title": "" }, { "docid": "67f4d685ed691d37025449c5ab4a55ef", "score": "0.5361971", "text": "def get_direction\n DIRECTION[current_direction.to_sym][instruction.to_sym]\n end", "title": "" }, { "docid": "0de880d3a2feee2581ba4b70da6d8fb8", "score": "0.53580225", "text": "def get_command\n\tcmd = :left\n\tcmd\nend", "title": "" }, { "docid": "c07ed5955dcddd08061035fb87ee379a", "score": "0.5341073", "text": "def get_next_state(character)\n transitions.each do |transition|\n is_valid = valid_transition?(transition, character)\n return transition if is_valid\n end\n nil\n end", "title": "" }, { "docid": "842962024cba8467e8d97f94377c4751", "score": "0.53337187", "text": "def get_mode\n @mode\n end", "title": "" }, { "docid": "7a6c4aaeb79e86a0155edcdb04621909", "score": "0.53180504", "text": "def current_command\n if @current_step <= @steps\n {command: \"VISIT\", method: @routine[@current_step], step: @current_step}\n else\n {command: \"STOP\"}\n end\n end", "title": "" }, { "docid": "22876723199185803a6987f14ea3b921", "score": "0.5299104", "text": "def handle_mode(cmd)\n # Eventually this could be used to make really interesting mode messages\n cmd =~ /^MODE(\\s+\\S+)?(\\s+\\S+)?(\\s+\\S+)?$/\n\n add_output \":#{@nick}!#{USERHOST} MODE#{$2}#{$3}\"\n end", "title": "" }, { "docid": "ed48724cb68d9534019ceae4069cd41a", "score": "0.5294053", "text": "def pulse_mode\n @status.mode\n end", "title": "" }, { "docid": "3fa5619f5ca4236ee73b3860473e056f", "score": "0.5287316", "text": "def get_mode\n\t\tend", "title": "" }, { "docid": "cfa28f46fe1f92e6652704b9eb3a21ec", "score": "0.52783865", "text": "def mode\n @mode\n end", "title": "" }, { "docid": "200499717cbd05c3c68e3626f3ad34a6", "score": "0.52708966", "text": "def resync \n res = @dyio.command_to.get_channel_mode(@channel_number) \n self.cached_mode = res[:mode]\n end", "title": "" }, { "docid": "b464a0babc3ae1493ae9e74a7daaa066", "score": "0.52619034", "text": "def change_direction(current_direction,command)\n cardinals = [\"N\",\"E\",\"S\",\"W\"]\n number = cardinals.index(current_direction)\n case command\n when 'L'\n if number >= 1\n number -= 1\n direction = cardinals[number]\n else\n number = 3\n direction = cardinals[number]\n end\n when 'R'\n if number <= 2\n number += 1\n direction = cardinals[number]\n else\n number = 0\n direction = cardinals[number]\n end\n end\n return direction\n end", "title": "" }, { "docid": "a6eba732c55ff253f1fa7fb52d003d5f", "score": "0.52613807", "text": "def run_mode(mp, pe)\n if pe == \"1\"\n return \"PE\"\n elsif mp == \"1\"\n return \"MP\"\n else\n return \"FR\"\n end\n end", "title": "" }, { "docid": "7b14336fe7e45874113233ecba903e3d", "score": "0.5257559", "text": "def mode\n \"#{@mode.class}\"[/\\w+$/].intern\n end", "title": "" }, { "docid": "4e82976eb6f5634f47096151010648d0", "score": "0.52540773", "text": "def next(mode = :shift)\n events.send(mode)\n end", "title": "" }, { "docid": "dee7bd3843859fe42bd3bc99c170516d", "score": "0.52536476", "text": "def mode; end", "title": "" }, { "docid": "dee7bd3843859fe42bd3bc99c170516d", "score": "0.52536476", "text": "def mode; end", "title": "" }, { "docid": "dee7bd3843859fe42bd3bc99c170516d", "score": "0.52536476", "text": "def mode; end", "title": "" }, { "docid": "dee7bd3843859fe42bd3bc99c170516d", "score": "0.52536476", "text": "def mode; end", "title": "" }, { "docid": "dee7bd3843859fe42bd3bc99c170516d", "score": "0.52536476", "text": "def mode; end", "title": "" }, { "docid": "dee7bd3843859fe42bd3bc99c170516d", "score": "0.52536476", "text": "def mode; end", "title": "" }, { "docid": "dee7bd3843859fe42bd3bc99c170516d", "score": "0.52536476", "text": "def mode; end", "title": "" }, { "docid": "dee7bd3843859fe42bd3bc99c170516d", "score": "0.52536476", "text": "def mode; end", "title": "" }, { "docid": "dee7bd3843859fe42bd3bc99c170516d", "score": "0.52536476", "text": "def mode; end", "title": "" }, { "docid": "dee7bd3843859fe42bd3bc99c170516d", "score": "0.52536476", "text": "def mode; end", "title": "" }, { "docid": "dee7bd3843859fe42bd3bc99c170516d", "score": "0.52536476", "text": "def mode; end", "title": "" }, { "docid": "dee7bd3843859fe42bd3bc99c170516d", "score": "0.52536476", "text": "def mode; end", "title": "" }, { "docid": "dee7bd3843859fe42bd3bc99c170516d", "score": "0.52536476", "text": "def mode; end", "title": "" }, { "docid": "dee7bd3843859fe42bd3bc99c170516d", "score": "0.52536476", "text": "def mode; end", "title": "" }, { "docid": "5ebb3a4aec95b974b33c45b35077b12f", "score": "0.5251006", "text": "def anim_mode\n if SceneManager.scene.mini_showing\n return GTBS::ACTOR_Animation_Mode_MINI[self.id] || GTBS::DEFAULT_ANIMATION_METHOD if actor?\n return GTBS::ENEMY_Animation_Mode_MINI[self.enemy_id] || GTBS::DEFAULT_ANIMATION_METHOD\n end\n return GTBS::ACTOR_Animation_Mode[self.id] || GTBS::DEFAULT_ANIMATION_METHOD if actor?\n return GTBS::ENEMY_Animation_Mode[self.enemy_id] || GTBS::DEFAULT_ANIMATION_METHOD\n end", "title": "" }, { "docid": "25670f60b1c5a35704f14ba8d433b688", "score": "0.523681", "text": "def to_sym\n mode.to_sym\n end", "title": "" }, { "docid": "b34832e99c1de668a69c49730429e742", "score": "0.5233837", "text": "def mode(target, modes = '', objects = '')\n # Dup strings so handler can filter safely\n target = target.dup\n modes = modes.dup\n objects = objects.dup\n\n handle(:outgoing_mode, target, modes, objects)\n\n message = \"MODE #{target}\"\n message += \" #{modes}\" unless modes.to_s.empty?\n message += \" #{objects}\" unless objects.to_s.empty?\n raw message\n end", "title": "" }, { "docid": "ad564dc99f5bae8d8832df02827438c0", "score": "0.52279764", "text": "def determine_mode\n# binding.pry\n return cur_mode if good_mode?(cur_mode)\n modes.shuffle.each do |mode| \n if good_mode?(mode)\n set_mode(mode)\n return cur_mode\n end\n end\n# binding.pry\n set_mode(nil)\n end", "title": "" }, { "docid": "39961df0a357789900aede2ab3d914c2", "score": "0.52181107", "text": "def get_commandomodes_commandomodetoken_transitions_with_http_info(commandomode_token, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CommandoModesApi.get_commandomodes_commandomodetoken_transitions ...'\n end\n # verify the required parameter 'commandomode_token' is set\n if @api_client.config.client_side_validation && commandomode_token.nil?\n fail ArgumentError, \"Missing the required parameter 'commandomode_token' when calling CommandoModesApi.get_commandomodes_commandomodetoken_transitions\"\n end\n # resource path\n local_var_path = '/commandomodes/{commandomode_token}/transitions'.sub('{' + 'commandomode_token' + '}', CGI.escape(commandomode_token.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?\n query_params[:'start_index'] = opts[:'start_index'] if !opts[:'start_index'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body]\n\n # return_type\n return_type = opts[:debug_return_type] || 'CommandoModeTransitionListResponse'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || []\n\n new_options = opts.merge(\n :operation => :\"CommandoModesApi.get_commandomodes_commandomodetoken_transitions\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CommandoModesApi#get_commandomodes_commandomodetoken_transitions\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "82bddb0b11c7f168f7134368860b966a", "score": "0.51977307", "text": "def command_type\n case @current[0]\n when 'pop', 'push'\n c = Code.new([@current[0].to_sym, @current[1].to_sym, @current[2]])\n c.translate_m.to_s\n when 'label'\n :c_label\n when 'goto'\n :c_goto\n when 'if'\n :c_if\n when 'function'\n :c_function\n when 'return'\n :c_return\n when 'call'\n :c_return\n else\n c = Code.new([@current[0].to_sym])\n c.translate_a.to_s\n end\n end", "title": "" }, { "docid": "0a60db36621e260dd02863e7f3044509", "score": "0.51948416", "text": "def main_transition\r\n Graphics.transition\r\n end", "title": "" }, { "docid": "b8c40c8ec6a741ed113ccf9418d9aec2", "score": "0.519139", "text": "def motor\n\t\t#Ahora que tenemos el metodo reader y getter, es posible obtener el modelo sin hacer referencia a la variable de instancia.\n\t\t\"El #{modelo} hace run run\"\n\tend", "title": "" }, { "docid": "b8005c47a4dff41a9e34520e231fd67f", "score": "0.5190152", "text": "def mode\n self.class.mode\n end", "title": "" }, { "docid": "ef80cc01fcc7ec2d3f6bfbdeccff8688", "score": "0.51865786", "text": "def to_transition trans\n case trans\n when Transition, nil\n trans\n when String\n stateMachine.rootStateMachine.transition[trans]\n else\n stateMachine.transition[trans]\n end\n end", "title": "" }, { "docid": "6be00ec76752976a12603a0e9a93d10b", "score": "0.51847535", "text": "def get_commandomodes_transitions_token(token, opts = {})\n data, _status_code, _headers = get_commandomodes_transitions_token_with_http_info(token, opts)\n data\n end", "title": "" }, { "docid": "6337240c462b54a472a21ec5dae35854", "score": "0.51845175", "text": "def transition_from_params\n return params[:proposal].ergo[:transition]\n end", "title": "" }, { "docid": "0f959d4e149da079b38b49d72eed8dc2", "score": "0.51818675", "text": "def display_mode situation\n if situation.mode == Situation::MODES[:one_at_a_time]\n link_to \"Switch to group mode\", edit_case_situation_path(:case_id=>@case.id,:id=>situation.id, :mode => Situation::MODES[:group])\n else\n link_to \"Switch to one-at-a-time mode\", edit_case_situation_path(:case_id=>@case.id,:id=>situation.id, :mode => Situation::MODES[:one_at_a_time] )\n end\n end", "title": "" }, { "docid": "efd42a194bcef0d366710106df17e61a", "score": "0.51807636", "text": "def transition\n\t\treturn StateTransitionMatcher.new\n\tend", "title": "" }, { "docid": "50fc7e10194b09a1942ec01f55427461", "score": "0.5165401", "text": "def read_instruction(instruction)\n if instruction == \"M\"\n move\n else\n turn(instruction)\n end\n end", "title": "" }, { "docid": "43c1cf37668a832088897c09a10907cf", "score": "0.51645446", "text": "def switch_type\n @switch_type\n end", "title": "" }, { "docid": "9f71bc4de8ff70272bf39d765cdcf5a2", "score": "0.5158224", "text": "def _SCENE_LINK(command_index)\n # Configure here any scenes you would like to link to the Title screen. You\n # must first configure the name of the command in COMMANDS. After that, just\n # fill in the name of the scene for the proper index. Any command index left\n # undefined will be assumed to be a 'Shutdown' option.\n \n # ex. when 2 then Scene_MyOptions\n \n # Will make the third command (index starts at 0) start the defined scene.\n # Do not configue anything for index 0 or 1. It will not work. They are \n # reserved for 'New Game' and 'Continue'.\n \n return case command_index\n when 2 then command_shutdown\n end\n end", "title": "" }, { "docid": "816f8b67684961b86419d29f983dbca8", "score": "0.51544", "text": "def get_pseudomode_for_itinerary(itinerary)\n\n if itinerary.is_walk\n mode_name = 'walk'\n elsif itinerary.mode.name.downcase == 'paratransit'\n mode_name = itinerary.service.service_type.name.downcase\n else\n mode_name = itinerary.mode.name.downcase\n end\n return mode_name \n end", "title": "" }, { "docid": "a88ed9b81561fcee5241b7a3e09599d1", "score": "0.51541597", "text": "def operation_mode_description\n case operation_mode\n when 1 then \"Standby\"\n when 2 then \"Always on\"\n else\n \"description n/a\" # TODO\n end\n end", "title": "" }, { "docid": "1fb9ad5c53b2a7051273aaa75f3b93b2", "score": "0.5151883", "text": "def mode(target_name)\n entry = registry[target_name]\n entry ? entry[1] : nil\n end", "title": "" }, { "docid": "8211411fc76c23a8faeb1812be7671b3", "score": "0.5141715", "text": "def transition_by_state(state)\n state = state.try(:to_sym)\n case state\n when :active\n :activate\n when :suspended\n :suspend\n end\n end", "title": "" }, { "docid": "fa16cc44df3fecf86b4215e24e91e38f", "score": "0.5137539", "text": "def transit_type\n unless mode.code == 'mode_transit'\n return nil\n end\n bus = false\n rail = false\n legs = get_legs(false)\n legs.each do |leg|\n case leg.mode.downcase\n when 'walk'\n next\n when 'bus'\n bus = true\n next\n when *Leg::TransitLeg::RAIL_LEGS\n rail = true\n next\n when 'car'\n return 'drivetransit'\n else\n return 'transit'\n end\n end\n\n if bus and !rail\n return 'bus'\n elsif !bus and rail\n return 'rail'\n elsif bus and rail\n return 'railbus'\n else\n return 'transit'\n end\n\n end", "title": "" }, { "docid": "8d11610fd2aa21cae36c7b893e862825", "score": "0.513631", "text": "def switch_to_mode(mode)\n return if mode == @mode || mode == Mode::Other\n # Stop observing the previous mode on the currently selected model.\n @observing.unwatch(@model, @mode)\n # Switch the mode variable.\n @mode = mode\n @settings['mode'] = mode\n # Start observing the new mode on the currently selected model.\n @observing.watch(@model, mode)\n end", "title": "" }, { "docid": "90dcf80bbc034e10a56134a44896ef03", "score": "0.5132513", "text": "def transfer_player_specific_transition\n if (transition_id = $game_variables[::Yuki::Var::MapTransitionID]) > 0\n Graphics.transition(1) if $game_temp.transition_processing\n case transition_id\n when 1 # Circular transition\n ::Yuki::Transitions.circular\n when 2 # Directed transition\n ::Yuki::Transitions.directed\n end\n Graphics.brightness = 0\n Graphics.wait(15)\n end\n end", "title": "" }, { "docid": "8bd505401be856ac3c4b5b77aeaceba5", "score": "0.51133835", "text": "def mode\n return @mode\n end", "title": "" }, { "docid": "81f4d7803713268ca225c55bd25c20b9", "score": "0.5111717", "text": "def next_state(event_name)\n transition = transitions.select{|t| t.is_transition_for?(event_name, @subject.send(state_method))}.first\n transition ? transition.to : nil\n end", "title": "" }, { "docid": "81f4d7803713268ca225c55bd25c20b9", "score": "0.5111717", "text": "def next_state(event_name)\n transition = transitions.select{|t| t.is_transition_for?(event_name, @subject.send(state_method))}.first\n transition ? transition.to : nil\n end", "title": "" }, { "docid": "3e21d168d09a506651ace8e0f763d8d9", "score": "0.51100165", "text": "def getMode()\n out = sprintf(\"%o\", eval(\"0x#{@value}\") )\n # last character of octal representation \n return out[-1]\n end", "title": "" }, { "docid": "6ad20325bc04f2c9a9c30e7210986340", "score": "0.51089853", "text": "def got_mode network, command\n name, modes, limit, nick, mask = command.params\n\n if channel = network.channel_by_name(name)\n if limit\n unless limit.numeric?\n nick = limit\n end\n\n if user = channel.user_by_nick(nick)\n user.merge_modes modes\n emit :user_mode, user, modes\n end\n else\n channel.merge_modes modes\n emit :channel_mode, channel, modes\n end\n end\n end", "title": "" }, { "docid": "d5c88916b4224eedebfcfa990be19e72", "score": "0.5102254", "text": "def next_command\n event = BattleManager.next_command\n if event\n telegraph_ability(15) if TurnManager.try_insert_phase_shift_event\n #p(event.time)\n #TurnManager.p_schedule\n case event.type\n when :event\n if event.phase_shift?\n TurnManager.start_new_phase($game_party.members + $game_troop.members)\n end\n #environmental?\n when :turn\n # process inputs\n if event.battler.is_a?(Game_Actor)\n event.battler.make_actions\n start_actor_command_selection\n elsif event.battler.is_a?(Game_Enemy)\n queue_enemy_next_turn(event)\n next_command\n end\n when :action\n # process execution\n @party_command_window.close\n @actor_command_window.close\n @status_window.unselect\n @subject = nil\n start_next_action(event)\n end\n else\n msgbox_p(\"no events in command list\")\n end\n end", "title": "" }, { "docid": "c7522da28e167b0239c8139a92ad63dd", "score": "0.50984484", "text": "def _SwitchTok\n\n _save = self.pos\n while true # sequence\n _tmp = match_string(\"switch\")\n unless _tmp\n self.pos = _save\n break\n end\n _save1 = self.pos\n _tmp = apply(:_IdentifierPart)\n _tmp = _tmp ? nil : true\n self.pos = _save1\n unless _tmp\n self.pos = _save\n end\n break\n end # end sequence\n\n set_failed_rule :_SwitchTok unless _tmp\n return _tmp\n end", "title": "" }, { "docid": "78e72c6fcfead82b86d2b173ca525214", "score": "0.5084794", "text": "def mode\n raise NotImplementedError\n end", "title": "" }, { "docid": "bd9c5ea56a3253474ac5d825e9c8cf27", "score": "0.5078369", "text": "def getMode\n data=[0].pack('C')\n @device.ioctl(SPI_IOC_RD_MODE(), data);\n return data.unpack('C')[0]\n end", "title": "" }, { "docid": "8f10b152b93654895458e96a54c922a7", "score": "0.5072202", "text": "def selected_mode\n return @data[self.index]\n end", "title": "" }, { "docid": "12d868e0c6cde90e5b66d89b551118d1", "score": "0.507134", "text": "def command room, device, state\n # @todo get the device name in here...\n # Command structure is <transaction number>,<Command>|<Action>|<State><cr>\n if room and device and !device.empty? and state\n '666,!' + room['id'] + room['device'][device] + state + '|Turn ' + room['name'] + ' ' + device + '|' + state + ' via @pauly'\n else\n '666,!' + room['id'] + state + '|Turn ' + room['name'] + '|' + state + ' via @pauly'\n end \n end", "title": "" }, { "docid": "39645c64634635189faa25106d9e87f7", "score": "0.5065549", "text": "def get_modes instruction\n modes = instruction.to_s.chars.map(&:to_i)\n while modes.length < 5\n modes.unshift 0\n end\n modes[0..2]\n # flip the order so they are in order of the param order\n # [param_1_mode, param_2_mode, param_3_mode]\n modes = [modes[2], modes[1], modes[0]]\n end", "title": "" }, { "docid": "39645c64634635189faa25106d9e87f7", "score": "0.5065549", "text": "def get_modes instruction\n modes = instruction.to_s.chars.map(&:to_i)\n while modes.length < 5\n modes.unshift 0\n end\n modes[0..2]\n # flip the order so they are in order of the param order\n # [param_1_mode, param_2_mode, param_3_mode]\n modes = [modes[2], modes[1], modes[0]]\n end", "title": "" }, { "docid": "39645c64634635189faa25106d9e87f7", "score": "0.5065549", "text": "def get_modes instruction\n modes = instruction.to_s.chars.map(&:to_i)\n while modes.length < 5\n modes.unshift 0\n end\n modes[0..2]\n # flip the order so they are in order of the param order\n # [param_1_mode, param_2_mode, param_3_mode]\n modes = [modes[2], modes[1], modes[0]]\n end", "title": "" }, { "docid": "8db41bf284545ed90fe902ce8d69a863", "score": "0.50555795", "text": "def stp(mode)\n # db: I,\n # TODO\n end", "title": "" }, { "docid": "273771fc2c85c03996e5a972e4fe25f7", "score": "0.5054411", "text": "def mode\n BLEND_MODES[blend_key.strip.to_sym]\n end", "title": "" }, { "docid": "853d1eeb7ee4e08f667ccc86a5b6471a", "score": "0.50519866", "text": "def main_state\n if start_step?\n return \"START\"\n elsif finish_step? && finished?\n return \"FINISH\"\n elsif state == \"ACTION\" && !params_hash[\"manual\"]\n return \"PROCESS\"\n else\n return state\n end\n end", "title": "" }, { "docid": "4f9ac332e1066fdc1962bf21c56d1b14", "score": "0.50496966", "text": "def command ()\n return @option_map[:command]\n end", "title": "" }, { "docid": "3f64b97648c2ad345a1d4fc6e6de3c32", "score": "0.5040519", "text": "def mode(channel, option)\n raw(\"MODE #{channel} #{option}\")\n end", "title": "" } ]
a2099a77c85e91272ae2f9e35b937953
Only allow a trusted parameter "white list" through.
[ { "docid": "2d5ebc0c30a8c75a2edd52352f5c3ee9", "score": "0.0", "text": "def ingredient_nutrient_params\n params.require(:ingredient_nutrient).permit(:nutrient_id, :ingredient_id)\n end", "title": "" } ]
[ { "docid": "c1f317213d917a1e3cfa584197f82e6c", "score": "0.7120904", "text": "def allowed_params\n ALLOWED_PARAMS\n end", "title": "" }, { "docid": "b32229655ba2c32ebe754084ef912a1a", "score": "0.70538116", "text": "def expected_permitted_parameter_names; end", "title": "" }, { "docid": "a91e9bf1896870368befe529c0e977e2", "score": "0.69469863", "text": "def param_whitelist\n [:role, :title]\n end", "title": "" }, { "docid": "547b7ab7c31effd8dcf394d3d38974ff", "score": "0.6901261", "text": "def default_param_whitelist\n [\"mode\"]\n end", "title": "" }, { "docid": "e291b3969196368dd4f7080a354ebb08", "score": "0.67348766", "text": "def permitir_parametros\n \t\tparams.permit!\n \tend", "title": "" }, { "docid": "4fc36c3400f3d5ca3ad7dc2ed185f213", "score": "0.6717708", "text": "def permitted_params\n []\n end", "title": "" }, { "docid": "e164094e79744552ae1c53246ce8a56c", "score": "0.66874576", "text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.6676195", "text": "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "title": "" }, { "docid": "c436017f4e8bd819f3d933587dfa070a", "score": "0.66601187", "text": "def filtered_parameters; end", "title": "" }, { "docid": "9a2a1af8f52169bd818b039ef030f513", "score": "0.65563625", "text": "def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end", "title": "" }, { "docid": "7ac5f60df8240f27d24d1e305f0e5acb", "score": "0.6525127", "text": "def parameters_list_params\n params.require(:parameters_list).permit(:name, :description, :is_user_specific)\n end", "title": "" }, { "docid": "53d84ad5aa2c5124fa307752101aced3", "score": "0.64565873", "text": "def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end", "title": "" }, { "docid": "60ccf77b296ed68c1cb5cb262bacf874", "score": "0.64494514", "text": "def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "f12336a181f3c43ac8239e5d0a59b5b4", "score": "0.644928", "text": "def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end", "title": "" }, { "docid": "12fa2760f5d16a1c46a00ddb41e4bce2", "score": "0.64452374", "text": "def param_whitelist\n [:rating, :review]\n end", "title": "" }, { "docid": "86b2d48cb84654e19b91d9d3cbc2ff80", "score": "0.6433947", "text": "def valid_params?; end", "title": "" }, { "docid": "16e18668139bdf8d5ccdbff12c98bd25", "score": "0.6412815", "text": "def permitted_params\n declared(params, include_missing: false)\n end", "title": "" }, { "docid": "16e18668139bdf8d5ccdbff12c98bd25", "score": "0.6412815", "text": "def permitted_params\n declared(params, include_missing: false)\n end", "title": "" }, { "docid": "7a6fbcc670a51834f69842348595cc79", "score": "0.6391939", "text": "def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend", "title": "" }, { "docid": "bd826c318f811361676f5282a9256071", "score": "0.63792473", "text": "def filter_parameters; end", "title": "" }, { "docid": "bd826c318f811361676f5282a9256071", "score": "0.63792473", "text": "def filter_parameters; end", "title": "" }, { "docid": "068f8502695b7c7f6d382f8470180ede", "score": "0.63738", "text": "def strong_params\n params.require(:team_member).permit(param_whitelist)\n end", "title": "" }, { "docid": "c04a150a23595af2a3d515d0dfc34fdd", "score": "0.6360176", "text": "def strong_params\n params.require(:community).permit(param_whitelist)\n end", "title": "" }, { "docid": "fc43ee8cb2466a60d4a69a04461c601a", "score": "0.6354222", "text": "def check_params; true; end", "title": "" }, { "docid": "9d23b31178b8be81fe8f1d20c154336f", "score": "0.6284756", "text": "def valid_params_request?; end", "title": "" }, { "docid": "533f1ba4c3ab55e79ed9b259f67a70fb", "score": "0.6277987", "text": "def strong_params\n params.require(:experience).permit(param_whitelist)\n end", "title": "" }, { "docid": "9735bbaa391eab421b71a4c1436d109e", "score": "0.6245304", "text": "def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end", "title": "" }, { "docid": "67fe19aa3f1169678aa999df9f0f7e95", "score": "0.62259704", "text": "def list_params\n params.permit(:name)\n end", "title": "" }, { "docid": "5ee931ad3419145387a2dc5a284c6fb6", "score": "0.62243503", "text": "def check_params\n true\n end", "title": "" }, { "docid": "fe4025b0dd554f11ce9a4c7a40059912", "score": "0.6223834", "text": "def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end", "title": "" }, { "docid": "bb32aa218785dcd548537db61ecc61de", "score": "0.62104595", "text": "def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end", "title": "" }, { "docid": "ff55cf04e6038378f431391ce6314e27", "score": "0.62081766", "text": "def additional_permitted_params\n []\n end", "title": "" }, { "docid": "c5f294dd85260b1f3431a1fbbc1fb214", "score": "0.61759263", "text": "def strong_params\n params.require(:education).permit(param_whitelist)\n end", "title": "" }, { "docid": "0d980fc60b69d03c48270d2cd44e279f", "score": "0.61721593", "text": "def resource_params\n params[resource_singular_name].try(:permit, self.class.param_whitelist)\n end", "title": "" }, { "docid": "1677b416ad07c203256985063859691b", "score": "0.6168236", "text": "def allow_params_authentication!; end", "title": "" }, { "docid": "3eef50b797f6aa8c4def3969457f45dd", "score": "0.61587787", "text": "def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end", "title": "" }, { "docid": "c25a1ea70011796c8fcd4927846f7a04", "score": "0.6143901", "text": "def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end", "title": "" }, { "docid": "8894a3d0d0ad5122c85b0bf4ce4080a6", "score": "0.6135065", "text": "def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end", "title": "" }, { "docid": "34d018968dad9fa791c1df1b3aaeccd1", "score": "0.61204714", "text": "def paramunold_params\n params.require(:paramunold).permit!\n end", "title": "" }, { "docid": "76d85c76686ef87239ba8207d6d631e4", "score": "0.61065775", "text": "def param_params\n params.require(:param).permit(:param_category_id, :param_table_id, :name, :english_name, :weighting, :description)\n end", "title": "" }, { "docid": "3c8ffd5ef92e817f2779a9c56c9fc0e9", "score": "0.60983306", "text": "def quote_params\n params.permit!\n end", "title": "" }, { "docid": "2b19f8222e09c2518b0d19b4bf1f69d3", "score": "0.6073666", "text": "def list_params\n params.permit(:list_name)\n end", "title": "" }, { "docid": "aabfd0cce84d7f71b1ccd2df6a6af7c3", "score": "0.6051939", "text": "def allowed_params(parameters)\n parameters.select do |name, values|\n values.location != \"path\"\n end\n end", "title": "" }, { "docid": "4f20d784611d82c07d49cf1cf0d6cb7e", "score": "0.6040974", "text": "def all_params; end", "title": "" }, { "docid": "5a96718b851794fc3e4409f6270f18fa", "score": "0.6036216", "text": "def permitted_resource_params\n params[resource.object_name].present? ? params.require(resource.object_name).permit! : ActionController::Parameters.new\n end", "title": "" }, { "docid": "ff7bc2f09784ed0b4563cfc89b19831d", "score": "0.60291374", "text": "def source_params\n params.require(:source).permit(all_allowed_params)\n end", "title": "" }, { "docid": "6c615e4d8eed17e54fc23adca0027043", "score": "0.6020614", "text": "def user_params\n end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.60180086", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.60180086", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.60180086", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.60180086", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.60180086", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.60180086", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.60180086", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.60180086", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.60180086", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.60180086", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.60180086", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.60180086", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.60180086", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.60180086", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.60180086", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.60180086", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.60180086", "text": "def params; end", "title": "" }, { "docid": "2032edd5ab9475d59be84bdf5595f23a", "score": "0.6017416", "text": "def get_allowed_parameters\n return _get_specific_action_config(:allowed_action_parameters, :allowed_parameters)&.map(&:to_s)\n end", "title": "" }, { "docid": "c59ec134c641678085e086ab2a66a95f", "score": "0.60161096", "text": "def permitted_params\n @wfd_edit_parameters\n end", "title": "" }, { "docid": "a8faf8deb0b4ac1bcdd8164744985176", "score": "0.6006702", "text": "def user_params\r\n end", "title": "" }, { "docid": "0cb77c561c62c78c958664a36507a7c9", "score": "0.6002367", "text": "def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend", "title": "" }, { "docid": "b98f58d2b73eac4825675c97acd39470", "score": "0.600212", "text": "def param_whitelist\n whitelist = [\n :comment,\n :old_progress, :new_progress,\n :metric_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:metric_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "7b7196fbaee9e8777af48e4efcaca764", "score": "0.5996321", "text": "def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end", "title": "" }, { "docid": "70fa55746056e81854d70a51e822de66", "score": "0.59943277", "text": "def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end", "title": "" }, { "docid": "be95d72f5776c94cb1a4109682b7b224", "score": "0.59942585", "text": "def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend", "title": "" }, { "docid": "e4c37054b31112a727e3816e94f7be8a", "score": "0.59858114", "text": "def get_params\n\t\t\n\t\treturn ActionController::Parameters.new(self.attributes).permit(:first_name, :last_name, :email, :provider)\n\n\tend", "title": "" }, { "docid": "e3089e0811fa34ce509d69d488c75306", "score": "0.5982845", "text": "def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end", "title": "" }, { "docid": "2202d6d61570af89552803ad144e1fe7", "score": "0.59766084", "text": "def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end", "title": "" }, { "docid": "4d77abbae6d3557081c88dad60c735d0", "score": "0.5973769", "text": "def valid_parameters\n sort_symbols(@interface.allowed_parameters)\n end", "title": "" }, { "docid": "55d8ddbada3cd083b5328c1b41694282", "score": "0.5968758", "text": "def params_permit\n params.permit(:id)\n end", "title": "" }, { "docid": "a44360e98883e4787a9591c602282c4b", "score": "0.59653395", "text": "def allowed_params\n params.require(:allowed).permit(:email)\n end", "title": "" }, { "docid": "45b8b091f448e1e15f62ce90b681e1b4", "score": "0.5964966", "text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "title": "" }, { "docid": "45b8b091f448e1e15f62ce90b681e1b4", "score": "0.5964966", "text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "title": "" }, { "docid": "4e758c3a3572d7cdd76c8e68fed567e0", "score": "0.5957481", "text": "def filter_params\n params.permit(*resource_filter_permitted_params)\n end", "title": "" }, { "docid": "b48f61fbb31be4114df234fa7b166587", "score": "0.59511584", "text": "def specialty_params\n\t\tparams.require(:specialty).permit(*Specialty::DEFAULT_ACCESSIBLE_ATTRIBUTES)\n\tend", "title": "" }, { "docid": "3154b9c9e3cd7f0b297f900f73df5d83", "score": "0.5951042", "text": "def community_params\n params.permit(:profile_image, :name, :description, :privacy_type, :viewed_by, {tags: []}, {features: []}, {admins: []}, :members, :location, :beacon, :creator, :ambassadors, :current_events, :past_events, :feed, :category, :address, :allow_member_post_to_feed, :allow_member_post_to_events)\n end", "title": "" }, { "docid": "c4802950f28649fdaed7f35882118f20", "score": "0.5948871", "text": "def authorize_params\n super.tap do |params|\n %w[display scope auth_type].each do |v|\n if request.params[v]\n params[v.to_sym] = request.params[v]\n end\n end\n end\n end", "title": "" }, { "docid": "5d64cb26ce1e82126dd5ec44e905341c", "score": "0.59427315", "text": "def feature_params_filter\n params.require(:feature).permit(:name, :cat, :lower, :upper, :opts, :category, :description, :company, :active, :unit, :icon)\n end", "title": "" }, { "docid": "7fa620eeb32e576da67f175eea6e6fa0", "score": "0.5930573", "text": "def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end", "title": "" }, { "docid": "da4f66ce4e8c9997953249c3ff03114e", "score": "0.5930121", "text": "def argument_params\n params.require(:argument).permit(:name)\n end", "title": "" }, { "docid": "f7c6dad942d4865bdd100b495b938f50", "score": "0.5926885", "text": "def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end", "title": "" }, { "docid": "9892d8126849ccccec9c8726d75ff173", "score": "0.5923959", "text": "def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end", "title": "" }, { "docid": "be01bb66d94aef3c355e139205253351", "score": "0.59182686", "text": "def property_params\n params.permit(:name, :is_available, :is_approved, :owner_id)\n end", "title": "" }, { "docid": "631f07548a1913ef9e20ecf7007800e5", "score": "0.5916637", "text": "def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end", "title": "" }, { "docid": "d6bf948034a6c8adc660df172dd7ec6e", "score": "0.5913613", "text": "def sponsor_params\n params.require(:sponsor).permit(WHITE_LIST)\n end", "title": "" }, { "docid": "eb5b91d56901f0f20f58d574d155c0e6", "score": "0.5912174", "text": "def whitelist_person_params\n params.require(:person).permit(:family, :pre_title, :given_name, :dates, :post_title, :epithet, :dates_of_office, same_as: [], related_authority: [], altlabel: [], note: []) # Note - arrays need to go at the end or an error occurs!\n end", "title": "" }, { "docid": "822c743e15dd9236d965d12beef67e0c", "score": "0.5906678", "text": "def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end", "title": "" }, { "docid": "c6a96927a6fdc0d2db944c79d520cd99", "score": "0.59059656", "text": "def parameters\n nil\n end", "title": "" }, { "docid": "a743e25503f1cc85a98a35edce120055", "score": "0.5904252", "text": "def sequence_param_whitelist\n default_param_whitelist << \"show_index\"\n end", "title": "" }, { "docid": "533048be574efe2ed1b3c3c83a25d689", "score": "0.5901623", "text": "def resource_filter_permitted_params\n raise(NotImplementedError, 'resource_filter_permitted_params method not implemented')\n end", "title": "" }, { "docid": "02a61b27f286a50802d652930fee6782", "score": "0.58983696", "text": "def normal_params\n reject{|param, val| param_definitions[param][:internal] }\n end", "title": "" }, { "docid": "3683f6af8fc4e6b9de7dc0c83f88b6aa", "score": "0.58962476", "text": "def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end", "title": "" }, { "docid": "238705c4afebc0ee201cc51adddec10a", "score": "0.589576", "text": "def special_device_list_params\n params.require(:special_device_list).permit(:name)\n end", "title": "" }, { "docid": "d493d59391b220488fdc1f30bd1be261", "score": "0.5893608", "text": "def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end", "title": "" } ]
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "e09df09de90e8e67fdbd6fe0083857c5", "score": "0.0", "text": "def catergory_params\n params.require(:catergory).permit(:name)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7495027", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.69566035", "text": "def strong_params\n params.require(:request).permit(param_whitelist)\n end", "title": "" }, { "docid": "c72da3a0192ce226285be9c2a583d24a", "score": "0.69225836", "text": "def strong_params\n params.require(:post).permit(param_whitelist)\n end", "title": "" }, { "docid": "3d346c1d1b79565bee6df41a22a6f28d", "score": "0.68929327", "text": "def strong_params\n params.require(:resource).permit(param_whitelist)\n end", "title": "" }, { "docid": "aa06a193f057b6be7c0713a5bd30d5fb", "score": "0.67848456", "text": "def strong_params\n params.require(:listing).permit(param_whitelist)\n end", "title": "" }, { "docid": "f6060519cb0c56a439976f0c978690db", "score": "0.674347", "text": "def permitted_params\n params.permit!\n end", "title": "" }, { "docid": "fad8fcf4e70bf3589fbcbd40db4df5e2", "score": "0.6682223", "text": "def allowed_params\n # Only this one attribute will be allowed, no hacking\n params.require(:user).permit(:username)\n end", "title": "" }, { "docid": "b453d9a67af21a3c28a62e1848094a41", "score": "0.6636527", "text": "def strong_params\n params.require(:kpi).permit(param_whitelist)\n end", "title": "" }, { "docid": "2c8e2be272a55477bfc4c0dfc6baa7a7", "score": "0.66291976", "text": "def strong_params\n params.require(:community_member).permit(param_whitelist)\n end", "title": "" }, { "docid": "1685d76d665d2c26af736aa987ac8b51", "score": "0.66258276", "text": "def permitted_params\n params.permit!\n end", "title": "" }, { "docid": "77f5795d1b9e0d0cbd4ea67d02b5ab7f", "score": "0.65625846", "text": "def safe_params\n params.except(:host, :port, :protocol).permit!\n end", "title": "" }, { "docid": "cc1542a4be8f3ca5dc359c2eb3fb7d18", "score": "0.6491194", "text": "def strong_params\n params.require(:message).permit(param_whitelist)\n end", "title": "" }, { "docid": "e291b3969196368dd4f7080a354ebb08", "score": "0.6477825", "text": "def permitir_parametros\n \t\tparams.permit!\n \tend", "title": "" }, { "docid": "2d2af8e22689ac0c0408bf4cb340d8c8", "score": "0.64526874", "text": "def allowed_params\n params.require(:user).permit(:name, :email)\n end", "title": "" }, { "docid": "236e1766ee20eef4883ed724b83e4176", "score": "0.64001405", "text": "def param_whitelist\n [\n :name,\n :tagline, :contact, :summary, :stage,\n :website, :facebook, :twitter, :linkedin, :github,\n :founded_at,\n community_ids: [],\n sectors: [\n :commercial,\n :social,\n :research\n ],\n privacy: [\n contact: [],\n kpis: []\n ],\n permission: [\n listings: [],\n profile: [],\n posts: [],\n kpis: []\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end", "title": "" }, { "docid": "b29cf4bc4a27d4b199de5b6034f9f8a0", "score": "0.63810205", "text": "def safe_params\n params\n .require( self.class.model_class.name.underscore.to_sym )\n .permit( self.class.params_list )\n end", "title": "" }, { "docid": "bfb292096090145a067e31d8fef10853", "score": "0.63634825", "text": "def param_whitelist\n whitelist = [\n :title, :description, :skills,\n :positions, :category, :salary_period,\n :started_at, :finished_at,\n :deadline,\n :salary_min, :salary_max, :hours,\n :equity_min, :equity_max,\n :privacy,\n :owner_id, :owner_type,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n unless action_name === 'create'\n whitelist.delete(:owner_id)\n whitelist.delete(:owner_type)\n end\n \n whitelist\n end", "title": "" }, { "docid": "6bf3ed161b62498559a064aea569250a", "score": "0.633783", "text": "def require_params\n return nil\n end", "title": "" }, { "docid": "b4c9587164188c64f14b71403f80ca7c", "score": "0.6336759", "text": "def sanitize_params!\n request.sanitize_params!\n end", "title": "" }, { "docid": "b63e6e97815a8745ab85cd8f7dd5b4fb", "score": "0.6325718", "text": "def excluded_from_filter_parameters; end", "title": "" }, { "docid": "38bec0546a7e4cbf4c337edbee67d769", "score": "0.631947", "text": "def user_params\n # Returns a sanitized hash of the params with nothing extra\n params.permit(:name, :email, :img_url, :password)\n end", "title": "" }, { "docid": "37d1c971f6495de3cdd63a3ef049674e", "score": "0.63146484", "text": "def param_whitelist\n whitelist = [\n :name,\n :overview,\n :website, :facebook, :twitter,\n :privacy,\n :avatar_id, :community_id, :category_ids,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n unless action_name === 'create'\n whitelist.delete(:community_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "5ec018b4a193bf3bf8902c9419279607", "score": "0.63137317", "text": "def user_params # contains strong parameters\n params.require(:user).permit(:name, :email, :password,\n :password_confirmation)\n # strong parameters disallows any post information that is not permitted (admin security) when signing_up\n # so not all users will get admin access by hacking params using curl\n end", "title": "" }, { "docid": "91bfe6d464d263aa01e776f24583d1d9", "score": "0.6306224", "text": "def permitir_parametros\n params.permit!\n end", "title": "" }, { "docid": "e012d7306b402a37012f98bfd4ffdb10", "score": "0.6301168", "text": "def strong_params\n params.require(:team).permit(param_whitelist)\n end", "title": "" }, { "docid": "157e773497f78353899720ad034a906a", "score": "0.63000035", "text": "def white_list_params\n params.require(:white_list).permit(:ip, :comment)\n end", "title": "" }, { "docid": "8c384af787342792f0efc7911c3b2469", "score": "0.629581", "text": "def whitelisted_vegetable_params\n params.require(:vegetable).permit(:name, :color, :rating, :latin_name)\n end", "title": "" }, { "docid": "0f69d0204a0c9a5e4a336cbb3dccbb2c", "score": "0.62926817", "text": "def allowed_params\n params.permit(:campaign_id,:marketer_id,:creator_id,:status)\n end", "title": "" }, { "docid": "0f69d0204a0c9a5e4a336cbb3dccbb2c", "score": "0.62926817", "text": "def allowed_params\n params.permit(:campaign_id,:marketer_id,:creator_id,:status)\n end", "title": "" }, { "docid": "9b76b3149ac8b2743f041d1af6b768b5", "score": "0.6280713", "text": "def filter_params\n params.permit(\n\t\t\t\t:name,\n\t\t\t\t:sitedefault,\n\t\t\t\t:opinions,\n\t\t\t\t:contested,\n\t\t\t\t:uncontested,\n\t\t\t\t:initiators,\n\t\t\t\t:comments,\n\t\t\t\t:following,\n\t\t\t\t:bookmarks,\n\t\t\t\t:lone_wolf,\n\t\t\t\t:level_zero,\n\t\t\t\t:level_nonzero,\n\t\t\t\t:private,\n\t\t\t\t:public_viewing,\n\t\t\t\t:public_comments,\n\t\t\t\t:has_parent,\n\t\t\t\t:has_no_parent,\n\t\t\t\t:today,\n\t\t\t\t:last_week,\n\t\t\t\t:last_month,\n\t\t\t\t:last_year,\n\t\t\t\t:sort_by_created_at,\n\t\t\t\t:sort_by_updated_at,\n\t\t\t\t:sort_by_views,\n\t\t\t\t:sort_by_votes,\n\t\t\t\t:sort_by_scores,\n\t\t\t\t:who_id)\n end", "title": "" }, { "docid": "603f4a45e5efa778afca5372ae8a96dc", "score": "0.6271388", "text": "def param_whitelist\n [:role]\n end", "title": "" }, { "docid": "f6399952b4623e5a23ce75ef1bf2af5a", "score": "0.6266194", "text": "def allowed_params\n\t\tparams.require(:password).permit(:pass)\n\tend", "title": "" }, { "docid": "37c5d0a9ebc5049d7333af81696608a0", "score": "0.6256044", "text": "def safe_params\n\t\tparams.require(:event).permit(:title, :event_date, :begti, :endti, :comments, :has_length, :is_private)\n\tend", "title": "" }, { "docid": "505e334c1850c398069b6fb3948ce481", "score": "0.62550515", "text": "def sanitise!\n @params.keep_if {|k,v| whitelisted? k}\n end", "title": "" }, { "docid": "6c4620f5d8fd3fe3641e0474aa7014b2", "score": "0.62525266", "text": "def white_listed_parameters\n params\n .require(:movie)\n .permit(:title, :description, :year_released)\n end", "title": "" }, { "docid": "d14bb69d2a7d0f302032a22bb9373a16", "score": "0.6234781", "text": "def protect_my_params\n return params.require(:photo).permit(:title, :artist, :url)\n\tend", "title": "" }, { "docid": "5629f00db37bf403d0c58b524d4c3c37", "score": "0.62278074", "text": "def filtered_params\n params.require(:user).permit(:name, :email, :password, :password_confirmation)\n end", "title": "" }, { "docid": "d370098b1b3289dbd04bf1c073f2645b", "score": "0.6226693", "text": "def allow_params\n params.permit(:id, :email, :password)\n end", "title": "" }, { "docid": "fde8b208c08c509fe9f617229dfa1a68", "score": "0.6226605", "text": "def strong_params\n params.require(:thread).permit(param_whitelist)\n end", "title": "" }, { "docid": "78cbf68c3936c666f1edf5f65e422b6f", "score": "0.6226114", "text": "def whitelisted_user_params\n if params[:user]\n params.require(:user).permit(:email, :username, :password)\n else\n { :email => params[:email],\n :username => params[:username],\n :password => params[:password] }\n end\nend", "title": "" }, { "docid": "d38efafa6be65b2f7da3a6d0c9b7eaf5", "score": "0.6200643", "text": "def roaster_params\n # Returns a sanitized hash of the params with nothing extra\n params.permit(:name, :email, :img_url, :password_digest, :address, :website, :phone, :latitude, :longitutde, :description)\n end", "title": "" }, { "docid": "d724124948bde3f2512c5542b9cdea74", "score": "0.61913997", "text": "def alpha_provider_params\n params.require(:alpha_provider).permit!\n end", "title": "" }, { "docid": "d18a36785daed9387fd6d0042fafcd03", "score": "0.61835426", "text": "def white_listed_parameters\n params\n .require(:company)\n .permit(:company_name, :company_avatar)\n end", "title": "" }, { "docid": "36956168ba2889cff7bf17d9f1db41b8", "score": "0.6179986", "text": "def set_param_whitelist(*param_list)\n self.param_whitelist = param_list\n end", "title": "" }, { "docid": "07bc0e43e1cec1a821fb2598d6489bde", "score": "0.61630195", "text": "def accept_no_params\n accept_params {}\n end", "title": "" }, { "docid": "fc4b1364974ea591f32a99898cb0078d", "score": "0.6160931", "text": "def request_params\n params.permit(:username, :password, :user_id, :status, :accepted_by, :rejected_by)\n end", "title": "" }, { "docid": "13e3cfbfe510f765b5944667d772f453", "score": "0.6155551", "text": "def admin_security_params\n params.require(:security).permit(:name, :url, :commonplace_id)\n end", "title": "" }, { "docid": "84bd386d5b2a0d586dca327046a81a63", "score": "0.61542404", "text": "def good_params\n permit_params\n end", "title": "" }, { "docid": "b9432eac2fc04860bb585f9af0d932bc", "score": "0.61356604", "text": "def wall_params\n params.permit(:public_view, :guest)\n end", "title": "" }, { "docid": "f2342adbf71ecbb79f87f58ff29c51ba", "score": "0.61342114", "text": "def housing_request_params\n params[:housing_request].permit! #allow all parameters for now\n end", "title": "" }, { "docid": "8fa507ebc4288c14857ace21acf54c26", "score": "0.61188847", "text": "def strong_params\n # to dooo\n end", "title": "" }, { "docid": "9292c51af27231dfd9f6478a027d419e", "score": "0.61140966", "text": "def domain_params\n params[:domain].permit!\n end", "title": "" }, { "docid": "fc43ee8cb2466a60d4a69a04461c601a", "score": "0.611406", "text": "def check_params; true; end", "title": "" }, { "docid": "fc43ee8cb2466a60d4a69a04461c601a", "score": "0.611406", "text": "def check_params; true; end", "title": "" }, { "docid": "a3aee889e493e2b235619affa62f39c3", "score": "0.61107725", "text": "def user_params\n params.permit(:full_name, :email, :job, :about, :max_search_distance,\n :website_url, :linkedin_url,\n :behance_url, :github_url, :stackoverflow_url)\n end", "title": "" }, { "docid": "585f461bf01ed1ef8d34fd5295a96dca", "score": "0.61038506", "text": "def param_whitelist\n whitelist = [\n :message,\n :privacy,\n :author_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:author_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "585f461bf01ed1ef8d34fd5295a96dca", "score": "0.61038506", "text": "def param_whitelist\n whitelist = [\n :message,\n :privacy,\n :author_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:author_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "b63ab280629a127ecab767e2f35b8ef0", "score": "0.6097247", "text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end", "title": "" }, { "docid": "b63ab280629a127ecab767e2f35b8ef0", "score": "0.6097247", "text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end", "title": "" }, { "docid": "677293afd31e8916c0aee52a787b75d8", "score": "0.60860336", "text": "def newsletter_params\n params.permit!.except(:action, :controller, :_method, :authenticity_token)\n end", "title": "" }, { "docid": "e50ea3adc222a8db489f0ed3d1dce35b", "score": "0.60855556", "text": "def params_without_facebook_data\n params.except(:signed_request).permit!.to_hash\n end", "title": "" }, { "docid": "b7ab5b72771a4a2eaa77904bb0356a48", "score": "0.608446", "text": "def search_params\n params.permit!.except(:controller, :action, :format)\n end", "title": "" }, { "docid": "b2841e384487f587427c4b35498c133f", "score": "0.6076753", "text": "def allow_params_authentication!\n request.env[\"devise.allow_params_authentication\"] = true\n end", "title": "" }, { "docid": "3f5347ed890eed5ea86b70281803d375", "score": "0.60742563", "text": "def user_params\n params.permit!\n end", "title": "" }, { "docid": "0c8779b5d7fc10083824e36bfab170de", "score": "0.60677326", "text": "def white_base_params\n params.fetch(:white_base, {}).permit(:name)\n end", "title": "" }, { "docid": "7646659415933bf751273d76b1d11b40", "score": "0.60666215", "text": "def whitelisted_observation_params\n return unless params[:observation]\n\n params[:observation].permit(whitelisted_observation_args)\n end", "title": "" }, { "docid": "fa0608a79e8d27c2a070862e616c8c58", "score": "0.6065763", "text": "def vampire_params\n # whitelist all of the vampire attributes so that your forms work!\n end", "title": "" }, { "docid": "a3dc8b6db1e6584a8305a96ebb06ad21", "score": "0.60655254", "text": "def need_params\n end", "title": "" }, { "docid": "4f8205e45790aaf4521cdc5f872c2752", "score": "0.6064794", "text": "def search_params\n params.permit(:looking_for, :utf8, :authenticity_token, :min_age,\n :max_age, :sort_by, likes:[])\n end", "title": "" }, { "docid": "e39a8613efaf5c6ecf8ebd58f1ac0a06", "score": "0.6062697", "text": "def permitted_params\n params.permit :utf8, :_method, :authenticity_token, :commit, :id,\n :encrypted_text, :key_size\n end", "title": "" }, { "docid": "c436017f4e8bd819f3d933587dfa070a", "score": "0.60620916", "text": "def filtered_parameters; end", "title": "" }, { "docid": "d6886c65f0ba5ebad9a2fe5976b70049", "score": "0.60562736", "text": "def allow_params_authentication!\n request.env[\"devise.allow_params_authentication\"] = true\n end", "title": "" }, { "docid": "96ddf2d48ead6ef7a904c961c284d036", "score": "0.60491294", "text": "def user_params\n permit = [\n :email, :password, :password_confirmation,\n :image, :name, :nickname, :oauth_token,\n :oauth_expires_at, :provider, :birthday\n ]\n params.permit(permit)\n end", "title": "" }, { "docid": "f78d6fd9154d00691c34980d7656b3fa", "score": "0.60490465", "text": "def authorize_params\n super.tap do |params|\n %w[display with_offical_account forcelogin].each do |v|\n if request.params[v]\n params[v.to_sym] = request.params[v]\n end\n end\n end\n end", "title": "" }, { "docid": "f78d6fd9154d00691c34980d7656b3fa", "score": "0.60490465", "text": "def authorize_params\n super.tap do |params|\n %w[display with_offical_account forcelogin].each do |v|\n if request.params[v]\n params[v.to_sym] = request.params[v]\n end\n end\n end\n end", "title": "" }, { "docid": "75b7084f97e908d1548a1d23c68a6c4c", "score": "0.6046521", "text": "def allowed_params\n params.require(:sea).permit(:name, :temperature, :bio, :mood, :image_url, :favorite_color, :scariest_creature, :has_mermaids)\n end", "title": "" }, { "docid": "080d2fb67f69228501429ad29d14eb29", "score": "0.6041768", "text": "def filter_user_params\n params.require(:user).permit(:name, :email, :password, :password_confirmation)\n end", "title": "" }, { "docid": "aa0aeac5c232d2a3c3f4f7e099e7e6ff", "score": "0.60346854", "text": "def parameters\n params.permit(permitted_params)\n end", "title": "" }, { "docid": "0bdcbbe05beb40f7a08bdc8e57b7eca8", "score": "0.6030552", "text": "def filter_params\n end", "title": "" }, { "docid": "cf73c42e01765dd1c09630007357379c", "score": "0.6024842", "text": "def params_striper\n\t \tparams[:user].delete :moonactor_ability\n\t end", "title": "" }, { "docid": "793abf19d555fb6aa75265abdbac23a3", "score": "0.6021606", "text": "def user_params\n if admin_user?\n params.require(:user).permit(:email, :password, :password_confirmation, :name, :address_1, :address_2, :apt_number, :city, :state_id, :zip_code, :newsletter, :active, :admin, :receive_customer_inquiry)\n else\n # Don't allow non-admin users to hack the parameters and give themselves admin security; self created records automatically set to active\n params.require(:user).permit(:email, :password, :password_confirmation, :name, :address_1, :address_2, :apt_number, :city, :state_id, :zip_code, :newsletter)\n end\n end", "title": "" }, { "docid": "2e70947f467cb6b1fda5cddcd6dc6304", "score": "0.6019679", "text": "def strong_params(wimpy_params)\n ActionController::Parameters.new(wimpy_params).permit!\nend", "title": "" }, { "docid": "2a11104d8397f6fb79f9a57f6d6151c7", "score": "0.6017253", "text": "def user_params\n sanitize params.require(:user).permit(:username, :password, :password_confirmation, :display_name, :about_me, :avatar, :current_password, :banned, :ban_message)\n end", "title": "" }, { "docid": "a83bc4d11697ba3c866a5eaae3be7e05", "score": "0.60145336", "text": "def user_params\n\t params.permit(\n\t :name,\n\t :email,\n\t :password\n\t \t )\n\t end", "title": "" }, { "docid": "2aa7b93e192af3519f13e9c65843a6ed", "score": "0.60074294", "text": "def user_params\n params[:user].permit!\n end", "title": "" }, { "docid": "9c8cd7c9e353c522f2b88f2cf815ef4e", "score": "0.6006753", "text": "def case_sensitive_params\n params.require(:case_sensitive).permit(:name)\n end", "title": "" }, { "docid": "45b8b091f448e1e15f62ce90b681e1b4", "score": "0.6005122", "text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "title": "" }, { "docid": "45b8b091f448e1e15f62ce90b681e1b4", "score": "0.6005122", "text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "title": "" }, { "docid": "9736586d5c470252911ec58107dff461", "score": "0.60048765", "text": "def params_without_classmate_data\n params.clone.permit!.except(*(CLASSMATE_PARAM_NAMES + DEBUG_PARAMS))\n end", "title": "" }, { "docid": "e7cad604922ed7fad31f22b52ecdbd13", "score": "0.60009843", "text": "def member_params\n # byebug\n params.require(:member).permit(\n :first_name, \n :last_name, \n :username, \n :email, \n :password, \n :image, \n :family_size, \n :address)\n\n end", "title": "" }, { "docid": "58ad32a310bf4e3c64929a860569b3db", "score": "0.6000742", "text": "def user_params\n\t\tparams.require(:user).permit!\n\tend", "title": "" }, { "docid": "58ad32a310bf4e3c64929a860569b3db", "score": "0.6000742", "text": "def user_params\n\t\tparams.require(:user).permit!\n\tend", "title": "" }, { "docid": "f70301232281d001a4e52bd9ba4d20f5", "score": "0.6000161", "text": "def room_allowed_params\n end", "title": "" }, { "docid": "2e6de53893e405d0fe83b9d18b696bd5", "score": "0.599852", "text": "def user_params\n params.require(:user).permit(:username, :password, :realname, :email, :publicvisible)\n end", "title": "" }, { "docid": "19bd0484ed1e2d35b30d23b301d20f7c", "score": "0.59984183", "text": "def unsafe_params\n ActiveSupport::Deprecation.warn(\"Using `unsafe_params` isn't a great plan\", caller(1))\n params.dup.tap(&:permit!)\n end", "title": "" }, { "docid": "19bd0484ed1e2d35b30d23b301d20f7c", "score": "0.59984183", "text": "def unsafe_params\n ActiveSupport::Deprecation.warn(\"Using `unsafe_params` isn't a great plan\", caller(1))\n params.dup.tap(&:permit!)\n end", "title": "" }, { "docid": "a50ca4c82eaf086dcbcc9b485ebd4261", "score": "0.59947807", "text": "def white_listed_parameters\n params\n .require(:story)\n .permit(:title, :link, :upvotes, :category)\n end", "title": "" }, { "docid": "0f53610616212c35950b45fbcf9f5ad4", "score": "0.5993962", "text": "def user_params(params)\n\tparams.permit(:email, :password, :name, :blurb)\n end", "title": "" }, { "docid": "b545ec7bfd51dc43b982b451a715a538", "score": "0.5992739", "text": "def user_params\n params_allowed = %i[email password password_confirmation is_admin]\n params.require(:user).permit(params_allowed)\n end", "title": "" }, { "docid": "0b704016f3538045eb52c45442e7f704", "score": "0.59911275", "text": "def admin_params\n filtered_params = params.require(:admin).permit(:display_name, :email, :password, :password_confirmation)\n if filtered_params[:password] == \"\"\n filtered_params.delete(:password)\n filtered_params.delete(:password_confirmation)\n end\n filtered_params\n end", "title": "" }, { "docid": "6af3741c8644ee63d155db59be10a774", "score": "0.59906775", "text": "def allowed_params\n %i[\n lock_version\n comments\n organization\n job_title\n pronouns\n year_of_birth\n gender\n ethnicity\n opted_in\n invite_status\n acceptance_status\n registered\n registration_type\n can_share\n registration_number\n can_photo\n can_record\n name\n name_sort_by\n name_sort_by_confirmed\n pseudonym\n pseudonym_sort_by\n pseudonym_sort_by_confirmed\n ]\n end", "title": "" } ]
5dbb0e18d2c5257212fe38d6390a3a6c
iterates through all fight instances of Fight.all and grabs the attributes to display each fight details to the user.
[ { "docid": "0d80f63e0f3cf590fc87c6f2f31c12f0", "score": "0.63054687", "text": "def scheduled_fight_details\n number_of_fights.each_with_index do|fight, index|\n puts \"----------------------------\".red + \"#{\"BOXING SCHEDULES\".blue}\" + \"------------------------------------------------\".red\n puts \"Fight ##{index+1}\".red\n puts \"Fight Channel & Location: #{fight.channel_location}\"\n puts \"Fight Time: #{fight.fight_time}\"\n puts \"Fighter Names: #{fight.fighter_names}\"\n puts \"All Fight Details: #{fight.fight_details.gsub(\"More Details\", \"\")}\"\n puts \"Fight Link:\" + \"#{fight.fight_url}\".yellow\n puts \"--------------------------------------------------------------------------------------------\".red\n end\n end", "title": "" } ]
[ { "docid": "abd2b96ef7e6e5e3b313175397e51729", "score": "0.6554812", "text": "def index\n @fighters = Fighter.all\n end", "title": "" }, { "docid": "abd2b96ef7e6e5e3b313175397e51729", "score": "0.6554812", "text": "def index\n @fighters = Fighter.all\n end", "title": "" }, { "docid": "abd2b96ef7e6e5e3b313175397e51729", "score": "0.6554812", "text": "def index\n @fighters = Fighter.all\n end", "title": "" }, { "docid": "e75d01bd8a89af5e9a0133ee06b458f2", "score": "0.62100536", "text": "def show\n @fight = Fight.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @fight.to_json( :include => { :field_initial => { :only => [:name] }, :field_actual => { :only => [:name] }, :category => { :only => [:name] }, :competitor_blue => { :only => [:last_name, :lot_number] }, :competitor_red => { :only => [:last_name, :lot_number] }, :competitor_winner => { :only => [:last_name, :lot_number] }, :previous_fight_blue => { :only => [:id, :number], :include => { :field_initial => { :only => [:name] } } }, :previous_fight_red => { :only => [:id, :number], :include => { :field_initial => { :only => [:name] } } } } ) }\n\n end\n end", "title": "" }, { "docid": "1b22b8fda782e4aae617a5d0d3944140", "score": "0.61346304", "text": "def fights\n Fight.where('fighter_left_id = ? OR fighter_right_id = ?', id, id)\n end", "title": "" }, { "docid": "ff666d5d8cfb09911306b35fb87f91c6", "score": "0.6132049", "text": "def show\n @fight = Fight.find(params[:id])\n @fighters = [@fight.fighter_one, @fight.fighter_two]\n @pick = Pick.new\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @fight }\n end\n end", "title": "" }, { "docid": "d93f8b70eea7f43ac90fe935b47dc7ae", "score": "0.59961885", "text": "def set_fight\n @fight = Fight.find(params[:id])\n end", "title": "" }, { "docid": "e83083f27015a7b80d9bfdeb91fa61ec", "score": "0.5952982", "text": "def show\n @fight = Fight.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @fight }\n end\n end", "title": "" }, { "docid": "02b1ebd0af9e8d7c79d9981432863c9f", "score": "0.5932029", "text": "def set_fight\n @fight = Fight.find(params[:id])\n end", "title": "" }, { "docid": "10f9d51ffa7f1986325f0a3f4e94c20c", "score": "0.58821213", "text": "def print_fight_details(fight_detail)\n number_of_fights.each_with_index do|fight, index|\n if index < number_of_fights.size\n puts \"Fight\".blue + \"##{index+1} \".red + \"#{fight.send(fight_detail)}\"\n end\n end\n end", "title": "" }, { "docid": "9d3f4323f49a564823e43f9ca40a4e2e", "score": "0.5841216", "text": "def show\n @fantasy_league = FantasyLeague.includes(:fantasy_teams, :fantasy_drafts).find(params[:id])\n end", "title": "" }, { "docid": "2f73d66a9ee22866dcf8e80b00a33060", "score": "0.58150864", "text": "def index\n @result_fights = ResultFight.where(user_id: current_user.id)\n end", "title": "" }, { "docid": "124ef114886bc48a2af665d6f400b2f8", "score": "0.58045864", "text": "def show\n @race = Race.find(@character.race_id)\n feat_assignments = @character.feat_assignments\n @feats = []\n feat_assignments.each do |assignment|\n @feats << Feat.find(assignment.feat_id)\n end\n @attributes = @character.attribute_list\n @class = PathfinderClass.find(@character.class_id)\n @base_attack = @class.baseAttackBonuses[1][0]\n @saves = @class.baseSaves[1]\n @description = @character.description\n end", "title": "" }, { "docid": "e10c3a94a7fd281a8aa5ddb1d6dbc9da", "score": "0.5742954", "text": "def flights \n ticket_instances = self.tickets # Returns all the ticket instances associated with this passenger\n\n ticket_instances.map do |ticket_instance| # Using map to transform it into an array of \n # flight instances associated with this passenger.\n ticket_instance.flight\n end \n end", "title": "" }, { "docid": "82ed49563304cda8b4c03ac8e6883e33", "score": "0.56750405", "text": "def fight\n @state.fight(self)\n end", "title": "" }, { "docid": "4af25bb44df591fb1b5c8903a1f18591", "score": "0.5655604", "text": "def fight (game)\n @state.fight(self, game)\n end", "title": "" }, { "docid": "e5d3848666b6ee3c073fbe04701c4092", "score": "0.56406975", "text": "def fight\n display_hero_attack(attack_resolver(hero, monster))\n if monster.current_health > 0\n display_monster_attack(attack_resolver(monster, hero))\n else\n hero_win\n end\n end", "title": "" }, { "docid": "d796e6fe780219b723de794636c95fc2", "score": "0.5603483", "text": "def fight\n monster = @game.current_room_model.monster\n player = @game.player\n return unless monster\n\n @game.state = FightingState.new @game\n\n if not player.weapons.empty?\n @game.state.status # Ask for weapon\n else\n @game.state.handle( nil ) # Start the fight directly\n end\n end", "title": "" }, { "docid": "949c329e726d31314c3e746c24b08f2c", "score": "0.5578884", "text": "def show\n @flights = Flight.all\n @first = @flight.first\n @business = @flight.business\n @economy = @flight.economy\n if @first\n @fseat = @first.seats\n end\n if @business\n @bseat = @business.seats\n end\n if @economy\n @eseat = @economy.seats\n end\n end", "title": "" }, { "docid": "4153522aaaaa4f2f801612b5683fa26d", "score": "0.55163866", "text": "def index\n @fights = Fight.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @fights.to_json( :include => { :field_initial => { :only => [:name] }, :field_actual => { :only => [:name] }, :category => { :only => [:name] }, :competitor_blue => { :only => [:last_name, :lot_number] }, :competitor_red => { :only => [:last_name, :lot_number] }, :competitor_winner => { :only => [:last_name, :lot_number] }, :previous_fight_blue => { :only => [:id, :number], :include => { :field_initial => { :only => [:name] } } }, :previous_fight_red => { :only => [:id, :number], :include => { :field_initial => { :only => [:name] } } } } ) }\n end\n end", "title": "" }, { "docid": "e8489e6981c4e80ad7f74fc8ba355d93", "score": "0.54874647", "text": "def show\n @teamSponsors = TeamsSponsor.eager_load(:sponsor).where(:team_id => params[:id])\n @teamsRosters = Roster.includes(:profile => :rating).where(:team_id => params[:id]).order('profiles.last_name')\n @games = Game.eager_load(:home_team, :away_team, :field).where(\"home_team_id = ? OR away_team_id = ?\", params[:id], params[:id]) \n @team_rating = calculate_team_ratings(@teamsRosters) \n end", "title": "" }, { "docid": "3c09f3865100e1a2f1791d05072c69a3", "score": "0.5487125", "text": "def set_fighter\n @fighter = Fighter.find(params[:id])\n end", "title": "" }, { "docid": "c5f1d3b3f662fdefd39a32a61e6fa1f9", "score": "0.5482676", "text": "def index\n @buddyfights = Buddyfight.all\n end", "title": "" }, { "docid": "ce04207e2f4b0317f964f9c6b97ba9d4", "score": "0.5438638", "text": "def new\n @fight = Fight.new\n @fighters = Fighter.order('first_name desc')\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @fight }\n end\n end", "title": "" }, { "docid": "9b2f0926aea6384936f464958b05666e", "score": "0.5416375", "text": "def number_of_fights\n BoxingSchedules::Fight.all\n end", "title": "" }, { "docid": "e86dd212a7140496f3de1d844d0a92d7", "score": "0.54145867", "text": "def fights_params\n params.require(:fight).permit('opponent_1_name', 'opponent_1_strength', 'opponent_1_life', 'opponent_1_adv', 'opponent_2_name', 'opponent_2_strength', 'opponent_2_life', 'opponent_2_adv', 'opponent_3_name', 'opponent_3_strength', 'opponent_3_life', 'opponent_3_adv', 'opponent_4_name', 'opponent_4_strength', 'opponent_4_life', 'opponent_4_adv', 'opponent_5_name', 'opponent_5_strength', 'opponent_5_life', 'opponent_5_adv')\n end", "title": "" }, { "docid": "7f558fd699f56c4f5eb201af58f25615", "score": "0.5409316", "text": "def show\n @title = t('view.firefighters.show_title')\n @firefighter = Firefighter.find(params[:id])\n @relatives = @firefighter.relatives\n @dockets = @firefighter.dockets.order(:id).page(params[:page])\n end", "title": "" }, { "docid": "7888e92de67ce6839baac9bb675dd6df", "score": "0.5395447", "text": "def view_flight_info\n\n self.current_person.flights.each do |flight|\n puts \"----------------------------------------\"\n puts \"Flight ID : #{flight.id}\"\n puts \"Airline : #{flight.airline}\"\n puts \"Origin : #{flight.origin}\"\n puts \"Destination: #{flight.destination}\"\n puts \"Departure Time: #{flight.departure_time}\"\n puts \"Arrival Time: #{flight.arrival_time}\"\n puts \"Duration: #{flight.duration}\"\n puts \"\"\n puts \"----------------------------------------\"\n\n end\n return_to_menu\n end", "title": "" }, { "docid": "f2fa8d8612965f72dcc03b6bddd96316", "score": "0.53351617", "text": "def index\n @attack_heights = AttackHeight.all\n end", "title": "" }, { "docid": "dedc8b9bb53fede712088551261758a5", "score": "0.5314143", "text": "def show\n @battle = Battle.find(params[:id])\n @user = User.find(@battle.user_id)\n # @enemy = Pet.find(@battle.enemy_id)\n # @aenemies = @battle.aenemies\n @ghost_logs = @battle.ghost_logs\n if @ghost_logs.any?\n @last_log = @ghost_logs.last\n if @last_log.item_id.presence \n @last_item = Item.find(@last_log.item_id)\n end\n if @last_log.pet_id.presence \n @last_pet = Pet.find(@last_log.pet_id)\n end\n if @last_log.ghost_id.presence\n @last_pet = Ghost.find(@last_log.ghost_id)\n end\n end\n #if (@battle.aenemies.any?)\n # @aenemy = Aenemy.find(@battle.aenemy_id)\n # end\n end", "title": "" }, { "docid": "21e217043cfd169021ad17d9d3cd0dd5", "score": "0.5312376", "text": "def set_fighter\n @fighter = Fighter.find(params[:id])\n end", "title": "" }, { "docid": "21e217043cfd169021ad17d9d3cd0dd5", "score": "0.5312376", "text": "def set_fighter\n @fighter = Fighter.find(params[:id])\n end", "title": "" }, { "docid": "149f7d480f63639c19f0552d785a29e7", "score": "0.5280095", "text": "def create\n \t@fight = current_user.fights.new(fights_params)\n \t@fight.save\n end", "title": "" }, { "docid": "7274e4d9bc2c7b70f6ea834c5b756688", "score": "0.5263801", "text": "def scrape_fight(event, fmid)\n visit event + '#' + fmid.to_s\n\n doc = Nokogiri::HTML.parse(page.source)\n\n # I wonder if there could be some way for me to figure this out on my own\n # I'm sure this has to do with some event id thing\n visit doc.xpath('//iframe[@id=\"matchup-modal-content\"]').first[:src]\n\n sleep 100\n\n doc = Nokogiri::HTML.parse(page.source)\n\n contents = doc.xpath('//*[contains(@class, \"col-span-6\")]')\n\n fight_props = {}\n fight_props[:event_id] = 0\n fight_props[:first_fighter_id] = 0\n fight_props[:second_fighter_id] = 0\n fight_props[:weight_class_id] = 0\n fight_props[:victor_id] = 0\n fight_props[:fight_id] = 0\n end", "title": "" }, { "docid": "79714ba536cee65d9d4480b65d1619e7", "score": "0.52510816", "text": "def index\n @auction_foregifts = AuctionForegift.all\n end", "title": "" }, { "docid": "56e3d2f79894fc2cc0b3e1865bed77b2", "score": "0.52463067", "text": "def fight\n # TODO: Add this back in, in a curses way\n #puts\n #puts \"========FIGHT========\"\n #puts \"#{@hero.name} Vs #{@monster.name}\"\n #puts\n\n # Populate an array with X number of levels Hero is and Y number of levels Monster is\n # This way whoever is a higher level has a better chance of attacking \n attack_arr = []\n @hero.level.to_i.times { attack_arr.push(\"Hero\") }\n @monster.level.to_i.times { attack_arr.push(\"Monster\") }\n\n # Loop until one character dies\n while @hero.cur_health > 0 && @monster.cur_health > 0\n case attack_arr.shuffle.first\n when \"Hero\" then @monster.cur_health -= @hero.strength\n when \"Monster\" then @hero.cur_health -= @monster.strength\n end\n end\n\n return (@hero.cur_health > @monster.cur_health)\n end", "title": "" }, { "docid": "d97246510b3f0392be7afd408c01c6b4", "score": "0.52423745", "text": "def fight\n return false if gladiators.size != 2\n\n # The names of each gladiator\n n1 = gladiators[0].name\n n2 = gladiators[1].name\n\n # Check for the special case that Maximus is around\n if n1 == \"Maximus\"\n remove(n2)\n return\n end\n\n if n2 == \"Maximus\"\n remove(n1)\n return\n end\n\n # If no Maximus, get weapons for each gladiator\n w1 = gladiators[0].weapon\n w2 = gladiators[1].weapon\n\n # If weapons are the same, remove both gladiators\n if w1 == w2\n remove(n1)\n remove(n2)\n else\n case w1\n when \"Spear\"\n # Spear loses to Trident but beats Club\n (w2 == \"Trident\") ? remove(n1) : remove(n2)\n when \"Trident\"\n # Trident loses to Club but beats Spear\n (w2 == \"Club\") ? remove(n1) : remove(n2)\n when \"Club\"\n # Club loses to Spear but beats Trident\n (w2 == \"Spear\") ? remove(n1) : remove(n2)\n end\n end\n end", "title": "" }, { "docid": "908347ff347f199d1cf7066e7f8f62d1", "score": "0.5240459", "text": "def all_lifters\n Membership.all.select do |membership_instance|\n if membership_instance.gym == self\n membership_instance.member\n end\n end\n end", "title": "" }, { "docid": "9c5dfad9de1673f694de12f300ed11b1", "score": "0.52354914", "text": "def show\n @trial_params = TrialParam.where trial_id: @trial.trial_id\n @trial_values = TrialValue.where trial_id: @trial.trial_id\n @trial_system_attributes = TrialSystemAttribute.where trial_id: @trial.trial_id\n @trial_user_attributes = TrialUserAttribute.where trial_id: @trial.trial_id\n end", "title": "" }, { "docid": "61a5b7ed0e43256514e5281e37dcd873", "score": "0.52186984", "text": "def show\n @battle = Battle.find(params[:id])\n @trainer = Trainer.find(@battle.trainer_id)\n @enemy = Trainer.find(@battle.enemy_id)\n \n @trainer_active_pokemon = @trainer.pokemons.find(@trainer.active_pokemon_id)\n @enemy_active_pokemon = @enemy.pokemons.find(@enemy.active_pokemon_id)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @battle }\n end\n end", "title": "" }, { "docid": "c1dbb9ccab5baa9b293531f309a92a5d", "score": "0.52158725", "text": "def show\n @teams = Team.all\n @group_stage_winners = GroupStageWinner.all\n @qf_winners = QfWinner.all\n @sf_winners = SfWinner.all\n @ko16_winners = Ko16Winner.all\n @final_winners = FinalWinner.all\n @users = User.all\n end", "title": "" }, { "docid": "c1dbb9ccab5baa9b293531f309a92a5d", "score": "0.52158725", "text": "def show\n @teams = Team.all\n @group_stage_winners = GroupStageWinner.all\n @qf_winners = QfWinner.all\n @sf_winners = SfWinner.all\n @ko16_winners = Ko16Winner.all\n @final_winners = FinalWinner.all\n @users = User.all\n end", "title": "" }, { "docid": "2c433b18d33c1f4b20589af69c71ae5e", "score": "0.5179494", "text": "def my_guests\n @festivals = Festival.where(user: current_user)\n end", "title": "" }, { "docid": "d00d3d37ca3f93b05838d9e3ffb0eaa1", "score": "0.51746166", "text": "def show\n @flower_ships = FlowerShip.where(flower_order_id: @flower_order.id)\n end", "title": "" }, { "docid": "f0f3586d6bb97846496d1bff54fdc721", "score": "0.51722807", "text": "def index\n @fantasy_league_fantasy_teams = FantasyLeagueFantasyTeam.all\n end", "title": "" }, { "docid": "4cfabcea529abc09090b57c81bb7f5a4", "score": "0.5161167", "text": "def show\n @tournament = @fish.tournament\n end", "title": "" }, { "docid": "d5f8a4e41da0b1dc5b94f8b846f53644", "score": "0.51559067", "text": "def index\n @fantasy_leagues = FantasyLeague.all\n end", "title": "" }, { "docid": "247ace0a373e1172879e352af3617128", "score": "0.51542705", "text": "def set_freight\n @freight = Freight.find(params[:id])\n end", "title": "" }, { "docid": "3e40a31ead1890883d4dc2ec61ced170", "score": "0.51497346", "text": "def fight\n if @gladiators.length == 2\n if @gladiators.first.weapon == @gladiators.last.weapon\n @gladiators.pop(2)\n elsif @gladiators.first.weapon == \"Spear\" && @gladiators.last.weapon == \"Trident\"\n @gladiators.shift(1)\n elsif @gladiators.first.weapon == \"Spear\" && @gladiators.last.weapon == \"Club\"\n @gladiators.pop(1)\n elsif @gladiators.first.weapon == \"Trident\" && @gladiators.last.weapon == \"Club\"\n @gladiators.shift(1)\n end\n end\n end", "title": "" }, { "docid": "550ddcf1ae46721390d5ff5835682cd4", "score": "0.51493335", "text": "def show_all_weapons\n if self.weapons.size == 0\n puts \"\"\n puts \"You have no weapons, try completing some quests first :)\"\n else\n puts \"\"\n puts \"Here Are Your Weapons:\".bold.white.on_light_black\n puts \" \"\n self.weapons.each do |weapon|\n puts \"**** #{weapon.name} **** Weapon Power: #{weapon.attack_power} ****\".italic\n end\n end\n end", "title": "" }, { "docid": "d6f7c87b0196e899a119bd62f1573ab0", "score": "0.51476854", "text": "def update\n @fight = Fight.find(params[:id])\n\n respond_to do |format|\n if @fight.update_attributes(params[:fight])\n format.html { redirect_to(@fight, :notice => 'Fight was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @fight.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4d5f16b5224d1629379c41b6088df3ee", "score": "0.51469904", "text": "def fight_params\n params.require(:fight).permit(:report, :time, :attacker_id, :defender_id)\n end", "title": "" }, { "docid": "bf36cf84f44eb446c16a00ee0a2fe082", "score": "0.51431704", "text": "def create\n @fight = Fight.new(fight_params)\n respond_to do |format|\n if @fight.save\n format.html { redirect_to @fight, notice: 'Fight was successfully created.' }\n format.json { render :show, status: :created, location: @fight }\n else\n format.html { render :new }\n format.json { render json: @fight.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "37b4d116c540d3a0a825451c27d765bd", "score": "0.5138643", "text": "def index\n @fattening_cages = FatteningCage.where(farm_id: @farm.id)\n @motherhood_cages = MotherhoodCage.where(farm_id: @farm.id)\n @weaning_cages = WeaningCage.where(farm_id: @farm.id)\n @race_cages = RaceCage.where(farm_id: @farm.id)\n\n end", "title": "" }, { "docid": "f82be655bef627ce79dc54120a8e67a8", "score": "0.51268166", "text": "def show\n @team = Team.find(params[:id])\n @teams_tournaments = TeamsTournament.find(:all, :include => [:tournament], :conditions => [\"team_id = ?\", @team.id])\n @unconfirmed = @teams_tournaments.find_all{|item| item.confirmed == false}\n @confirmed = @teams_tournaments.find_all{|item| item.confirmed == true}\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @team }\n end\n end", "title": "" }, { "docid": "824317c807ee7ae0e5a5aace130d6727", "score": "0.5118654", "text": "def all_gyms\n Membership.all.map do |membership| \n if membership.lifter == self\n membership.gym\n end\n end\n end", "title": "" }, { "docid": "6f4b33b787e05bf32d16d4e086bda892", "score": "0.5112121", "text": "def update\n @fight = Fight.find(params[:id])\n\n respond_to do |format|\n if @fight.update_attributes(params[:fight])\n format.html { redirect_to @fight, notice: 'Fight was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @fight.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "89d7ec693ec5e5d5a5777b43975e2977", "score": "0.51093876", "text": "def show\n @user = current_user\n @round = Round.find(params[:id])\n @fighter = Fighter.find(@round.fighter_id)\n @score = Score.find_by_user_id(@user.id)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @round }\n end\n end", "title": "" }, { "docid": "d344fb6b866c65674e705e6a40afb8a6", "score": "0.5103417", "text": "def show\n \t@stats = Stat.all\n @shared = Stat.select(\"id\", \"weather\", \"week\")\n @teamA = Stat.select(\"teamA\", \"winA\", \"homeA\", \"pointsA\", \"run_attemptA\", \"yards_per_carryA\", \"pass_attemptA\", \"pass_completionA\", \"yards_per_catchA\", \"first_downA\", \"fourth_down_attemptA\", \"fourth_down_madeA\", \"time_of_possesionA\", \"fourth_down_ratingA\", \"total_offenseA\", \"o_playsA\", \"pass_efficiencyA\")\n @teamB = Stat.select(\"teamB\", \"winB\", \"homeB\", \"pointsB\", \"run_attemptB\", \"yards_per_carryB\", \"pass_attemptB\", \"pass_completionB\", \"yards_per_catchB\", \"first_downB\", \"fourth_down_attemptB\", \"fourth_down_madeB\", \"time_of_possesionB\", \"fourth_down_ratingB\", \"total_offenseB\", \"o_playsB\", \"pass_efficiencyB\")\n end", "title": "" }, { "docid": "5710eba0e4b481a2839fb93adb8339ef", "score": "0.5103124", "text": "def show\n @venue = get_venue\n @tour = Tour.find(params[:id])\n @attraction_tours = @tour.attraction_tours.order(\"tour_order ASC\")\n @attractions = @tour.venue.attractions\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @tour.to_json( :include => {:attraction_tours => { :include => :attraction} , :media => {} } ) }\n end\n end", "title": "" }, { "docid": "2469b9736ecb604d07c705586f78f890", "score": "0.50990987", "text": "def show\n @flight = Flight.find(params[:flight_id])\n @economy = @flight.economy\n end", "title": "" }, { "docid": "58aff69edcfda0c99e3261ab6309c3fb", "score": "0.50957036", "text": "def show\n session.delete(:return_path)\n @wrestlers = @school.wrestlers.includes(:deductedPoints,:matches,:weight,:school)\n @tournament = @school.tournament\n end", "title": "" }, { "docid": "b1d4ac203911bdf4ea524e7040f204b1", "score": "0.509207", "text": "def index\n @flightstats = Flightstat.all\n end", "title": "" }, { "docid": "4cf5bb80678c4cf1d35dcaa11671e1ec", "score": "0.5079989", "text": "def load_fantasy_stats\n load_tournament_list\n load_tournament_game_data\n create_leagues\n load_player_data\n end", "title": "" }, { "docid": "7fe88e82acc49a1641b2a7d0f627d387", "score": "0.50782", "text": "def set_result_fight\n @result_fight = ResultFight.find(params[:id])\n end", "title": "" }, { "docid": "7ddc7ae8464bb4aad1080fcd6014874f", "score": "0.50781345", "text": "def show\n @headings = ExpertHeading.where(expert: @expert)\n friend_ids = Friendship.where(expert: @expert).pluck(:friend_id)\n friend_ids << @expert.id\n @all_experts = Expert.where.not(id: friend_ids)\n end", "title": "" }, { "docid": "7a9b8329b54ebaeb81d15f1e9aa5ceca", "score": "0.5077565", "text": "def index\n @leagues = League.includes(:teams)\n Rails.logger.debug \"********************************************************\"\n @leagues.each do |league|\n Rails.logger.debug league.inspect\n Rails.logger.debug league.teams.inspect\n end\n Rails.logger.debug \"********************************************************\" \n end", "title": "" }, { "docid": "70cd8fed5d552a3b8fc4eba130a05f39", "score": "0.50774914", "text": "def all_lifters\n all_memberships.map {|lifters| lifters.lifter}\n end", "title": "" }, { "docid": "dd4a2d2c59fd95776375f99a7caf7e90", "score": "0.50660354", "text": "def get_hotel_fares(hotels)\n fare_list = Hash.new\n \thotels.each do | hotel |\n\t fare_list[hotel.class.name] = hotel.get_fare(self)\n\tend\n fare_list\n end", "title": "" }, { "docid": "516c37eee92e33910084fce6642ce259", "score": "0.50380677", "text": "def index\n @sights = Sight.all\n end", "title": "" }, { "docid": "daec33a00b2cdfd70ca7ba5ba1dacf47", "score": "0.503235", "text": "def index\n @tier_fillings = TierFilling.all\n end", "title": "" }, { "docid": "611b01a4fed35fa6b29c2e15061bb45c", "score": "0.5025659", "text": "def print_attacks_with_stats\n @battle_commands.each do |command|\n\n # Simple way to check for both damage and success rate attributes.\n # Prevents the name from being displayed for non-attacks.\n unless command.damage.nil?\n puts command.name + \"\\n Damage: #{command.damage}\"\n\n unless command.success_rate.nil?\n puts \" Success Rate: #{command.success_rate}\"\n end\n\n end\n end\n\n print \"\\n\"\n end", "title": "" }, { "docid": "f6b5043e6f9cadfd37dec367eb691bba", "score": "0.50174224", "text": "def index\n @fours = Four.all\n end", "title": "" }, { "docid": "d0cd686029b5040e4681533f7d5792f3", "score": "0.5015172", "text": "def show\n\t\t@team = Team.find(params[:id])\n\t\tquery = @team.name\n\n\t\t# Pulls news articles about each team through Google RSS\n\t\tdata = party_time(\"https://news.google.com/news/feeds?q=#{query.downcase.gsub(/\\s/, '+')}&output=rss\")\n\t\t@articles = data[\"rss\"][\"channel\"][\"item\"]\n\n\t\t# Pulls upcoming fixtures for this team\n\t\t@data2 = party_time(\"http://api.statsfc.com/premier-league/fixtures.json?key=DThzCPsM_TI0XUGeUOJqr26JHwtYXVIfYvSSb0ui&team=#{query.downcase.gsub(/\\s/, '-')}&timezone=America/New_York&limit=5\")\n\n\t\t# Pulls past results for this team \n\t\t@data3 = party_time(\"http://api.statsfc.com/premier-league/results.json?key=DThzCPsM_TI0XUGeUOJqr26JHwtYXVIfYvSSb0ui&team=#{query.downcase.gsub(/\\s/, '-')}&timezone=America/New_York&limit=5\")\n\tend", "title": "" }, { "docid": "f1bb5e5193b241a5dede125678edce18", "score": "0.5013767", "text": "def index\n @fostereds = Fostered.all\n end", "title": "" }, { "docid": "a539047be84e31031012275ceadca737", "score": "0.5013005", "text": "def show\n gr = Rent.find(params[:id]).grossrent\n mi = Rent.find(params[:id]).mortage_interest\n reoair = Rent.find(params[:id]).repairs\n ins = Rent.find(params[:id]).insurance\n manacharge = Rent.find(params[:id]).management_charges\n agefee = Rent.find(params[:id]).agent_fee\n o = Rent.find(params[:id]).other\n wr = Rent.find(params[:id]).wear_and_tear\n good = Rentalprofitorloss::Rentalmaster.expense(gr,mi,reoair,ins,manacharge,agefee,o,wr)\n @duck = good\n \n end", "title": "" }, { "docid": "f80b6e5022d207e63d96ee76549b4987", "score": "0.50089294", "text": "def generate_fighters(number, initial_health)\n fighters = []\n for i in 1..number\n number = \"%.2i\" %i\n fighters << {runner: generate_fighter(\"runner \" + number, initial_health, \"Runner\"), viking: generate_fighter(\"viking \" + number, initial_health, \"Viking\")}\n end\n return fighters\nend", "title": "" }, { "docid": "d32815c1cf7d62fe1aecc5d97efb8e24", "score": "0.500136", "text": "def show\n @leaguemembers = League.find(params[:id]).users\n @matches = Match.where(:league_id => params[:id])\n \n end", "title": "" }, { "docid": "9b7c6f0c83edba0e49e76c5b66f4d290", "score": "0.4998486", "text": "def stats\n # nb of flight last 30days\n @nb_flights_30d = Flight.where('created_at > ?', 30.days.ago).count\n # top 3 longest flights\n @longest_flight = Flight.all.order('length desc').limit(3)\n end", "title": "" }, { "docid": "7a69b61b7ecc1460cb4eab4435a3ac12", "score": "0.49852955", "text": "def show\n @meeting = Meeting.find(params[:id])\n @user = User.find_by_watiam(session[:cas_user])\n\n @allattendees = Attendee.where(:meeting_id => @meeting.id).all\n @allattendees.find(:sort => 'weight')\n @allusers = []\n \n \n #creates array of users that are attending the meeting\n @allattendees.each do |attendee|\n @userall = User.find(:first, :conditions => {:id => attendee.user_id})\n @allusers << @userall\n end\n \n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @meeting }\n end\n end", "title": "" }, { "docid": "77d301718c8f51380b4f0585c2a21965", "score": "0.49825165", "text": "def display_list_of_drinks\n #Access all the drinks\n #print each one out\n Drink.all.each.with_index(1) do |drink, index| #call class method in the drink class that is keeping track of all drinks\n puts \"#{index}. #{drink.name}\" #print out name attribute otherwise you'll get the object id\n\n end \nend", "title": "" }, { "docid": "9d9ca7fff82666baf59a9c23267e83a8", "score": "0.49750772", "text": "def index\n @flight_infos = FlightInfo.all\n end", "title": "" }, { "docid": "627bbc8c4622f5611e51bc3de3586291", "score": "0.4970262", "text": "def show_fans(player) \n player1 = Player.find_by(name: player)\n fans_array = player1.fans\n fans_array.each do |fan|\n puts fan.name \n end\nend", "title": "" }, { "docid": "d4cd0adf0cbdaeb84207f347a7f47ed5", "score": "0.4960835", "text": "def show\n @strategy_guide = StrategyGuide.find(params[:id])\n @hero = @strategy_guide.hero\n @hero_pros = @strategy_guide.hero_pros\n @hero_cons = @strategy_guide.hero_cons\n @skill_build = @strategy_guide.skill_build\n @strategy_items = @strategy_guide.strategy_items\n end", "title": "" }, { "docid": "399d671c6b68acdcb91a5c6cbf54fa97", "score": "0.496001", "text": "def show\n @good = Good.includes(\n :situation,\n movements: { department: :property },\n category: { sub_kind: :kind },\n financial_movements: :kind\n ).find(params[:id])\n\n set_avaliable_departments\n\n @movement_kinds = MovementKind.select(:id, :description).find(1, 2).map { |k| [MovementKind.t(k.description), k.id] }\n end", "title": "" }, { "docid": "dce5c1adc7a5766eb0beaeaa8de20e1a", "score": "0.49420795", "text": "def update\n respond_to do |format|\n if @fight.update(fight_params)\n format.html { redirect_to @fight, notice: 'Fight was successfully updated.' }\n format.json { render :show, status: :ok, location: @fight }\n else\n format.html { render :edit }\n format.json { render json: @fight.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1c3a1ec71669da416986f8e1a9218639", "score": "0.49361888", "text": "def fight_number(number, fight_detail)\n number_of_fights.select.with_index(1) do |fight, index|\n if index == number\n puts \"\"\n puts \"Selected fight:\"\n puts \"--------------------------------------------------------------------------------------------\".red\n puts \"Fight ##{index}:\".red\n puts \"Selected details:\" + \" #{fight.send(fight_detail)}\".gsub(\"More Details\", \"\")\n puts \"Fight Link:\" +\" #{fight.fight_url}\".yellow\n puts \"---------------------------------------------------------------------------------------------\".red\n puts \"\"\n end\n end\n end", "title": "" }, { "docid": "fd61a46f2d6339f6f0beb9f8153df195", "score": "0.49360248", "text": "def index\n @frats = Frat.all\n end", "title": "" }, { "docid": "95a4a98602c316ee6d94f4c4573c4f1c", "score": "0.49335894", "text": "def show\n @incidentfollowup = Incidentfollowup.new\n @incidentfollowup.incident_id = params[:id]\n @investigation = Investigation.where(incident_id: params[:id]).first\n\n @witness = Witness.new\n @witness.incident_id = params[:id]\n @witnesses = Witness.where(incident_id: params[:id]).order(\"id\")\n\n @victim = Victim.new\n @victim.incident_id = params[:id]\n @victims = Victim.where(incident_id: params[:id]).order(\"id\")\n\n @incidentattachment = Incidentattachment.new\n @incidentattachment.incident_id = params[:id]\n\n @action_required = ActionRequired.new\n @action_required.incident_id = params[:id]\n @action_requireds = ActionRequired.where(incident_id: params[:id])\n end", "title": "" }, { "docid": "db0532677beaa78be6640c97249f854f", "score": "0.4925913", "text": "def show\n @gofes = Gofe.all\n @scores = Score.all\n @club_awards = ClubAward.all\n @ab_teams = AbTeam.all\n @external_awards = ExternalAward.all\n @star_golds = StarGold.all\n @star_with_honors = StarWithHonor.all\n @gold_tests = GoldTest.all\n @goe_years = @gofes.pluck(:year).map{|x| x}.uniq.sort\n @star_gold_years = @star_golds.pluck(:year).map{|x| x}.uniq.sort\n end", "title": "" }, { "docid": "7ddcfdccbab4c3d1efb9f1fad7fcae8e", "score": "0.49178985", "text": "def index\n @facilities = Facility.all\n end", "title": "" }, { "docid": "da94377c352e9a26eee5d50ce3e69dd9", "score": "0.49099353", "text": "def new\n @fight = Fight.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @fight }\n end\n end", "title": "" }, { "docid": "e4f0b5fcb2c2b39002326bafde89d3f4", "score": "0.490903", "text": "def index\n @federations = Federation.all\n end", "title": "" }, { "docid": "c6449883602bdb776c148355f78cb5b8", "score": "0.48972628", "text": "def index\n @flowers = Flower.all\n end", "title": "" }, { "docid": "d9356ee45e7e382648d887787e91ea40", "score": "0.48901686", "text": "def show\n @goals = Goal.all\n @fitbit = FakeFitbit.where(patient_id: @patient.id)\n @asthma_app = AsthmaApp.where(patient_id: @patient.id)\n @obesity_app = ObesityApp.where(patient_id: @patient.id)\n @diabetes_app = DiabetesApp.where(patient_id: @patient.id)\n end", "title": "" }, { "docid": "4db58484e4386ddc6a5ea3704b77445b", "score": "0.4888972", "text": "def index\n @fisheries = @country.fisheries\n end", "title": "" }, { "docid": "07fe67d68c8c4d278231930b658e40e4", "score": "0.48836735", "text": "def display_last_attr(weapon)\n add_speed, add_strength, add_intelligence, add_health = weapon.get_attributes()\n puts\n puts \"Speed: #@speed+#{add_speed}\" \n puts \"Strength #@strength+#{add_strength}\"\n puts \"Intelligence #@intelligence+#{add_intelligence}\"\n puts \"health #@health+#{add_health}\"\n end", "title": "" }, { "docid": "f440d800403da2b449f3d73d2b74391f", "score": "0.48831338", "text": "def fight_methods\n self.class.instance_methods(false).\n reject{|a| a == :choose_attack || a == :fight_methods }\n end", "title": "" }, { "docid": "c37dc5cc0f08c6e64e131a04c68bd4ff", "score": "0.4874419", "text": "def index\n @freight_bills = FreightBill.all\n end", "title": "" }, { "docid": "87992c83186498b54f8150a1053a79e7", "score": "0.48709464", "text": "def index\n @ship_weapons = ShipWeapon.all\n end", "title": "" } ]
18e960eb463db932a7e572b1d4e899c9
The path used after resending confirmation instructions.
[ { "docid": "18d94b2fe120ea728cc494c4f54bd3ae", "score": "0.6264584", "text": "def after_resending_confirmation_instructions_path_for(resource_name)\n new_session_path(resource_name) if is_navigational_format?\n end", "title": "" } ]
[ { "docid": "56661b07f279a36775c40d0b91c31aac", "score": "0.65103084", "text": "def after_resending_confirmation_instructions_path_for(resource_name)\n root_path\n end", "title": "" }, { "docid": "44f5577107f85d6abdaf5394fe67b6a9", "score": "0.6509975", "text": "def after_resending_confirmation_instructions_path_for(resource_name)\n root_path(resource_name)\n end", "title": "" }, { "docid": "ba13b7ee4e675e2206c15728e9d4c01e", "score": "0.6504726", "text": "def after_resending_confirmation_instructions_path_for(resource_name)\n root_path\n end", "title": "" }, { "docid": "7cd62deffed38cb4378b7003c9ba7bcd", "score": "0.64469093", "text": "def after_resending_confirmation_instructions_path_for(resource_name)\n current_dreamer ? account_dreamer_path(current_dreamer) : new_session_path(resource_name)\n end", "title": "" }, { "docid": "cc2f2ec79b6e77d13b67acca1f98ec64", "score": "0.6444199", "text": "def redo_path\n self.path = @temp_path\n end", "title": "" }, { "docid": "c90bb0a1b0180bbf68454c0601e2e079", "score": "0.64329875", "text": "def after_resending_confirmation_instructions_path_for(resource_name)\n root_path\n end", "title": "" }, { "docid": "82625a9232010a30e3ae6fd461115725", "score": "0.63625544", "text": "def after_resending_confirmation_instructions_path_for(resource_name)\n logger.debug(\"Users::ConfirmationsController.after_resending_confirmation_instructions_path_for\")\n super(resource_name)\n end", "title": "" }, { "docid": "810dac74435a28e037d228e647a4ffc6", "score": "0.6311603", "text": "def after_confirmation_path_for(resource_name, resource)\n root_path\n end", "title": "" }, { "docid": "cd07866b4af242f863f44cc2041251c5", "score": "0.63072443", "text": "def after_confirmation_path_for(resource_name, resource)\n root_path(resource_name)\n end", "title": "" }, { "docid": "715dfbb7963829874ede13697d65d721", "score": "0.63031816", "text": "def after_confirmation_path_for(resource_name, resource)\n logger.debug(\"Users::ConfirmationsController.after_confirmation_path_for\")\n super(resource_name, resource)\n end", "title": "" }, { "docid": "ff9f3c72378cd497dec891c4a9535bb6", "score": "0.62927675", "text": "def after_confirmation_path_for(resource_name, resource) \n send(\"edit_#{resource.class.name.underscore}_path\",resource)\n end", "title": "" }, { "docid": "724a472a95662c76fc2fc3b57dcb9bc9", "score": "0.6278483", "text": "def after_resending_confirmation_instructions_path_for(resource_name)\n super(resource_name)\n end", "title": "" }, { "docid": "6effa3a75dcc46ecccf52f0f9043478b", "score": "0.6270486", "text": "def after_confirmation_path_for(resource_name, resource)\n current_dreamer ? account_dreamer_path(current_dreamer) : root_path\n end", "title": "" }, { "docid": "f6a504ee35036a2b052584dc1c4999f5", "score": "0.6253305", "text": "def path\n unless self.delete_marker?\n active_path\n else\n trash_path\n end\n end", "title": "" }, { "docid": "731e8cc4bc7c3c767f6b2f992e6d9868", "score": "0.62522304", "text": "def after_confirmation_path_for(resource_name, resource)\n '/'\n end", "title": "" }, { "docid": "ab7b23d6b62cfc386c4d5feffc4dfdfa", "score": "0.6221374", "text": "def after_resending_confirmation_instructions_path_for(resource_name)\n is_navigational_format? ? sms_confirmation_path(resource_name) : '/'\n end", "title": "" }, { "docid": "5b290d61f3293fdbf727c4765278800e", "score": "0.61732405", "text": "def path\n return @path\n end", "title": "" }, { "docid": "5b290d61f3293fdbf727c4765278800e", "score": "0.61732405", "text": "def path\n return @path\n end", "title": "" }, { "docid": "5b290d61f3293fdbf727c4765278800e", "score": "0.61732405", "text": "def path\n return @path\n end", "title": "" }, { "docid": "4894d0cc3d5b5daa99a1d499b12e7ed3", "score": "0.61599934", "text": "def path\n return @path\n end", "title": "" }, { "docid": "3fc73f24956e7b3b48b0cd17723b1806", "score": "0.61523026", "text": "def after_confirmation_path_for(resource_name, resource)\n if Rails.configuration.respond_to?(:confirmation_urls)\n Rails.configuration.confirmation_urls[resource_name][\"confirmation_succeeded\"]\n else\n #In future report this kind of case to System Admin via email\n 'http://'+request.host+':'+request.port.to_s\n end\n end", "title": "" }, { "docid": "72084562f23c4695ae988048d90a3ff5", "score": "0.6134565", "text": "def path\n location.path\n end", "title": "" }, { "docid": "7cf2dd78220cd1994f3086f7fd494055", "score": "0.60977966", "text": "def path\n @path\n end", "title": "" }, { "docid": "7cf2dd78220cd1994f3086f7fd494055", "score": "0.60977966", "text": "def path\n @path\n end", "title": "" }, { "docid": "7cf2dd78220cd1994f3086f7fd494055", "score": "0.60977966", "text": "def path\n @path\n end", "title": "" }, { "docid": "7cf2dd78220cd1994f3086f7fd494055", "score": "0.60977966", "text": "def path\n @path\n end", "title": "" }, { "docid": "de1963e6492da57db3466e9df030969a", "score": "0.60936654", "text": "def path\n Path.new(@tmpname)\n end", "title": "" }, { "docid": "26db972c9635a8ae98a2e765d7423953", "score": "0.6092185", "text": "def path\n ensure_valid\n @path\n end", "title": "" }, { "docid": "ccd3e6875099dd4ab6e45e36ab8d98f2", "score": "0.6083479", "text": "def remote_path\n File.join(path, TRIGGER).sub(/^\\//, '')\n end", "title": "" }, { "docid": "3f17fda907077ec811d498532aba9f6f", "score": "0.60817754", "text": "def after_confirmation_path_for(resource_name, resource)\n super(resource_name, resource)\n end", "title": "" }, { "docid": "debae43998cf08654dea13bf1151c387", "score": "0.6038668", "text": "def remaining_path\n @remaining_path || Bowser.window.location.path\n end", "title": "" }, { "docid": "7831ba0661be45c2543cf0e8ff15c3e9", "score": "0.60330415", "text": "def original_fullpath; end", "title": "" }, { "docid": "eedef77e0e57dbed8507118ee6298496", "score": "0.60215604", "text": "def path\n @path\n end", "title": "" }, { "docid": "eedef77e0e57dbed8507118ee6298496", "score": "0.60215604", "text": "def path\n @path\n end", "title": "" }, { "docid": "eedef77e0e57dbed8507118ee6298496", "score": "0.60215604", "text": "def path\n @path\n end", "title": "" }, { "docid": "eedef77e0e57dbed8507118ee6298496", "score": "0.60215604", "text": "def path\n @path\n end", "title": "" }, { "docid": "6115c3bf50c2de0d45db22f018e21fa5", "score": "0.6010112", "text": "def path\n # TODO: is this trip really necessary?!\n data.fetch(\"path\") { relative_path }\n end", "title": "" }, { "docid": "ff0841eb53eba2f5f96efba91da19e7e", "score": "0.59820426", "text": "def full_path\n path\n end", "title": "" }, { "docid": "a6d2e7512faa078ca2b6ad2d322aa181", "score": "0.5978774", "text": "def after_confirmation_path_for(_resource_name, _resource)\n current_user_locations_path\n end", "title": "" }, { "docid": "e295e6b79414ed916949710b233113e7", "score": "0.59464425", "text": "def path\n\t\trequest.original_fullpath\n\tend", "title": "" }, { "docid": "dcbb81430c8c5586b81fa3d5c7985aa1", "score": "0.59403473", "text": "def exitName\n @path.pop\n end", "title": "" }, { "docid": "4e5495e541ade4f5b6deb8ed603f0923", "score": "0.59252256", "text": "def path\n @location.path\n end", "title": "" }, { "docid": "b1dfac8ee8b46bb487efcc98fe0f18d1", "score": "0.59116733", "text": "def after_confirmation_path_for(resource_name, resource)\r\n users_settings_path\r\n end", "title": "" }, { "docid": "c20ad8060ed0b7548dd1c6ac52844149", "score": "0.59101903", "text": "def path\n @path\n end", "title": "" }, { "docid": "c20ad8060ed0b7548dd1c6ac52844149", "score": "0.59101903", "text": "def path\n @path\n end", "title": "" }, { "docid": "9168e70b63c718c7dabb1e15b364ee25", "score": "0.5900506", "text": "def atomic_path\n atomic_paths.path\n end", "title": "" }, { "docid": "6d9c38628fcfb25c6fa8c499c5c6dd0e", "score": "0.5887286", "text": "def tmp_path\n File.join(TMP_PATH, TRIGGER)\n end", "title": "" }, { "docid": "4f75ce2081553278ea10252b5bd103f6", "score": "0.58853215", "text": "def path\n @new_filename || @filename\n end", "title": "" }, { "docid": "96cd7cb81b460fdce36674bc81363316", "score": "0.5830025", "text": "def path\n File.join(self.drive.path, self.relative_path)\n end", "title": "" }, { "docid": "06ed36a06e6b823f178b803bf167cf1f", "score": "0.5824592", "text": "def after_confirmation_path_for(resource_name, resource)\n unless params[:user].nil?\n admin_path\n else\n new_user_session_path\n end\n #super(resource_name, resource)\n end", "title": "" }, { "docid": "4a2fd245a967d181797a9ff50c767281", "score": "0.5820211", "text": "def path\n @data[\"path\"].to_s\n end", "title": "" }, { "docid": "d7b980fa6abe06943d766f294458eb0f", "score": "0.5820101", "text": "def full_path; end", "title": "" }, { "docid": "c7b65321e51f021d663140fdf41a2a4d", "score": "0.58165956", "text": "def after_confirmation_path_for(resource_name, resource)\n \tif signed_in?\n \t signed_in_root_path(resource)\n \telse\n \t new_session_path(resource_name)\n \tend\n end", "title": "" }, { "docid": "509b09952e8afc12f834950f5c969262", "score": "0.58121675", "text": "def save_path_with_own_path\n File.join(save_path, path)\n end", "title": "" }, { "docid": "c70e496f96dc167797ab717a2a46edc2", "score": "0.58022296", "text": "def path\n end", "title": "" }, { "docid": "398fb7809b9439849140d689ea3c45b6", "score": "0.57997626", "text": "def path() end", "title": "" }, { "docid": "398fb7809b9439849140d689ea3c45b6", "score": "0.57997626", "text": "def path() end", "title": "" }, { "docid": "398fb7809b9439849140d689ea3c45b6", "score": "0.57997626", "text": "def path() end", "title": "" }, { "docid": "b72b247ffea0902bf91af8b244b4740b", "score": "0.5796241", "text": "def path\n @tmpname\n end", "title": "" }, { "docid": "f10ac599f98c7ed73dcf30145a872ecc", "score": "0.57889235", "text": "def remote_path\n File.join(path, TRIGGER, @time)\n end", "title": "" }, { "docid": "3e7288718e855ce14fd3f102a7465df8", "score": "0.57848454", "text": "def relative_path\n name\n end", "title": "" }, { "docid": "f7f8b1cb3dab6c054e7def16f785c9ae", "score": "0.5783507", "text": "def remote_path\n File.join(path, TRIGGER)\n end", "title": "" }, { "docid": "94e0cf31c5996b1082a19f746ea04f13", "score": "0.5777093", "text": "def after_confirmation_path_for(resource_name, resource)\n edit_profile_path(resource.profile)\n end", "title": "" }, { "docid": "5163609ceda95e6fec6055a6417e7170", "score": "0.5773616", "text": "def after_confirmation_path_for(resource_name, resource, params = {})\n #super(resource_name, resource)\n if signed_in?(resource_name)\n signed_in_root_path(resource)\n else\n home_path()\n end\n end", "title": "" }, { "docid": "9b9d3f63abbf2c7de732128cb318cee3", "score": "0.57712984", "text": "def local_backup_path\n local_path\n end", "title": "" }, { "docid": "2b95266b217d0f7b18d7f4a06ba80228", "score": "0.5763355", "text": "def file_path(was=false)\n if was\n self.site.directory_path.join(name_was)\n else\n self.site.directory_path.join(name)\n end\n end", "title": "" }, { "docid": "d66de8bfa1e71b4a71cb88ddd6edbe0d", "score": "0.57594836", "text": "def path\n @j_del.path\n end", "title": "" }, { "docid": "ac1c59088ff3add21a2986431aac2e46", "score": "0.57589537", "text": "def success_path\n\t\t\t\t\t\tric_payment_public.done_payment_url(@payment_subject)\n\t\t\t\t\tend", "title": "" }, { "docid": "f3d09cf5fa6c7452f41838d709320d4d", "score": "0.5758773", "text": "def cleaned_relative_path; end", "title": "" }, { "docid": "f3d09cf5fa6c7452f41838d709320d4d", "score": "0.5758773", "text": "def cleaned_relative_path; end", "title": "" }, { "docid": "f05cf6583946536a86fa5eb4f3923793", "score": "0.57503533", "text": "def path\r\n @pathname.to_s\r\n end", "title": "" }, { "docid": "f844b54bf35c4e68714d0cadc8d2d4b5", "score": "0.5749665", "text": "def path\n location.nil? ? nil : location.path\n end", "title": "" }, { "docid": "ea54b428ddc1e728dd94b3efd1314302", "score": "0.5746726", "text": "def path\n `window.location.pathname`\n end", "title": "" }, { "docid": "f433acf0e398527a793facaac0ddf6ce", "score": "0.57455516", "text": "def path\n request.path\n end", "title": "" }, { "docid": "ee8fb21eb24e2507c892ebba7cfc3a1b", "score": "0.5744221", "text": "def path\n real_path = Pathname.new(root).realpath.to_s\n full_path.sub(%r{^#{real_path}/}, '')\n end", "title": "" }, { "docid": "570abc7a829f37065b860efe5c7a2e56", "score": "0.57441425", "text": "def return_path(value = nil)\n if value.nil?\n @return_path\n else\n @return_path = value\n end\n end", "title": "" }, { "docid": "ec37c80723e566c73f5e250ff0f57818", "score": "0.57432824", "text": "def path\n return @path if instance_variable_defined? :@path\n @path = parent.path + path_components\n end", "title": "" }, { "docid": "a66846f99301d5c77cb4e560206e6ef7", "score": "0.5737336", "text": "def local_backup_path #:nodoc:\n local_path\n end", "title": "" }, { "docid": "aff10aa48ffed62fa7fab236e8113563", "score": "0.5737078", "text": "def path\n return @path.sub(/^\\//,'').sub(/^%2F/,'/')\n end", "title": "" }, { "docid": "afd2c26a2405ec50af0cc4ee0b06f2d4", "score": "0.57345736", "text": "def after_confirmation_path_for(resource_name, resource)\n dm_cms.showpage_path(:locale => DmCore::Language.locale, :slug => 'confirmation_success')\n end", "title": "" }, { "docid": "2eb878dcf877b98acffec4081c2baed8", "score": "0.57331336", "text": "def path\n\t\t@path\n\tend", "title": "" }, { "docid": "9a4a19c2369af10a3b3aea705cb2e5c9", "score": "0.5726433", "text": "def path\n tempfile.path\n end", "title": "" }, { "docid": "c6e097908089236a8fa46c929cb413a5", "score": "0.5725764", "text": "def path\n return self.saved? ? @realfile.path : nil\n end", "title": "" }, { "docid": "3ecd547430623f48487f64a630f24eee", "score": "0.5725303", "text": "def relative_path; end", "title": "" }, { "docid": "3ecd547430623f48487f64a630f24eee", "score": "0.5725303", "text": "def relative_path; end", "title": "" }, { "docid": "3ecd547430623f48487f64a630f24eee", "score": "0.5725303", "text": "def relative_path; end", "title": "" }, { "docid": "3ecd547430623f48487f64a630f24eee", "score": "0.5725303", "text": "def relative_path; end", "title": "" }, { "docid": "3ecd547430623f48487f64a630f24eee", "score": "0.5725303", "text": "def relative_path; end", "title": "" }, { "docid": "8c74c75b5c3a0e6685783e57ed5f339c", "score": "0.5723674", "text": "def path\n @pathname.to_s\n end", "title": "" }, { "docid": "c6b4ad0daf5e803b12ed57d8d0bea905", "score": "0.5722994", "text": "def after_sending_reset_password_instructions_path_for(resource_name)\n\t\t#new_session_path(resource_name) if is_navigational_format?\n\t\troot_path\n\tend", "title": "" }, { "docid": "6e89403f397e18f3c23022ba95403d94", "score": "0.572287", "text": "def path\n # FIXME: Do this without exception!\n #\"#{ @parent.path unless @parent == self }##{ ident }\"\n # rescue base path\n \"#{@parent.path rescue ''}##{ident}\"\n end", "title": "" }, { "docid": "9fc18045fda90799019e268a035796f2", "score": "0.5721755", "text": "def relativePath\n #N Without this the path elements won't be joined together with \"/\" to get the relative path as a single string\n return @pathElements.join(\"/\")\n end", "title": "" }, { "docid": "0202cd48a06c36fc65a490d2f6c354c1", "score": "0.5717391", "text": "def path\n data.fetch(\"path\") { relative_path }\n end", "title": "" }, { "docid": "a7c51c90fd5317e583ced312850d4109", "score": "0.57082796", "text": "def path\n return @path if instance_variable_defined? :@path\n @path = path_components\n end", "title": "" }, { "docid": "f7795c7c043622df52fc3fcb413daef3", "score": "0.570387", "text": "def destination_path\n @destination_path ||= Pathname.new(self.destination_root)\n end", "title": "" }, { "docid": "094225f7e3e4edafb15e872717ce8ac0", "score": "0.57001275", "text": "def current_texte_path\n config = File.open('./.config.msh','rb'){|f|Marshal.load(f)}\n config[:last_file_path]\n end", "title": "" }, { "docid": "b8abe244d6eeda5e5805e44b73e6e400", "score": "0.5692559", "text": "def after_confirmation_path_for(resource_name, resource)\n \t'/welcome/index'\n end", "title": "" } ]
ad7fe88297ee91ae1f33bb35aa32e609
% initialize : () > []
[ { "docid": "30db4e5d165a6098d1aeb8f8dd7b66e8", "score": "0.7607796", "text": "def initialize() end", "title": "" } ]
[ { "docid": "8e3629bb42b471c640e3e1bd665bf3b2", "score": "0.7818684", "text": "def initialize(*) end", "title": "" }, { "docid": "8e3629bb42b471c640e3e1bd665bf3b2", "score": "0.7818684", "text": "def initialize(*) end", "title": "" }, { "docid": "8e3629bb42b471c640e3e1bd665bf3b2", "score": "0.7818684", "text": "def initialize(*) end", "title": "" }, { "docid": "8e3629bb42b471c640e3e1bd665bf3b2", "score": "0.7818684", "text": "def initialize(*) end", "title": "" }, { "docid": "8e3629bb42b471c640e3e1bd665bf3b2", "score": "0.7818684", "text": "def initialize(*) end", "title": "" }, { "docid": "27b17d3efbfa96fcae1899acb992e406", "score": "0.76943123", "text": "def initialize; end", "title": "" }, { "docid": "27b17d3efbfa96fcae1899acb992e406", "score": "0.76943123", "text": "def initialize; end", "title": "" }, { "docid": "27b17d3efbfa96fcae1899acb992e406", "score": "0.76943123", "text": "def initialize; end", "title": "" }, { "docid": "27b17d3efbfa96fcae1899acb992e406", "score": "0.76943123", "text": "def initialize; end", "title": "" }, { "docid": "27b17d3efbfa96fcae1899acb992e406", "score": "0.76943123", "text": "def initialize; end", "title": "" }, { "docid": "27b17d3efbfa96fcae1899acb992e406", "score": "0.76943123", "text": "def initialize; end", "title": "" }, { "docid": "27b17d3efbfa96fcae1899acb992e406", "score": "0.76943123", "text": "def initialize; end", "title": "" }, { "docid": "27b17d3efbfa96fcae1899acb992e406", "score": "0.76943123", "text": "def initialize; end", "title": "" }, { "docid": "27b17d3efbfa96fcae1899acb992e406", "score": "0.76943123", "text": "def initialize; end", "title": "" }, { "docid": "27b17d3efbfa96fcae1899acb992e406", "score": "0.76943123", "text": "def initialize; end", "title": "" }, { "docid": "27b17d3efbfa96fcae1899acb992e406", "score": "0.76943123", "text": "def initialize; end", "title": "" }, { "docid": "ba150e806f4d2439269b282e73860569", "score": "0.7684559", "text": "def initialize; @ary = []; end", "title": "" }, { "docid": "7cff05b1d14c458d3002432786d3d4f4", "score": "0.75959307", "text": "def initialize(*); end", "title": "" }, { "docid": "20c1a42ff46b4acd0a7e6696392551e0", "score": "0.74437827", "text": "def initialize(*) \n end", "title": "" }, { "docid": "435735604c818451dfb91e70ad4ed4f1", "score": "0.7443723", "text": "def initialize\n empty!\n end", "title": "" }, { "docid": "435735604c818451dfb91e70ad4ed4f1", "score": "0.7443723", "text": "def initialize\n empty!\n end", "title": "" }, { "docid": "0b928db5caaf32e4251f1f2fdf4e72a9", "score": "0.7369037", "text": "def initialize\nend", "title": "" }, { "docid": "5cf2cba0ee7f9825b63b087af5363b37", "score": "0.73142445", "text": "def init; end", "title": "" }, { "docid": "5cf2cba0ee7f9825b63b087af5363b37", "score": "0.73142445", "text": "def init; end", "title": "" }, { "docid": "5cf2cba0ee7f9825b63b087af5363b37", "score": "0.73142445", "text": "def init; end", "title": "" }, { "docid": "5cf2cba0ee7f9825b63b087af5363b37", "score": "0.73142445", "text": "def init; end", "title": "" }, { "docid": "47900f884ffd31ed0953e9fcb5bea261", "score": "0.7313846", "text": "def initialize()\n\t@list_arr\t= []\nend", "title": "" }, { "docid": "5089834c8fb49e78a140c77b7194d0c9", "score": "0.7266467", "text": "def initialize\n\n\tend", "title": "" }, { "docid": "5089834c8fb49e78a140c77b7194d0c9", "score": "0.7266467", "text": "def initialize\n\n\tend", "title": "" }, { "docid": "7d2e344238e7987f7b5aa68318c9a331", "score": "0.72497886", "text": "def initialize\n\t\nend", "title": "" }, { "docid": "55d539453c287fc90b8cf716625cac85", "score": "0.7238893", "text": "def initialize\n end", "title": "" }, { "docid": "18250542a2b1999be90588db1d071d92", "score": "0.7184183", "text": "def initialize\n\t\t\n\tend", "title": "" }, { "docid": "d08f0cfe2b2b8c3c738e72226f397b1f", "score": "0.71787256", "text": "def initialize\n\n\n\n end", "title": "" }, { "docid": "1556c42eb28e75c9b56e717f1f4a0c77", "score": "0.71770763", "text": "def initialize\n # nothing here for now\n end", "title": "" }, { "docid": "1ba36f1dcca7a651ef60759bdaa51e8d", "score": "0.7171038", "text": "def initialize array_of_items\n\tend", "title": "" }, { "docid": "1cfb25d64e44716c066680addcf4d135", "score": "0.7170793", "text": "def initialize\n @array = []\n end", "title": "" }, { "docid": "769e6c5939d580f922ebe018ac257213", "score": "0.7162249", "text": "def initialize()\n\tend", "title": "" }, { "docid": "769e6c5939d580f922ebe018ac257213", "score": "0.7162249", "text": "def initialize()\n\tend", "title": "" }, { "docid": "d589f744266c11f22f2e4a80d9902c2e", "score": "0.71558964", "text": "def initialize\n\n\nend", "title": "" }, { "docid": "9a9905da7e67d59570aaf174612c2dcd", "score": "0.7152334", "text": "def initialize(*rest) end", "title": "" }, { "docid": "00f6687b2eff0f27e4147c7ef6b03d1f", "score": "0.714055", "text": "def initialize_parameters\n []\n end", "title": "" }, { "docid": "b4415eef25258d664ec71e2d1c7e1033", "score": "0.7097653", "text": "def initialize\n\nend", "title": "" }, { "docid": "3f21ca984f084ea63784f88bbfa3820a", "score": "0.70960885", "text": "def initialize(*args); end", "title": "" }, { "docid": "700c042555d8ebc7c4de252bf9ffc0af", "score": "0.708474", "text": "def constructor; end", "title": "" }, { "docid": "d5b2c651ef02f091c61a5639e05783d2", "score": "0.70693254", "text": "def initialize\n \n end", "title": "" }, { "docid": "3c29a06b1e194a29c05635d71f51c108", "score": "0.70623696", "text": "def initialize\n \n end", "title": "" }, { "docid": "3c29a06b1e194a29c05635d71f51c108", "score": "0.70623696", "text": "def initialize\n \n end", "title": "" }, { "docid": "7a5eade4fa268386033662e3824d1d7a", "score": "0.7051317", "text": "def initialize()\n end", "title": "" }, { "docid": "7a5eade4fa268386033662e3824d1d7a", "score": "0.7051317", "text": "def initialize()\n end", "title": "" }, { "docid": "7a5eade4fa268386033662e3824d1d7a", "score": "0.7051317", "text": "def initialize()\n end", "title": "" }, { "docid": "7a5eade4fa268386033662e3824d1d7a", "score": "0.7051317", "text": "def initialize()\n end", "title": "" }, { "docid": "7a5eade4fa268386033662e3824d1d7a", "score": "0.7051317", "text": "def initialize()\n end", "title": "" }, { "docid": "7a5eade4fa268386033662e3824d1d7a", "score": "0.7051317", "text": "def initialize()\n end", "title": "" }, { "docid": "7a5eade4fa268386033662e3824d1d7a", "score": "0.7051317", "text": "def initialize()\n end", "title": "" }, { "docid": "7a5eade4fa268386033662e3824d1d7a", "score": "0.7051317", "text": "def initialize()\n end", "title": "" }, { "docid": "7b2a9c01c879a0b2fdf74f0f38b03e4e", "score": "0.7043996", "text": "def initialize\n initialize!\n end", "title": "" }, { "docid": "7b2a9c01c879a0b2fdf74f0f38b03e4e", "score": "0.7043996", "text": "def initialize\n initialize!\n end", "title": "" }, { "docid": "18aa0584e23408de0e740b2f5c12dc90", "score": "0.7042863", "text": "def init; end", "title": "" }, { "docid": "5f7e684c87ccff267913a355cced6ff7", "score": "0.70407254", "text": "def initialize(*args)\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "24ac52bd5081d1b00e266c1d95312518", "score": "0.7036958", "text": "def initialize(z=\"\") end", "title": "" }, { "docid": "b8b5349ad0cdcd8a84cc5d08945435b7", "score": "0.702706", "text": "def initialize\n self.list = []\n end", "title": "" }, { "docid": "55a901162b2653dcf2b3047d1e75ab08", "score": "0.69977874", "text": "def initialize arr = []\n super arr\n end", "title": "" }, { "docid": "02fcfb474eba429c123242d716e023e7", "score": "0.6992704", "text": "def initialize\n end", "title": "" }, { "docid": "02fcfb474eba429c123242d716e023e7", "score": "0.6992704", "text": "def initialize\n end", "title": "" }, { "docid": "02fcfb474eba429c123242d716e023e7", "score": "0.6992704", "text": "def initialize\n end", "title": "" }, { "docid": "02fcfb474eba429c123242d716e023e7", "score": "0.6992704", "text": "def initialize\n end", "title": "" }, { "docid": "02fcfb474eba429c123242d716e023e7", "score": "0.6992704", "text": "def initialize\n end", "title": "" }, { "docid": "02fcfb474eba429c123242d716e023e7", "score": "0.6992704", "text": "def initialize\n end", "title": "" }, { "docid": "02fcfb474eba429c123242d716e023e7", "score": "0.6992704", "text": "def initialize\n end", "title": "" }, { "docid": "02fcfb474eba429c123242d716e023e7", "score": "0.6992704", "text": "def initialize\n end", "title": "" }, { "docid": "02fcfb474eba429c123242d716e023e7", "score": "0.6992704", "text": "def initialize\n end", "title": "" }, { "docid": "e28dbc9d22830c163044e0c376e1fc92", "score": "0.69647706", "text": "def initialize(p0=\"\") end", "title": "" }, { "docid": "dc90d29d71dcbecfbdd1751b07b0b039", "score": "0.6961106", "text": "def init\n end", "title": "" }, { "docid": "dc90d29d71dcbecfbdd1751b07b0b039", "score": "0.6961106", "text": "def init\n end", "title": "" }, { "docid": "dc90d29d71dcbecfbdd1751b07b0b039", "score": "0.6961106", "text": "def init\n end", "title": "" }, { "docid": "c41b8fb611c34b271e3c462c37962e4f", "score": "0.6943696", "text": "def initialize\n @elements = []\n end", "title": "" }, { "docid": "bc61391a3f3441c34dba967ace487c64", "score": "0.69215274", "text": "def initialize(document, list = T.unsafe(nil)); end", "title": "" }, { "docid": "bc61391a3f3441c34dba967ace487c64", "score": "0.69215274", "text": "def initialize(document, list = T.unsafe(nil)); end", "title": "" }, { "docid": "f174b1672c086fba72b0371d2ba85cf8", "score": "0.69106734", "text": "def initialize\n # complete\n end", "title": "" }, { "docid": "b6effe9676e6aee4f4166aad375c7f6f", "score": "0.69042313", "text": "def initialize(*)\n end", "title": "" }, { "docid": "b6effe9676e6aee4f4166aad375c7f6f", "score": "0.69042313", "text": "def initialize(*)\n end", "title": "" }, { "docid": "16d75915b84d17186b08d9a06d76f700", "score": "0.6903898", "text": "def initialize()\n end", "title": "" }, { "docid": "16d75915b84d17186b08d9a06d76f700", "score": "0.6903898", "text": "def initialize()\n end", "title": "" }, { "docid": "b400b560eb97c0db55cbdba5cd71fa1c", "score": "0.68544406", "text": "def initialize()\n\t\tend", "title": "" }, { "docid": "8e10117902ff3282a42ea5b72dde9df5", "score": "0.6852244", "text": "def initialize\n end", "title": "" }, { "docid": "8e10117902ff3282a42ea5b72dde9df5", "score": "0.6852244", "text": "def initialize\n end", "title": "" }, { "docid": "8e10117902ff3282a42ea5b72dde9df5", "score": "0.6852244", "text": "def initialize\n end", "title": "" }, { "docid": "8e10117902ff3282a42ea5b72dde9df5", "score": "0.6852244", "text": "def initialize\n end", "title": "" }, { "docid": "8e10117902ff3282a42ea5b72dde9df5", "score": "0.6852244", "text": "def initialize\n end", "title": "" }, { "docid": "8e10117902ff3282a42ea5b72dde9df5", "score": "0.6852244", "text": "def initialize\n end", "title": "" }, { "docid": "8e10117902ff3282a42ea5b72dde9df5", "score": "0.6852244", "text": "def initialize\n end", "title": "" }, { "docid": "8e10117902ff3282a42ea5b72dde9df5", "score": "0.6852244", "text": "def initialize\n end", "title": "" }, { "docid": "8e10117902ff3282a42ea5b72dde9df5", "score": "0.6852244", "text": "def initialize\n end", "title": "" }, { "docid": "8e10117902ff3282a42ea5b72dde9df5", "score": "0.6852244", "text": "def initialize\n end", "title": "" }, { "docid": "44704d8df08c151f9f5c8e155ad93b63", "score": "0.68458295", "text": "def initialize\n @exact = []\n @list = []\n end", "title": "" }, { "docid": "bba9fbc807f0a73e812ebf601045bf31", "score": "0.68451846", "text": "def initialize()\n\n end", "title": "" }, { "docid": "b176ede5f1b6494a7d3354c76f896267", "score": "0.68372786", "text": "def init; @entries = [] end", "title": "" }, { "docid": "a57829ce1a3f57668b9166308705ab69", "score": "0.6832139", "text": "def initialize\n @data = []\n end", "title": "" }, { "docid": "cdd58dace22c11a7043a695fbef6319a", "score": "0.6832001", "text": "def initialize\n\n end", "title": "" }, { "docid": "cdd58dace22c11a7043a695fbef6319a", "score": "0.6832001", "text": "def initialize\n\n end", "title": "" } ]
1ceede8d4ce33aba61431789e318624b
GET /appointments/1 GET /appointments/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "e79442243806cc9cfd997bd0d24c7367", "score": "0.79667956", "text": "def list_appointments\n json_response(Appointment.all)\n end", "title": "" }, { "docid": "9e3c5e9516b143477b08d415a9896db7", "score": "0.7787401", "text": "def index\n @appointments = @client.appointments\n end", "title": "" }, { "docid": "c6c6417ec37ed1d2e2db0d2ac045262e", "score": "0.77747655", "text": "def get_appoitment\n\t\tid = params[:id]\n\t\t#user_token = params[:user_token]\n\t\turl = \"https://sdpm-appointment-service.herokuapp.com/appointment/#{id}\"\n\n\t\tresponse = RestClient::Request.execute(\n \t\tmethod: :get, \n\t\t\t\turl: url,\n\t\t\t)\n\n\t\trender :json => response\n\tend", "title": "" }, { "docid": "5c141ea335b3ddb8b87fc11802c98d77", "score": "0.7754148", "text": "def index\n @appointments = current_user.appointments\n render json: @appointments\n end", "title": "" }, { "docid": "2bb949825f6ca12577ffdb424a76ba9c", "score": "0.76953256", "text": "def appointment_alert\n JSON.parse RestClient.get $api_service+'/appointments/appointment_for_alert'\n end", "title": "" }, { "docid": "59f6c9e6daa646d25380859c029b06cb", "score": "0.7659298", "text": "def show\n @user_appointments = Appointment.where('user_id = 1', params[:id])\n render json: @user_appointments\n end", "title": "" }, { "docid": "5d8eb551ff5a23c56d2fb75ab636e94a", "score": "0.7559606", "text": "def show\n @appointment = Appointment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @appointment }\n end\n end", "title": "" }, { "docid": "5d8eb551ff5a23c56d2fb75ab636e94a", "score": "0.75592273", "text": "def show\n @appointment = Appointment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @appointment }\n end\n end", "title": "" }, { "docid": "5d8eb551ff5a23c56d2fb75ab636e94a", "score": "0.75592273", "text": "def show\n @appointment = Appointment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @appointment }\n end\n end", "title": "" }, { "docid": "5d8eb551ff5a23c56d2fb75ab636e94a", "score": "0.75592273", "text": "def show\n @appointment = Appointment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @appointment }\n end\n end", "title": "" }, { "docid": "5d8eb551ff5a23c56d2fb75ab636e94a", "score": "0.75592273", "text": "def show\n @appointment = Appointment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @appointment }\n end\n end", "title": "" }, { "docid": "5d8eb551ff5a23c56d2fb75ab636e94a", "score": "0.75592273", "text": "def show\n @appointment = Appointment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @appointment }\n end\n end", "title": "" }, { "docid": "5d8eb551ff5a23c56d2fb75ab636e94a", "score": "0.75592273", "text": "def show\n @appointment = Appointment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @appointment }\n end\n end", "title": "" }, { "docid": "5d8eb551ff5a23c56d2fb75ab636e94a", "score": "0.75592273", "text": "def show\n @appointment = Appointment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @appointment }\n end\n end", "title": "" }, { "docid": "7997a930dc59b03ed59d7ed2964bd1de", "score": "0.75409526", "text": "def show\n @appointment = Appointment.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @appointment }\n end\n end", "title": "" }, { "docid": "e36fafef4ea1a5ce7f8dc6d7317b52d5", "score": "0.75028604", "text": "def show\n @appointment = Appointment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @appointment }\n end\n end", "title": "" }, { "docid": "e36fafef4ea1a5ce7f8dc6d7317b52d5", "score": "0.75028604", "text": "def show\n @appointment = Appointment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @appointment }\n end\n end", "title": "" }, { "docid": "0625a6921118e0d3a1a295dde74f6ec9", "score": "0.74968445", "text": "def show\n render json: @appointment\n end", "title": "" }, { "docid": "0c99b7804791a9375423eb398323fd23", "score": "0.7307049", "text": "def show\n @appointments = @patient.appointments.order('appointment_date DESC').page(params[:page])\n end", "title": "" }, { "docid": "a8d659ffafab19e4c7ffa12df8695b0b", "score": "0.7301133", "text": "def index\n @appointments = Appointment.all\n end", "title": "" }, { "docid": "a8d659ffafab19e4c7ffa12df8695b0b", "score": "0.7301133", "text": "def index\n @appointments = Appointment.all\n end", "title": "" }, { "docid": "a8d659ffafab19e4c7ffa12df8695b0b", "score": "0.7301133", "text": "def index\n @appointments = Appointment.all\n end", "title": "" }, { "docid": "a8d659ffafab19e4c7ffa12df8695b0b", "score": "0.7301133", "text": "def index\n @appointments = Appointment.all\n end", "title": "" }, { "docid": "a8d659ffafab19e4c7ffa12df8695b0b", "score": "0.7301133", "text": "def index\n @appointments = Appointment.all\n end", "title": "" }, { "docid": "a8d659ffafab19e4c7ffa12df8695b0b", "score": "0.7301133", "text": "def index\n @appointments = Appointment.all\n end", "title": "" }, { "docid": "a8d659ffafab19e4c7ffa12df8695b0b", "score": "0.7301133", "text": "def index\n @appointments = Appointment.all\n end", "title": "" }, { "docid": "a8d659ffafab19e4c7ffa12df8695b0b", "score": "0.7301133", "text": "def index\n @appointments = Appointment.all\n end", "title": "" }, { "docid": "a8d659ffafab19e4c7ffa12df8695b0b", "score": "0.7301133", "text": "def index\n @appointments = Appointment.all\n end", "title": "" }, { "docid": "a8d659ffafab19e4c7ffa12df8695b0b", "score": "0.7301133", "text": "def index\n @appointments = Appointment.all\n end", "title": "" }, { "docid": "a8d659ffafab19e4c7ffa12df8695b0b", "score": "0.7301133", "text": "def index\n @appointments = Appointment.all\n end", "title": "" }, { "docid": "a8d659ffafab19e4c7ffa12df8695b0b", "score": "0.7301133", "text": "def index\n @appointments = Appointment.all\n end", "title": "" }, { "docid": "a8d659ffafab19e4c7ffa12df8695b0b", "score": "0.7301133", "text": "def index\n @appointments = Appointment.all\n end", "title": "" }, { "docid": "a8d659ffafab19e4c7ffa12df8695b0b", "score": "0.7301133", "text": "def index\n @appointments = Appointment.all\n end", "title": "" }, { "docid": "a8d659ffafab19e4c7ffa12df8695b0b", "score": "0.7301133", "text": "def index\n @appointments = Appointment.all\n end", "title": "" }, { "docid": "1f3b349cfa12f257593921a4cdf5ae09", "score": "0.72887397", "text": "def show\n @appointments = @client.appointments\n\n respond_to do |format|\n format.html\n format.json\n format.ics { render :text => generate_ical(@appointments) }\n end\n end", "title": "" }, { "docid": "ea3902ba46c69c579e48752a1ff6b522", "score": "0.7276165", "text": "def show\n json_response(@appointment)\n end", "title": "" }, { "docid": "f1f05177d44e429648974ab9df310a9b", "score": "0.7274438", "text": "def get_all_appoitments\n\n\t\tid = params[:id]\n\t\t#id = 18\n\t\tresponse = RestClient.get 'https://sdpm-appointment-service.herokuapp.com/appointment', {params: {doctor_id: id}}\n \trender json: response\n\tend", "title": "" }, { "docid": "5d5695ef5d84773e63e1494f8be4cd2d", "score": "0.7240201", "text": "def appointments\n @hospital = Hospital.find(params[:hospital])\n end", "title": "" }, { "docid": "cabe1356ff4c1e202ad2f206677c4928", "score": "0.7236841", "text": "def index\n @appointments = Appointment.account(current_user.account).order(\"appointment_date, appointment_time DESC\").paginate :page => params[:page], :per_page => 16\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @appointments }\n end\n end", "title": "" }, { "docid": "11231a856733007e283a56d895c054ae", "score": "0.7232336", "text": "def show\n @appointment_status = AppointmentStatus.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @appointment_status }\n end\n end", "title": "" }, { "docid": "3797dd9a90347363bed1bed0e92c0f0f", "score": "0.7211602", "text": "def show\n @appointments = current_user.fetch_appointments\n end", "title": "" }, { "docid": "3797dd9a90347363bed1bed0e92c0f0f", "score": "0.7211602", "text": "def show\n @appointments = current_user.fetch_appointments\n end", "title": "" }, { "docid": "b074c907816310760be0adc2f160f72d", "score": "0.7202784", "text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @appointment }\n end\n end", "title": "" }, { "docid": "e8b4d23e9b39d47e36fb94c33fd3c715", "score": "0.71898925", "text": "def show\n @appointment = Appointment.where(:id => params[:id], :company_id => current_user.company.id).first\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @appointment }\n end\n end", "title": "" }, { "docid": "1dacc549ce334adbc1ff39ab13be0c0a", "score": "0.7188331", "text": "def index\n @appointments = Appointment.all\n end", "title": "" }, { "docid": "94f148f5f989ef836324cdadcab0d956", "score": "0.716621", "text": "def show\n @patient = Patient.find(params[:id])\n @appointments = @patient.appointments.paginate(:page => params[:page], :per_page => 5).order('ap_date DESC')\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @patient }\n end\n end", "title": "" }, { "docid": "3118b7001ff905320a8f2ec82bb09d43", "score": "0.71529436", "text": "def index\n if (params[:dress_id])\n @dress = Dress.find(params[:dress_id])\n @appointments = @dress.appointments\n elsif (params[:user_id])\n @user = User.find(params[:user_id])\n @appointments = @user.appointments\n end\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @appointments }\n end\n end", "title": "" }, { "docid": "c23a8d5ef6c461f00c6be9288f33844f", "score": "0.71239644", "text": "def index\n @appointments = current_user.appointments\n end", "title": "" }, { "docid": "d9fe7296a896cb392f8afe1dd9dd24e8", "score": "0.7112295", "text": "def show\n @appointments = Appointment.where('invoice_id = ?', @invoice.id)\n end", "title": "" }, { "docid": "b928b30c6bc65aa699541dd8721ca02d", "score": "0.71090776", "text": "def index\n @appointments = @user_holder.appointments\n end", "title": "" }, { "docid": "8cd798d5fd68e3533a2f0ee5f8ccfa87", "score": "0.7073237", "text": "def appointments\n @appointments\n end", "title": "" }, { "docid": "c4cad65ee03aff1f456432bc39f0542c", "score": "0.70717055", "text": "def index\n @appointment = Appointment.new\n @appointments = current_user.appointments\n\n @appointments.each do |appointment|\n appointments << {:id => appointment.id, :title => appointment.name , :description => appointment.description || \"Some cool description here...\", :start => appointment.start_at, :end => appointment.end_at, :class => \"\"}\n end\n\n respond_to do |format|\n format.html\n format.json {render :json => appointments.to_json}\n end\n\n end", "title": "" }, { "docid": "907432fba76c3e74a86740c8b5736f51", "score": "0.7065258", "text": "def index\n @assistent_appointments = AssistentAppointment.all\n end", "title": "" }, { "docid": "c214986fcc943822e29f724eb5f28188", "score": "0.70546454", "text": "def appointments \n @appointments\n end", "title": "" }, { "docid": "f615015e98949a4ebd8d4e60e3e3713e", "score": "0.7050081", "text": "def index\n appointments = Appointment.includes(:patient, :physician).all\n render json: { status: 200,\n data: ActiveModel::Serializer::ArraySerializer.new(appointments.recent_first, :each_serializer =>\n AppointmentSerializer).as_json }\n end", "title": "" }, { "docid": "4c52d9f61ec9515a7f99e45ab7a73520", "score": "0.703444", "text": "def see_appointments(address)\n\t\tresponse = HTTParty.get(address)\n\t\tresponse.body\n\tend", "title": "" }, { "docid": "97dc5e9b0532151936237164831fe272", "score": "0.70104325", "text": "def get_appointments\n @get_appointments ||= appointment_service.get_appointments(three_months_ago, one_year_from_now)\n end", "title": "" }, { "docid": "621c8981a1480b143313aded49671c19", "score": "0.700506", "text": "def show\n\t\t#@patient_appointments = Appointment.find(params[:patient_id])\n\t\t@patient.appointments\n end", "title": "" }, { "docid": "a29f0174dae68f59dff424aced8d8066", "score": "0.70048136", "text": "def show\n \n residence_id = params[:residence_id]\n @residence = Residence.find(residence_id)\n doctor_id = @residence.doctor_id\n office_id = @residence.office_id\n \n @appointment = @residence.appointments.find(params[:id]) \n \n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @appointment }\n end\n end", "title": "" }, { "docid": "b696e494f9b7e48a74cfeb700c34022e", "score": "0.69967234", "text": "def index\n @appointments = @patient.appointments\n #@patient = Patient.appointments.find(params[:patient_id])\n end", "title": "" }, { "docid": "ca3907eda35519fefd74d25e09ecf0d8", "score": "0.6988696", "text": "def index\n appointments = []\n (0..7*1-1).each do |day|\n date = Date.today + day.days\n appointments |= appointments_for_date(date)\n end\n #appointments = appointments_for_date(Date.today)\n \n @available_appointments = appointments\n #render :text => appointments.to_json\n #return\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @available_appointments }\n end\n #expires_in 30.minutes, public: true\n end", "title": "" }, { "docid": "47ff355aa9f0641f218c2272e6e1cb80", "score": "0.69793695", "text": "def index\n @appointment = Appointment.all\n end", "title": "" }, { "docid": "96352cacbadf37d32068a4379ff75141", "score": "0.69687504", "text": "def index\n @appointments = Appointment.order('created_at DESC').paginate(\n page: params[:page], per_page: 10\n )\n end", "title": "" }, { "docid": "99a3a305fc7b523d68ce59296b70bef6", "score": "0.6922435", "text": "def index\n add_breadcrumb \"all\", nil, \"glyphicon-list\"\n\n @appointments = current_user.account.appointments || []\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @appointments }\n end\n end", "title": "" }, { "docid": "f1c3157bf7bbca323d46c84903737e2d", "score": "0.69052196", "text": "def index\n @appointments = @patient.appointments.active\n end", "title": "" }, { "docid": "d378c0b9b72a19dea90b51e53810dcaf", "score": "0.69032186", "text": "def show\n @appointment = Appointment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @appointment }\n format.xml #show.xml.builder\n end\n end", "title": "" }, { "docid": "1986543a753e986f457e5e043a220737", "score": "0.68935883", "text": "def index\n @appointments = Appointment.where(:user => current_user)\n end", "title": "" }, { "docid": "daba9f7462615338715c7691d333a15d", "score": "0.68753415", "text": "def appointments\n @guest = Guest.find(params[:id])\n @appointments = Appointment.paginate(:all, :conditions => [\"guest_id = ?\", params[:id]], :page => params[:page], :per_page => 10)\n render :action => \"show\"\n end", "title": "" }, { "docid": "ad91a920e72bedaa67deaaecbae989a3", "score": "0.68650657", "text": "def index\n @appointments = @pet.blank? ? Appointment.all : @pet.appointments\n @appointments = @appointments.where(\n doctor_id: current_user.id) if current_user.doctor?\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @appointments }\n end\n end", "title": "" }, { "docid": "3c029fc4f5db16fc5502186cc2e38b81", "score": "0.6847584", "text": "def tire_store_appointments\n if validate_token_for_tire_store(params[:tire_store_id])\n @query_date = Date.parse(params[:reference_date])\n @appointments = Appointment.store_appointments(params[:tire_store_id], @query_date)\n\n respond_to do |format|\n format.json { render json: @appointments.to_json(:methods => [:tire_description, :order_price, :formatted_price, :order_id, :formatted_price, :confirmed_time, :primary_request_time, :secondary_request_time, :vehicle_name, :services_list]) }\n end\n else\n render :file => \"public/422.html\", :status => :unauthorized\n end\n rescue\n render :file => \"public/422.html\", :status => :internal_server_error\n end", "title": "" }, { "docid": "240431073f15a0416a90873d63eb16f4", "score": "0.68366927", "text": "def show\n @bookappointment = Bookappointment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bookappointment }\n end\n end", "title": "" }, { "docid": "484208d03a568ef257b2878bb5874bf2", "score": "0.68213683", "text": "def index\n @clinic = Clinic.includes(:appointments).find(params[:clinic_id])\n @appointments = @clinic.appointments\n if params[:date]\n begin\n date = Date.parse(params[:date])\n @appointments = @appointments.where(\"start_time BETWEEN ? AND ?\", date.beginning_of_day, date.end_of_day)\n rescue\n return render json: {\n success: false,\n message: 'Invalid date',\n data: {}\n }\n end\n end\n if params[:doctor_id].present?\n @appointments = @appointments.where(doctor_id: params[:doctor_id])\n end\n format = :as_json\n if params[:format]\n format = params[:format].to_sym\n end\n render json: {\n success: true,\n info: '',\n data: {appointments: @appointments.map {|a| a.send(format)}}\n }\n end", "title": "" }, { "docid": "20704bf9a71dbe191ed523131aa39404", "score": "0.6811626", "text": "def index\n # @events = Appointment.joins(service: :item).select('appointments.id, appointments.client_name as title, items.name as desc, start_time as start, end_time as end').load\n if(params[:year] && params[:month] && params[:day])\n date = Date.new(params[:year].to_i, params[:month].to_i, params[:day].to_i)\n else\n date = Time.now\n end\n\n # @events = Appointment.joins(service: :item).select(\n # 'appointments.id',\n # # \"concat_ws(' - ', appointments.client_name, items.name) AS title\",\n # \"appointments.client_name AS title\",\n # 'items.name as desc',\n # 'start_time as start',\n # 'end_time as end',\n # 'appointments.specialist_id',\n # 'appointments.service_id',\n # 'appointments.canceled'\n # ).where('start_time > ? AND end_time < ?', date.beginning_of_week, date.end_of_week)\n\n @events = Appointment.joins(service: :item).where('start_time > ? AND end_time < ?', date.beginning_of_week, date.end_of_week)\n\n if !current_user.admin?\n @events = @events.where(specialist_id: current_user.specialist_id)\n end\n\n render json: AppointmentsSerializer.new(@events).serializable_hash[:data]\n end", "title": "" }, { "docid": "21c25eb7303338631b9a0de3a7ea84e4", "score": "0.6811439", "text": "def index\n @appointments = current_user.appointment_feed\n end", "title": "" }, { "docid": "8b351290fc4b9ab179e1057dc045afb9", "score": "0.67923343", "text": "def new\n @appointment = Appointment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @appointment }\n end\n end", "title": "" }, { "docid": "8b351290fc4b9ab179e1057dc045afb9", "score": "0.67923343", "text": "def new\n @appointment = Appointment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @appointment }\n end\n end", "title": "" }, { "docid": "8b351290fc4b9ab179e1057dc045afb9", "score": "0.67923343", "text": "def new\n @appointment = Appointment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @appointment }\n end\n end", "title": "" }, { "docid": "8b351290fc4b9ab179e1057dc045afb9", "score": "0.67923343", "text": "def new\n @appointment = Appointment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @appointment }\n end\n end", "title": "" }, { "docid": "8b351290fc4b9ab179e1057dc045afb9", "score": "0.67923343", "text": "def new\n @appointment = Appointment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @appointment }\n end\n end", "title": "" }, { "docid": "8b351290fc4b9ab179e1057dc045afb9", "score": "0.67923343", "text": "def new\n @appointment = Appointment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @appointment }\n end\n end", "title": "" }, { "docid": "8b351290fc4b9ab179e1057dc045afb9", "score": "0.67923343", "text": "def new\n @appointment = Appointment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @appointment }\n end\n end", "title": "" }, { "docid": "8b351290fc4b9ab179e1057dc045afb9", "score": "0.67923343", "text": "def new\n @appointment = Appointment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @appointment }\n end\n end", "title": "" }, { "docid": "0745d35a1c02326fdccaa1b9dc025609", "score": "0.67696315", "text": "def show\n add_breadcrumb \"all\", nil, \"glyphicon-screenshot\"\n\n @appointment = Appointment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @appointment }\n end\n end", "title": "" }, { "docid": "f263d555f498cc5f0edfb3c116e5bc6c", "score": "0.6768653", "text": "def index\n @appointments = []\n Appointment.all.each do |appointment|\n # binding.pry\n appointment_hash = {}\n appointment_hash[\"id\"] = appointment.id\n appointment_hash[\"patient\"] = Patient.find_by_id(appointment.patient_id).try(:name) \n # binding.pry\n appointment_hash[\"doctor\"] = Doctor.find_by_id(appointment.doctor_id).try(:name)\n appointment_hash[\"diseases\"] = appointment.diseases\n @appointments << appointment_hash\n end\n # binding.pry\n render json: Response.new.success('All Appointments', @appointments, @current_user.acess_token) \n end", "title": "" }, { "docid": "ba265a684422d34f8007e546e8f21867", "score": "0.6756494", "text": "def new\n @appointment = Appointment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @appointment }\n end\n end", "title": "" }, { "docid": "ba265a684422d34f8007e546e8f21867", "score": "0.6756494", "text": "def new\n @appointment = Appointment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @appointment }\n end\n end", "title": "" }, { "docid": "bece75f901f68d4f61693cf0f9a3dc8d", "score": "0.6755303", "text": "def index\n @customer = Customer.find(params[:customer_id])\n @appointments = @customer.appointments\n end", "title": "" }, { "docid": "ae8bd51d9e023c46e716d802a4a115dd", "score": "0.6752987", "text": "def index\n @appointments = current_user.appointments.all\n # @appointments = Appointment.all\n end", "title": "" }, { "docid": "069ff3a1d45820930661efc8370ea3a7", "score": "0.6748295", "text": "def index\n @appointments = Appointment.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @appointments }\n end\n end", "title": "" }, { "docid": "df206c35f938e3e834e73d2da8143187", "score": "0.6746056", "text": "def new\n add_breadcrumb \"add\", nil, \"glyphicon-plus-sign\"\n\n @appointment = Appointment.new\n @current_appointments = get_current_appointments(current_user.account.appointments || [])\n @past_appointments = current_user.account.appointments - @current_appointments\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @appointment }\n end\n end", "title": "" }, { "docid": "eb862f5b3bd1bfedbb29154eb9fdcfa9", "score": "0.6737584", "text": "def issue_alert\n JSON.parse RestClient.get $api_service+'/appointments/issue_for_alert'\n end", "title": "" }, { "docid": "29a82c61e6510cbaebd8669ff9b65ac9", "score": "0.6730093", "text": "def index\n @nextappointments = Nextappointment.all\n end", "title": "" }, { "docid": "67023ce123b8e4718e3a15c606a951a0", "score": "0.67198503", "text": "def index\n # @appointments = Appointment.all\n # @user = current_user\n # render json: User.first.appointments.order(created_at: :desc), include: :doctor\n render json: current_user.appointments.order(created_at: :desc), include: :doctor\n end", "title": "" }, { "docid": "fc2d1009cd92ee29413e0c6dad683cfa", "score": "0.67187506", "text": "def show\n @appointment_field = AppointmentField.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @appointment_field }\n end\n end", "title": "" }, { "docid": "2dccaf55c9a664858165f8335b7ff00e", "score": "0.670673", "text": "def appointments\n @profile = Profile.find(params[:id])\n @appointments = Appointment.find_all_by_tutor_id(current_user.id)\n \n end", "title": "" }, { "docid": "5570346d8e66d14f5f267bab06edeb7c", "score": "0.6704811", "text": "def appointments=(value)\n @appointments = value\n end", "title": "" }, { "docid": "cc16bc0d19863f0889933f539774ab51", "score": "0.6661685", "text": "def new\n initialize_appointment\n @available_time_slots = get_available_time_slots\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @appointment }\n end\n end", "title": "" }, { "docid": "b0b11fc908576895d140f04b1f0166e4", "score": "0.66599506", "text": "def index\r\n @grooming_appointments = GroomingAppointment.all\r\n end", "title": "" }, { "docid": "1b9e207d88e7132a96e6a69a249a3985", "score": "0.6651112", "text": "def show\n @appointment = Appointment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @appointment }\n end\n end", "title": "" }, { "docid": "bb27f8d3b0f3ff033f27f09ca314234b", "score": "0.6643227", "text": "def index\n @approved_appointments = ApprovedAppointment.all\n end", "title": "" }, { "docid": "680bf45b62b285b7ed5cccbc6abd77c8", "score": "0.6635413", "text": "def index\n @appointments = Appointment.where(pet_id: params[:pet_id])\n # @appointments = @pet.appointment\n end", "title": "" } ]
5f05dc1ba1194b058b2fa27bc051edcf
POST /playerprofiles POST /playerprofiles.json
[ { "docid": "abb7babe23f04cc8df0a2ecaadb7d9a9", "score": "0.61467826", "text": "def create\n \n @playerprofile = current_user.playerprofile.build(params[:playerprofile])\n #@playerprofile = Playerprofile.where( :user_id => current_user.id).first\n @playerprofile.name=current_user.username\n @playerprofile.lastscoreupdatedate=current.user.created_at.to_date\n @playerprofile.curscore=@playerprofile.initscore\n @playerprofile.id=@playerprofile.user_id\n\n respond_to do |format|\n if @playerprofile.save\n format.html { redirect_to @playerprofile, notice: 'Playerprofile was successfully created.' }\n format.json { render json: @playerprofile, status: :created, location: @playerprofile }\n else\n format.html { render action: \"new\" }\n format.json { render json: @playerprofile.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
[ { "docid": "0359467b214c4cb3d6adfc08f6ff2471", "score": "0.72870684", "text": "def create\n @user = User.find(params[:user_id])\n @player_profile = PlayerProfile.new(player_profile_params)\n respond_to do |format|\n if @player_profile.save\n @user.update(player_profile: @player_profile)\n format.html { redirect_to user_player_profiles_path(@user, @player_profile), notice: 'Player profile was successfully created.' }\n format.json { render :show, status: :created, location: @player_profile }\n else\n byebug\n format.html { render :new }\n format.json { render json: @player_profile.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4755f6b9532c36bba5e9b7ff2eb510fe", "score": "0.6543624", "text": "def playerprofile_params\n params.require(:playerprofile).permit(:user_id, :name, :initscore, :curscore, :totalwongames, :totallosegames, :lastgamedate, :lastscoreupdatedate, :gamehistory, \n :profileurl, :imageurl, :bio, :paddleholdtype, :paddlemodel, :forwardrubber, :backrubber )\n end", "title": "" }, { "docid": "e1c6dc0571ab6dc573c112dd6f8180f9", "score": "0.6454291", "text": "def create\n @profile = Profile.new(profile_params)\n\n if @profile.save\n render json: @profile, status: :created\n else\n render json: @profile.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "480a46f272acf0911d6b511266263c79", "score": "0.64389205", "text": "def player_profile_params\n profile_params = params.require(:player_profile).permit(:user_id, :bio, :experience_level, :max_distance, :online_play, :homebrew, :original_ruleset, :advanced_ruleset, :pathfinder, :third, :three_point_five, :fourth, :fifth, :original_campaign, :module)\n profile_params[:user_id] = params[:user_id]\n profile_params[:experience_level] ||= params[:experience_level]\n profile_params\n end", "title": "" }, { "docid": "6c480c52901bebd71c41ef255b1dc418", "score": "0.638416", "text": "def create\n @profile = Profile.new(req_params)\n if @profile.save\n redirect_to new_partnership_path(p_id: @profile.id)\n else\n flash[:profile_attempt] = req_params\n respond_with_submission_error(@profile.errors.messages, new_dummy_profile_path)\n end\n end", "title": "" }, { "docid": "b9844e899055456315fae7a29b82c988", "score": "0.638167", "text": "def create\n @profile = current_user.profiles.build(profile_params)\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render action: 'show', status: :created, location: @profile }\n else\n format.html { render action: 'new' }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5bf39c88267ca137caec40933b03b63d", "score": "0.6341232", "text": "def create\n @profile = Profile.create({\n name: params['profile']['name'],\n speciality: params['profile']['speciality'],\n city: params['profile']['city'],\n user_id: current_user['id']\n })\n @profile.save\n respond_with(@profile)\n end", "title": "" }, { "docid": "036df0a14be8d7719b908289818ac9f4", "score": "0.6269375", "text": "def create\n @profile = Profile.new(params[:profile])\n @profile.profile_id = UUIDTools::UUID.timestamp_create().to_s\n @profile.user_id = current_user.id\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to users_profile_index_path, notice: t(:profile_successfully_created) }\n format.json { render json: @profile, status: :created, location: @profile }\n else\n format.html { render action: \"new\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9e9c934ef1bf0d810a6e44b3eae042a9", "score": "0.6249786", "text": "def create\n logger.info(\"CREATE PROFILE #{params[:profile].inspect}\")\n @profile = Profile.new(params[:profile])\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render json: @profile, status: :created, location: @profile }\n else\n format.html { render action: \"new\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6a5dc6edfec1a04c32fc5d713b59e6d1", "score": "0.6240869", "text": "def create\n byebug\n @skill_user_profile = SkillUserProfile.new(skill_user_profile_params)\n\n if @skill_user_profile.save\n render json: @skill_user_profile, status: :created, location: @skill_user_profile\n else\n render json: @skill_user_profile.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "037566099fbdbea26a09ba2c6de1c5cc", "score": "0.6183058", "text": "def create\n @profile = Profile.new(profile_params)\n\n @profile.user = current_user\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to root_path, notice: t('controller.profiles.create.success') }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f7a9a4532cd1d5ad837c006c651f79a6", "score": "0.61816967", "text": "def create\n @profile = Profile.new(params[:profile])\n \n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, :notice => 'Profile was successfully created.' }\n format.json { render :json => @profile, :status => :created, :location => @profile }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @profile.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c2ffaf64c7cb4c158dbe566e2cd07f85", "score": "0.61766386", "text": "def add_player_to_roster\n response = Hash.new\n profileId = params[:profile_id]\n teamId = params[:team_id]\n profile = Profile.find_by_id(profileId)\n roster = Roster.new(\n :team_id => teamId,\n :profile_id => profileId\n )\n if roster.valid?\n roster.save\n response[:success] = true\n response[:profile_html] = render_to_string \"teams/_roster_profile.haml\", :layout => false, :locals => { :roster => roster}\n else\n response[:errors] = roster.errors.full_messages\n end\n respond_to do |format|\n format.json { render :json=> response}\n end\n end", "title": "" }, { "docid": "d48b9509048204ca4baf847dadbf7c3f", "score": "0.6163841", "text": "def create\n @profiles = current_user.profiles.new(profile_params)\n\n if @profiles.save\n redirect_to profiles_path, notice: 'Profile was successfully created.'\n else\n render :new\n end\n end", "title": "" }, { "docid": "f2b2f48445bbd42826210fcc4b626ee5", "score": "0.61295784", "text": "def create\n @profile = Profile.new(profile_params)\n respond_to do |format|\n if @profile.save\n format.html do\n redirect_to @profile, notice:\n \"Profile was successfully created.\"\n end\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json do\n render json: @profile.errors,\n status: :unprocessable_entity\n end\n end\n end\n end", "title": "" }, { "docid": "d4fd6794050befc2a078643f8288a575", "score": "0.61271685", "text": "def create\n \n @user.profile = Profile.new(params[:profile])\n if params[:goal_worth]\n @goal = @user.goals.create do |g|\n g.goal_type = \"recurring\"\n g.started_on = Date.today\n g.name = \"What my time is worth\"\n g.goal_amount_score = params[:goal_worth].to_i\n end\n else\n @goal = nil\n end\n \n respond_to do |format|\n \n if @user.profile && @goal\n \n format.html { redirect_to user_profiles_path, notice: 'Profile was successfully created.' }\n format.json { render json: @profile, status: :created, location: @profile }\n else\n format.html { render action: \"new\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a9a81d6a497784780019fc1065030f28", "score": "0.61007", "text": "def create\n # Buidles a profile in association witht eh user\n @user = User.find(current_user.id)\n @profile = @user.build_profile(params[:user])\n @profile.update_attributes(params[:profile])\n\n respond_to do |format|\n if @profile.save\n format.json { render json: @profile, status: :created, location: @profile }\n else\n format.html { render action: \"new\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "19b78d374f774cbf46b7b1c943f350bb", "score": "0.60941905", "text": "def create\n @profile = Profile.new(profile_params)\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to root_path, notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2768e990022b5a9a3abc7ec03e8dcad8", "score": "0.6088646", "text": "def create\n @profile = Profile.new(profile_params)\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2768e990022b5a9a3abc7ec03e8dcad8", "score": "0.6088646", "text": "def create\n @profile = Profile.new(profile_params)\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2768e990022b5a9a3abc7ec03e8dcad8", "score": "0.6088646", "text": "def create\n @profile = Profile.new(profile_params)\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2768e990022b5a9a3abc7ec03e8dcad8", "score": "0.6088646", "text": "def create\n @profile = Profile.new(profile_params)\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2768e990022b5a9a3abc7ec03e8dcad8", "score": "0.6088646", "text": "def create\n @profile = Profile.new(profile_params)\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2768e990022b5a9a3abc7ec03e8dcad8", "score": "0.6088646", "text": "def create\n @profile = Profile.new(profile_params)\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2768e990022b5a9a3abc7ec03e8dcad8", "score": "0.6088646", "text": "def create\n @profile = Profile.new(profile_params)\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2768e990022b5a9a3abc7ec03e8dcad8", "score": "0.6088646", "text": "def create\n @profile = Profile.new(profile_params)\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6b0d1b8905d3ca8ec0c7496f70c32bce", "score": "0.6070184", "text": "def create\n json = ActiveSupport::JSON.decode(params[:player])\n @player = Player.new\n @player.gender = json[\"gender\"]\n @player.username = json[\"username\"]\n @player.uuid = json[\"uuid\"]\n @player.last_location = json[\"location\"]\n @player.player_monsters = [ PlayerMonster.new({ :nickname => json[\"starting_monster\"][\"nickname\"],\n :monster_id => json[\"starting_monster\"][\"id\"],\n :caught_location => json[\"location\"]\n }) ]\n if @player.save\n render :json => { :success => true, :player => @player } , :status => 200\n else\n render :json => { :success => false, :message => @player.errors } , :status => 400\n end\n end", "title": "" }, { "docid": "e4506f549ee90b74c1d303eb839bb26f", "score": "0.606841", "text": "def create\n @profile = Profile.new(profile_params)\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to '/', notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c56f3234d096aa368198b284aa12e102", "score": "0.6055225", "text": "def create\n @profile = Profile.new(profile_params)\n @profile.user = current_user\n @profile.save\n \n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "df5a515a009f984f7042e6755327f4b8", "score": "0.60464334", "text": "def create\n @profile = Profile.new(params[:profile])\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render json: @profile, status: :created, location: @profile }\n else\n format.html { render action: \"new\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "df5a515a009f984f7042e6755327f4b8", "score": "0.60464334", "text": "def create\n @profile = Profile.new(params[:profile])\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render json: @profile, status: :created, location: @profile }\n else\n format.html { render action: \"new\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "df5a515a009f984f7042e6755327f4b8", "score": "0.60464334", "text": "def create\n @profile = Profile.new(params[:profile])\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render json: @profile, status: :created, location: @profile }\n else\n format.html { render action: \"new\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "df5a515a009f984f7042e6755327f4b8", "score": "0.60464334", "text": "def create\n @profile = Profile.new(params[:profile])\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render json: @profile, status: :created, location: @profile }\n else\n format.html { render action: \"new\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "df5a515a009f984f7042e6755327f4b8", "score": "0.60464334", "text": "def create\n @profile = Profile.new(params[:profile])\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render json: @profile, status: :created, location: @profile }\n else\n format.html { render action: \"new\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "df5a515a009f984f7042e6755327f4b8", "score": "0.60464334", "text": "def create\n @profile = Profile.new(params[:profile])\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render json: @profile, status: :created, location: @profile }\n else\n format.html { render action: \"new\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "df5a515a009f984f7042e6755327f4b8", "score": "0.60464334", "text": "def create\n @profile = Profile.new(params[:profile])\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render json: @profile, status: :created, location: @profile }\n else\n format.html { render action: \"new\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ba4e084d8dd0df73044f512f3b94b890", "score": "0.60453063", "text": "def create\n @userprofile = Userprofile.new(userprofile_params)\n\n respond_to do |format|\n if @userprofile.save\n format.html { redirect_to @userprofile, notice: 'Userprofile was successfully created.' }\n format.json { render :show, status: :created, location: @userprofile }\n else\n format.html { render :new }\n format.json { render json: @userprofile.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7d4f472762538d214640eab1270562ac", "score": "0.60446405", "text": "def create\n\n @profile = Profile.new(profile_params)\n @profile.user = current_user\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "581f5cc74c9c1506b71fb47406172614", "score": "0.6038643", "text": "def create\n @profile = Profile.new(profile_params)\n @profile.user = current_user\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fccd3f93933b70a4857448f648bed569", "score": "0.6037792", "text": "def create\n @profile = Profile.new(profile_params)\n @profile.user = current_user\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fccd3f93933b70a4857448f648bed569", "score": "0.6037792", "text": "def create\n @profile = Profile.new(profile_params)\n @profile.user = current_user\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fccd3f93933b70a4857448f648bed569", "score": "0.6037792", "text": "def create\n @profile = Profile.new(profile_params)\n @profile.user = current_user\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "523017fa53ec69463a6053b49f8b8793", "score": "0.60289115", "text": "def create\n @driver_profile = DriverProfile.new(driver_profile_params)\n\n respond_to do |format|\n if @driver_profile.save\n format.html { redirect_to @driver_profile, notice: 'Driver profile was successfully created.' }\n format.json { render :show, status: :created, location: @driver_profile }\n post_request\n else\n flash[:error] = \"#{@driver_profile.errors.full_messages.to_sentence}\"\n format.html { render :new }\n format.json { render json: @driver_profile.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "af8163b91fda1c81ad6679455d74c6ec", "score": "0.6021036", "text": "def create\n @partner_profile = PartnerProfile.new(partner_profile_params)\n\n respond_to do |format|\n if @partner_profile.save\n format.html { redirect_to @partner_profile, notice: 'Partner profile was successfully created.' }\n format.json { render :show, status: :created, location: @partner_profile }\n else\n format.html { render :new }\n format.json { render json: @partner_profile.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "46398165f87dee640905e38ce298ae77", "score": "0.6016619", "text": "def create\n @profile = Profile.new(profile_params)\n authorize @profile\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to quit_user_profile_path, notice: \"Profile: #{I18n.t('helpers.saved')}\" }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "80d8dcb8e2b400f06bbc722e09d0edb2", "score": "0.601346", "text": "def create\r\n @profile = Profile.new(profile_params)\r\n\r\n respond_to do |format|\r\n if @profile.save\r\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\r\n format.json { render :show, status: :created, location: @profile }\r\n else\r\n format.html { render :new }\r\n format.json { render json: @profile.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "title": "" }, { "docid": "888f630b7e87155c0a089433ff657cfb", "score": "0.6013122", "text": "def create\n @profile = Profile.new(profile_params)\n @user = current_user\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render json: @profile, status: :created, location: @profile }\n else\n format.html { render \"new\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "26b87f4a8d991304c9fcaa5020963c67", "score": "0.60098535", "text": "def create\n @profile = Profile.new(profile_params)\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render action: 'show', status: :created, location: @profile }\n else\n format.html { render action: 'new' }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "afff586835053017f7dde403c427016d", "score": "0.5999839", "text": "def create\n @profile = current_user.build_profile(pro_params)\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { redirect_to new_profile_path, alert: 'Please fill all fields' }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fb41f5adab068b30c409579c59ef6da6", "score": "0.5995229", "text": "def create\n @user = User.new(user_params)\n if @user.save\n log_in @user\n session[:remember_me] == '1' ? remember(@user) : forget(@user)\n @tutorial = true if params[:help] == \"yes\"\n if params[:player] == \"yes\" ? @profile_type = \"player_profiles\" : @profile_type = \"dm_profiles\"\n respond_to do |format|\n format.html { redirect_to \"/users/#{@user.id}/#{@profile_type}/new?tutorial=#{@tutorial}\"}\n end\n end\n else\n respond_to do |format|\n format.html { render :new }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "35bd286a38b7bde2a2fbbfd26ca53f62", "score": "0.5991822", "text": "def create\n @profile_user = ProfileUser.new(profile_user_params)\n\n respond_to do |format|\n if @profile_user.save\n format.html { redirect_to @profile_user, notice: 'Profile user was successfully created.' }\n format.json { render :show, status: :created, location: @profile_user }\n else\n format.html { render :new }\n format.json { render json: @profile_user.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fa1eb9789023f4c6578b3870d8a475c0", "score": "0.5988683", "text": "def create\n @user_profile = UserProfile.new(params[:user_profile])\n\n respond_to do |format|\n if @user_profile.save\n format.html { redirect_to @user_profile, notice: 'User profile was successfully created.' }\n format.json { render json: @user_profile, status: :created, location: @user_profile }\n else\n format.html { render action: \"new\" }\n format.json { render json: @user_profile.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fa1eb9789023f4c6578b3870d8a475c0", "score": "0.5988683", "text": "def create\n @user_profile = UserProfile.new(params[:user_profile])\n\n respond_to do |format|\n if @user_profile.save\n format.html { redirect_to @user_profile, notice: 'User profile was successfully created.' }\n format.json { render json: @user_profile, status: :created, location: @user_profile }\n else\n format.html { render action: \"new\" }\n format.json { render json: @user_profile.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "831c34d14dff6f9846796345350cf3dd", "score": "0.5987221", "text": "def create\n params[:profile][:tag_list] = params[:profile][:tag_list]\n @profile = Profile.new(profile_params)\n @profile.user_id = current_user.id\n\n # Store friendly profile URI\n current_user.profile_uri = getUniqueURI(current_user) \n current_user.save\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to profile_path(@profile), notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fd8af35e1ad65c6158b839fb8b388290", "score": "0.59719884", "text": "def create\n\t\t@equalizer_profile = current_user.equalizer_profiles.new(params[:equalizer_profile])\n\n\t\trespond_to do |format|\n\t\t\tif @equalizer_profile.save\n\t\t\t\tformat.html { redirect_to(@equalizer_profile, :notice => 'Equalizer profile was successfully created.') }\n\t\t\t\tformat.xml { render :xml => @equalizer_profile, :status => :created, :location => @equalizer_profile }\n\t\t\t\tformat.json { render :json => @equalizer_profile, :status => :created, :location => @equalizer_profile }\n\t\t\t\tformat.yaml { render :text => @equalizer_profile.to_yaml, :content_type => 'text/yaml', :status => :created, :location => @equalizer_profile }\n\t\t\telse\n\t\t\t\tformat.html { render :action => \"new\" }\n\t\t\t\tformat.xml { render :xml => @equalizer_profile.errors, :status => :unprocessable_entity }\n\t\t\t\tformat.json { render :json => @equalizer_profile.errors, :status => :unprocessable_entity }\n\t\t\t\tformat.yaml { render :text => @equalizer_profile.errors.to_yaml, :content_type => 'text/yaml', :status => :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "7aa084e0a2650e2de39b84db313b6ca2", "score": "0.5963572", "text": "def create\n @profile = Profile.new(profile_params)\n @profile.user_id = current_user.id\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7d453787ff79d02172871ae865c3998a", "score": "0.5957129", "text": "def create\n @profile = Profile.new(profile_params)\n @profile.user_id = current_user.id\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7d453787ff79d02172871ae865c3998a", "score": "0.5957129", "text": "def create\n @profile = Profile.new(profile_params)\n @profile.user_id = current_user.id\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4ef8c91a06efb2c8b7f42010c0c99484", "score": "0.5956327", "text": "def create\n @user_profile = UserProfile.new(user_profile_params)\n\n respond_to do |format|\n if @user_profile.save\n format.html { redirect_to @user_profile, notice: 'User profile was successfully created.' }\n format.json { render :show, status: :created, location: @user_profile }\n else\n format.html { render :new }\n format.json { render json: @user_profile.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cb27a815e267da4b77d58b853d4fa911", "score": "0.5948435", "text": "def update\n @user = @player_profile.user\n respond_to do |format|\n\n if @player_profile.update_attributes(player_profile_params)\n\n format.html { redirect_to user_player_profiles_path(@user, @player_profile), notice: 'Player profile was successfully updated.' }\n format.json { render :show, status: :ok, location: @player_profile }\n else\n format.html { render :edit }\n format.json { render json: @player_profile.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e885bb322cfe6d59e668ce9335349e87", "score": "0.5935412", "text": "def create\n player = Player.create(player_params)\n render json: player, status: 201\n end", "title": "" }, { "docid": "a95fdd442c8e8844fe35f062756cb1c2", "score": "0.5928746", "text": "def profile_params\n params.require(:profile).permit(:name, :nickname, :gender, :description, { experienced_language_ids: [] })\n end", "title": "" }, { "docid": "39a4a6cea997da51a0eb45b3350d96d7", "score": "0.5925852", "text": "def set_player_profile\n @player_profile = PlayerProfile.where(user_id: params[:user_id])[0]\n end", "title": "" }, { "docid": "c8a6e43bef6b301b6b2ac0f854d64f00", "score": "0.5890633", "text": "def create\n @profile = Profile.new(profile_params)\n @profile.my_id = current_user.id\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to profiles_path, notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0f3da41cfff0491731fa900db8804e34", "score": "0.5880305", "text": "def create\n @profile = Profile.new(profile_params)\n @profile.user_id = current_user.id\n\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "df48104cc711bedeaa19eb8c1a893402", "score": "0.58709764", "text": "def create\n @profile = Profile.new(profile_params)\n @profile.user=current_user\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ee2b5e1ccb95db2bb6f7bfa6983f16a4", "score": "0.5870778", "text": "def create\n @profile = current_user.build_profile\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, :notice => 'Profile was successfully created.' }\n format.json { render :json => @profile, :status => :created, :location => @profile }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @profile.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5aafe180eb744ec13d09d19ee7e7bc5f", "score": "0.5869372", "text": "def profile_params\n params.require(:profile).permit!\n end", "title": "" }, { "docid": "0126ff36092c02d5eca725d26b768d7a", "score": "0.5868161", "text": "def create\n @profile = @account.build_profile(profile_attributes)\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to root_path, notice: 'Анкета успешно сохранена. Ваш магазин добавлен в очередь на оптимизацию.' }\n format.json { render json: @profile, status: :created, location: @profile }\n else\n format.html { render action: 'new' }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6e05168312e51db2ee635d48a1beac3e", "score": "0.5859348", "text": "def set_playerprofile\n @playerprofile = Playerprofile.find(params[:id])\n end", "title": "" }, { "docid": "460a96912dbf82f929398721b69961a1", "score": "0.5857162", "text": "def create\n @profile = Profile.new(profile_params)\n @profile.user = current_user\n respond_to do |format|\n if @profile.save\n format.html { redirect_to manage_profile_path(@profile), notice: 'Profile was successfully created.' }\n format.json { render action: 'show', status: :created, location: @profile }\n else\n format.html { render action: 'new' }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "51458204823b3cab3b773b84131cddd1", "score": "0.58538866", "text": "def create\n @user_profile = UserProfile.new(user_profile_params)\n\n respond_to do |format|\n if @user_profile.save\n flash[:success] = 'User profile was successfully created.'\n format.html { redirect_to @user_profile}\n format.json { render :show, status: :created, location: @user_profile }\n else\n flash[:danger] = \"There are some mistakes, please try again\"\n format.html { render :new }\n format.json { render json: @user_profile.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2be37bea0a2ecf31af394fcdbe123032", "score": "0.58509", "text": "def create\n @user_profile = UserProfile.new(user_profile_params) \n\n respond_to do |format| \n if @user_profile.save\n format.html { redirect_to @user_profile, notice: 'User profile was successfully created.' }\n format.json { render :show, status: :created, location: @user_profile }\n else\n format.html { render :new }\n format.json { render json: @user_profile.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5305842ec563a8315af4c754add48155", "score": "0.5847774", "text": "def new\n\n @playerprofile = current_user.build_playerprofile\n @playerprofile.id=@playerprofile.user_id\n format.html { redirect_to @playerprofile, notice: 'Playerprofile was successfully new.' }\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @playerprofile }\n end\n end", "title": "" }, { "docid": "0424d8121fb0894da329399f0ecb9c80", "score": "0.5845556", "text": "def create\n @player = Player.new(params[:player])\n \n if @player.save\n render :json => @player, :status => :created, :location => @player\n else\n render :json => @player.errors, :status => :unprocessable_entity\n end\n end", "title": "" }, { "docid": "b2693ac247725e07e115a285cdb0fe23", "score": "0.584443", "text": "def create\n @player = Player.new(player_params)\n\n if @player.save\n render json: @player, status: :created, location: @player\n else\n render json: {errors: @player.errors}, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "4559c536c994b6ce73d44da2daba6ab7", "score": "0.5841206", "text": "def profile_params\n params.require(:profile).permit(:name, :gender, :userId, :age, :feet, :inch, :weight, :fitnessGoal, :token)\n end", "title": "" }, { "docid": "cf0caa014701aa7e369eec58128a0714", "score": "0.58347726", "text": "def create\n @admin_profile = Admin::Profile.new(admin_profile_params)\n\n respond_to do |format|\n if @admin_profile.save\n unless params[:admin_profile][:avatar].blank?\n preloaded = Cloudinary::Uploader.upload(params[:admin_profile][:avatar], :use_filename => true, :public_id => \"profiles/#{@admin_profile.id}\")\n end\n\n unless params[:admin_profile][:profile_skills_attributes].blank?\n params[:admin_profile][:profile_skills_attributes].each do |skill|\n admin_skill = Admin::ProfileSkill.create({profile_id: @admin_profile.id, name: skill[1][:name], skill: skill[1][:skill]})\n admin_skill.save\n end\n end\n\n unless params[:admin_profile][:profile_hobbies_attributes].blank?\n params[:admin_profile][:profile_hobbies_attributes].each do |hobby|\n admin_hobby = Admin::ProfileHobby.create({profile_id: @admin_profile.id, name: hobby[1][:name]})\n admin_hobby.save\n end\n end\n\n format.html { redirect_to admin_root_path, notice: 'Profile was successfully created.' }\n format.json { render action: 'show', status: :created, location: @admin_profile }\n else\n format.html { render action: 'new'}\n format.json { render json: @admin_profile.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "266c0bb535d36ef0f53ab5a2aa369c27", "score": "0.5832203", "text": "def create\n @profile = Profile.new(profile_params)\n @profile.user_id = current_user.id\n \n \n @profile.artist = find_preferred_artist_id\n @profile.advisor = find_preferred_advisor_id\n\n respond_to do |format|\n if @profile.save\n current_user.update(clientstatus: \"free\")\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "29bb88f72e1647e4abd8a1bc306a1f0f", "score": "0.58256716", "text": "def profile_params\n params.require(:profile).permit(:description, :steam, :mmr, :carry, :mid, :support, :offlane, :jungle, :image, :dotabuff, :compete, :casual, :language_id, :time_zone, :hero_id)\n end", "title": "" }, { "docid": "dc1348b9c62f5700f05e8c75125e07e0", "score": "0.58215696", "text": "def create\n Userprofile.create(\"name\" => params[\"full_name\"], \"photo_url\" => params[\"url\"])\n redirect_to \"/userprofiles\"\n end", "title": "" }, { "docid": "7389acf1a23112146eb74765ecef2b66", "score": "0.5820537", "text": "def create\n @private_profile = PrivateProfile.new(params[:private_profile])\n\n respond_to do |format|\n if @private_profile.save\n format.html { redirect_to @private_profile, notice: 'Private profile was successfully created.' }\n format.json { render json: @private_profile, status: :created, location: @private_profile }\n else\n format.html { render action: \"new\" }\n format.json { render json: @private_profile.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "49bfca066af9cff9a006d6593f231b0e", "score": "0.58171475", "text": "def create\n @talent_profile = TalentProfile.new(talent_profile_params)\n\n respond_to do |format|\n if @talent_profile.save\n format.html { redirect_to @talent_profile, notice: 'Talent profile was successfully created.' }\n format.json { render :show, status: :created, location: @talent_profile }\n else\n format.html { render :new }\n format.json { render json: @talent_profile.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "25b7fdb4329d178b3f7d9f0191dc9aca", "score": "0.5815025", "text": "def create\n @profile_pick = ProfilePick.new(profile_pick_params)\n\n respond_to do |format|\n if @profile_pick.save\n format.html { redirect_to @profile_pick, notice: 'Profile pick was successfully created.' }\n format.json { render :show, status: :created, location: @profile_pick }\n else\n format.html { render :new }\n format.json { render json: @profile_pick.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5d7dc9e101befbb62ab91f7243d410db", "score": "0.58103776", "text": "def create\n @tag_pro_profile = current_user.build_tag_pro_profile(tag_pro_profile_params)\n if @tag_pro_profile.save\n flash[:notice] = 'Tag pro profile was successfully created.' if is_navigational_format?\n end\n respond_with(@tag_pro_profile, location: root_url)\n end", "title": "" }, { "docid": "1e8ab0b5c330d1d43729abc92ee553c7", "score": "0.5803443", "text": "def player_params\n params.require(:player).permit(:mtu_id, :first_name, :last_name, :nickname, :email, :profile_pic, :remove_profile_pic, :major, :hometown, :position, :height_feet, :height_inches, :years_played, :description, :autocomplete)\n end", "title": "" }, { "docid": "4f0422ecfaa7d9be2a3cfb9518d80786", "score": "0.5796681", "text": "def profile_params\n params.require(:profile).permit(:description, :experience, :profession, :current_location,\n :user_id, :image, :youtube_url, :name, :latitude, :longitude)\n end", "title": "" }, { "docid": "09b6ab3cfb4c93251d569f4da0b4b48f", "score": "0.57941717", "text": "def profile_params\n params.require(:profile).permit(PERMIT_FIELDS)\n end", "title": "" }, { "docid": "9d16dd2addc8af24808967228eafe292", "score": "0.57926065", "text": "def create\n @professional_profile = ProfessionalProfile.new(professional_profile_params)\n @professional_profile.user = current_user\n\n respond_to do |format|\n if @professional_profile.save\n format.html { redirect_to @professional_profile, notice: 'Professional profile was successfully created.' }\n format.json { render :show, status: :created, location: @professional_profile }\n else\n format.html { render :new }\n format.json { render json: @professional_profile.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b301200312f04828fab942949164b48e", "score": "0.5778825", "text": "def add_profile(post, profile)\n post[:profile] = profile\n post[:profileupdate] = 'Y'\n end", "title": "" }, { "docid": "29667c8bc6be85b0bd11a7d11e1452e3", "score": "0.57705", "text": "def create\n @seeker_profile = SeekerProfile.new(seeker_profile_params)\n\n respond_to do |format|\n if @seeker_profile.save\n format.html { redirect_to @seeker_profile, notice: 'Seeker profile was successfully created.' }\n format.json { render :show, status: :created, location: @seeker_profile }\n else\n format.html { render :new }\n format.json { render json: @seeker_profile.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "52a819a06c3924a1d74b346f636dec0d", "score": "0.57644", "text": "def profile_params\n params.fetch(:profile, {}).permit(profile_attributes)\n end", "title": "" }, { "docid": "52e882fdef8ecdb4628bc48b77276024", "score": "0.5759933", "text": "def create\n @profile = Profile.new(profile_params)\n \n @profile.user_id = current_user.id\n @profile.full_name = @profile.first_name + @profile.last_name\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, :notice => t('alerts.profiles.create') }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2f142819272a6530b2fd7063159722e9", "score": "0.57562816", "text": "def create\n profile = Payments::Profile.new(profile_params)\n profile.user = current_user\n\n respond_to do |format|\n if profile.save\n format.html {redirect_to payments_profiles_path}\n else\n format.html {redirect_to :back, flash: {error: \"Error saving payment profile\"}}\n end\n end\n end", "title": "" }, { "docid": "0a0b39c1c70e17338333522379467b1b", "score": "0.5748852", "text": "def create\n @player = Player.new(player_params)\n\n respond_to do |format|\n if @player.save\n format.json { render json: @player, status: :created }\n else\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5b6b9e3d957b24eec0201452a679be3d", "score": "0.5748731", "text": "def profile_params\n params.require(:profile).permit(:profile_first_name, :profile_last_name, :user_id, :profile_preferred_right_id)\n end", "title": "" }, { "docid": "bee604b4f8dd0b429177fa0dd8759c30", "score": "0.57400745", "text": "def create\n @security_profile = Security::Profile.new(security_profile_params)\n @security_profile.user_created_id = current_user.id\n respond_to do |format|\n if @security_profile.save\n format.html { redirect_to security_profiles_path, notice: I18n.t('profiles.controller.create')}\n format.json { render :show, status: :created, location: @security_profile }\n else\n format.html { render :new }\n format.json { render json: @security_profile.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "13cd493ba83b7b94df022e8bd174d341", "score": "0.5735582", "text": "def profile_params\n params.require(:profile).permit(:user_id, :name, :surname, :age, :profile_picture, :gender, :relationship_status)\n end", "title": "" }, { "docid": "cdb4d1fadb624816b6b7ecad6ece2442", "score": "0.5735349", "text": "def create\n @retailer_profile = RetailerProfile.new(retailer_profile_params)\n @retailer_profile.user = current_user\n\n respond_to do |format|\n if @retailer_profile.save\n format.html { redirect_to root_path, notice: 'Your profile was successfully created.' }\n format.json { render action: 'show', status: :created, location: @retailer_profile }\n else\n format.html { render action: 'new' }\n format.json { render json: @retailer_profile.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1d6386fcb9a903821599874a2fe17bad", "score": "0.57323253", "text": "def create\n respond_to do |format|\n if @user_profile.save\n format.html { redirect_to @user_profile, :notice => 'Корисничкиот профил е успешно создаден.' }\n format.json { render :json => @user_profile, :status => :created, :location => @user_profile }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @user_profile.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" } ]
6c5343b5db9869342bae15a42fc29fda
Public: Determines if the SubscriptionPlan has at least one Subscription. Returns a Boolean.
[ { "docid": "d68832a7a3855dbd3c47ac1ce6d7df6c", "score": "0.7592596", "text": "def has_subscriptions?\n subscriptions.any?\n end", "title": "" } ]
[ { "docid": "442cd0286c85505d744f4b529528408e", "score": "0.7785593", "text": "def has_subscription?\n if self.subscription.nil?\n return false\n else \n return true\n end\n end", "title": "" }, { "docid": "f44a87dc4d1c2bbbb847ee425dee6d9c", "score": "0.75096303", "text": "def is_subscription?\n return self.subscription_id.present?\n end", "title": "" }, { "docid": "17332661226ffca0f80aff2cded4bbb5", "score": "0.721749", "text": "def subscribed?\n subscription.nil? || active_trial? ? false : true\n end", "title": "" }, { "docid": "ec3f2f9593df7076819abe0dae857d0e", "score": "0.7142879", "text": "def has_active_subscriptions?\n subscriptions.any?(&:active?)\n end", "title": "" }, { "docid": "4dea90184c02f3434ab3bf32d5b40942", "score": "0.7025317", "text": "def subscribes_to? subscribable\n subscriptions.any? do |subscription|\n subscription.subscribable == subscribable\n end\n end", "title": "" }, { "docid": "086ce607973d05c56d9871436ee7446b", "score": "0.6997528", "text": "def subscribed?\n if @subscriber.nil?\n false\n else\n ![@subscriber.channels, @subscriber.groups, @subscriber.wildcard_channels].flatten.empty?\n end\n end", "title": "" }, { "docid": "f3a7e76d2d2d0fdeef45444cdd5c435d", "score": "0.69832355", "text": "def subscribed?\n self.active_subscription.present?\n end", "title": "" }, { "docid": "bbc3a480ec581606c9eab838f9bfa342", "score": "0.69460934", "text": "def check_if_active_subs\n active_sub = self.user.subscriptions.where(subscription_status_id: 11).count > 0\n return true if active_sub\n return errors.add(:subscription, \"No active subscriptions\") if !active_sub\n end", "title": "" }, { "docid": "6fcd86d3b0915a7e76e5dfb8967daf6a", "score": "0.6918531", "text": "def subscription_successful?\n !payment_gateway_responses.subscription.successful.blank? # row found = true, nil = false\n end", "title": "" }, { "docid": "43b953de2bb88e975a38466568b99632", "score": "0.69089985", "text": "def has_valid_subscription?\n stripe.subscriptions.data.count{|s| %w(active trialing past_due).include? s.status} > 0\n end", "title": "" }, { "docid": "5369707ea74b489573e16bc2d02b38e5", "score": "0.68804634", "text": "def has_subscription_for?(user)\n users.exists?(id: user.id)\n end", "title": "" }, { "docid": "c27a8de85fc62886cb45b87c2c5fa1c7", "score": "0.68786806", "text": "def subscription?\n !latest_transaction.nil?\n end", "title": "" }, { "docid": "0daae851b3c5192affa8ce291e3fe1cb", "score": "0.6854708", "text": "def subscription?\n !latest_receipt_info.nil? && latest_receipt_info.size.positive?\n end", "title": "" }, { "docid": "292902edf02aad0fc377854ba86610f3", "score": "0.6835809", "text": "def active_subscribed?\n subscription.nil? ? false : true\n end", "title": "" }, { "docid": "4aa7243b2cdd47882fdc9413d630e234", "score": "0.6826892", "text": "def subscribed_by?(user)\n subscriptions.where(user: user).any?\n end", "title": "" }, { "docid": "4aa7243b2cdd47882fdc9413d630e234", "score": "0.6826892", "text": "def subscribed_by?(user)\n subscriptions.where(user: user).any?\n end", "title": "" }, { "docid": "aca031f8d9abd1e8fa73879879ddebc3", "score": "0.6797344", "text": "def subscribed_to?(stripe_id)\n subscription_plan = subscription.plan if subscription.present?\n if subscription_plan.present?\n return true if subscription_plan.stripe_id == stripe_id\n\n if Tang.plan_inheritance\n other_plan = Plan.find_by(stripe_id: stripe_id)\n return true if other_plan.present? && subscription_plan.order >= other_plan.order\n end\n end\n false\n end", "title": "" }, { "docid": "50bde58e9165a17007afca4b0313da9a", "score": "0.6795793", "text": "def subscription?\n @item.type == 'subscription'\n end", "title": "" }, { "docid": "88629cfcbcf2d973e2829703163c9ebc", "score": "0.6794708", "text": "def subscription?\n subscription_node\n end", "title": "" }, { "docid": "69367cb9f99f5fcd1dc084ad986de23a", "score": "0.6794637", "text": "def has_subscription?(show)\n !(subscriptions.find_by show_id: show.id).nil?\n end", "title": "" }, { "docid": "44a4b8725004621a765a4d413e4837ad", "score": "0.67505145", "text": "def subscribed?(sub)\n subscriptions.include?(sub)\n end", "title": "" }, { "docid": "8e824c4d7a25001f561a5cc94f5a85b5", "score": "0.67380726", "text": "def subscribed_to?(stripe_id)\n subscription_plan = self.subscription.plan if self.subscription.present?\n if subscription_plan.present?\n return true if subscription_plan.stripe_id == stripe_id\n if Tang.plan_inheritance\n other_plan = Plan.find_by(stripe_id: stripe_id)\n return true if other_plan.present? && subscription_plan.order >= other_plan.order\n end\n end\n return false\n end", "title": "" }, { "docid": "03bc09534a551254541ba3adaf0998d4", "score": "0.67194337", "text": "def can_subscribe?\n @ask == 'subscribe' && %w[none from].include?(@subscription)\n end", "title": "" }, { "docid": "03bc09534a551254541ba3adaf0998d4", "score": "0.67194337", "text": "def can_subscribe?\n @ask == 'subscribe' && %w[none from].include?(@subscription)\n end", "title": "" }, { "docid": "053eca789650ff22de9ee8b1d43729ca", "score": "0.66907483", "text": "def paid_subscriptions? # TODO: include periods\r\n !self.subscriptions.map { |sub| sub.periods.paid }.flatten.empty?\r\n end", "title": "" }, { "docid": "62d1aa97be9a79acea8f837e14f39dac", "score": "0.66843563", "text": "def subscribed_by?(user)\n !subscriptions.where(user: user).empty?\n end", "title": "" }, { "docid": "48eaa07313b3fc70b6fba4263e3e2042", "score": "0.66814196", "text": "def active_subscription?\n if self.current_subscription && (self.current_subscription.active? || self.current_subscription.trialing?)\n true\n else\n false\n end\n end", "title": "" }, { "docid": "a22832896af2edc6ab44b3a2ecad2523", "score": "0.66771466", "text": "def customer_has_a_membership_plan?\n return false if customer.nil? || customer.deleted?\n\n membership_plans = MembershipPlan.stripe_plans.map(&:id)\n customer.subscriptions.any? do |subscription|\n membership_plans.include?(subscription.plan.id)\n end\n end", "title": "" }, { "docid": "153717219030ac316e361d43598ecb42", "score": "0.6650046", "text": "def has_active_subscription?\n self.is_paid? and self.is_still_paid?\n end", "title": "" }, { "docid": "0200bf22bf39decbade8838eae3675a0", "score": "0.66419995", "text": "def has_active_subscriptions?\n return false unless is_registered_with_braintree?\n\n !subscriptions.empty?\n end", "title": "" }, { "docid": "1da78c04ce57380b55480f18d319f878", "score": "0.66226834", "text": "def active_subscription?\n managers.map(&:subscribed?).include?(true) || managers.map(&:active_trial?).include?(true) ? true : false\n end", "title": "" }, { "docid": "db79f264d0d2e3ec23d653b91d3a2dcf", "score": "0.6622383", "text": "def has_active_subscription?\n if company_subscription.present?\n # subscription is not expired\n return true if not company_subscription.expires_at.present?\n\n # otherwise check expiration date\n Time.now < company_subscription.expires_at\n else\n # user has never paid\n false\n end\n end", "title": "" }, { "docid": "965dd895938959660acabccce82c8745", "score": "0.6615663", "text": "def has_subscribed?(question)\n self.subscriptions.where(question: question).exists?\n end", "title": "" }, { "docid": "0f5dec86ffd300a3fda7b264dd6691c3", "score": "0.66096944", "text": "def subscribed?(question)\n subscriptions.where(question: question).exists?\n end", "title": "" }, { "docid": "8c2c8c194c1c16649faacb5a1a43dfa0", "score": "0.65936506", "text": "def subscribed?\n ( @subscription_id.nil? or @watermark.nil? )? false : true\n end", "title": "" }, { "docid": "2be00c14c8ceba681f5f22b15b94519d", "score": "0.6589556", "text": "def subscribed?\n ( @subscription_id.nil? or @watermark.nil? )? false : true\n end", "title": "" }, { "docid": "668a3ec805168ec3d2cbb39fa442689a", "score": "0.6588883", "text": "def subscribed?(example_subscription)\n if user_subs.find_by(subscription_id: example_subscription.id)\n return true\n else\n return false\n end\n end", "title": "" }, { "docid": "353726676750e6f65ff7099276cb2c84", "score": "0.65547246", "text": "def has_temporarily_suspended_subscription?\n subscriptions.any?(&:temporarily_suspended?)\n end", "title": "" }, { "docid": "c4a9e21e51b81bf12db5b9ab53fa941e", "score": "0.6536294", "text": "def has_subscription_record?(plan, users_in_license, license_type)\n # find any records that have a matching plan and seats and type\n subscription_history_element.hashes.any? do |record|\n record['Plan'] == plan[:name].capitalize && record['Seats'] == users_in_license.to_s && \\\n record['Type'].strip.downcase == license_type\n end\n end", "title": "" }, { "docid": "36db200683f3b82cff3ac06c7f4ac2ec", "score": "0.65164685", "text": "def active?\n subscriptions.any?(&:running?)\n end", "title": "" }, { "docid": "5b9302c291aa45fe55d2fa0e4f773e4b", "score": "0.65082145", "text": "def subscribed(name = 'default', plan = nil)\n subscription = self.subscription(name)\n\n return false unless subscription&.valid?\n\n plan ? subscription.plan?(plan) : true\n end", "title": "" }, { "docid": "8a1d7e8f394a17979905850053b1d905", "score": "0.6498203", "text": "def has_active_subscription?\n true\n # self.is_paid? and self.is_still_paid?\n end", "title": "" }, { "docid": "ce3274a215c0911987dc164337edebb3", "score": "0.6497492", "text": "def subscribed?(profile)\n subscriber_feed_subscriptions.where(profile_id: profile.id).first ?\n true : false\n end", "title": "" }, { "docid": "ce3274a215c0911987dc164337edebb3", "score": "0.649615", "text": "def subscribed?(profile)\n subscriber_feed_subscriptions.where(profile_id: profile.id).first ?\n true : false\n end", "title": "" }, { "docid": "f8b744cfa3336b3c598e4db8aaca510a", "score": "0.6484329", "text": "def subscribed_to?\n %w[to both].include?(@subscription)\n end", "title": "" }, { "docid": "f8b744cfa3336b3c598e4db8aaca510a", "score": "0.6484329", "text": "def subscribed_to?\n %w[to both].include?(@subscription)\n end", "title": "" }, { "docid": "5919b8f4a28dd3ac4e9b3a05b5d3bcb7", "score": "0.6463883", "text": "def on_plan(plan)\n subscriptions.any? { |subscription| subscription.valid && subscription.plan?(plan) }\n end", "title": "" }, { "docid": "4b1b0d82a85272be2be949f9c7b1e35b", "score": "0.64399266", "text": "def subscribed?\n stripe_subscription_id?\n end", "title": "" }, { "docid": "1faabac3e9486dc877cab777a56059ad", "score": "0.6399985", "text": "def is_User_Logged_In_With_A_Subscription?\n\t\tbegin\n\t\t\tfind(:xpath, getXpath(:dashboard, :shippingBilling))\n\t\t\treturn true\n\t\trescue\n\t\t\treturn false\n\t\tend\n\tend", "title": "" }, { "docid": "3a95a83753e3f75f48ba24912c1075e2", "score": "0.6373963", "text": "def existing_subscription?(queue_arn, topic_arn)\n subscriptions = @client.sns.list_subscriptions.subscriptions\n subscriptions.any? { |subscription| subscription.topic_arn == topic_arn && subscription.endpoint == queue_arn }\n end", "title": "" }, { "docid": "ff3b9a7c769fc1b8653f18c9a0a9e69d", "score": "0.63470113", "text": "def validate_subscription\n url = File.join(Azure::Armrest::RESOURCE, 'subscriptions') + \"?api-version=#{api_version}\"\n\n options = {\n :url => url,\n :proxy => proxy,\n :ssl_version => ssl_version,\n :ssl_verify => ssl_verify,\n :headers => {\n :accept => accept,\n :content_type => content_type,\n :authorization => token\n }\n }\n\n response = Azure::Armrest::ArmrestService.send(:rest_get, options)\n json = JSON.parse(response.body)['value']\n\n subscriptions = json.map { |hash| [hash['subscriptionId'], hash['state']] }\n\n found = subscriptions.find { |array| array.first == subscription_id }\n\n unless found\n raise ArgumentError, \"Subscription ID '#{subscription_id}' not found\"\n end\n\n if found.last.casecmp(\"enabled\") != 0\n warn \"Subscription '#{found.first}' found but not enabled.\"\n end\n\n true\n end", "title": "" }, { "docid": "fac279f314639503638113afeaf78f61", "score": "0.6333623", "text": "def subscribers?(topic)\n !subscribers_for(topic).empty?\n end", "title": "" }, { "docid": "e171681aa5529803d89a3325ba104ed1", "score": "0.6292256", "text": "def subscribers?(topic)\n !subscribers_for(topic).empty?\n end", "title": "" }, { "docid": "be40b61cd62295eb3acb0abfec1bb078", "score": "0.627389", "text": "def is_subscription_payment?\n status == 'Subscription-Payment-Success'\n end", "title": "" }, { "docid": "be40b61cd62295eb3acb0abfec1bb078", "score": "0.627389", "text": "def is_subscription_payment?\n status == 'Subscription-Payment-Success'\n end", "title": "" }, { "docid": "1577fbfcb604ea981d9ebbee9131d914", "score": "0.6255048", "text": "def has_subscriber?(consumer)\n subscriptions.collect(&:consumer_id).include?(consumer.id)\n end", "title": "" }, { "docid": "fda626bf7168e7c1de30ac15d79b1c0e", "score": "0.62518126", "text": "def expires?\n self.subscription_plan && self.subscription_plan.expires?\n end", "title": "" }, { "docid": "dc40340997173f79f6572664bc14ffca", "score": "0.62444246", "text": "def subscribed_to_plan(plans, name = 'default')\n subscription = self.subscription(name)\n\n return false unless subscription&.valid?\n\n plans = [plans] unless plans.instance_of? Array\n\n plans.each do |plan|\n return true if subscription.plan?(plan)\n end\n\n false\n end", "title": "" }, { "docid": "8af4ee8f2426a64bf6d6bb7cf5fb2623", "score": "0.62333184", "text": "def is_subscription_payment?\n status == 'Subscription-Payment-Success'\n end", "title": "" }, { "docid": "10decf74fe496631054082438739c6e8", "score": "0.62206745", "text": "def subscribed_by?(user)\n Subscription.exists?(feed_id: self.id, user_id: user.id)\n end", "title": "" }, { "docid": "dc3f6296bf1c5f612bf097bc1db86b2c", "score": "0.62189716", "text": "def is_subscribed?(post)\n subscriptions.where(:post => post).count > 0\n end", "title": "" }, { "docid": "5fccb25d710f39c06cde9f9cc9cb7326", "score": "0.62074846", "text": "def is_subscription?\n product.is_subscription? \n end", "title": "" }, { "docid": "ec5d3212191af699c299d0d6b8957789", "score": "0.619251", "text": "def subscribed?(sub)\n subscribed_subs.include?(sub)\n end", "title": "" }, { "docid": "1c320c50af2a69e5ff13e615fc052b5d", "score": "0.6176797", "text": "def subscription_trialing?\n subscribed? && subscription_status == EffectiveOrders::TRIALING\n end", "title": "" }, { "docid": "37a003f478e568cafd2e911798aa4d35", "score": "0.6175328", "text": "def subscribed?(subreddit)\n subscribed_subreddits.include?(subreddit)\n end", "title": "" }, { "docid": "7c1822637af344f5c566604e9c50db21", "score": "0.61561847", "text": "def subscribed?\n managers.map(&:subscribed?).include?(true) ? true : false\n end", "title": "" }, { "docid": "ebc4d6253e8b6984a837424031430c05", "score": "0.6144466", "text": "def active?\n active && subscription.active?\n end", "title": "" }, { "docid": "08bac26505deb9083227f309d496c267", "score": "0.61191636", "text": "def subscribed?\n subscribed == true\n end", "title": "" }, { "docid": "1acaba21d8e005f27668c0bb8a597b2a", "score": "0.61191165", "text": "def is_paid?\n !self.subscription.blank?\n end", "title": "" }, { "docid": "1acaba21d8e005f27668c0bb8a597b2a", "score": "0.61191165", "text": "def is_paid?\n !self.subscription.blank?\n end", "title": "" }, { "docid": "41c1508ca8a3207bb7a1debba49a6f7d", "score": "0.6101815", "text": "def is_subscribed_to_NASDAQ?\n return false unless has_active_subscriptions?\n\n !subscriptions.find_by_name(:AF_NASDAQ_01).nil?\n end", "title": "" }, { "docid": "92fc45ea78f4173b7cecb209c0c079d8", "score": "0.6074106", "text": "def unsubscribed?\n subscription.nil? ? true : false\n end", "title": "" }, { "docid": "243280393c03eec6083be6f3df1a63a8", "score": "0.60620034", "text": "def subscribed?(course_id)\n begin\n self.courses.find(course_id)\n return true\n rescue ActiveRecord::RecordNotFound\n return false\n end\n end", "title": "" }, { "docid": "b5efa6eca2524b9d9433ac2e11e570a6", "score": "0.6061406", "text": "def has_weekender?\n self.subscriptions.any? do |sub|\n sub.publication.name == 'Crikey Weekender'\n end\n end", "title": "" }, { "docid": "4103f9e591864b7c9bc52860758dbbdb", "score": "0.605256", "text": "def is_subscribed_to_single_activation?\n return false unless has_active_subscriptions?\n\n !subscriptions.find_by_name(:AF_SINGLE_ACTIVATION_01).nil?\n end", "title": "" }, { "docid": "d001efcecb4f1230382f76a93671a53e", "score": "0.6039102", "text": "def subscribing?(subscribed_user)\n subscribing.include?(subscribed_user)\n end", "title": "" }, { "docid": "705e2009ec6bf3a64562cada0a1ab020", "score": "0.6030788", "text": "def subscribed?\n not unsubscribed?\n end", "title": "" }, { "docid": "e3dfbf6e50eb25d6dd7317a736cf3b95", "score": "0.60030675", "text": "def analyze?\n @query.subscription?\n end", "title": "" }, { "docid": "7478f23c9ada40758e69478f91e9499f", "score": "0.6001705", "text": "def recurring?\n self.pending? && !self.payments.recurring.empty?\n end", "title": "" }, { "docid": "bf40ab7b17c3ecab649318af6f1b7236", "score": "0.5997242", "text": "def validate_subscription\n found = subscriptions.find { |sub| sub.subscription_id == subscription_id }\n\n unless found\n raise ArgumentError, \"Subscription ID '#{subscription_id}' not found\"\n end\n\n if found.state.casecmp('enabled') != 0\n warn \"Subscription '#{found.subscription_id}' found but not enabled.\"\n end\n end", "title": "" }, { "docid": "e69f36a447ff870457982c9e425be30e", "score": "0.5976881", "text": "def valid_subscription?\n subscription_expires_at.present? && !subscription_expires_at.past?\n end", "title": "" }, { "docid": "39076810726425cc8eb8aee276815250", "score": "0.59753853", "text": "def confirm_subscriptions?\n\t\treturn ! ( self.listdir + 'nosubconfirm' ).exist?\n\tend", "title": "" }, { "docid": "19387869f07b82cdd2167765eed34b03", "score": "0.597034", "text": "def has_subscription_for?(newsletter_archive)\n self.newsletter_archives.include?(newsletter_archive)\n end", "title": "" }, { "docid": "0541709c9c7a71d647abff44750c5a9f", "score": "0.59660804", "text": "def subscribed?(course)\n\t\tsubscribed_courses.include?(course)\n\tend", "title": "" }, { "docid": "b24a3d31082dbfac5d32162da414ee2c", "score": "0.5959905", "text": "def subscribed?\n !ended? && !unsubscribed?\n end", "title": "" }, { "docid": "703be5b12fa19c6a8ec6e2fab93db835", "score": "0.5947338", "text": "def qualifies_for?(plan)\n Subscription::Limits.keys.collect {|rule| rule.call(self, plan) }.all?\n end", "title": "" }, { "docid": "703be5b12fa19c6a8ec6e2fab93db835", "score": "0.5947338", "text": "def qualifies_for?(plan)\n Subscription::Limits.keys.collect {|rule| rule.call(self, plan) }.all?\n end", "title": "" }, { "docid": "703be5b12fa19c6a8ec6e2fab93db835", "score": "0.5947338", "text": "def qualifies_for?(plan)\n Subscription::Limits.keys.collect {|rule| rule.call(self, plan) }.all?\n end", "title": "" }, { "docid": "703be5b12fa19c6a8ec6e2fab93db835", "score": "0.5947338", "text": "def qualifies_for?(plan)\n Subscription::Limits.keys.collect {|rule| rule.call(self, plan) }.all?\n end", "title": "" }, { "docid": "59deda5b377791ccecd2b7bac5d79a29", "score": "0.59450126", "text": "def has_subscribers(name)\n self.subscribers(name).length > 0 ? true : false\n end", "title": "" }, { "docid": "fee3a7c15f04c67dd375b34bb925521c", "score": "0.5936904", "text": "def subscribable?\n @subscribable ? @subscribable.call : true\n end", "title": "" }, { "docid": "fee3a7c15f04c67dd375b34bb925521c", "score": "0.5936904", "text": "def subscribable?\n @subscribable ? @subscribable.call : true\n end", "title": "" }, { "docid": "92fc03826ed2793f67ef5a7942261602", "score": "0.5893831", "text": "def active?\n (in_trial? or (!canceled? and stripe_subscription_id.present?))\n end", "title": "" }, { "docid": "b1b55e79060890eb82027f99e2da32cc", "score": "0.58905804", "text": "def committed?\n subscriptions.any? do |subscription|\n subscription.commitment_period > 0 && subscription.running?\n end\n end", "title": "" }, { "docid": "ce1dd10bb5ced56cef7ca3be184e2c16", "score": "0.58853173", "text": "def subscribed_to?(article)\n subscriptions.where(article_id: article.id, user_id: self.id).count > 0\n end", "title": "" }, { "docid": "3a1068013b9c03341cc828353e5a2e72", "score": "0.58712816", "text": "def is_subscribed?(podcastID)\n has_id = Subscription.where(\"user_id = ? AND podcast_id = ?\", current_user.id, podcastID)\n has_id.any?\n end", "title": "" }, { "docid": "6d671267c41d0fdf837c3e8ce8dd7270", "score": "0.5868012", "text": "def unsubscribed?\n @subscription.nil?\n end", "title": "" }, { "docid": "de4b3e47606a4ba70baaea09779e7b95", "score": "0.58464724", "text": "def has_link_to_subscribe?(options = {}) # TODO: which channel\n # TODO: might take as an option WHICH channel to subscribe to\n # in order to check if it's my own channel\n links.any?{|link| link.kind == :subscription}\n end", "title": "" }, { "docid": "261bcce1ec20195e7b729bf61f0c854b", "score": "0.58407086", "text": "def active_and_paying?\n (!canceled? and stripe_subscription_id.present?)\n end", "title": "" }, { "docid": "b694322e928e7d1f72235d7bd6189593", "score": "0.58365583", "text": "def subscription_successful?\n order_placed_online? && user_intakes.first.order.subscription_successful?\n end", "title": "" } ]
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "da140bff456d9701a1fb40fda5ef6acd", "score": "0.0", "text": "def set_hao\n @hao = Hao.find(params[:id])\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.6163163", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.6045976", "text": "def action_hook; end", "title": "" }, { "docid": "b8b36fc1cfde36f9053fe0ab68d70e5b", "score": "0.5946146", "text": "def run_actions; end", "title": "" }, { "docid": "3e521dbc644eda8f6b2574409e10a4f8", "score": "0.591683", "text": "def define_action_hook; end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.5890051", "text": "def actions; end", "title": "" }, { "docid": "bfb8386ef5554bfa3a1c00fa4e20652f", "score": "0.58349305", "text": "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end", "title": "" }, { "docid": "6c8e66d9523b9fed19975542132c6ee4", "score": "0.5776858", "text": "def add_actions; end", "title": "" }, { "docid": "9c186951c13b270d232086de9c19c45b", "score": "0.5703237", "text": "def callbacks; end", "title": "" }, { "docid": "9c186951c13b270d232086de9c19c45b", "score": "0.5703237", "text": "def callbacks; end", "title": "" }, { "docid": "6ce8a8e8407572b4509bb78db9bf8450", "score": "0.5652805", "text": "def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end", "title": "" }, { "docid": "1964d48e8493eb37800b3353d25c0e57", "score": "0.5621621", "text": "def define_action_helpers; end", "title": "" }, { "docid": "5df9f7ffd2cb4f23dd74aada87ad1882", "score": "0.54210985", "text": "def post_setup\n end", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.5411113", "text": "def action_methods; end", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.5411113", "text": "def action_methods; end", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.5411113", "text": "def action_methods; end", "title": "" }, { "docid": "c5904f93614d08afa38cc3f05f0d2365", "score": "0.5391541", "text": "def before_setup; end", "title": "" }, { "docid": "f099a8475f369ce73a38d665b6ee6877", "score": "0.53794575", "text": "def action_run\n end", "title": "" }, { "docid": "2c4e5a90aa8efaaa3ed953818a9b30d2", "score": "0.5357573", "text": "def execute(setup)\n @action.call(setup)\n end", "title": "" }, { "docid": "0464870c8688619d6c104d733d355b3b", "score": "0.53402257", "text": "def define_action_helpers?; end", "title": "" }, { "docid": "0e7bdc54b0742aba847fd259af1e9f9e", "score": "0.53394014", "text": "def set_actions\n actions :all\n end", "title": "" }, { "docid": "5510330550e34a3fd68b7cee18da9524", "score": "0.53321576", "text": "def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end", "title": "" }, { "docid": "97c8901edfddc990da95704a065e87bc", "score": "0.53124547", "text": "def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end", "title": "" }, { "docid": "4f9a284723e2531f7d19898d6a6aa20c", "score": "0.529654", "text": "def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end", "title": "" }, { "docid": "83684438c0a4d20b6ddd4560c7683115", "score": "0.5296262", "text": "def before_actions(*logic)\n self.before_actions = logic\n end", "title": "" }, { "docid": "210e0392ceaad5fc0892f1335af7564b", "score": "0.52952296", "text": "def setup_handler\n end", "title": "" }, { "docid": "a997ba805d12c5e7f7c4c286441fee18", "score": "0.52600986", "text": "def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end", "title": "" }, { "docid": "1d50ec65c5bee536273da9d756a78d0d", "score": "0.52442724", "text": "def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.52385926", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.52385926", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.52385926", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.52385926", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.52385926", "text": "def action; end", "title": "" }, { "docid": "635288ac8dd59f85def0b1984cdafba0", "score": "0.5232394", "text": "def workflow\n end", "title": "" }, { "docid": "e34cc2a25e8f735ccb7ed8361091c83e", "score": "0.523231", "text": "def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end", "title": "" }, { "docid": "78b21be2632f285b0d40b87a65b9df8c", "score": "0.5227454", "text": "def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end", "title": "" }, { "docid": "6350959a62aa797b89a21eacb3200e75", "score": "0.52226824", "text": "def before(action)\n invoke_callbacks *self.class.send(action).before\n end", "title": "" }, { "docid": "923ee705f0e7572feb2c1dd3c154b97c", "score": "0.52201617", "text": "def process_action(...)\n send_action(...)\n end", "title": "" }, { "docid": "b89a3908eaa7712bb5706478192b624d", "score": "0.5212327", "text": "def before_dispatch(env); end", "title": "" }, { "docid": "7115b468ae54de462141d62fc06b4190", "score": "0.52079266", "text": "def after_actions(*logic)\n self.after_actions = logic\n end", "title": "" }, { "docid": "d89a3e408ab56bf20bfff96c63a238dc", "score": "0.52050185", "text": "def setup\n # override and do something appropriate\n end", "title": "" }, { "docid": "62c402f0ea2e892a10469bb6e077fbf2", "score": "0.51754695", "text": "def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end", "title": "" }, { "docid": "72ccb38e1bbd86cef2e17d9d64211e64", "score": "0.51726824", "text": "def setup(_context)\n end", "title": "" }, { "docid": "b4f4e1d4dfd31919ab39aecccb9db1d0", "score": "0.51710224", "text": "def setup(resources) ; end", "title": "" }, { "docid": "1fd817f354d6cb0ff1886ca0a2b6cce4", "score": "0.5166172", "text": "def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end", "title": "" }, { "docid": "5531df39ee7d732600af111cf1606a35", "score": "0.5159343", "text": "def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end", "title": "" }, { "docid": "bb6aed740c15c11ca82f4980fe5a796a", "score": "0.51578903", "text": "def determine_valid_action\n\n end", "title": "" }, { "docid": "b38f9d83c26fd04e46fe2c961022ff86", "score": "0.51522785", "text": "def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end", "title": "" }, { "docid": "199fce4d90958e1396e72d961cdcd90b", "score": "0.5152022", "text": "def startcompany(action)\n @done = true\n action.setup\n end", "title": "" }, { "docid": "994d9fe4eb9e2fc503d45c919547a327", "score": "0.51518047", "text": "def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end", "title": "" }, { "docid": "62fabe9dfa2ec2ff729b5a619afefcf0", "score": "0.51456624", "text": "def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end", "title": "" }, { "docid": "faddd70d9fef5c9cd1f0d4e673e408b9", "score": "0.51398855", "text": "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end", "title": "" }, { "docid": "adb8115fce9b2b4cb9efc508a11e5990", "score": "0.5133759", "text": "def define_tasks\n define_weave_task\n connect_common_tasks\n end", "title": "" }, { "docid": "e1dd18cf24d77434ec98d1e282420c84", "score": "0.5112076", "text": "def setup(&block)\n define_method(:setup, &block)\n end", "title": "" }, { "docid": "3b4fb29fa45f95d436fd3a8987f12de7", "score": "0.5111866", "text": "def setup\n transition_to(:setup)\n end", "title": "" }, { "docid": "3b4fb29fa45f95d436fd3a8987f12de7", "score": "0.5111866", "text": "def setup\n transition_to(:setup)\n end", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.5110294", "text": "def action\n end", "title": "" }, { "docid": "f54964387b0ee805dbd5ad5c9a699016", "score": "0.5106169", "text": "def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend", "title": "" }, { "docid": "35b302dd857a031b95bc0072e3daa707", "score": "0.509231", "text": "def config(action, *args); end", "title": "" }, { "docid": "bc3cd61fa2e274f322b0b20e1a73acf8", "score": "0.50873137", "text": "def setup\n @setup_proc.call(self) if @setup_proc\n end", "title": "" }, { "docid": "5c3cfcbb42097019c3ecd200acaf9e50", "score": "0.5081088", "text": "def before_action \n end", "title": "" }, { "docid": "246840a409eb28800dc32d6f24cb1c5e", "score": "0.508059", "text": "def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end", "title": "" }, { "docid": "dfbcf4e73466003f1d1275cdf58a926a", "score": "0.50677156", "text": "def action\n end", "title": "" }, { "docid": "36eb407a529f3fc2d8a54b5e7e9f3e50", "score": "0.50562143", "text": "def matt_custom_action_begin(label); end", "title": "" }, { "docid": "b6c9787acd00c1b97aeb6e797a363364", "score": "0.5050554", "text": "def setup\n # override this if needed\n end", "title": "" }, { "docid": "9fc229b5b48edba9a4842a503057d89a", "score": "0.50474834", "text": "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "title": "" }, { "docid": "9fc229b5b48edba9a4842a503057d89a", "score": "0.50474834", "text": "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "title": "" }, { "docid": "fd421350722a26f18a7aae4f5aa1fc59", "score": "0.5036181", "text": "def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end", "title": "" }, { "docid": "d02030204e482cbe2a63268b94400e71", "score": "0.5026331", "text": "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end", "title": "" }, { "docid": "4224d3231c27bf31ffc4ed81839f8315", "score": "0.5022976", "text": "def after(action)\n invoke_callbacks *options_for(action).after\n end", "title": "" }, { "docid": "24506e3666fd6ff7c432e2c2c778d8d1", "score": "0.5015441", "text": "def pre_task\n end", "title": "" }, { "docid": "0c16dc5c1875787dacf8dc3c0f871c53", "score": "0.50121695", "text": "def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end", "title": "" }, { "docid": "c99a12c5761b742ccb9c51c0e99ca58a", "score": "0.5000944", "text": "def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end", "title": "" }, { "docid": "0cff1d3b3041b56ce3773d6a8d6113f2", "score": "0.5000019", "text": "def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end", "title": "" }, { "docid": "791f958815c2b2ac16a8ca749a7a822e", "score": "0.4996878", "text": "def setup_signals; end", "title": "" }, { "docid": "6e44984b54e36973a8d7530d51a17b90", "score": "0.4989888", "text": "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "title": "" }, { "docid": "6e44984b54e36973a8d7530d51a17b90", "score": "0.4989888", "text": "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "title": "" }, { "docid": "5aa51b20183964c6b6f46d150b0ddd79", "score": "0.49864885", "text": "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end", "title": "" }, { "docid": "7647b99591d6d687d05b46dc027fbf23", "score": "0.49797225", "text": "def initialize(*args)\n super\n @action = :set\nend", "title": "" }, { "docid": "67e7767ce756766f7c807b9eaa85b98a", "score": "0.49785787", "text": "def after_set_callback; end", "title": "" }, { "docid": "2a2b0a113a73bf29d5eeeda0443796ec", "score": "0.4976161", "text": "def setup\n #implement in subclass;\n end", "title": "" }, { "docid": "63e628f34f3ff34de8679fb7307c171c", "score": "0.49683493", "text": "def lookup_action; end", "title": "" }, { "docid": "a5294693c12090c7b374cfa0cabbcf95", "score": "0.4965126", "text": "def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end", "title": "" }, { "docid": "57dbfad5e2a0e32466bd9eb0836da323", "score": "0.4958034", "text": "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "title": "" }, { "docid": "5b6d613e86d3d68152f7fa047d38dabb", "score": "0.49559742", "text": "def release_actions; end", "title": "" }, { "docid": "4aceccac5b1bcf7d22c049693b05f81c", "score": "0.4954353", "text": "def around_hooks; end", "title": "" }, { "docid": "2318410efffb4fe5fcb97970a8700618", "score": "0.49535993", "text": "def save_action; end", "title": "" }, { "docid": "64e0f1bb6561b13b482a3cc8c532cc37", "score": "0.4952725", "text": "def setup(easy)\n super\n easy.customrequest = @verb\n end", "title": "" }, { "docid": "fbd0db2e787e754fdc383687a476d7ec", "score": "0.49467874", "text": "def action_target()\n \n end", "title": "" }, { "docid": "b280d59db403306d7c0f575abb19a50f", "score": "0.49423352", "text": "def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end", "title": "" }, { "docid": "9f7547d93941fc2fcc7608fdf0911643", "score": "0.49325448", "text": "def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end", "title": "" }, { "docid": "da88436fe6470a2da723e0a1b09a0e80", "score": "0.49282882", "text": "def before_setup\n # do nothing by default\n end", "title": "" }, { "docid": "17ffe00a5b6f44f2f2ce5623ac3a28cd", "score": "0.49269363", "text": "def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end", "title": "" }, { "docid": "21d75f9f5765eb3eb36fcd6dc6dc2ec3", "score": "0.49269104", "text": "def default_action; end", "title": "" }, { "docid": "3ba85f3cb794f951b05d5907f91bd8ad", "score": "0.49252945", "text": "def setup(&blk)\n @setup_block = blk\n end", "title": "" }, { "docid": "80834fa3e08bdd7312fbc13c80f89d43", "score": "0.4923091", "text": "def callback_phase\n super\n end", "title": "" }, { "docid": "f1da8d654daa2cd41cb51abc7ee7898f", "score": "0.49194667", "text": "def advice\n end", "title": "" }, { "docid": "99a608ac5478592e9163d99652038e13", "score": "0.49174926", "text": "def _handle_action_missing(*args); end", "title": "" }, { "docid": "9e264985e628b89f1f39d574fdd7b881", "score": "0.49173003", "text": "def duas1(action)\n action.call\n action.call\nend", "title": "" }, { "docid": "399ad686f5f38385ff4783b91259dbd7", "score": "0.49171105", "text": "def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end", "title": "" }, { "docid": "0dccebcb0ecbb1c4dcbdddd4fb11bd8a", "score": "0.4915879", "text": "def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end", "title": "" }, { "docid": "6e0842ade69d031131bf72e9d2a8c389", "score": "0.49155936", "text": "def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend", "title": "" } ]
81cae9baacc864bf90a39662a4b6516f
temporarily moves defender's pieces to try to block check
[ { "docid": "658ab15256bb55b42d0d9e1e60a8a3ee", "score": "0.0", "text": "def play_out_move(poss_move, player)\n player.new_spot = poss_move\n return unless player.valid_spot?\n player.move\n attack(player)\n end", "title": "" } ]
[ { "docid": "7fe279bc7f1fb0d2487acbb369f19c08", "score": "0.6211523", "text": "def run\n move\n check_must_attack\n end", "title": "" }, { "docid": "2822517852bde9387cf6ae8764b139e5", "score": "0.6060493", "text": "def greyout_blockers\n cut_behind(@selectable_region).each do |spc|\n if $game_temp.grid[0][spc].get_unit.is_a?(Game_Actor) && $game_temp.grid[0][spc].get_unit != BattleManager.actor\n @blocked = true unless $game_temp.grid[0][spc].get_unit.dead?\n $game_temp.grid[0][spc].get_unit.add_new_state(2)\n end\n end\n end", "title": "" }, { "docid": "82630922ed1b6e7c7ca8e4c58b722847", "score": "0.60061026", "text": "def set_action_none(battler)\n battler.movement = battler.step_foward = false\n $game_temp.forcing_battler = nil\n battler.action_done = true\n end", "title": "" }, { "docid": "2cc0c85f47e19ca4228ad6de80eae757", "score": "0.59313905", "text": "def cmd_defend\n @energy += 2 #restores user energy\n #if anything equipped and armor equipped\n if @world[:equipped] and @world[:equipped][:armor]\n puts \"You are defending with #{@world[:equipped][:armor]}\"\n enemy_attack(@world[:equipped][:armor].defense)\n else #nothing equipped\n puts \"You have nothing to defend with and are wide open for any attacks!\"\n enemy_attack\n end\n #check if user died from enemy attack\n if @world[:health] <= 0\n return FailureState.new\n else\n self\n end\n end", "title": "" }, { "docid": "52e049f852b764b0d5a62d93600c5507", "score": "0.5870903", "text": "def dealer_move\n stay = false\n until bust(cpu_hand) || blackjack?(p1_hand) || stay || bust(p1_hand)\n if value(cpu_hand) > 17\n puts \"Dealer stays with #{value(cpu_hand)}\"\n stay = true\n elsif value(cpu_hand) < 16\n puts \"Dealer hits\"\n cpu_hand << deck.draw\n dealer_ace(cpu_hand)\n dealer_hand\n end\n end\n end", "title": "" }, { "docid": "ba0ef6066c6d57b691d9aa8ef0ea0071", "score": "0.5847913", "text": "def act_normal\n if adjacent_to?(:enemy?)\n @warrior.bind! @enemies.pop\n elsif @d_captives.any?{|d| d.ticking?}\n free_ticking_captives\n else\n if !@friendly_captives.empty?\n free_captives\n else\n if adjacent_to?(:captive?)\n attack_slime\n else\n if can_hear?(:captive?)\n free_captives\n elsif can_hear?(:enemy?)\n attack_slime\n else\n move_to_exit\n end\n end\n end\n end\n end", "title": "" }, { "docid": "629ad6f5b2710eb98895451ff9fc51aa", "score": "0.5833755", "text": "def flee!(group)\n return if group.class != Group\n group.disown!(self)\n end", "title": "" }, { "docid": "825be947b59a7e90e1eb7e580d2dec9a", "score": "0.5787053", "text": "def all_dead?(check_only = false)\n return false if !check_only && !$game_system.allow_gameover?\n re = super() && ($game_party.in_battle || members.size > 0)\n @dead_confirm_timer = 0 if @dead_confirm_timer.nil?\n @dead_confirm_timer = re ? @dead_confirm_timer + 1 : 0\n BattleManager.send_flag(in_battle: true) if re\n return re && @dead_confirm_timer > 180\n end", "title": "" }, { "docid": "d919dce163229a83f8eb050e661670ad", "score": "0.5782509", "text": "def piece_drop!\n @cur_piece.move_down! while @cur_piece.can_be_set?\n @cur_piece.move_up!\n end", "title": "" }, { "docid": "8a6c30cae82a94da46f15890cc1164ee", "score": "0.5759323", "text": "def bring_to_life\n @dead=false\n end", "title": "" }, { "docid": "8be5161ef01b6c5994fe7a876d261cc3", "score": "0.5743938", "text": "def scared\n runaway(closest_corner(self.position(now)))\n\n enemy = target || nearest_enemy\n sweep_prep if enemy.nil? #manually override the radar settings from the update_radar method\n attack(enemy)\n end", "title": "" }, { "docid": "4ac8d51f6c38f452bbfd2ea3589cbe4f", "score": "0.57332456", "text": "def rescue_ticking\n each_direction do |dir|\n if @warrior.feel(dir).captive? && real_captive?(dir)\n @warrior.rescue!(dir)\n return true\n end\n end\n\n ticking_space = @listen.find(&:ticking?)\n return unless ticking_space\n\n dir = @warrior.direction_of(ticking_space)\n if @warrior.feel(dir).enemy?\n new_dir = empty_dir\n if new_dir && new_dir != OPOSITE_DIRS[@last_walk_dir]\n dir = new_dir\n else\n return true if detonate_bomb_to(dir)\n return true if shoot_to(dir)\n end\n end\n\n walk_to(dir)\n end", "title": "" }, { "docid": "e72ea1f51caca6ab5f5478e9e61a6483", "score": "0.5722781", "text": "def defend_strategy(board)\n \n ## Strengthen if Opponent gets 3 corners\n ## Stop him from getting 3 corners\n ## create a defense for it\n \n # On 1st Turn, Take 'Center' if open take it.\n move = \"5\" if !board.taken?(5) && board.turn_count == 1\n \n # CPU has Center FlowChart.\n if board.cells[4] == token \n \n # Cpu 2nd move should be a Side Move, unless you need to block\n if board.turn_count == 3 || board.turn_count == 5\n move = find_or_block_move(board)\n move = Game::SIDE_MOVES.sample.to_s if move == nil\n move\n end\n \n if board.turn_count >= 7\n move = find_or_block_move(board)\n end\n move\n end\n \n # Opponent has Center FlowChart.\n if board.cells[4] != token && board.cells[4] != \" \"\n \n # First move should be a corner.\n move = Game::CORNER_MOVES.sample.to_s if board.turn_count == 1\n \n # No way to Win unless a mistake is made, just block until tie, or mistake.\n move = find_or_block_move(board) if board.turn_count >= 3\n \n end\n # Final Return\n move\n end", "title": "" }, { "docid": "c22f49828904d01c23de6b482e067438", "score": "0.57067674", "text": "def process_combat_defeat(player)\n return if player.coords.values == GameData::DEFAULT_COORDS.values\n\n shifted_entity = @grid[GameData::DEFAULT_COORDS[:y]][GameData::DEFAULT_COORDS[:x]].entity\n player_location = player.coords\n @grid[GameData::DEFAULT_COORDS[:y]][GameData::DEFAULT_COORDS[:x]].entity = nil\n process_movement(player, GameData::DEFAULT_COORDS)\n process_movement(shifted_entity, player_location) unless shifted_entity.nil?\n end", "title": "" }, { "docid": "1d9137352186d012a34d05e314bc39f4", "score": "0.5702411", "text": "def bring_to_life\n @dead = false\n end", "title": "" }, { "docid": "1d9137352186d012a34d05e314bc39f4", "score": "0.5702411", "text": "def bring_to_life\n @dead = false\n end", "title": "" }, { "docid": "fdcc0c8adaeac50be9f96132e951d55a", "score": "0.5678167", "text": "def update_action\n # stop if force moving knockback or action doesn't exist\n return if @ai.state == BlizzABS::AI::Knockback || !@ai.act.valid?\n # decrease delay timer\n @ai.act.delay -= 1\n # if leader and counter expired and only sometimes\n if @ai.leader && @ai.act.ready? && rand(100) < 10\n # all minions\n @ai.minions.each {|b|\n # 50% chance if they have an action pending\n if b.ai.act.valid? && rand(2) == 0\n # force into action\n b.ai.act.delay = 0\n # 50% chance for same target\n b.ai.target = @ai.target if rand(2) == 0\n end}\n end\n # projectile evasion processing if attribute \"defensive\" is active\n $BlizzABS.AI.evade_projectiles(self) if @ai.defensive && @move_type != 3\n # if counter expired and either running away or defending\n if @ai.act.ready? && (@ai.act.escape? || @ai.act.defend?)\n # reset action\n self.reset_action\n # reset sprites\n self.reset_sprites\n end\n end", "title": "" }, { "docid": "de13da3fedd300f8c6de5fee9d78d566", "score": "0.5666772", "text": "def dealer_act\n if !@stayed_players.empty?() # if all players busted or blackjack, stop\n puts '----------------------- dealer\\'s turn -----------------------'\n display_hands(@dealer, @dealer.hand0) \n loop do\n if @dealer.hand0.values().max() <= 16\n puts 'dealer hit'\n @dealer.hand0 << @deck.draw()\n display_hands(@dealer, @dealer.hand0)\n if @dealer.hand0.blackjack?() \n # dealer blackjack, all remaining players lose\n puts 'dealer BLACKJACK!'\n @stayed_players.each do |player|\n player.hands.each do |hand|\n puts \"player %s, hand %d lose (dealer blackjack)\" %[player.name,\n hand.index]\n player.lose(hand.bet) \n end\n end\n elsif @dealer.hand0.bust?()\n puts 'dealer BUST!'\n return true\n end\n else\n puts 'dealer stay'\n return false\n end\n end\n end\n end", "title": "" }, { "docid": "179a47cf23b9f98d4c373aa6d77551d1", "score": "0.5660207", "text": "def blockers\n\n end", "title": "" }, { "docid": "6fb69685cbb831b9ce6f1ee5a4d2d5b9", "score": "0.5656053", "text": "def rescue_captive_action\n if far_off_captive?(0)\n warrior.rescue!\n elsif far_off_captive?(1)\n warrior.walk!\n elsif far_off_captive?(2)\n warrior.walk!\n end\n end", "title": "" }, { "docid": "6fb69685cbb831b9ce6f1ee5a4d2d5b9", "score": "0.5656053", "text": "def rescue_captive_action\n if far_off_captive?(0)\n warrior.rescue!\n elsif far_off_captive?(1)\n warrior.walk!\n elsif far_off_captive?(2)\n warrior.walk!\n end\n end", "title": "" }, { "docid": "4b65c20ca3cebf7c8bfb43e3feeb0d29", "score": "0.56508774", "text": "def drop_all_the_way\n if @game.is_running?\n ran = @current_block.drop_by_one\n @current_pos.each{|block| block.remove}\n while ran\n @score += 1\n ran = @current_block.drop_by_one\n end\n draw\n store_current\n if !game_over?\n next_piece\n end\n @game.update_score\n draw\n end\n end", "title": "" }, { "docid": "292abd01d1357d37525db504f196e70f", "score": "0.565003", "text": "def race()\n while not next_to_a_beeper?() \n move()\n end\n pick_beeper()\n turn_off()\n end", "title": "" }, { "docid": "1371428a74e5aaf692c15ef2310dd3f6", "score": "0.56339556", "text": "def cpu_prevent\n current_turn = @state[:turn]\n @state[:turn] = current_turn == PLAYER_1_TURN ? PLAYER_2_TURN : PLAYER_1_TURN # pretend to be other player\n (0..(@state[:board_columns] - 1)).each do |c|\n token_placed = board_place_token(c)\n if game_result != NO_RESULT_YET\n board_remove_token(c) # remove the winning move\n @state[:turn] = current_turn # change back\n place_token(c) # place token to block\n return true\n elsif token_placed # make sure token was placed before force delete\n board_remove_token(c)\n end\n end\n @state[:turn] = current_turn # remember to switch back\n false\n end", "title": "" }, { "docid": "346adf4afe6e3e8e7c39d40712b62333", "score": "0.5624978", "text": "def king_would_remain_safe\n restore_state_after do\n not exposes_king_to_check?\n end\n end", "title": "" }, { "docid": "5ad648f88e941ca2e8d9dbf2d225fef6", "score": "0.5620623", "text": "def allowed_to_kick(m, target) # rubocop:disable all\n binding.pry if @chatty # rubocop:disable all\n if @protected.include? target\n m.channel.kick m.user.nick, \"Cool down, #{m.user.nick}, you're trying some abuse, here.\"\n return false\n end\n if @punished.detect { |p| p.match m.user.nick }\n m.channel.kick m.user.nick, 'You have lost this privilege, please stop.'\n return false\n end\n kicker = m.user\n auth_user = bot.config.authentication.logged_in.detect { |(k, _v)| k == kicker }\n return false unless auth_user\n return true if kicker.nick == 'xartet'\n\n kickee = nick_to_user(m.channel, target)\n unless kickee\n if @chatty\n kicker.msg \"#{target} is gone or changed nicks\"\n else\n m.reply \"#{target} is gone or changed nicks\"\n end\n return false\n end\n kickee_user = current_user(OpenStruct.new(user: kickee.first))\n binding.pry if @chatty # rubocop:disable Lint/Debugger\n if kickee.last.include?('v') || (kickee_user && kickee_user.level == 'subop')\n m.reply \"#{kicker.nick}: Battle initiated with #{target}\" if @chatty # rubocop:disable Metrics/LineLength\n return voice_versus_voice(m, kicker, kickee)\n end unless authenticated?(m, :admins)\n binding.pry if @chatty\n if kickee.last.include?('o') || (kickee_user && kickee_user.level == 'admin')\n if @chatty\n m.reply \"#{m.user}: #{auth_user.level} Can't kick an op: #{kickee.first}\"\n else\n kicker.msg \"#{m.user}: #{auth_user.level} Can't kick an op: #{kickee.first}\"\n end\n m.channel.kick \"#{kicker.nick}\", \"Lost battle to #{target}'s impenetrable '@' defense\"\n return false\n end\n binding.pry if @chatty\n @protected << target\n Timer(30, shots: 1) { @protected.delete target }\n auth_user\n end", "title": "" }, { "docid": "a3b2b4ff167800374b3fd755bd49a69b", "score": "0.56181103", "text": "def grow_unblocked_moves_in_dir(dx,dy) #private\n #dx = difference in x\n available = []\n #dy = difference in y\n x, y = self.pos \n #cants : \n if self.color == new_pos.color\n \"invalid pos\" \n end \n #cans :\n if self.color != new_pos.color\n self.pos = new\n #takes in position \n #check if own piece\n #check if enemy piece\n #will return array of available/possible positions\n\n end\n\nend", "title": "" }, { "docid": "574e7c4c8f69706edf550a621e699af0", "score": "0.5617094", "text": "def claim_blocks\n @piece_order.each(@in_fuseki, @peers.length) do |i|\n p = @package.pieces[i]\n next if p.complete?\n# rt_debug \"+ considering piece #{p}\"\n if @in_endgame\n p.each_empty_block(BLOCK_SIZE) { |b| yield b }\n else\n p.each_unclaimed_block(BLOCK_SIZE) do |b|\n if yield b\n p.claim_block b\n return if @in_fuseki # fuseki shortcut\n end\n end\n end\n end\n end", "title": "" }, { "docid": "7b3a1c0aa81c879518831c23fd95270f", "score": "0.56137955", "text": "def remaining; end", "title": "" }, { "docid": "7b3a1c0aa81c879518831c23fd95270f", "score": "0.56137955", "text": "def remaining; end", "title": "" }, { "docid": "7b3a1c0aa81c879518831c23fd95270f", "score": "0.56137955", "text": "def remaining; end", "title": "" }, { "docid": "186e972ec73a37ddcffbcb3ff4e3c4c6", "score": "0.5613711", "text": "def disband\n\t\t$logger.info \"Disbanding #{ self }\"\n\t\tleader = nil\n\t\t@ants.each do |a|\n\t\t\tif leader.nil?\n\t\t\t\tleader = a\n\t\t\t\ta.clear_orders\n\t\t\t\ta.collective = nil\n\t\t\telse\n\t\t\t\ta.collective = nil\n\t\t\t\ta.remove_target_from_order leader\n\t\t\tend\n\t\tend\n\n\t\t@ants = []\n\n\t\t# Collective doesn't exist any more. Skip any other statements\n\t\t$logger.info \"Doing throw because collective disbanded.\"\n\t\tthrow :done\n\tend", "title": "" }, { "docid": "785daaa7486a71e373d4a0b46f397bce", "score": "0.5611249", "text": "def run \n ran = @current_block.drop_by_one\t\n if !ran\n store_current\t \n if !game_over? \n\t\tif @cheat\n\t\t special_piece\n\t\telse\n\t\t\tnext_piece\n\t\tend\n end\n end\n @game.update_score\n draw\n end", "title": "" }, { "docid": "2e0c29aa866e93a0c7a7f162fe5f855b", "score": "0.55995864", "text": "def insure_paths_to_enemy_bases_not_blocked\n # assume the unit is not a capturer\n raise \"insure_paths_to_enemy_bases_not_blocked called for a CAPTURER\" if CAPTURERS.include?(@type)\n return false if surrounded_by?(6, @game.units)\n capturers = @game.my_capturers\n return false if capturers.size == 0\n return false if @game.enemy_bases.size == 0\n # take the nearest capturer, calcul its path to nearest base\n # if blocked, move away from base\n n = nearest(capturers, []) # no exclusions\n path_size = shortest_path(n, []).size\n return false if path_size > n.speed(1)-2 # -2 to let space to go away\n b = nearest(@game.enemy_bases, []) # no exclusions\n path = n.shortest_path(b, [])\n if path.include?(@hex)\n puts \"! moving away from #{b} as #{n} could go to it dist_between(n)=#{dist_between(n)}\"\n return move_away_from([b])\n end\n false\n end", "title": "" }, { "docid": "7aa84e9da754c2bcf401ab3c3d4e4c1e", "score": "0.55753684", "text": "def test_move_invalid_blocked_by_own_piece\n\t\tboard = ChessBoard.create_empty\n\t\tpawny = Pawn.new board, :black, 'c', 1\n\t\ttest_me = Rook.new board, :black, 'a', 1\n\t\tboard << test_me\n\t\tboard << pawny\n\t\tblack_king = King.new board, :black, 'g', 3\n\t\twhite_king = King.new board, :white, 'g', 5\n\t\tboard << black_king\n\t\tboard << white_king\n\n\t\tassert !test_me.move_valid?('c', 1)\n\tend", "title": "" }, { "docid": "8848847633bb2b4506ef1534099bae05", "score": "0.55705184", "text": "def king_legal_moves\n legal_moves\n get_castling_moves\n @legal_moves -= enemy_possible_check_moves\n end", "title": "" }, { "docid": "db505e7cba25e9d35e0cdc2ae1265b1b", "score": "0.55553305", "text": "def checkmate?\n\t\t# check = check?(@board.state)\n\t\t# return false if !check\n\t\tthreatened_space = @board.legal_moves(@other_player,@board.state)\n\t\tking = @current_player.pieces.select{|piece| piece.name == :king}.first\n\t\tking_moves = @board.legal_move(king,@board.state)\n\t\toverlap = Array.new(@board.empty_state)\n\t\tfor i in 0..7\n\t\t\tfor j in 0..7\n\t\t\t\toverlap[i][j] = king_moves[i][j] && threatened_space[i][j]\n\t\t\tend\n\t\tend\n\t\tking_stuck = overlap == king_moves\n\t\treturn false if !king_stuck\n\n\t\tthreatening_pieces = []\n\t\t@other_player.pieces.each {|piece|\n\t\t\tif @board.legal_move(piece,@board.state)[king.position.x-1][king.position.y-1]\n\t\t\t\tthreatening_pieces << piece\n\t\t\tend\n\t\t}\n\t\tif threatening_pieces.length == 0\n\t\t\treturn false\n\t\t#Single check: Any other piece can move/capture\n\t\telsif threatening_pieces.length == 1\n\t\t\tthreatening_piece = threatening_pieces.pop\n\t\t\tpos = threatening_piece.position\n\t\t\tdefending_pieces = []\n\t\t\t@current_player.pieces.each {|piece|\n\t\t\tif @board.legal_move(piece,@board.state)[pos.x-1][pos.y-1]\n\t\t\t\tdefending_pieces << piece\n\t\t\tend\n\t\t\t}\n\t\t\t# defending_pieces.each {|piece|\n\t\t\t# \tputs \"#{piece.name}. #{piece.position.x},#{piece.position.y}\"\n\t\t\t# }\n\t\t\t#loop over defending pieces and check if there is one that can remove the threatening piece\n\t\t\t#without leaving the king in check.\n\t\t\tnot_savable = true\n\t\t\twhile not_savable && !defending_pieces.empty?\n\t\t\t\tpiece = defending_pieces.pop\n\t\t\t\thypothetical_state = Marshal.load(Marshal.dump(@board.state))\n\t\t\t\tbegin\n\t\t\t\t\t#if this move leaves the king in check, an error is thrown.\n\t\t\t\t\t# puts \"#{threatening_piece.name}. #{threatening_piece.position.x},#{threatening_piece.position.y}\"\n\t\t\t\t\t@board.move_piece(hypothetical_state,piece.position,threatening_piece.position)\n\t\t\t\t\t#if not, the king can be saved.\n\t\t\t\t return false\n\t\t\t\trescue\n\t\t\t\tend\n\t\t\tend\n\t\t\treturn not_savable\n\t\t#Double check (>1): Only king can move/capture\n\t\telse\n\t\t\tking = @current_player.pieces.select{|piece| piece.name == :king}\n\t\t\tthreatening_pieces.each{|threat|\n\t\t\t\thypothetical_state = Marshal.load(Marshal.dump(@board.state))\n\t\t\t\tif legal_move(king)[threat.position.x-1][threat.position.y-1]\n\t\t\t\t\tbegin\n\t\t\t\t\t\t#if this move leaves the king in check, an error is thrown.\n\t\t\t\t\t\t@board.move_piece(hypothetical_state,king.position,threat.position)\n\t\t\t\t\t\t#if not, the king can be saved.\n\t\t\t\t\t\treturn false\n\t\t\t\t\trescue\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\t}\n\t\t\treturn true\n\t\tend\n\tend", "title": "" }, { "docid": "e4e2a8d7625a729cec11894437eb5bdb", "score": "0.55547595", "text": "def process_move\n\t\tblock_successful = false\n\t\t\n\t\tbegin\n\t\t\tdebug \"Action #{@id}: Processing #{@type}, listening for block (#{ActionGracePeriodSeconds}s)...\"\n\n\t\t\tstatus = Timeout::timeout(ActionGracePeriodSeconds) {\n\t\t\t while true do \n\t\t\t \t@fight.reload # reload the instance variable from the database to ensure we catch any changes to fight_actions\n\t\t\t \t\n\t\t\t \t# check for a move by the other user\n\t\t\t \tblock_successful = true if @fight.fight_actions.last.from == @to.user_name\n\t\t\t \tsleep 1\n\t\t\t end\n\t\t\t}\n\n\t\t\tdebug \"Action #{@id}: Finished waiting for block.\"\n\n\t\trescue Timeout::Error\n\t\t\t# intentional stub; we're really looking to pass through to ensure\n\t\t\tdebug \"Action #{@id}: Timeout. Block successful: #{block_successful}\"\n\n\t\tensure\n\t\t\tunless block_successful\n\t\t\t\treset_pending_move\n\t\t\t\treturn Moves.__send__(@type.to_sym, @fight, @from, @to) # execute a move\n\t\t\tend\t\t\t\n\n\t\tend\n\tend", "title": "" }, { "docid": "09c85101eea410b883b5352bc80f0084", "score": "0.55485976", "text": "def drop_all_the_way\n if @game.is_running?\n ran = @current_block.drop_by_one\n @current_pos.each{|block| block.remove}\n acc = 0 # init accumulator to count how many points were scored\n while ran\n \tacc += 1\n ran = @current_block.drop_by_one\n end\n @score += acc\n draw\n @game.put_message('+' + acc.to_s)\n store_current\n if !game_over?\n next_piece\n end\n @game.update_score\n draw\n end\n end", "title": "" }, { "docid": "1187f2ffcae573685b4551ca02c277b4", "score": "0.5544897", "text": "def set_default_collision_func(&block); end", "title": "" }, { "docid": "1187f2ffcae573685b4551ca02c277b4", "score": "0.5544897", "text": "def set_default_collision_func(&block); end", "title": "" }, { "docid": "fa08452197ead6baa10149c67220c677", "score": "0.5537819", "text": "def despatched?\n not waiting_pickup?\n end", "title": "" }, { "docid": "2bf94f6121c5c579c68677653e030780", "score": "0.55326307", "text": "def reset_target_position(battler)\n battler.wait_time = 16 if battler.lifted\n for target in battler.target_battlers + [battler]\n target.freeze = false\n target.rising = false\n target.rised = false\n target.lifted = false\n target.lifting = false\n target.heavy_fall = 0\n target.dmgwait = 0\n end\n end", "title": "" }, { "docid": "cf3c1e4475258414ed87e5371d9b065a", "score": "0.5525858", "text": "def check_for_defeated_armies\n loser_army = $game_map.army.find{|army| next if army.nil? ; army.lost_battle}\n if loser_army != nil\n case loser_army.id\n when 1 then p \"Player 1/Orange Star lost\"\n when 2 then p \"Player 2/Blue Moon lost\"\n when 3 then p \"Player 3/Green Earth lost\"\n when 4 then p \"Player 4/Yellow Comet lost\"\n end\n # If there are at least 2 armies remaining\n if $game_map.army.compact.size > 2\n # If routed\n if loser_army.lost_battle == 1\n while loser_army.owned_props.size > 0\n loser_army.owned_props[0].army = 0\n end\n # If HQ captured\n elsif loser_army.lost_battle == 2\n loser_army.units.each{|unit| unit.destroy}\n # Assign all owned properties to the capturer\n while loser_army.owned_props.size > 0\n loser_army.owned_props[0].army = @player\n end\n end\n # Set this army to nil so it will no longer be evaluated\n $game_map.army[loser_army.id-1] = nil\n # If lost on own turn, then advance to next player's turn\n @phase = 7 if loser_army == @player\n else\n winner_army = $game_map.army.compact[0]\n case winner_army.id\n when 1 then p \"Player 1/Orange Star wins!\"\n when 2 then p \"Player 2/Blue Moon wins!\"\n when 3 then p \"Player 3/Green Earth wins!\"\n when 4 then p \"Player 4/Yellow Comet wins!\"\n end\n # Closes the game...for now\n $scene = nil\n end\n end\n end", "title": "" }, { "docid": "6aab8241efeedcdd5468b39cd16d48bf", "score": "0.55227375", "text": "def perform_not_spam(performed_by, _args)\n bouncer.submit_feedback(target, \"ham\")\n log_confirmation(performed_by, \"confirmed_ham\")\n\n successful_transition :rejected, :disagreed\n end", "title": "" }, { "docid": "200e344d98d28a4b746e91cd61c7350f", "score": "0.55220306", "text": "def halted=(_); end", "title": "" }, { "docid": "7eb711e7b20e6035f06bd491d01d18d6", "score": "0.55129725", "text": "def follower_attack\n enemy = @abs_target.character\n if enemy.nil? || enemy.battler.nil? || enemy.battler.dead?\n @is_fighting = false\n return false\n end\n\n if (@autoattack && @follower_combo[0])\n if (@follower_combo[1] > 0)\n @follower_combo[1] -= 1\n return true\n end\n dx = (@real_x - enemy.real_x).abs\n dy = (@real_y - enemy.real_y).abs\n sequence = PRABS::HERO.get_sequence(@battler.id, @battler.weapon_id, 0)[0]\n offset_x = sequence.nil? ? nil : sequence[5]\n if dx + dy <= 256 + (offset_x.nil? ? 0 : offset_x * 256)\n target_attack(enemy, @follower_combo[2])\n if (rand(@combo_max * 2) <= (@combo_max - @follower_combo[2] + 1) && @follower_combo[2] < @combo_max)\n @follower_combo[1] = rand(10) + 10\n @follower_combo[2] += 1\n else\n @follower_combo = [false, 0, 1]\n end\n @abs_wait = 40 + (@follower_combo[2] * 15)\n return true\n end\n end\n\n if @abs_wait > 0\n @abs_wait -= 1\n return true\n end\n\n return false\n end", "title": "" }, { "docid": "ef71223c3787323896f6e99cf0e34a06", "score": "0.5509579", "text": "def pickup(roomfloor, player, bodified, &block)\n if roomfloor.detect{|item| item == bodified }\n then roomfloor.reject!{|item| item == bodified}\n player.pinventory.unshift(bodified)\n yield\n else \n puts \"THERE IS NO #{bodified.upcase} ON THE FLOOR! THERE IS NO #{bodified.upcase} ON THE FLOOR!\"\n end\nend", "title": "" }, { "docid": "ea790bc2bd3b76c8fa43f9bff19d2fbe", "score": "0.5508724", "text": "def move_action_waiting\n @move_actions.size > 0\n end", "title": "" }, { "docid": "0efc566f2a606dc65596ec914fb15032", "score": "0.5501006", "text": "def perform_not_spam(performed_by, _args)\n bouncer.submit_feedback(target, 'ham')\n log_confirmation(performed_by, 'confirmed_ham')\n\n successful_transition :rejected, :disagreed\n end", "title": "" }, { "docid": "9e8c8166864eb35d72976105098e68bb", "score": "0.54997253", "text": "def throw_away!; end", "title": "" }, { "docid": "b6b443887d515cfdaf95fcc4b8064f59", "score": "0.5494623", "text": "def check_for_defeated_armies\n loser_army = $game_map.army.find{|army| next if army.nil? ; army.lost_battle}\n if loser_army != nil\n case loser_army.id\n when 1 then p \"Player 1/Orange Star lost\"\n when 2 then p \"Player 2/Blue Moon lost\"\n when 3 then p \"Player 3/Green Earth lost\"\n when 4 then p \"Player 4/Yellow Comet lost\"\n end\n # If there are at least 2 armies remaining\n if $game_map.army.count{|x| !x.nil?} > 2\n # If routed\n if loser_army.lost_battle == 1\n while loser_army.owned_props.size > 0\n loser_army.owned_props[0].army = 0\n end\n # If HQ captured\n elsif loser_army.lost_battle == 2\n loser_army.units.each{|unit| unit.destroy}\n # Assign all owned properties to the capturer\n while loser_army.owned_props.size > 0\n loser_army.owned_props[0].army = @player_turn\n end\n end\n # Set this army to nil so it will no longer be evaluated\n $game_map.army[loser_army.id-1] = nil\n # If lost on own turn, then advanced to next player's turn\n @phase = 7 if loser_army == @player_turn\n else\n winner_army = $game_map.army.find{|army| !army.nil?}\n case winner_army.id\n when 1 then p \"Player 1/Orange Star wins!\"\n when 2 then p \"Player 2/Blue Moon wins!\"\n when 3 then p \"Player 3/Green Earth wins!\"\n when 4 then p \"Player 4/Yellow Comet wins!\"\n end\n # Closes the game...for now\n $scene = nil\n end\n end\n end", "title": "" }, { "docid": "567ec35a64571b67d126b6e9d778453b", "score": "0.5490704", "text": "def after_action\n refill_train_deck_from_discards! if train_deck.empty?\n\n discard_available_train_cards! if three_available_train_cards_are_wild?\n\n replenish_available_cards\n end", "title": "" }, { "docid": "b94e717286202ceb764641aabe68ca2e", "score": "0.5490588", "text": "def defense(board)\n defense_move = win_combo(board, self.other_token)\n if defense_move \n puts \"prevented a win #{defense_move}\"\n defense_move.find { |i| !board.taken?(i + 1)}\n end\n end", "title": "" }, { "docid": "f117b91695174c9897cd97642a3c6870", "score": "0.548997", "text": "def check_faint\n return if !$game_switches[Following_Activated_Switch] || $Trainer.party.length<=0\n if $PokemonGlobal.bicycle\n return\n elsif $PokemonGlobal.diving && WATERPOKEMONCANDIVE && $Trainer.party[0].hasType?(:WATER)\n return\n elsif $PokemonGlobal.surfing && WATERPOKEMONCANSURF && $Trainer.party[0].hasType?(:WATER)\n return\n elsif $PokemonGlobal.surfing && ALWAYS_ANIMATED_CAN_SURF && ($Trainer.party[0].hasType?(:FLYING) || \n isConst?($Trainer.party[0].ability,PBAbilities,:LEVITATE) ||\n ALWAYS_ANIMATED_FOLLOWERS.include?($Trainer.party[0].species)) &&\n !(ALWAYS_ANIMATED_EXCEPTION.include?($Trainer.party[0].species))\n return\n else\n if $Trainer.party[0].hp<=0 \n $game_variables[Current_Following_Variable]=0 \n remove_sprite\n elsif $Trainer.party[0].hp>0 && !$Trainer.party[0].isEgg? && $game_variables[Current_Following_Variable]==0 \n $game_variables[Current_Following_Variable]=$Trainer.party[0]\n refresh_sprite\n end \n end\nend", "title": "" }, { "docid": "d515df8d030ca64d8189d24d26821f80", "score": "0.5489095", "text": "def bringToLife\n @dead = false\n end", "title": "" }, { "docid": "e12f7e85022781847f7d69e87c71c380", "score": "0.5484418", "text": "def bringToLife\n @dead = false\n end", "title": "" }, { "docid": "ca3a8e82551e28c682c79083ad9289e5", "score": "0.5482985", "text": "def minkoff_delay_off\n if MNK_AT_DELAY \n # Fomar's Action Cost Detection\n if $game_system.mnk_det_acb_detect\n for actor in $game_party.actors\n actor.vitality = 1\n end\n for enemy in $game_troop.enemies\n enemy.vitality = 1\n end\n end\n # Trickster's AT Detection\n if $game_system.mnk_det_abs_detect\n for actor in $game_party.actors\n actor.at_bonus = [1,0]\n end\n for enemy in $game_troop.enemies\n enemy.at_bonus = [1,0]\n end\n end\n # Cogwheel RTAB Detection\n @rtab_wait_flag = false if $game_system.mnk_det_rtab_systm\n end\n end", "title": "" }, { "docid": "f9786f57ca64847745ba2e92a2bb8996", "score": "0.54822874", "text": "def hunt_down_enemy\n if @energy.to_f / $config['max_energy'].to_f >= (@mode == 'collect_batteries' ? HYST_ENERGY_FRACTION : MIN_ENERGY_FRACTION) &&\n @health.to_f / $config['max_health'].to_f >= MIN_HEALTH_FRACTION\n @mode = \"hunt_down_enemy\"\n move_toward @enemy\n end\n end", "title": "" }, { "docid": "2d7f94518f80252dc963de498c543528", "score": "0.54747295", "text": "def do_auto_recovery\n #if auto_hp_recover and not dead?\n # self.hp += maxhp / 20\n #end\n end", "title": "" }, { "docid": "4a242a19a2ed786b9b20687f5902ce0e", "score": "0.5471035", "text": "def phase_decision\n unless cursor.moving?\n if Input.trigger?(Input::C)\n @confirm_choice = true\n elsif Input.trigger?(Input::B)\n @cancel_choice = true\n $game_system.se_play($data_system.cancel_se)\n end\n end\n Config.play_se(\"target\") if (@action == \"Fire\" and @zones[cursor.x, cursor.y].is_a?(MoveTile) and Input.dir4 != 0)\n # Update arrow path\n @arrow_path.each{|i| i.update}\n # Update @zones tiles\n @locations.each{|tile| tile.update}\n # If player pressed \"C\"\n if @confirm_choice\n @confirm_choice = false\n # If launching a missile silo\n if @action == \"Launch\"\n cursor.character_name = \"cursor\"\n # Remove the unit command window\n @unit_command_window.dispose\n @unit_command_window = nil\n # Prepare unit for moving\n process_movement\n # Reset values\n # @locations.each{|tile| tile.dispose}\n \n #TESTING\n @locations.each{|tile| tile.visible = false}\n \n @locations = []\n @zones = []\n elsif @zones[cursor.x][cursor.y].is_a?(MoveTile)#.include?([cursor.x, cursor.y]) kk20\n # If the action is to attack a unit or structure\n if @action == \"Fire\"\n @target_unit = $game_map.get_unit(cursor.x, cursor.y)\n if @target_unit.nil?\n @target_unit = $game_map.get_tile(cursor.x, cursor.y)\n end\n # The action is to drop a unit\n else\n if @action == \"Drop\"\n if @decided_spot_x - cursor.x == 1 #left\n @drop_dir_1 = [4]\n elsif @decided_spot_x - cursor.x == -1 #right\n @drop_dir_1 = [6]\n elsif @decided_spot_y - cursor.y == 1 #up\n @drop_dir_1 = [8]\n elsif @decided_spot_y - cursor.y == -1 #down\n @drop_dir_1 = [2]\n end\n elsif @action == \"Drop \"\n if @decided_spot_x - cursor.x == 1 #left\n @drop_dir_2 = [4]\n elsif @decided_spot_x - cursor.x == -1 #right\n @drop_dir_2 = [6]\n elsif @decided_spot_y - cursor.y == 1 #up\n @drop_dir_2 = [8]\n elsif @decided_spot_y - cursor.y == -1 #down\n @drop_dir_2 = [2]\n end\n end\n # Is this the first unit being dropped? Or the second?\n if @first_drop_unit.nil?\n if @action == \"Drop\"\n @first_drop_unit = @selected_unit.holding_units[0]\n else\n @first_drop_unit = @selected_unit.holding_units[1]\n end\n else\n if @action == \"Drop\"\n @second_drop_unit = @selected_unit.holding_units[0]\n else\n @second_drop_unit = @selected_unit.holding_units[1]\n end\n end\n # For the next conditional line\n if @action == \"Drop\"\n direction = @drop_dir_1\n else\n direction = @drop_dir_2\n end\n # If there is still another unit that can be dropped and there is\n # space for it to be dropped.\n if @unit_command_window.two_drop_commands and @second_drop_unit.nil? and can_drop_second?(@selected_unit, direction)\n Config.play_se(\"decide\")\n @unit_command_window.new_commands\n @phase = 6\n @unit_command_window.index = 0\n @unit_command_window.visible = true\n # @locations.each{|tile| tile.dispose}\n \n \n #TESTING\n @locations.each{|tile| tile.visible = false}\n \n @locations = []\n @zones = []\n return\n end\n end\n # Remove the unit command window\n @unit_command_window.dispose\n @unit_command_window = nil\n # Prepare unit for moving\n process_movement\n # Reset values\n # @locations.each{|tile| tile.dispose}\n \n \n #TESTING\n @locations.each{|tile| tile.visible = false}\n \n @locations = []\n @zones = []\n else\n $game_system.se_play($data_system.buzzer_se)\n end\n end\n # If player pressed \"B\"\n if @cancel_choice\n cursor.character_name = \"cursor\"\n @cancel_choice = false\n # Dispose the zones\n # @locations.each{|tile| tile.dispose}\n \n #TESTING\n @locations.each{|tile| tile.visible = false}\n \n @locations = []\n @zones = []\n # Return the cursor to the spot where the unit was decided to move to\n cursor.moveto(@decided_spot_x, @decided_spot_y)\n # Show unit command window and move range again. Action is now nil.\n x = (cursor.real_x - $game_map.display_x) / 4\n x -= (@unit_command_window.width/2 - 16)\n y = (cursor.real_y - $game_map.display_y) / 4\n @unit_command_window.set_at(x, y)\n @unit_command_window.visible = true\n # Update @ranges\n @ranges.each{|i| i.update}\n show_move_ranges if @first_drop_unit.nil?\n # Update arrow path\n @arrow_path.each{|i| i.update}\n @action = nil\n # Back to phase 6\n @phase = 6\n end\n end", "title": "" }, { "docid": "4a242a19a2ed786b9b20687f5902ce0e", "score": "0.5471035", "text": "def phase_decision\n unless cursor.moving?\n if Input.trigger?(Input::C)\n @confirm_choice = true\n elsif Input.trigger?(Input::B)\n @cancel_choice = true\n $game_system.se_play($data_system.cancel_se)\n end\n end\n Config.play_se(\"target\") if (@action == \"Fire\" and @zones[cursor.x, cursor.y].is_a?(MoveTile) and Input.dir4 != 0)\n # Update arrow path\n @arrow_path.each{|i| i.update}\n # Update @zones tiles\n @locations.each{|tile| tile.update}\n # If player pressed \"C\"\n if @confirm_choice\n @confirm_choice = false\n # If launching a missile silo\n if @action == \"Launch\"\n cursor.character_name = \"cursor\"\n # Remove the unit command window\n @unit_command_window.dispose\n @unit_command_window = nil\n # Prepare unit for moving\n process_movement\n # Reset values\n # @locations.each{|tile| tile.dispose}\n \n #TESTING\n @locations.each{|tile| tile.visible = false}\n \n @locations = []\n @zones = []\n elsif @zones[cursor.x][cursor.y].is_a?(MoveTile)#.include?([cursor.x, cursor.y]) kk20\n # If the action is to attack a unit or structure\n if @action == \"Fire\"\n @target_unit = $game_map.get_unit(cursor.x, cursor.y)\n if @target_unit.nil?\n @target_unit = $game_map.get_tile(cursor.x, cursor.y)\n end\n # The action is to drop a unit\n else\n if @action == \"Drop\"\n if @decided_spot_x - cursor.x == 1 #left\n @drop_dir_1 = [4]\n elsif @decided_spot_x - cursor.x == -1 #right\n @drop_dir_1 = [6]\n elsif @decided_spot_y - cursor.y == 1 #up\n @drop_dir_1 = [8]\n elsif @decided_spot_y - cursor.y == -1 #down\n @drop_dir_1 = [2]\n end\n elsif @action == \"Drop \"\n if @decided_spot_x - cursor.x == 1 #left\n @drop_dir_2 = [4]\n elsif @decided_spot_x - cursor.x == -1 #right\n @drop_dir_2 = [6]\n elsif @decided_spot_y - cursor.y == 1 #up\n @drop_dir_2 = [8]\n elsif @decided_spot_y - cursor.y == -1 #down\n @drop_dir_2 = [2]\n end\n end\n # Is this the first unit being dropped? Or the second?\n if @first_drop_unit.nil?\n if @action == \"Drop\"\n @first_drop_unit = @selected_unit.holding_units[0]\n else\n @first_drop_unit = @selected_unit.holding_units[1]\n end\n else\n if @action == \"Drop\"\n @second_drop_unit = @selected_unit.holding_units[0]\n else\n @second_drop_unit = @selected_unit.holding_units[1]\n end\n end\n # For the next conditional line\n if @action == \"Drop\"\n direction = @drop_dir_1\n else\n direction = @drop_dir_2\n end\n # If there is still another unit that can be dropped and there is\n # space for it to be dropped.\n if @unit_command_window.two_drop_commands and @second_drop_unit.nil? and can_drop_second?(@selected_unit, direction)\n Config.play_se(\"decide\")\n @unit_command_window.new_commands\n @phase = 6\n @unit_command_window.index = 0\n @unit_command_window.visible = true\n # @locations.each{|tile| tile.dispose}\n \n \n #TESTING\n @locations.each{|tile| tile.visible = false}\n \n @locations = []\n @zones = []\n return\n end\n end\n # Remove the unit command window\n @unit_command_window.dispose\n @unit_command_window = nil\n # Prepare unit for moving\n process_movement\n # Reset values\n # @locations.each{|tile| tile.dispose}\n \n \n #TESTING\n @locations.each{|tile| tile.visible = false}\n \n @locations = []\n @zones = []\n else\n $game_system.se_play($data_system.buzzer_se)\n end\n end\n # If player pressed \"B\"\n if @cancel_choice\n cursor.character_name = \"cursor\"\n @cancel_choice = false\n # Dispose the zones\n # @locations.each{|tile| tile.dispose}\n \n #TESTING\n @locations.each{|tile| tile.visible = false}\n \n @locations = []\n @zones = []\n # Return the cursor to the spot where the unit was decided to move to\n cursor.moveto(@decided_spot_x, @decided_spot_y)\n # Show unit command window and move range again. Action is now nil.\n x = (cursor.real_x - $game_map.display_x) / 4\n x -= (@unit_command_window.width/2 - 16)\n y = (cursor.real_y - $game_map.display_y) / 4\n @unit_command_window.set_at(x, y)\n @unit_command_window.visible = true\n # Update @ranges\n @ranges.each{|i| i.update}\n show_move_ranges if @first_drop_unit.nil?\n # Update arrow path\n @arrow_path.each{|i| i.update}\n @action = nil\n # Back to phase 6\n @phase = 6\n end\n end", "title": "" }, { "docid": "1b1f4e9b54a9c3757cbde894b8e291c3", "score": "0.5468141", "text": "def minkoff_delay_on\n if MNK_AT_DELAY \n # Fomar's Action Cost Detection\n if $game_system.mnk_det_acb_detect\n for actor in $game_party.actors\n actor.vitality= 0\n end\n for enemy in $game_troop.enemies\n enemy.vitality= 0\n end\n end\n # Trickster's AT Detection\n if $game_system.mnk_det_abs_detect\n for actor in $game_party.actors\n actor.at_bonus= [0,0]\n end\n for enemy in $game_troop.enemies\n enemy.at_bonus= [0,0]\n end\n end\n # Cogwheel RTAB Detection\n @rtab_wait_flag = true if $game_system.mnk_det_rtab_systm\n end \n end", "title": "" }, { "docid": "9d8b6a2ebee83e14a1b6b0e715ee6f09", "score": "0.54674876", "text": "def hard_drop(main_piece: true)\n while move_down(1, main_piece: main_piece)\n end\n end", "title": "" }, { "docid": "9bc515660306bb6dbb4b4af3a4529140", "score": "0.5459583", "text": "def tick\n alive = move_random\n die if alive && @orgs_eaten < @size\n end", "title": "" }, { "docid": "ad63430cc384b0e94c98cc02b3b7212d", "score": "0.54590535", "text": "def grue_attacked\r\n puts \"Grue is scared off, drops something shiny, and flees to an adjacent room!\"\r\n move_randomly\r\n end", "title": "" }, { "docid": "86589fc243bb7b686df61ddd8fae3197", "score": "0.5455238", "text": "def handle\r\n Battle.with_a_combatant(self.name, client, enactor) do |combat, combatant|\r\n\r\n if (combat.organizer != enactor)\r\n client.emit_failure t('battle.only_organizer_can_do')\r\n return\r\n end\r\n\r\n combatant.update(is_ko: false)\r\n client.emit_success t('battle.is_no_longer_koed', :name => self.name)\r\n end\r\n end", "title": "" }, { "docid": "54f9614dac00588dfad30d4c0d6fd3c4", "score": "0.54543525", "text": "def reset_move\n if remain_move[0] != $game_temp.battle_turn\n remain_move[0] = $game_temp.battle_turn\n move = base_move_range\n for s_id in @states\n case s_id\n when 11 #delay (slow)\n move -= 2\n end\n end\n remain_move[1] = move\n end\n end", "title": "" }, { "docid": "cbb09cdc8b533ada849e8ae998560d76", "score": "0.5453805", "text": "def test_move_invalid_blocked_by_own_piece\n\t\tboard = ChessBoard.create_empty\n\t\tpawny = Pawn.new board, :black, 'c', 3\n\t\ttest_me = Knight.new board, :black, 'b', 1\n\t\tboard << test_me\n\t\tboard << pawny\n\t\tblack_king = King.new board, :black, 'g', 3\n\t\twhite_king = King.new board, :white, 'g', 5\n\t\tboard << black_king\n\t\tboard << white_king\n\n\t\tassert !test_me.move_valid?('c', 3)\n\tend", "title": "" }, { "docid": "026e17009ce4f88f4b986fe024727ae1", "score": "0.54335344", "text": "def let_the_hunt_begin\n\t\n\t# The two functions we're going to use\n\t# Dynamically defines a method on Object\n\tdef defn symbol, &block\n\t\tself.class.send :define_method, symbol, &block\n\tend\n\t\n\t# Dynamically undefines a method on Object\n\tdef undefn symbol\n\t\tself.class.send :remove_method, symbol\n\tend\n\t\n\tdef undefn_each arr\n\t\tarr.each do |j|\n\t\t\tbegin\n\t\t\t\tundefn j\n\t\t\trescue\n\t\t\tend\n\t\tend\n\tend\n\t\n\t# Generates a random symbol\n\tdef generate_symbol\n\t\tsym = (0...4).map{65.+(rand(25)).chr}.join.downcase.to_sym\n\t\tif Object.methods.include? sym\n\t\t\tgenerate_symbol\n\t\telse\n\t\t\tsym\n\t\tend\n\tend\n\t\n\t# Check if a game's already running\n\tif $game_running\n\t\tprint 'Would you like to quit? [y/n] '\n\t\texit if gets.chomp.downcase == 'y'\n\t\treturn\n\tend\n\t\n\t# The game is now running\n\t$game_running = true\n\t\n\t# Each 'cavern' is a node, represented by an array\n\tdescriptions = [:cavernous, :flooded, :smelly, :clean, :grimy, :mucky,\n\t :muddy, :large, :small, :wide, :wet, :stuffy, :overgrown,\n\t :warm, :cold, :red, :greenish, :blueish, :yellow,\n\t :purpleish, :dingy, :chilly, :haunted, :ghostly, :tiny ]\n\tnodes = descriptions.take(ChamberCount).shuffle.map { |x| [x, :safe] }\n\tnodes[0][1] = :wumpus\n\tnodes[1][1] = :pit\n\t\n\t# The first node is the one the player will climb down into.\n\t# Therefore, we shuffle until there is nothing dangerous there\n\t# and replace whatever is there with the ladder\n\tnodes.shuffle! while nodes[0][1] != :safe\n\t\n\t# Game over\n\tdefn :game_over do |str|\n\t\tputs <<-EOF\n\n \\033[1m#{str}\\033[0m.\n\n If you would like to play again, call \\033[1mlet_the_hunt_begin\\033[0m.\n \nEOF\n\t\t$game_running = false\n\t\tundefn_each nodes.map { |node| node[0] }\n\t\tundefn :shoot\n\t\tnil\n\tend\n\t\n\t# Let the user shoot\n\tdefn :shoot do |node|\n\t\t\n\t\t# Check if it's a valid node\n\t\tns = nodes.reject { |x| x[0] != node }\n\t\t\n\t\t# If it's not valid\n\t\tif ns.nil? or ns.empty?\n\t\t\tgame_over \"You shot the wall!\"\n\t\t\n\t\t# If you shot the wumpus\n\t\telsif ns.first[1] == :wumpus\n\t\t\tgame_over \"You \\033[32mshot the Wumpus!\\033[0m.\"\n\t\t\n\t\t# If you didn't shoot the wumpus\n\t\telse\n\t\t\tgame_over \"You wasted your only bullet.\"\n\t\tend\n\tend\n\t\n\t# Explain the situation to the user\n\tputs <<-EOF\n\n You are deep in the Caves of Closure, hunting the mysterious Wumpus.\n You have a gun (called with \\033[1mshoot(cavern_description)\\033[0m) with one bullet. Use it well.\n \n You are in a cavern with a ladder, leading to a \\033[1m#{nodes[0][0]}\\033[0m chamber.\n Call the function (by typing it's name) \\033[1m#{nodes[0][0]}\\033[0m to climb down the ladder\n and enter the first cavern.\n \n EOF\n\t\n\t# The definer, an object which creates and destroys caverns.\n\tdefiner = lambda do |index, &block|\n\t\t\n\t\t# Determine which nodes are adjacent\n\t\tadjacent_indicies = [(index + ChamberCount - 1) % ChamberCount,\n\t\t (index + 1) % ChamberCount,\n\t\t\t\t\t\t\t (index + 4) % ChamberCount,\n\t\t\t\t\t\t\t (index + ChamberCount - 4) % ChamberCount].uniq.\n\t\t\t\t\t\t\t \tshuffle\n\t\tadjacent_nodes = adjacent_indicies.map { |x| nodes[x] }\n\t\tadjacents = Hash[ adjacent_indicies.zip adjacent_nodes ]\n\t\t\n\t\t# Define the given cavern as a function with the node name\n\t\tdefn nodes[index][0] do\n\t\t\t\n\t\t\t# This node\n\t\t\tnode = nodes[index]\n\t\t\t\n\t\t\t# Call the 'teardown' method of the previous node, if given\n\t\t\tblock.call unless block.nil?\n\t\t\t\n\t\t\t# Define the new method for each adjacent node\n\t\t\tadjacents.each do |i, n|\n\t\t\t\tdefiner.call i do\n\t\t\t\t\tundefn_each adjacent_nodes.map { |x| x[0] }\n\t\t\t\tend \n\t\t\tend\n\t\t\t\n\t\t\t# Describe the chamber to the user\n\t\t\tif [:wumpus, :pit, :ladder].include? node[1]\n\t\t\t\tprint \"\\n You have entered a chamber with a #{node[1]} in it.\"\n\t\t\telse\n\t\t\t\tprint \"\\n You have entered a #{node[0]} chamber.\"\n\t\t\tend\n\t\t\t\n\t\t\t# If the player entered a bad chamber...\n\t\t\tcase node[1]\n\t\t\twhen :wumpus\n\t\t\t\tgame_over \"\\033[31mThe wumpus ate you\\033[0m\"\n\t\t\t\treturn\n\t\t\twhen :pit\n\t\t\t\tgame_over \"You have fallen into a pit\"\n\t\t\t\treturn\n\t\t\tend\n\t\t\t\n\t\t\t# Look in the adjacent chambers for a wumpus or pit\n\t\t\tif adjacent_nodes.inject(false) { |a, n| (a | (n[1] == :wumpus)) }\n\t\t\t\tprint \" There is \\033[31;1mblood on the walls\\033[0m.\"\n\t\t\tend\n\t\t\tif adjacent_nodes.inject(false) { |a, n| (a | (n[1] == :pit)) }\n\t\t\t\tprint \" You feel a \\033[34;1mbreeze\\033[0m.\"\n\t\t\tend\n\t\t\tprint \"\\n\"\n\t\t\t\n\t\t\t# Inform the user of the tunnels\n\t\t\tputs \"\\n There are tunnels to \" +\n\t\t\t\tadjacent_nodes[0..adjacent_nodes.length-2].map { |x| \"\\033[1m#{x[0]}\\033[0m\" }.join(', ') +\n\t\t\t\t\"#{',' if adjacent_nodes.length > 2} and \" + \"\\033[1m#{adjacent_nodes[adjacent_nodes.length-1][0]}\\033[0m chambers.\\n\\n\"\n\t\t\t\n\t\t\t# Return the tunnel ids\n\t\t\tadjacent_nodes.map { |n| n[0] }[0..adjacent_nodes.length-1]\n\t\tend\n\tend\n\t\n\tdefiner.call 0\n\treturn nodes[0][0]\nend", "title": "" }, { "docid": "93c5337ce0ad2847edfa4fe062ef29d5", "score": "0.5431911", "text": "def flee!(entity)\n entity.disown!(self)\n end", "title": "" }, { "docid": "fea97f27edf37823d99c004f4ccd4247", "score": "0.54236907", "text": "def hatch_check_update\n return if cant_process_event_tasks?\n\n amca = FASTER_HATCH_ABILITIES.include?(@actors[0]&.ability_db_symbol || :__undef__)\n @actors.each do |pokemon|\n next unless pokemon.step_remaining > 0\n\n pokemon.step_remaining -= 1\n pokemon.step_remaining -= 1 if amca && (pokemon.step_remaining > 0)\n if pokemon.step_remaining == 0\n pokemon.egg_finish\n $scene.delay_display_call(:display_egg_hatch, pokemon)\n end\n end\n end", "title": "" }, { "docid": "18437352255e08e2cefaa4440697c736", "score": "0.5419901", "text": "def valid_moves\n #filters out he #moves of a Piece that would leave the player in check\n end", "title": "" }, { "docid": "63d2e9ed72bfc0fcbbf490811c6a8d8d", "score": "0.5416426", "text": "def waiting=(_); end", "title": "" }, { "docid": "d41692a1f53b1053397c916b222ab8fc", "score": "0.5405283", "text": "def blocked_by; end", "title": "" }, { "docid": "d9edda53c27f4e6dadcb527dd8cb6062", "score": "0.54046416", "text": "def feelempty(warrior)\n if (warrior.health == MAXHEALTH)\n warrior.walk!\n #check the array for enemies\n elsif (warrior.look.any? { |space| space.enemy? })\n warrior.shoot!\n else\n warrior.rest!\n end\n end", "title": "" }, { "docid": "49bd672153311ddf952653033b2ca4a4", "score": "0.5400666", "text": "def defers_finished?; end", "title": "" }, { "docid": "5993b34e7e55cc257bc0c4b08ce9b78e", "score": "0.539407", "text": "def keep_dealing(player)\n while handTotal(player) <= 16\n deal_card(player)\n end \n if handTotal(player) > 21\n player.bust = true\n end \n end", "title": "" }, { "docid": "c1a90216c7abae279f3a46963bc19d82", "score": "0.5392872", "text": "def expand_plague(inf)\n sane = []\n members.each { |member| sane.push(member) if member.infected == 0 }\n if sane.size > 0\n battler = sane[rand(sane.size)]\n battler.apply_state_changes(FakeStObj.new(inf))\n end\n end", "title": "" }, { "docid": "9e34c56d45ab21696b8bdc7542c142ad", "score": "0.53864866", "text": "def mark_dead(x, y)\n # need to traverse the board by y then x because rows then cols\n @board[y][x] = false\n end", "title": "" }, { "docid": "5bc4f88270fc60a02b0f56ae3eac3885", "score": "0.53842044", "text": "def reset_battle_status\n target_select_cleanup\n end_skill_selection\n end_target_selection\n reset_atb_actor rescue return\n azzera_tutto rescue nil\n end", "title": "" }, { "docid": "b9113b2d75edfcaacbe90d21be0a6151", "score": "0.53827655", "text": "def protecting_moves(pieces)\n\t\tcheck_up(\"taken_teammate\", pieces) + check_down(\"taken_teammate\", pieces) + check_right(\"taken_teammate\", pieces) + check_left(\"taken_teammate\", pieces)\n\tend", "title": "" }, { "docid": "b9113b2d75edfcaacbe90d21be0a6151", "score": "0.53827655", "text": "def protecting_moves(pieces)\n\t\tcheck_up(\"taken_teammate\", pieces) + check_down(\"taken_teammate\", pieces) + check_right(\"taken_teammate\", pieces) + check_left(\"taken_teammate\", pieces)\n\tend", "title": "" }, { "docid": "7e5ce316be61b3dd301442d12bea45f2", "score": "0.5379658", "text": "def leave_block\r\n if @ball.drop_speed != @ball.drop_speed2\r\n @blocks.each do |block|\r\n dist = block.y - (@ball.y + @ball.image.height)\r\n if ((@ball.x + @ball.image.width <= block.x) || (@ball.x >= block.x + block.image.width)) && (dist <= 0 && dist > -@ball.image.height/3)\r\n @ball.drop_speed = @ball.drop_speed2\r\n end\r\n end\r\n end\r\nend", "title": "" }, { "docid": "d0ffed14686b3dfd9327ddf0d5f75c61", "score": "0.53777516", "text": "def expand_plague(inf)\n sane = []\n for member in members\n sane.push(member) if member.infected == 0\n end\n if sane.size > 0\n battler = sane[rand(sane.size)]\n battler.apply_state_changes(FakeStObj.new(inf))\n end\n end", "title": "" }, { "docid": "825842725acb453cd13f2037d42aa81f", "score": "0.5376745", "text": "def do_if_falling\n if @state == :falling then\n\n #Continue falling if target not yet reached\n if @y != @target_y then\n @y += 4\n else\n #End of falling --- look for player below and take_damage him\n obj = $map.adjacent_tile(@x, @y, :down)\n if obj.class != NilClass then\n #Play sound if not hitting a falling boulder or ruby\n @drop_sound.play(1, 1, false) unless (obj.class.superclass == Dropper && obj.state == :falling)\n end\n #Continue falling?\n check_fall\n end\n end\n end", "title": "" }, { "docid": "ba81bf1c730ae2b5d254c9d1c2a9fbc5", "score": "0.53745604", "text": "def infect_plague\n $game_troop.check_plague\n $game_party.check_plague\n end", "title": "" }, { "docid": "ba81bf1c730ae2b5d254c9d1c2a9fbc5", "score": "0.53745604", "text": "def infect_plague\n $game_troop.check_plague\n $game_party.check_plague\n end", "title": "" }, { "docid": "0ca353126db73dce5ec24121f4acafef", "score": "0.53727067", "text": "def awaiting\n\n end", "title": "" }, { "docid": "4dd195d3328d4c182d3e203e5724840f", "score": "0.5371601", "text": "def wait\n @pieceManager.wait\n end", "title": "" }, { "docid": "856754271279ed4fba9ee2360730f90c", "score": "0.5369311", "text": "def flee\n end", "title": "" }, { "docid": "3a207638eb3005bc9de32137dde1f377", "score": "0.5368565", "text": "def start_filming\n if actor.ready?\n actor.act\n actor.fall_off_ladder\n actor.light_on_fire\n actor.act \n end\n end", "title": "" }, { "docid": "db2b4ca006e46e93f3d127167b59e8be", "score": "0.5367428", "text": "def halted?; end", "title": "" }, { "docid": "db2b4ca006e46e93f3d127167b59e8be", "score": "0.5367428", "text": "def halted?; end", "title": "" }, { "docid": "8cea768ce8f0625ce034b523727ae176", "score": "0.53670996", "text": "def process_ok\n $game_party.target_actor = $game_party.members[index] unless @cursor_all\n call_ok_handler\n end", "title": "" }, { "docid": "d547b67cd4f62a97dd4a1e7afb1c17e4", "score": "0.53663707", "text": "def healing; end", "title": "" }, { "docid": "d9f1e26d42c3c91e84e0ac7ea4806ceb", "score": "0.53650206", "text": "def deal\n\t\tcase @phase\n\t\t\twhen 0 then new_hand\n\t\t\twhen 1 then flop\n\t\t\twhen 2 then turn_or_river\n\t\t\twhen 3 then turn_or_river\n\t\tend\n\t\t@current_position = @button\n\t\t@minimum_bet = @small_blind * 2\n\t\tmove_position(@phase == 0 ? 3 : 1) \n\t\t@phase += 1\n\t\t@moves_taken = 0\n\tend", "title": "" }, { "docid": "8ef76751f5c050880dfa00fb1ff74c8b", "score": "0.5364151", "text": "def fight_turn(attacker,deffender)\n # calculating damage to be dealt\n deffender_defence=deffender.defence-attacker.defence_penetration\n critical_strike_chance=attacker.get_critical_strikes_level_if_has_one*5\n has_criticaly_striked=rand(1..100)\n has_criticaly_striked_boolean=false\n if has_criticaly_striked<critical_strike_chance\n damage_dealt_to_defender=attacker.damage*2-deffender_defence\n has_criticaly_striked_boolean=true\n else\n damage_dealt_to_defender=attacker.damage-deffender_defence\n end\n damage_dealt_to_defender=1 if damage_dealt_to_defender<0 \n\n # checking if deffender can dodge\n deffender_dodge_level=deffender.get_dodging_level_if_has_one\n dodge_chance=deffender_dodge_level*5;\n has_dodged=rand(0..100)\n if (has_dodged<=dodge_chance) then\n @fight_results_arr.push(avoided:\"#{deffender.name} has successfully avoided damage\")\n elsif has_criticaly_striked_boolean\n deffender.health-=damage_dealt_to_defender \n @fight_results_arr.push(damageDealt:\"#{attacker.name} has crtically striked #{deffender.name} dealing #{damage_dealt_to_defender}\")\n else\n deffender.health-=damage_dealt_to_defender \n @fight_results_arr.push(damageDealt:\"#{attacker.name} has dealt #{damage_dealt_to_defender} damage to #{deffender.name}\")\n end \n end", "title": "" }, { "docid": "76031ce5b473306f487719ed32ee35e7", "score": "0.5363312", "text": "def do_if_falling\n if @state == :falling then\n #Continue falling if target not yet reached\n if @y != @target_y then\n @y += 4\n else\n #End of falling --- look for player below and take_damage him\n obj = $map.adjacent_tile(@x, @y, :down)\n if obj.class == Actor then\n obj.take_damage(@damage)\n else\n if obj.class != NilClass then\n #Play sound if not hitting a falling boulder or ruby\n @drop_sound.play(1, 1, false) unless (obj.class.superclass == Dropper && obj.state == :falling)\n end\n end\n\n #Continue falling?\n check_fall\n\n end\n end\n end", "title": "" }, { "docid": "09223c261a97d788c8ecb8b2be280113", "score": "0.536176", "text": "def attempt_word_block_attack(words)\n # first, set up the possibles for each piece based on the words provided\n words.each { |w| @pieces.each { |p| p.possible?(w) } }\n # sort the pieces by the number of possibles\n @pieces.sort! do |a, b|\n a.matches <=> b.matches\n end\n # now run through the attack from the beginning\n do_word_block_attack(0, @legend)\n end", "title": "" }, { "docid": "1ae98fe9ba2f6d641f2fb03278f4c615", "score": "0.5361191", "text": "def defend\n\t\t\tshield_add = rand(1..4)\n\t\t#\tplayer.mshield = player.level + 5\n\n\t\t\tif player.shield >= player.maxshield\n\t\t\t\tputs \"#{player.name} already has maximum defense!\"\n\t\t\t\taction\n\t\t\telsif (player.shield + shield_add) > player.maxshield\n\t\t\t\tplayer.shield = player.maxshield\n\t\t\t\tputs \"#{player.name} now has maximum defense!\"\n\t\t\t\taction\t\t\t\n\t\t\telse\n\t\t\t\tplayer.shield += shield_add\n\t\t\t\tputs \"#{player.name} prepares their defenses!\"\n\t\t\t\taction\n\t\t\tend\n\t\tend", "title": "" } ]
123a6eac48cf3fe7731fdfed3ec0d706
=begin def self.find(args) if args.length == 1 Response.find_by_id(args.first) changed find_by_map_id to find_by_id else super end end =end =begin def self.find_by_id(args) Response.find_by_id(args.first) changed find_by_map_id to find_by_id end =end
[ { "docid": "abb602006db3b3fb23c097f61a24dcac", "score": "0.0", "text": "def response\n self\n end", "title": "" } ]
[ { "docid": "65ca3e864411273782c5bf1c42ccf1e3", "score": "0.7540901", "text": "def find(id)\n\nend", "title": "" }, { "docid": "ff9ea5765451fe5c64260579b843c6f7", "score": "0.7457782", "text": "def find(id); end", "title": "" }, { "docid": "ff9ea5765451fe5c64260579b843c6f7", "score": "0.7457782", "text": "def find(id); end", "title": "" }, { "docid": "851a8801abc5f345051d642e476ab796", "score": "0.6991128", "text": "def find(id)\n end", "title": "" }, { "docid": "b69339727e6a855d297cfb45073b6892", "score": "0.69648594", "text": "def find(id)\n raise NotImplementedError\n end", "title": "" }, { "docid": "c414e6e51269c1b5179607660ba43042", "score": "0.68650043", "text": "def find(*args, &block)\n if args.first.is_a?(Hash)\n super(*args, &block)\n else\n super(id: args)\n end\n end", "title": "" }, { "docid": "6915e1b9a6690cf2814e70398b2377bb", "score": "0.6821498", "text": "def find(id)\n find_result\n end", "title": "" }, { "docid": "8ba4cb8c63d5ef612994a44c487f962c", "score": "0.67356795", "text": "def find_by()\n\n end", "title": "" }, { "docid": "a7018e3624b25caf8999cbaee4fc99b4", "score": "0.6686965", "text": "def find(*args)\n select(*args)\n\n=begin\n\n options = args.last.is_a?(Hash) ? args.pop : {}\n case args.first\n when :all then find_every options\n when :first then find_initial options\n else find_from_ids args, options\n end\n\n=end\n\n end", "title": "" }, { "docid": "7fc740e62563ebb84f2377ab8a4cf75f", "score": "0.6639376", "text": "def find(id)\n fetch([name, id]) do\n super\n end\n end", "title": "" }, { "docid": "62057304fbc2009a66cb3be6b5703910", "score": "0.6604553", "text": "def find; end", "title": "" }, { "docid": "54d1ca9ff3c3b157b108e38e3a54e505", "score": "0.653458", "text": "def find item\n\tend", "title": "" }, { "docid": "ede9f54b55e6ec57acedb504a90021f0", "score": "0.65090376", "text": "def find(query); end", "title": "" }, { "docid": "ede9f54b55e6ec57acedb504a90021f0", "score": "0.65090376", "text": "def find(query); end", "title": "" }, { "docid": "572cbcf039a8a5931bbffc233292d2fd", "score": "0.6471956", "text": "def find(id)\n # Your code Here\n @candidates.each do |candidate|\n \tif candidate[:id] == id\n \t return candidate\n \tend\n end\n return nil\nend", "title": "" }, { "docid": "99b52dd38aca67c7b8a9fb39186dd221", "score": "0.6467085", "text": "def find(id)\n finder_or_run(:find, id)\n end", "title": "" }, { "docid": "6fe63f093a4e894e59fa9db7ddd3ea1b", "score": "0.6435841", "text": "def find_by_id(id)\n raise NotImplementedError.new\n end", "title": "" }, { "docid": "73eef3f612417445c09820e6d1846c23", "score": "0.64053434", "text": "def find_by_name(id)\n end", "title": "" }, { "docid": "26846373fd206a37ddb573f38b75b90c", "score": "0.63653886", "text": "def find(id)\n\t records = DATA.execute(\"SELECT * FROM #{@table} WHERE id = #{id}\")\n\t record = records[0]\n fields=[]\n if record.nil?\n return nil\n else\n for i in 0..((record.count/2)-1)\n fields.push(record[i])\n end\n end\n \n self.new(*fields)\n end", "title": "" }, { "docid": "85b8058e7bfced71a94beac04b4e4dbb", "score": "0.63106763", "text": "def find(*args)\n return super if block_given?\n find_with_ids(*args)\n end", "title": "" }, { "docid": "e26c878d05d451cf7a226c34405f4764", "score": "0.6299363", "text": "def find(id)\n @candidates.each do |candidate|\n if id == candidate[:id] \n return candidate\n end\nend\n\n nil\nend", "title": "" }, { "docid": "8134c6839d82e38e5e613beeeb78b96b", "score": "0.62792885", "text": "def find(id)\n\nreturn candidates.detect{|candidate| candidate[:id]==id }\n\nend", "title": "" }, { "docid": "ecb26b59223fd4151689af0795ccc7c5", "score": "0.6271173", "text": "def find(id)\n # takes single candidate as id :\n @candidates.each do | candidate |\n if candidate[:id] == id \n\n return candidate\n else \n nil\n end\n end\nend", "title": "" }, { "docid": "5da12dc769d6da2b71838b765644206e", "score": "0.6263609", "text": "def find(id, params = {})\n from_base id, params\n end", "title": "" }, { "docid": "25f84b4c111cf797f9f693a03742b79c", "score": "0.6252997", "text": "def find id, params = {}\n puts \"Repository - find id\"\n #Special id handling\n if params[\"DocId\"]\n id = params[\"DocId\"]\n #Rails.logger.debugger(\"Solr Repository = Using DocID #{id.inspect}\")\n #id is already a value being sent in, so just use that\n# else \n# id ||= params[:id]\n end\n \n doc_params = params.reverse_merge(blacklight_config.default_document_solr_params)\n .reverse_merge(qt: blacklight_config.document_solr_request_handler)\n .merge(blacklight_config.document_unique_id_param => id)\n \n solr_response = send_and_receive blacklight_config.document_solr_path || blacklight_config.solr_path, doc_params\n raise Blacklight::Exceptions::RecordNotFound.new if solr_response.documents.empty?\n solr_response\n end", "title": "" }, { "docid": "aee7ce44dc9c9c48faf59bb25b577a75", "score": "0.6228983", "text": "def find(id)\n binding.pry\n candidate.each do |candidate|\n if @candidate[:id] == id\n return candidate\n else\n nil\n end \n end \nend", "title": "" }, { "docid": "e1719d7a5aadbc7640fbaac873c15015", "score": "0.61870843", "text": "def find(id)\n @candidates.each do |item|\n if item[:id]==id\n @result = item\n end\n end\n @result\nend", "title": "" }, { "docid": "88412679fe2e9f395a016f3c87e18d26", "score": "0.61763096", "text": "def find(id)\n # Your code Here\n @candidates.each do |candidate|\n if id == candidate[:id]\n return candidate\n end\n end\n\n nil\nend", "title": "" }, { "docid": "b24eca8b556cf4004f5eb935e8b8f5d4", "score": "0.6161525", "text": "def find(id)\n # Your code Here\n # puts \"you are looking for id: #{id}\"\n @candidates.each do |candidate|\n if candidate[:id] == id\n return candidate\n end\n end\n return nil\nend", "title": "" }, { "docid": "8ad72e596089ffb68280124a73185894", "score": "0.61611295", "text": "def find\n raise \"Method not implemented\"\n end", "title": "" }, { "docid": "63268346b4afe49786a9e279ae391696", "score": "0.614943", "text": "def find_by_id(id)\n find_by(:id, id)\n end", "title": "" }, { "docid": "8fc7685af004e090682d44707a2b8755", "score": "0.61436987", "text": "def find(id)\n # Your code Here\n @candidates.each do |candidate|\n if candidate[:id] == id\n return candidate\n end\n end\n nil\nend", "title": "" }, { "docid": "4a7a969b06f34ae53fb83374ecce361c", "score": "0.6093538", "text": "def find(id)\n @candidates.select{|candidate| candidate[:id] === id }\n #return @candidates\n\nend", "title": "" }, { "docid": "3ad88f39a0f0159df7a2f792a1e84186", "score": "0.6092125", "text": "def find(id)\n # Your code Here\n @candidates.each do |el|\n # logic to check if id match else null\n if el[:id] == id\n puts 'found match'\n return el\n end\n end\n return nil\nend", "title": "" }, { "docid": "17322d531ebd22d0955f7bb6a4a7fe25", "score": "0.6091676", "text": "def find(record_id) \n result = CONNECTION.execute(\"SELECT * FROM #{self.table_name} WHERE id = #{record_id}\").first\n \n self.new(result)\n end", "title": "" }, { "docid": "87bdcb830cf540517313c7ea515fb486", "score": "0.60830116", "text": "def find id, params = {}, &block\n rel = relation params, &block\n rel.where!(config.document_unique_id_param => id) \n rel.load\n rel\n end", "title": "" }, { "docid": "a78e34b238dbcf39b73b00055e16daf5", "score": "0.6076229", "text": "def find(id)\nraise \"candidates must be an Array\" if @candidates.nil?\n @candidates.each do |candidate|\n return candidate if candidate[:id] == id\n end\n nil\nend", "title": "" }, { "docid": "d5bd9035871353f211d59f516740aea4", "score": "0.60499287", "text": "def find(id)\n @candidates.each do |candidate|\n return candidate if candidate[:id]==id\n end\n nil\nend", "title": "" }, { "docid": "dad6eb34964b81525a9d0eedb691add3", "score": "0.6048215", "text": "def find\n fail NotImplementedError\n end", "title": "" }, { "docid": "e6cd0290544ee27bc659e619572fdf89", "score": "0.5994951", "text": "def find(id)\n # binding.pry\n raise '@candidates must be an Array' if @candidates.nil?\n candidate.each do |candidate|\n if candidate[:id] == id\n return candidate\n else\n nil\n end \n end \nend", "title": "" }, { "docid": "f3f6415ce8b56a3eec32b01e909f7c14", "score": "0.598392", "text": "def find! id, options = {}\n\n find( id, options ) ||\n raise( MongoMapper::DocumentNotFound.new(\"#{self.to_s} with id #{id} not found\") )\n\n end", "title": "" }, { "docid": "a371c8c5b0b78ca2bbc10ffc73ac1bed", "score": "0.5977754", "text": "def prepare_find\n raise Error.new('Cannot find an event without an ID') if id.blank?\n self\n end", "title": "" }, { "docid": "8f418ec4231400a7c83a9d0c4d94563b", "score": "0.59670204", "text": "def find_by_id(id)\n find(id)\n end", "title": "" }, { "docid": "24fcc626cff85cefe3c227f8a9b02092", "score": "0.59668595", "text": "def find_record #:nodoc:\r\n if @tables.size == 1\r\n @record = @tables.first[0].find(params[:id])\r\n else\r\n rec = @tables.first[0].find(@ids.first) # top most record\r\n 1.upto(@tables.size - 2) { |i| rec = rec.send(@tables[i][1].pluralize).find(@ids[i]) } # find embedded childrens by ids\r\n @record = rec.send(@tables.last[1].pluralize).find(params[:id]) # record to edit\r\n end\r\nend", "title": "" }, { "docid": "24fcc626cff85cefe3c227f8a9b02092", "score": "0.59668595", "text": "def find_record #:nodoc:\r\n if @tables.size == 1\r\n @record = @tables.first[0].find(params[:id])\r\n else\r\n rec = @tables.first[0].find(@ids.first) # top most record\r\n 1.upto(@tables.size - 2) { |i| rec = rec.send(@tables[i][1].pluralize).find(@ids[i]) } # find embedded childrens by ids\r\n @record = rec.send(@tables.last[1].pluralize).find(params[:id]) # record to edit\r\n end\r\nend", "title": "" }, { "docid": "37e4df9606bb861971751297efb05ebb", "score": "0.5962769", "text": "def find_by_id(id)\n resp = get(\"/#{exposed_as}/#{id}\")\n case resp.response.code.to_i\n when 200\n result = MultiJson.load resp.parsed_response\n new(result)\n when 404\n nil\n else\n raise \"#{self.class.name}#try_find with ID #{id.inspect} returned unexpected response: #{resp.inspect}\"\n end\n end", "title": "" }, { "docid": "8165077100f494dbaa06ee3778f34e57", "score": "0.596214", "text": "def find(*args)\n ids = args.__find_args__\n raise_invalid if ids.any?(&:nil?)\n for_ids(ids).execute_or_raise(ids, args.multi_arged?)\n end", "title": "" }, { "docid": "22d9589ee7b9741424e2536dde9eb2d7", "score": "0.5948365", "text": "def find(record_id)\n # Figure out the table's name from the class we're calling the method on.\n table_name = self.to_s.pluralize.underscore\n \n results= CONNECTION.execute(\"SELECT * FROM #{table_name} WHERE id = #{record_id}\")\n if results.empty? \n return nil\n else \n result=results.first\n self.new(result)\n end\n end", "title": "" }, { "docid": "82ac1fe78805bb6c7e337cc443c0314e", "score": "0.59362113", "text": "def fetch_one(id, extra_controller_params)\n puts \"fetch one search helper\"\n old_solr_doc_params = Deprecation.silence(Blacklight::SearchHelper) do\n solr_doc_params(id)\n end\n\n if default_solr_doc_params(id) != old_solr_doc_params\n Deprecation.warn Blacklight::SearchHelper, \"The #solr_doc_params method is deprecated. Instead, you should provide a custom SolrRepository implementation for the additional behavior you're offering. The current behavior will be removed in Blacklight 6.0\"\n extra_controller_params = extra_controller_params.merge(old_solr_doc_params)\n end\n \n #Override id\n if params[\"DocId\"]\n id = params[\"DocId\"]\n #Rails.logger.debug(\"Found DocID #{params['DocId'].inspect} and id is #{id.inspect}\")\n else \n id ||= params[:id]\n #Rails.logger.debug(\"Using other id\")\n end\n \n\n solr_response = repository.find id, extra_controller_params\n [solr_response, solr_response.documents.first]\n end", "title": "" }, { "docid": "ea09fc6ae04c051265c3167747e58681", "score": "0.5930413", "text": "def find(id)\n @candidates.each do | candidate |\n if candidate[:id] == id\n return candidate \n end\n end\nend", "title": "" }, { "docid": "0187cf079c5d2c7dc38ec58965cbdb51", "score": "0.5912818", "text": "def find_entity_by_id(id_list_or_array)\n end", "title": "" }, { "docid": "94de9bbe5ad5fc794de1183cee2e03e2", "score": "0.5881733", "text": "def find(*args)\n #self.class.new(layout, data, (queries.dup << args))\n wrap_data(data, (queries.dup << args))\n end", "title": "" }, { "docid": "bbd79c5e38bfd961c3c973ae4102caef", "score": "0.58804715", "text": "def find_record(item, no_raise: false, meth: nil, **opt)\n return item if item.nil? || item.is_a?(record_class)\n meth ||= __method__\n record = error = id = sid = nil\n id_key = opt.key?(:id_key) ? opt[:id_key] : id_column\n sid_key = opt.key?(:sid_key) ? opt[:sid_key] : sid_column\n if id_key || sid_key\n opt.merge!(item) if item.is_a?(Hash)\n opt.reverse_merge!(id_term(item, **opt))\n id = id_key && (opt[id_key] || opt[alt_id_key(opt)])\n sid = sid_key && opt[sid_key]\n if valid_sid?(id)\n if sid && (id != sid)\n Log.warn { \"#{meth}: id: #{id.inspect}, but sid: #{sid.inspect}\" }\n end\n id, sid = [nil, id]\n elsif id && sid\n Log.debug do\n \"#{meth}: choosing id: #{id.inspect} over sid: #{sid.inspect}\"\n end\n end\n if id && (id_key == id_column)\n record = record_class.find(id)\n error = \"for #{id_key} #{id.inspect}\" unless record\n elsif id\n record = record_class.find_by(id_key => id)\n error = \"for #{id_key} #{id.inspect}\" unless record\n elsif sid\n record = record_class.find_by(sid_key => sid)\n error = \"for #{sid_key} #{sid.inspect}\" unless record\n else\n error = '%s value given' % [id_key, sid_key].compact.join(' or ')\n end\n error &&= \"No #{record_name} #{error}\"\n else\n error = \"#{record_name}: both :id_key and :sid_key set to nil\"\n end\n if record\n record\n elsif !id && !sid\n Log.info { \"#{meth}: #{error} (no record specified)\" }\n raise_failure(:file_id) unless no_raise\n elsif no_raise\n # noinspection RubyMismatchedReturnType\n Log.warn { \"#{meth}: #{error} (skipping)\" }\n else\n Log.error { \"#{meth}: #{error}\" }\n raise_failure(:find, item) unless no_raise\n end\n end", "title": "" }, { "docid": "1305d315c71ae04018626bc28e54b99f", "score": "0.5875532", "text": "def find(id)\n raise '@candidates must be an array!' if @candidates.nil?\n candidate = @candidates.select { |candidate| candidate[:id] == id }\n\nend", "title": "" }, { "docid": "cca5abbde53dcb882714d98f5b042c40", "score": "0.5872899", "text": "def find(id)\n puts id\n @candidates.each do |candidate|\n if candidate[:id] == id \n return candidate\n end\n end\n puts \"No candidate found with that ID\"\n return nil\nend", "title": "" }, { "docid": "6d1afda47f89dfb772a057ac7be978da", "score": "0.5867031", "text": "def find(*args)\n list = []\n if args.first == :all\n result = Rhom::RhomDbAdapter::select_from_table(Rhom::TABLE_NAME,\n '*',\n {\"source_id\"=>get_source_id,\"update_type\"=>'query'},\n {\"order by\"=>'object'})\n else\n obj = strip_braces(args.first.to_s)\n result = Rhom::RhomDbAdapter::select_from_table(Rhom::TABLE_NAME,\n '*',\n {\"object\"=>obj})\n end\n list = get_list(result)\n if list.length == 1\n return list[0]\n end\n list\n end", "title": "" }, { "docid": "814b4c57b8b002eea3a8f75796610acb", "score": "0.58661497", "text": "def find(id)\n @candidates.each do |candidate|\n return candidate if candidate[:id] == id\n end\n return nil\nend", "title": "" }, { "docid": "84d7dd778ff4cabd6b4c31ab88b44fbd", "score": "0.58650064", "text": "def find(id)\n @candidates.each do |candidate|\n return candidate if id == candidate[:id]\n end\n nil\nend", "title": "" }, { "docid": "5251291fcb4b21005401da0be9a97a9a", "score": "0.5864139", "text": "def find(id)\n @candidates.find {|h| h[:id] == id}\nend", "title": "" }, { "docid": "c026959daae7e562f6cb236c38854848", "score": "0.5856698", "text": "def find(id)\n @data[id]\n end", "title": "" }, { "docid": "b8253598840654890af71670a89019e0", "score": "0.5851574", "text": "def find(id)\n @candidates.each do |candidate|\n if id == candidate[:id]\n candidate\n end\n end\n nil\nend", "title": "" }, { "docid": "f8ddbe042bc4dccd4f5cd689040f33dd", "score": "0.58474624", "text": "def find(id)\n first(\"Id = '#{id}'\")\n end", "title": "" }, { "docid": "cb4e3e249d9ec265228dcd8c367b29a1", "score": "0.5829309", "text": "def find id\n model.find id\n end", "title": "" }, { "docid": "2afde0a38e134c3988309b2e9914927a", "score": "0.58286345", "text": "def find(id)\n # Your code Here\n @candidates.each do |element|\n \tif element[:id] == id\n \t\tpp element\n \tend\n end\n pp nil\n\nend", "title": "" }, { "docid": "89d5f0397801d41bd2f8de03529f3e43", "score": "0.5807294", "text": "def find(id=nil)\n record = self.connection.exec_params('SELECT * FROM contacts '\\\n 'WHERE id = $1::int', [id]) if id.is_a?(Integer)\n \n record.nil? || record.num_tuples.zero? ? nil : new(record[0].values[1], record[0].values[2], record[0].values[0])\n end", "title": "" }, { "docid": "642dfcb4349823ecb0c96ca6f20a0334", "score": "0.5804753", "text": "def find_by_friendly_id(id); end", "title": "" }, { "docid": "c86553370a1d777666a235bef13a7c18", "score": "0.5800088", "text": "def find(record_id)\n results = CONNECTION.execute(\"SELECT * FROM #{table_name} WHERE id = #{record_id}\")\n results_as_objects = []\n\n results.each do |result_hash|\n results_as_objects << self.new(result_hash)\n end\n return results_as_objects.first \n end", "title": "" }, { "docid": "03f85886e85437b7f2cae8d975da7d75", "score": "0.5799959", "text": "def find(id)\n @candidates.each do |candidate|\n if candidate[:id] == id\n return candidate\n else\n return nil\n end\n end\nend", "title": "" }, { "docid": "09351a00a580c6bb532256982d871b3b", "score": "0.57971245", "text": "def method_for_find\n :find_by_slug!\n end", "title": "" }, { "docid": "89e8bdc44274ba958569f8dbb85daef3", "score": "0.5791762", "text": "def find(id)\n found = nil\n @candidates.each do |candidate|\n if candidate[:id] == id\n found = candidate\n end\n end\n found\nend", "title": "" }, { "docid": "1bf759d982be972417d6efb5542646b2", "score": "0.579137", "text": "def find\n super.first\n end", "title": "" }, { "docid": "432241a9670a897e22d341fe25945f5c", "score": "0.57821864", "text": "def method_missing(method_id, *arguments)\n if match = /find_(all_by|by)_([_a-zA-Z]\\w*)/.match(method_id.to_s)\n finder = determine_finder(match)\n\n facets = extract_attribute_names_from_match(match)\n super unless all_attributes_exists?(facets)\n\n #Overrride facets to use appropriate attribute name for current locale\n facets.collect! {|attr_name| respond_to?(:globalize_facets) && globalize_facets.include?(attr_name.intern) ? localized_facet(attr_name) : attr_name}\n\n attributes = construct_attributes_from_arguments(facets, arguments)\n\n case extra_options = arguments[facets.size]\n when nil\n options = { :conditions => attributes }\n set_readonly_option!(options)\n ActiveSupport::Deprecation.silence { send(finder, options) }\n\n when Hash\n finder_options = extra_options.merge(:conditions => attributes)\n validate_find_options(finder_options)\n set_readonly_option!(finder_options)\n\n if extra_options[:conditions]\n with_scope(:find => { :conditions => extra_options[:conditions] }) do\n ActiveSupport::Deprecation.silence { send(finder, finder_options) }\n end\n else\n ActiveSupport::Deprecation.silence { send(finder, finder_options) }\n end\n\n else\n raise ArgumentError, \"Unrecognized arguments for #{method_id}: #{extra_options.inspect}\"\n end\n elsif match = /find_or_(initialize|create)_by_([_a-zA-Z]\\w*)/.match(method_id.to_s)\n instantiator = determine_instantiator(match)\n facets = extract_attribute_names_from_match(match)\n super unless all_attributes_exists?(facets)\n\n if arguments[0].is_a?(Hash)\n attributes = arguments[0].with_indifferent_access\n find_attributes = attributes.slice(*facets)\n else\n find_attributes = attributes = construct_attributes_from_arguments(facets, arguments)\n end\n options = { :conditions => find_attributes }\n set_readonly_option!(options)\n\n find_initial(options) || send(instantiator, attributes)\n else\n super\n end\n end", "title": "" }, { "docid": "2c1e123334dc48c73c849da0c19987f0", "score": "0.57606083", "text": "def find(id)\n @candidates.each do |person|\n if person[:id] === id\n return person\n end\n end\n return nil\nend", "title": "" }, { "docid": "ce68dbbe06531359daa3eb0d0937715e", "score": "0.57505333", "text": "def find(*args)\n options = args.last.is_a?(Hash) ? args.pop : {}\n warn \"The Wakoopa API doesn\\'t support finding single rows. \\n Please use \\\".all()\\\" or \\\"s.find(:all)\\\" instead of \\\".find()\\\".\" unless args.first == :all\n find_every(options)\n end", "title": "" }, { "docid": "1cae2f0c87a6f191afa985e98c756b5b", "score": "0.5748851", "text": "def find_one\n return super if params[klass.primary_key].present?\n @find_one ||= klass.new_collection_from_result(limit(1).fetch).first\n rescue ::Spyke::ConnectionError => error\n fallback_or_reraise(error, default: nil)\n end", "title": "" }, { "docid": "9fbe9bc7171e3d4999af5292801badfa", "score": "0.57280165", "text": "def find_from_search(*ids)\n unless ids.blank?\n results = {}\n ids.flatten.dice(20).each do |set|\n query = (set.map { |id| \"(id:\\\"#{id}\\\")\" }).join(' || ')\n search_results = search_for(query, :qt => 'standard', :rows => set.length)\n search_results.models.each do |result|\n results[result.id] = result\n end\n end\n ids.flatten.map { |id| results[id] }\n else\n []\n end\n end", "title": "" }, { "docid": "3ea3c3cbcdaeb1aa03d9c6a3fc3ed2dd", "score": "0.57257974", "text": "def find(id, optional = {})\n find_all([id], optional).first\n end", "title": "" }, { "docid": "ba9298f12642e88c1555e4a5908046ae", "score": "0.57221216", "text": "def find_all\n \n end", "title": "" }, { "docid": "6170e90698f1d9ab786e923adbf722d5", "score": "0.5713272", "text": "def find(id)\r\n find_one do |record|\r\n record.id == id\r\n end\r\n end", "title": "" }, { "docid": "2bd133262f40d13d3a0ec117b70bcf14", "score": "0.57095915", "text": "def find(record_id) \n # Figure out the table's name from the class we're calling the method on.\n table_name = self.to_s.pluralize.underscore\n results = QUIZ.execute(\"SELECT * FROM #{table_name} WHERE id = #{record_id}\").first\n self.new(results)\n end", "title": "" }, { "docid": "793672a8fc4bb547f65337f0db1b3e8b", "score": "0.57077914", "text": "def find(id)\n klass.find(id)\n end", "title": "" }, { "docid": "996d49babebd389502b4226da12156fd", "score": "0.57012993", "text": "def find(record_id)\n self.new(CONNECTION.execute(\"SELECT * FROM #{get_table_name} WHERE id = #{record_id}\").first)\n end", "title": "" }, { "docid": "754e5dd2b4fc5f9989fe829e603ffdd7", "score": "0.5694616", "text": "def find_by_id(id)\n results = many.find_with_attributes_ne(id)\n results.blank? && nil || with_details(results)\n end", "title": "" }, { "docid": "ef8d32b815d9b75aaa681a97894718ed", "score": "0.5694334", "text": "def find( id )\n model.get( id ).extend( InstanceMethods )\n end", "title": "" }, { "docid": "b2fd456169a9b70dc3301fbc3f180477", "score": "0.5690919", "text": "def find(id)\n map_id = proc { |object| object.respond_to?(:id) ? object.send(:id) : object }\n\n result = find_by_id_or_ids(map_id, id)\n\n fail RecordNotFound.new(\n \"Couldn't find #{name} with '#{id_property_name}'=#{id.inspect}\",\n name, id_property_name, id) if result.blank?\n result.tap { |r| find_callbacks!(r) }\n end", "title": "" }, { "docid": "9f5e04370ecebff258df4ede086f493f", "score": "0.5686004", "text": "def find(id)\n raise '@candidates must be an array' if @candidates.nil?\n @candidates.detect {|candidate| candidate[:id] == id}\n\nend", "title": "" }, { "docid": "459dbcf77b9963552e5f2dddbe65f72f", "score": "0.56813097", "text": "def find(id)\n puts id\n @candidates.each do |c|\n if c[:id] == id\n puts c\n return c\n end\n end\nend", "title": "" }, { "docid": "8f5d25435b22a82a59de23a5b24dd615", "score": "0.5673816", "text": "def find_one(id)\n response = request(:get, \"/#{resource_name}/#{id}\")\n #puts response\n construct_record_from_singular(response)\n end", "title": "" }, { "docid": "41b13e1b1cff9f78790e9c95730b7f38", "score": "0.567162", "text": "def find_by_id(id)\n find_by_attributes(:id => id).first\n end", "title": "" }, { "docid": "49c511154c4d411658ce1ef05ccd84aa", "score": "0.5670145", "text": "def find_object(parent_object, id)\n raise NotImplementedError, \"#{self.class} must implement method: #{__callee__}\"\n end", "title": "" }, { "docid": "1c9f14b61394a67e9994fbee567a15dc", "score": "0.56634945", "text": "def find(args, mode); end", "title": "" }, { "docid": "afc4814c25dc5cf57d2a63035bdc0e78", "score": "0.56631976", "text": "def find(id, ignore: [])\n hit = es_get(id, ignore: ignore)\n if hit['found']\n result = instantiate_result(hit)\n return result\n end\n false\n end", "title": "" }, { "docid": "eac7f9c8d3c8c58cef2a16f055258c62", "score": "0.56615424", "text": "def find\n\t\tif defined?(@collection)\n\t\t\treturn @collection.find\n \tend\n\tend", "title": "" }, { "docid": "b98417f487fee62883d4acb013c0785c", "score": "0.56608707", "text": "def find(*args)\n records = super\n @after.call(records) if @after\n records\n end", "title": "" }, { "docid": "ebca7db90b697acc0fb204b417e75b8f", "score": "0.56604195", "text": "def find_locally(id)\n if @all.present?\n @all.find { |model| model.id == id }\n end\n end", "title": "" }, { "docid": "8fe5dec25cfee45a2816e87ad809a4c0", "score": "0.5658031", "text": "def rest_find_by_name_or_id(parent_id, val)\n # use explicitly defined finders\n # else default to new generic CliCommand find_by methods\n if rest_has_name\n if respond_to?(\"find_#{rest_key}_by_name_or_id\", true)\n send(\"find_#{rest_key}_by_name_or_id\", parent_id, val)\n else\n find_by_name_or_id(rest_key, parent_id, val)\n end\n else\n if respond_to?(\"find_#{rest_key}_by_id\", true)\n send(\"find_#{rest_key}_by_id\", parent_id, val)\n else\n find_by_id(rest_key, parent_id, val)\n end\n end\n end", "title": "" }, { "docid": "7a68e25224ec878b1d165344181e4c6f", "score": "0.56557804", "text": "def find(id, options = {})\n response = fetch({:key => id})\n response.parsed_response['id'] = id\n new(response.parsed_response)\n end", "title": "" }, { "docid": "b0b79427063a563c0450b5dd0781d2a6", "score": "0.5653729", "text": "def find_record(item, no_raise: false, meth: nil, **opt)\n # noinspection RubyMismatchedReturnType\n return item if item.nil? || item.is_a?(record_class)\n meth ||= __method__\n record = error = id = nil\n\n id_key = opt.key?(:id_key) ? opt[:id_key] : id_column\n if id_key\n opt.merge!(item) if item.is_a?(Hash)\n opt.reverse_merge!(id_term(item, **opt))\n id = opt[id_key] || opt[alt_id_key(opt)]\n if id && (id_key == id_column)\n record = record_class.find(id)\n error = \"for #{id_key} #{id.inspect}\" unless record\n elsif id\n record = record_class.find_by(id_key => id)\n error = \"for #{id_key} #{id.inspect}\" unless record\n else\n error = \"#{id_key} value given\"\n end\n error &&= \"No #{record_name} #{error}\"\n else\n error = \"#{record_name}: :id_key set to nil\"\n end\n\n if record\n record\n elsif !id\n Log.info { \"#{meth}: #{error} (no record specified)\" }\n raise_failure(:file_id) unless no_raise\n elsif no_raise\n # noinspection RubyMismatchedReturnType\n Log.warn { \"#{meth}: #{error} (skipping)\" }\n else\n Log.error { \"#{meth}: #{error}\" }\n raise_failure(:find, item) unless no_raise\n end\n end", "title": "" }, { "docid": "b0f42ebd9039a8296ffca0cdd41dbd38", "score": "0.5653262", "text": "def find_id(id)\n @candidates.find {|candidate| candidate if candidate[:id] == id}\nend", "title": "" }, { "docid": "7464355f4faa5a6df74f525415c4df7a", "score": "0.5651584", "text": "def find_by_id(id)\n results = one.find_by_id_ne(id)\n results && !results['id'].blank? && new(results) || nil\n end", "title": "" }, { "docid": "fed6a9c347395da5e62380371986c3ba", "score": "0.5646929", "text": "def find_single(id, *args)\n data = get(id.to_s, *args)\n return nil unless data && !data.empty?\n instantiate(id, data)\n end", "title": "" } ]
85edd37fac07067a30c438e2a1b2374e
Set the value of the GlobalID input for this Choreo.
[ { "docid": "b0b29abe6c11bbcd91db122eb29af1dc", "score": "0.7564284", "text": "def set_GlobalID(value)\n set_input(\"GlobalID\", value)\n end", "title": "" } ]
[ { "docid": "3307e8bda195fb717fb19eb35834ce74", "score": "0.67061085", "text": "def set_global\n @global = Global.find(params[:id])\n end", "title": "" }, { "docid": "3307e8bda195fb717fb19eb35834ce74", "score": "0.67061085", "text": "def set_global\n @global = Global.find(params[:id])\n end", "title": "" }, { "docid": "77cd4081486dc7d9b91b7b54de4560b8", "score": "0.6202", "text": "def from_global_id(global_id)\n @from_global_id_proc.call(global_id)\n end", "title": "" }, { "docid": "05bb2bffd7cc7e680e4f43afe37f9fb9", "score": "0.61035246", "text": "def set_global\n @global = Global.find(params[:id])\n end", "title": "" }, { "docid": "408ec62474d0b10e707455beb536821e", "score": "0.59593487", "text": "def set_global_preference\n @global_preference = GlobalPreference.find(params[:id])\n end", "title": "" }, { "docid": "d1f462e8e360a5f308aea73eeeeedbe5", "score": "0.5864592", "text": "def set_global_role\n @global_role = GlobalRole.find(params[:id])\n end", "title": "" }, { "docid": "ca683b449de190d223873f32947bb878", "score": "0.5833345", "text": "def set_global_link\n @global_link = GlobalLink.find(params[:id])\n end", "title": "" }, { "docid": "0f0ae99400b50cdf361d1ca60e690c96", "score": "0.5708983", "text": "def set_globalinfo\r\n @globalinfo = Globalinfo.find(params[:id])\r\n end", "title": "" }, { "docid": "357a7e20e19685004600d509955b8c80", "score": "0.5675227", "text": "def change_global_user_id(user_id)\n $user_id = user_id\n end", "title": "" }, { "docid": "6fb096a3655522d2598764041b545974", "score": "0.56298417", "text": "def set_global_variable\n @global_variable = GlobalVariable.find(params[:id])\n end", "title": "" }, { "docid": "7bad4322136f04a0a7914331b752e1cb", "score": "0.54635936", "text": "def global_var=(value)\n $global_var = value\n end", "title": "" }, { "docid": "b5bec50c98c74b2aa7b0e7800cc00757", "score": "0.5445386", "text": "def set_global_setting\n @global_setting = GlobalSetting.find(params[:id])\n end", "title": "" }, { "docid": "b34bc9d2eb569ab1591f4ea6eb14286e", "score": "0.5430204", "text": "def set_globalsetting\n @globalsetting = Globalsetting.find(params[:id])\n end", "title": "" }, { "docid": "b0ce69382d2c03a888854a2d74fbfddf", "score": "0.541887", "text": "def global_id_for(any_id, source_shard = nil)\n id = integral_id_for(any_id)\n return any_id unless id\n\n signed_id_operation(id) do |abs_id|\n if abs_id >= IDS_PER_SHARD\n abs_id\n else\n source_shard ||= Shard.current\n source_shard.global_id_for(abs_id)\n end\n end\n end", "title": "" }, { "docid": "aa577589cabd3d4843fa0fba2339d6ce", "score": "0.54001486", "text": "def set_global_only\n @global_only = true\n self\n end", "title": "" }, { "docid": "aa577589cabd3d4843fa0fba2339d6ce", "score": "0.54001486", "text": "def set_global_only\n @global_only = true\n self\n end", "title": "" }, { "docid": "afaf3d32385b6ea70159493780886a1b", "score": "0.5363174", "text": "def global_id_for(local_id)\n return nil unless local_id\n\n self.class.signed_id_operation(local_id) do |abs_id|\n abs_id + (id * IDS_PER_SHARD)\n end\n end", "title": "" }, { "docid": "a20ae7819e26fbb630214997fbdd8582", "score": "0.5290116", "text": "def set_globalcontact\n @globalcontact = Globalcontact.find(params[:id])\n end", "title": "" }, { "docid": "03404220c78e6dcabba3b7ef732c85f0", "score": "0.5254232", "text": "def global_id\n return id if eadid == id\n\n \"#{eadid}_#{id}\"\n end", "title": "" }, { "docid": "6412c73d9a4aa31be87f9f3baf8a6ccc", "score": "0.5182418", "text": "def set_g4_dongal_board_global\n @g4_dongal_board_global = G4DongalBoardGlobal.find(params[:id])\n end", "title": "" }, { "docid": "88bf1d29c3d3a94d3ae2865b35f2d3a7", "score": "0.51683354", "text": "def global_id\n return id if eadid == id\n \"#{eadid}#{id}\"\n end", "title": "" }, { "docid": "750cfe96d8c85af1b954bb6bcc1fd751", "score": "0.5092299", "text": "def set_global_annoucement\n @global_annoucement = GlobalAnnoucement.find(params[:id])\n end", "title": "" }, { "docid": "e67cc20d152f579be3a648d3673dbe31", "score": "0.5037968", "text": "def set_global_var(name, value)\n @@_global_variables[name] = value\n end", "title": "" }, { "docid": "812a7016f7ce774f0b4fb538c1f27887", "score": "0.49633282", "text": "def set_global_goal\n @global_goal = GlobalGoal.find(params[:id])\n end", "title": "" }, { "docid": "0c690862110dc5ff665fb7cc53b2ed1a", "score": "0.4928142", "text": "def to_global_id\n GlobalID.create(self, app: config.identifier, score: score)\n end", "title": "" }, { "docid": "6b4d963a61fe3494a511caaa9be21759", "score": "0.4927026", "text": "def last_id\n num = read '/', '_global_id'\n unless num\n num = 0\n write '/', '_global_id', :set, num.to_i\n end\n num.to_i\n end", "title": "" }, { "docid": "f8494fc114dda4f76c329c1d4c5f580f", "score": "0.49263766", "text": "def set_global_report\n @global_report = GlobalReport.find(params[:id])\n end", "title": "" }, { "docid": "f63ee711eb80d316ba3dcec8b0cb7106", "score": "0.49163255", "text": "def set_tbl_global\n @tbl_global = TblGlobal.find(params[:id])\n end", "title": "" }, { "docid": "5d2188b5835952feca951efab50f0808", "score": "0.4915145", "text": "def family_id= new_family_id\n frozen_check!\n @gapi.family_id = new_family_id\n end", "title": "" }, { "docid": "cd3b0aa8fb661245d3c60a857ceb95b1", "score": "0.49110204", "text": "def to_signed_global_id(options = {})\n SignedGlobalID.create(self, options)\n end", "title": "" }, { "docid": "4c97f07ec8dd15e6cbf310a63a7a1677", "score": "0.49003237", "text": "def to_global_id(type_name, id)\n @to_global_id_proc.call(type_name, id)\n end", "title": "" }, { "docid": "d8b8db3af8aa0d5cae756b05172b9bed", "score": "0.48804405", "text": "def edit_global_variable(variable_id, body, opts = {})\n data, _status_code, _headers = edit_global_variable_with_http_info(variable_id, body, opts)\n data\n end", "title": "" }, { "docid": "1a62e24ce86f530f5de6ec3ceea9c68d", "score": "0.4876456", "text": "def object_from_id(global_id, ctx = {})\n gid = parse_gid(global_id, ctx)\n\n find_by_gid(gid)\n end", "title": "" }, { "docid": "4796c8e1ce73ac776cf2c04583ef8823", "score": "0.48639706", "text": "def to_gid_param(options = {})\n to_global_id(options).to_param\n end", "title": "" }, { "docid": "fdfe311efc65736819ee59eeef491075", "score": "0.48619777", "text": "def global_scope\n @scope = :global\n self\n end", "title": "" }, { "docid": "5c2c267ce10aae0bb884938f6a9ac6c7", "score": "0.4846844", "text": "def update\n @global_param = GlobalParam.find(params[:id])\n\n respond_to do |format|\n if @global_param.update_attributes(params[:global_param])\n format.html { redirect_to @global_param, notice: 'Global param was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @global_param.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "17b58f21fac33eb1048c72fe15bddabc", "score": "0.4837546", "text": "def setID=(value)\n\t\t@m_id = value;\n\tend", "title": "" }, { "docid": "da896acfdd66e5673bce3148a49b03bd", "score": "0.48222953", "text": "def group_id=(value)\n set :group_id, value\n end", "title": "" }, { "docid": "51ddc1ad61a866a2dc13e9fbb46bf6a2", "score": "0.48094946", "text": "def set_global (options)\n if options\n @global = Configuration.new(options)\n else\n @global = nil\n end\n end", "title": "" }, { "docid": "55f9219d9dc608d6c12505b6b3452bb2", "score": "0.47598195", "text": "def set_global(window)\n Tk.execute(:grab, :set, '-global', window)\n end", "title": "" }, { "docid": "a3e500e97252e7a2ac3e6d4b0cec5436", "score": "0.4757559", "text": "def market_id=(market_id)\n @headers ||= {}\n @headers['X-EBAY-SOA-GLOBAL-ID'] = market_id\n end", "title": "" }, { "docid": "cbe875306b4cf52a5b275e8d1cfc9fe4", "score": "0.47458282", "text": "def group_id= v\n set :groupid, v\n end", "title": "" }, { "docid": "5bcdc1a186a54801115b70f122143cfe", "score": "0.4744395", "text": "def define_global_variable(name, value = nil)\n return add_child_definition(name, :global_variable, value)\n end", "title": "" }, { "docid": "38010e1ba4c6b595ec5262f91b716434", "score": "0.47158155", "text": "def pointer_to_global(global)\n C.get_pointer_to_global(self, global)\n end", "title": "" }, { "docid": "8ab0a6c20a29fef98280a1c28f334b24", "score": "0.4704538", "text": "def index_object_id( global_id, key )\n\n @keys[ key ] = global_id\n @reverse_keys[ global_id ] = key\n \n return self\n\n end", "title": "" }, { "docid": "fa49d6314b9cd207b19d6b26dca16fa5", "score": "0.46959263", "text": "def []=(key, value)\n global[key] = value\n end", "title": "" }, { "docid": "705ccce293e18f9f786c24f0259d11b2", "score": "0.4667477", "text": "def register_global_mode(mode)\n unless mode.nil?\n register_mode(mode)\n @global_mode = mode.new\n else\n raise \"Can't register nil as global mode\"\n end\n end", "title": "" }, { "docid": "b7b81080f94a4bd62a6ec7f859ac0036", "score": "0.46521893", "text": "def update\n respond_to do |format|\n if @global.update(global_params)\n format.html { redirect_to @global, notice: 'Global was successfully updated.' }\n format.json { render :show, status: :ok, location: @global }\n else\n format.html { render :edit }\n format.json { render json: @global.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c1b92a0378dc9942d6fa8b8b5e53eab7", "score": "0.46487752", "text": "def pointer_to_global(global)\n C.LLVMGetPointerToGlobal(self, global)\n end", "title": "" }, { "docid": "26bec53b2dee256118452e69554e143d", "score": "0.4622181", "text": "def global_headers=(headers)\n @global_headers = headers\n end", "title": "" }, { "docid": "5e863a079945f9f4425752e1a421edec", "score": "0.46195891", "text": "def update_bre_global(id, opts = {})\n data, _status_code, _headers = update_bre_global_with_http_info(id, opts)\n return data\n end", "title": "" }, { "docid": "6d5fad75254905c5a3a055578d388714", "score": "0.46090984", "text": "def set_EventID(value)\n set_input(\"EventID\", value)\n end", "title": "" }, { "docid": "6d5fad75254905c5a3a055578d388714", "score": "0.46090984", "text": "def set_EventID(value)\n set_input(\"EventID\", value)\n end", "title": "" }, { "docid": "6d5fad75254905c5a3a055578d388714", "score": "0.46090984", "text": "def set_EventID(value)\n set_input(\"EventID\", value)\n end", "title": "" }, { "docid": "6d5fad75254905c5a3a055578d388714", "score": "0.46090984", "text": "def set_EventID(value)\n set_input(\"EventID\", value)\n end", "title": "" }, { "docid": "6d5fad75254905c5a3a055578d388714", "score": "0.46082768", "text": "def set_EventID(value)\n set_input(\"EventID\", value)\n end", "title": "" }, { "docid": "cdafc7e603f556a1f07d0cf48c8f8db1", "score": "0.4600583", "text": "def initialize\n super(GLOBAL_ID)\n end", "title": "" }, { "docid": "7a87da1faa833be7f88ae93c47d66b5d", "score": "0.4597687", "text": "def set_ID(value)\n set_input(\"ID\", value)\n end", "title": "" }, { "docid": "7a87da1faa833be7f88ae93c47d66b5d", "score": "0.45968014", "text": "def set_ID(value)\n set_input(\"ID\", value)\n end", "title": "" }, { "docid": "7a87da1faa833be7f88ae93c47d66b5d", "score": "0.45968014", "text": "def set_ID(value)\n set_input(\"ID\", value)\n end", "title": "" }, { "docid": "7a87da1faa833be7f88ae93c47d66b5d", "score": "0.45968014", "text": "def set_ID(value)\n set_input(\"ID\", value)\n end", "title": "" }, { "docid": "7a87da1faa833be7f88ae93c47d66b5d", "score": "0.45968014", "text": "def set_ID(value)\n set_input(\"ID\", value)\n end", "title": "" }, { "docid": "7a87da1faa833be7f88ae93c47d66b5d", "score": "0.45968014", "text": "def set_ID(value)\n set_input(\"ID\", value)\n end", "title": "" }, { "docid": "7a87da1faa833be7f88ae93c47d66b5d", "score": "0.45968014", "text": "def set_ID(value)\n set_input(\"ID\", value)\n end", "title": "" }, { "docid": "7a87da1faa833be7f88ae93c47d66b5d", "score": "0.45968014", "text": "def set_ID(value)\n set_input(\"ID\", value)\n end", "title": "" }, { "docid": "7a87da1faa833be7f88ae93c47d66b5d", "score": "0.45968014", "text": "def set_ID(value)\n set_input(\"ID\", value)\n end", "title": "" }, { "docid": "7a87da1faa833be7f88ae93c47d66b5d", "score": "0.45968014", "text": "def set_ID(value)\n set_input(\"ID\", value)\n end", "title": "" }, { "docid": "7a87da1faa833be7f88ae93c47d66b5d", "score": "0.45968014", "text": "def set_ID(value)\n set_input(\"ID\", value)\n end", "title": "" }, { "docid": "7a87da1faa833be7f88ae93c47d66b5d", "score": "0.45968014", "text": "def set_ID(value)\n set_input(\"ID\", value)\n end", "title": "" }, { "docid": "7a87da1faa833be7f88ae93c47d66b5d", "score": "0.45968014", "text": "def set_ID(value)\n set_input(\"ID\", value)\n end", "title": "" }, { "docid": "853ed5f5fa283587bc3401a55c2dd000", "score": "0.4587956", "text": "def set_id\n @id = 0 #Normally IDs are generated using packages, like UUID package for example. Never hard-coded.\n end", "title": "" }, { "docid": "39f351cbf7c3d1284c5b51829baf86e9", "score": "0.4587293", "text": "def gid=(value)\n value = group2id(value) unless [Fixnum, Bignum].include?(value.class)\n\n @property_hash[:gid] = value\n end", "title": "" }, { "docid": "3649ee1c3d2d2635c501addbca3ac855", "score": "0.4584583", "text": "def scope_id=(value)\n @scope_id = value\n end", "title": "" }, { "docid": "3649ee1c3d2d2635c501addbca3ac855", "score": "0.4584583", "text": "def scope_id=(value)\n @scope_id = value\n end", "title": "" }, { "docid": "5c6d071c42a66b1203f76667db294937", "score": "0.45784438", "text": "def set(groupid)\n @groupid = groupid\n self\n end", "title": "" }, { "docid": "3b1bf88cb3db3109bc32bb042f470620", "score": "0.45759338", "text": "def default_server_group_id=(new_id)\n clear_servers!\n self[:default_server_group_id] = new_id\n end", "title": "" }, { "docid": "3727aea78320ab055383e2317976914e", "score": "0.45745057", "text": "def set_PlaceID(value)\n set_input(\"PlaceID\", value)\n end", "title": "" }, { "docid": "3727aea78320ab055383e2317976914e", "score": "0.45745057", "text": "def set_PlaceID(value)\n set_input(\"PlaceID\", value)\n end", "title": "" }, { "docid": "1bdfc7e7a8b516cf9c26f780dec8fd91", "score": "0.4567825", "text": "def []=(gm_id, value)\n return nil if gm_id.nil?\n @db[gm_id] = value\n end", "title": "" }, { "docid": "d0f2d7bd0bea2e0cdfc30855fdde0c8b", "score": "0.45611855", "text": "def update\n @all_global = AllGlobal.find(params[:id])\n\n respond_to do |format|\n if @all_global.update_attributes(params[:all_global])\n format.html { redirect_to @all_global, notice: 'All global was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @all_global.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ea7a6e971d32cb901d5e604538d0fe5d", "score": "0.45411313", "text": "def group_id=( g )\n @prev_group_id ||= group_id\n self[ :group_id ] = g\n end", "title": "" }, { "docid": "71b2f719487166994f69ae06165fcd42", "score": "0.45250973", "text": "def set_ID(value)\n set_input(\"ID\", value)\n end", "title": "" }, { "docid": "71b2f719487166994f69ae06165fcd42", "score": "0.45250106", "text": "def set_ID(value)\n set_input(\"ID\", value)\n end", "title": "" }, { "docid": "71b2f719487166994f69ae06165fcd42", "score": "0.45243508", "text": "def set_ID(value)\n set_input(\"ID\", value)\n end", "title": "" }, { "docid": "71b2f719487166994f69ae06165fcd42", "score": "0.45243508", "text": "def set_ID(value)\n set_input(\"ID\", value)\n end", "title": "" }, { "docid": "71b2f719487166994f69ae06165fcd42", "score": "0.45243508", "text": "def set_ID(value)\n set_input(\"ID\", value)\n end", "title": "" }, { "docid": "71b2f719487166994f69ae06165fcd42", "score": "0.45243508", "text": "def set_ID(value)\n set_input(\"ID\", value)\n end", "title": "" }, { "docid": "71b2f719487166994f69ae06165fcd42", "score": "0.45243508", "text": "def set_ID(value)\n set_input(\"ID\", value)\n end", "title": "" }, { "docid": "71b2f719487166994f69ae06165fcd42", "score": "0.45243508", "text": "def set_ID(value)\n set_input(\"ID\", value)\n end", "title": "" }, { "docid": "71b2f719487166994f69ae06165fcd42", "score": "0.45243508", "text": "def set_ID(value)\n set_input(\"ID\", value)\n end", "title": "" }, { "docid": "71b2f719487166994f69ae06165fcd42", "score": "0.45243508", "text": "def set_ID(value)\n set_input(\"ID\", value)\n end", "title": "" }, { "docid": "71b2f719487166994f69ae06165fcd42", "score": "0.45243508", "text": "def set_ID(value)\n set_input(\"ID\", value)\n end", "title": "" }, { "docid": "71b2f719487166994f69ae06165fcd42", "score": "0.45243508", "text": "def set_ID(value)\n set_input(\"ID\", value)\n end", "title": "" }, { "docid": "71b2f719487166994f69ae06165fcd42", "score": "0.45243508", "text": "def set_ID(value)\n set_input(\"ID\", value)\n end", "title": "" }, { "docid": "71b2f719487166994f69ae06165fcd42", "score": "0.45243508", "text": "def set_ID(value)\n set_input(\"ID\", value)\n end", "title": "" }, { "docid": "71b2f719487166994f69ae06165fcd42", "score": "0.45243508", "text": "def set_ID(value)\n set_input(\"ID\", value)\n end", "title": "" } ]
0b4f51773ef4a7ad154f7dd530f303b0
Returns the centroid of a bounding box
[ { "docid": "a11ecc80c433eaa495feea236cf86696", "score": "0.7070238", "text": "def bbox_centroid(left_btm, right_top)\n haversine_midpoint(*left_btm, *right_top)\n end", "title": "" } ]
[ { "docid": "1e924da5bff7d5e2eacb7974ac4a7620", "score": "0.77792686", "text": "def centroid\n @centroid = @geometry.centroid unless @centroid\n @centroid\n end", "title": "" }, { "docid": "7ec62b3354d6a43ba2ed3ef7277818c9", "score": "0.7579035", "text": "def centroid\n @centroid ||= calculate_centroid\n end", "title": "" }, { "docid": "171cf4d7bec117507301ed2d008e7301", "score": "0.74156505", "text": "def centroid\n # TODO - is this right?\n x = self.elements.inject(0.0) { |sum, p| p.x + sum } / self.elements.length\n y = self.elements.inject(0.0) { |sum, p| p.y + sum } / self.elements.length\n return Point.new(x, y)\n end", "title": "" }, { "docid": "fb25105f2408431a31f474853bc9890c", "score": "0.74156195", "text": "def centroid\n postgis_calculate(:centroid, self)\n end", "title": "" }, { "docid": "e23c25cd57410aa9bb529e49ef911816", "score": "0.7391772", "text": "def calculate_centroid(bounding_box)\n latitude = (bounding_box[:sw][:latitude].to_f + bounding_box[:ne][:latitude].to_f) / 2.0\n longitude = (bounding_box[:sw][:longitude].to_f + bounding_box[:ne][:longitude].to_f) / 2.0\n { :latitude => latitude, :longitude => longitude }\n end", "title": "" }, { "docid": "f44009a3bf4717c075183b92a118e2fc", "score": "0.7281809", "text": "def centroid\n MB::Geometry.centroid(voronoi_vertices.map(&:point))\n end", "title": "" }, { "docid": "05f25114426865ec13096088f1950e1d", "score": "0.7186738", "text": "def centroid\n self.vertices.pointlist.centroid\n end", "title": "" }, { "docid": "98e938bdec31a8a50f19262e07e88b59", "score": "0.71846104", "text": "def centroid\n Placemaker::Coordinates.new(@nodeset.search('.//xmlns:centroid'))\n end", "title": "" }, { "docid": "399c443e8dcfa40e714cdd2e690d2f3f", "score": "0.7178657", "text": "def centroid\n cent = []\n @matrix.dim.times do |i|\n cent[i] = @matrix[i, true].sum / @matrix.sizes[1]\n end\n return NArray.to_na(cent)\n end", "title": "" }, { "docid": "c35775bba886ef89cba44771e9a7c2c0", "score": "0.71123594", "text": "def centroid\n return nil unless surface? && !feature.empty?\n\n point = feature.centroid\n [point.y, point.x]\n end", "title": "" }, { "docid": "92997de7421738bfb4b64ee4cd92718e", "score": "0.70908487", "text": "def centroid\n upoints = unique_points\n if upoints.length <= 2\n return @points.first\n end\n\n cx = 0.0\n cy = 0.0\n j = upoints.length\n n = j\n factor = 0.0\n upoints.each_with_index() do |p, i|\n j = (i + 1) % n\n factor = p.lat * upoints[j].lon - upoints[j].lat * p.lon\n cx += (p.lat + upoints[j].lat) * factor\n cy += (p.lon + upoints[j].lon) * factor\n end\n\n factor = 1 / (area * 6.0)\n cx *= factor\n cy *= factor\n OpenStruct.new(lat: cx, lon:cy)\n end", "title": "" }, { "docid": "804048fea215bdb7ccc6e8944d0bcb1f", "score": "0.7070175", "text": "def center(bounding_box)\n { \n :latitude => (bounding_box[:sw][:latitude].to_f + bounding_box[:ne][:latitude].to_f) / 2.0,\n :longitude => (bounding_box[:sw][:longitude].to_f + bounding_box[:ne][:longitude].to_f) / 2.0,\n }\n end", "title": "" }, { "docid": "7e0eb999a1de5179d51dcd65a2a4ebe9", "score": "0.7068058", "text": "def centroid\n nil\n end", "title": "" }, { "docid": "504941d3e882fcaaa895500ff2233642", "score": "0.68498576", "text": "def getCenterInLonLat() ;\n bbox = getBBoxInLonLat() ;\n cx = (bbox.minPos().x() + bbox.maxPos().x()) / 2.0 ;\n cy = (bbox.minPos().y() + bbox.maxPos().y()) / 2.0 ;\n return Geo2D::Point.new(cx, cy) ;\n end", "title": "" }, { "docid": "5b049146f26672169a48acdfa72cb3ea", "score": "0.6686636", "text": "def centroid\n multipeak? ? centroids_from_multipeak : centroid_from_single_peak\n end", "title": "" }, { "docid": "30d7fdcc43aaa0c8ea1465a7bf2c54c0", "score": "0.6625371", "text": "def centroid\n raise Error::UnsupportedOperation, \"Method Surface#centroid not defined.\"\n end", "title": "" }, { "docid": "33372f41eab1c20db5ee265ac688a8bd", "score": "0.6609903", "text": "def centroid_of (bin)\n\t\taverage_l = bin.inject(0){|acc, v| acc + v['frequency']*v['lab']['l']}\n\t\taverage_a = bin.inject(0){|acc, v| acc + v['frequency']* v['lab']['a']}\n\t\taverage_b = bin.inject(0){|acc, v| acc + v['frequency']* v['lab']['b']}\n\t\t\n\t\tcount_pixels = bin.inject(0){|acc, v| acc + v['frequency']}\t\n\t\t\n\t\taverage_l /= count_pixels; average_a /= count_pixels; average_b /= count_pixels\n\t\t\n\t\tcentroid = {'l' => average_l, 'a'=>average_a, 'b'=>average_b, 'frequency' => count_pixels}\n\tend", "title": "" }, { "docid": "ccd4630ee1d9e5346ccf5ffb32b13d26", "score": "0.65551007", "text": "def centroid_from_single_peak\n\n # Also, note Guo's \"A Simple Algorithm for Fitting a Gaussian\n # Function\" 2011. IEEE signal processing magazine.\n # http://scipy-central.org/item/28/2/fitting-a-gaussian-to-noisy-data-points\n\n # also consider the approach of just old school calc of stand-dev!\n (xs, ys) = xpoints_ypoints\n if xs.length == 1\n [xs[0], 0]\n elsif xs.length == 2\n centroid_two_points(xs,ys)\n else\n centroid_gaussian(xs,ys)\n end\n end", "title": "" }, { "docid": "7eb5225b4163232918208048544325d8", "score": "0.64726025", "text": "def centroid\n raise Error::UnsupportedOperation, \"Method MultiSurface#centroid not defined.\"\n end", "title": "" }, { "docid": "7eb5225b4163232918208048544325d8", "score": "0.64726025", "text": "def centroid\n raise Error::UnsupportedOperation, \"Method MultiSurface#centroid not defined.\"\n end", "title": "" }, { "docid": "9fcdf6e31f1686090191392e3d7ee614", "score": "0.63243735", "text": "def get_centroid\n get_line_median_a.find_intersecting_point_with_line(get_line_median_b)\n end", "title": "" }, { "docid": "bf331ec82d66f3de15fc5a005d6a49d5", "score": "0.63148695", "text": "def get_centroids\n getClusterCentroids\n end", "title": "" }, { "docid": "9fde53af0c034ca0558e1c2aa12238a3", "score": "0.6273927", "text": "def bounding_box\n self.vertices.pointlist.bounding_box\n end", "title": "" }, { "docid": "829310232303be6228db0f8ad43a4306", "score": "0.6250373", "text": "def center\n\t[map(&:x).mean, map(&:y).mean]\n end", "title": "" }, { "docid": "f21dcb9450249c5244212dc29a211597", "score": "0.62427205", "text": "def random_centroid\n position = (0...self.dimension_size).inject([]) do |list, i|\n list << rand_between(self.boundaries[i].first, self.boundaries[i].last)\n end\n Centroid.new(position)\n end", "title": "" }, { "docid": "159b7af5f952f6f74557af1349e7bf27", "score": "0.62419575", "text": "def bounding_box\n points = @register.map { |row|\n row.shape.bounding_box\n }\n points = points.compact.flatten\n PointList.new(points).bounding_box\n end", "title": "" }, { "docid": "754666f8f2c4a1111205d4cd5b452b07", "score": "0.6239015", "text": "def centre\n if location.geometry_type == RGeo::Feature::Point\n location\n else\n envelope = location.envelope\n if envelope.geometry_type == RGeo::Feature::Point\n envelope\n else\n envelope.centroid\n end\n end\n end", "title": "" }, { "docid": "e3fe854265e9957457dccaa08db01dcf", "score": "0.6212292", "text": "def centroid(data_set)\n data_set.get_mean_or_mode\n end", "title": "" }, { "docid": "c6723e997a4ea15ffe864e4b8f6bd9d5", "score": "0.6211051", "text": "def st_centroid(g)\n args = [g]\n\n ::RGeo::ActiveRecord::SpatialNamedFunction.new(\n 'ST_Centroid', args, [true, true]\n )\n end", "title": "" }, { "docid": "db327e025c006a25a51eff3743abbfca", "score": "0.6209312", "text": "def calculate_centroid\n\n # Clear the centroid vector\n @vcentroid.clear\n tcentroid = Hash.new( \"0\" )\n\n # Iterate through each feature vector\n @people.each do |person|\n\n # Sum the feature vectors in this cluster\n person.each do |key,value|\n tcentroid[key] = tcentroid.delete(key).to_i + value.to_i\n end\n\n end\n\n # Compute the average for the centroid\n tcentroid.each do |key,value|\n @vcentroid[key] = value.to_f / @people.length\n end\n\n end", "title": "" }, { "docid": "6eba3dee2f5acf92378c388696d26825", "score": "0.6188305", "text": "def bounding_box\n width = image.width * scaling\n height = image.height * scaling\n\n Box.new(\n Point.new(position.x + width * 0.3, position.y + height * 0.6, position.z),\n width * 0.4,\n height * 0.4,\n )\n end", "title": "" }, { "docid": "c49e7e4b155ff597f2880c48fad187cf", "score": "0.6179198", "text": "def compute\n # first-cut bounding box (in degrees)\n @max_latitude = latitude + rad2deg(radius / EARTH_RADIUS)\n @min_latitude = latitude - rad2deg(radius / EARTH_RADIUS)\n\n # compensate for degrees longitude getting smaller with increasing latitude\n @max_longitude = longitude + rad2deg(radius / EARTH_RADIUS / Math.cos(deg2rad(latitude)))\n @min_longitude = longitude - rad2deg(radius / EARTH_RADIUS / Math.cos(deg2rad(latitude)))\n end", "title": "" }, { "docid": "7185c1f029bf86979dd10d4a1ef4f005", "score": "0.6168171", "text": "def centroid(points)\n HonorRoll::Point.new points.transpose.map{ |d| d.reduce(:+) / d.count.to_f }\n end", "title": "" }, { "docid": "d4c0c8d3fb39b178b63c717692f22376", "score": "0.61648935", "text": "def center\n x = @rect.x + (@rect.width / 2)\n y = @rect.y + (@rect.height / 2)\n\n Point.new(x, y)\n end", "title": "" }, { "docid": "05d44707184005d76bef15bd8fa1acf9", "score": "0.6140114", "text": "def calculate_bounding_box(*attributes)\n center = attributes.length == 2 && [attributes[0], attributes[1]] || attributes.first\n if center.kind_of?(Array) && center.length == 2\n center.map! { |value| value.to_f }\n {\n :sw => { :latitude => center.first - 0.25, :longitude => center.last - 0.25 },\n :ne => { :latitude => center.first + 0.25, :longitude => center.last + 0.25 }\n }\n elsif center.kind_of?(Hash) && center.include?(:latitude) && center.include?(:longitude)\n {\n :sw => { :latitude => center[:latitude].to_f - 0.25, :longitude => center[:longitude].to_f - 0.25 },\n :ne => { :latitude => center[:latitude].to_f + 0.25, :longitude => center[:longitude].to_f + 0.25 }\n }\n elsif center.nil?\n nil\n else\n raise \"Invaild center attribute when trying to calculate bounding box.\"\n end\n end", "title": "" }, { "docid": "9a5a43e1288cdc11be094ac01c2433bf", "score": "0.6124882", "text": "def centroid(points) #INPUT: an Array of Points\n x = 0\n z = 0\n points.each do |p|\n x = p.x + x\n z = p.z + z\n end\n x = x / points.size\n z = z / points.size\n return x, z\n end", "title": "" }, { "docid": "fbab362c3ebd3ce4696120c0ddb31252", "score": "0.60863525", "text": "def get_point(input)\n geocode_base_uri = \"http://geocoding.cloudmade.com/\" + ENV[\"CLOUDMADE_API_KEY\"] + \"/geocoding/v2/find.js\"\n\n results = open(geocode_base_uri + \"?query=\" + URI.escape(input))\n\n centroid = []\n\n results_hash = JSON.load(results.read)\n if !results_hash.nil? && !results_hash.empty? && results_hash.keys.include?(\"found\")\n centroid = results_hash[\"features\"][0][\"centroid\"][\"coordinates\"]\n end\n\n return centroid\n end", "title": "" }, { "docid": "999251f16c4e566b5bd809652dae9bce", "score": "0.59977806", "text": "def centroid(locations, options = {})\n case locations.length\n when 1 then return locations.first\n when 2 then return midpoint_between(locations.first, locations.last, options)\n when 3 then return triangle_centroid(locations[0], locations[1], locations[2], options)\n end\n\n areas, total_area, centroids, clockwise = centroid_area_helper(locations, :all, options)\n\n # Take the area weighted sum of the centroids, with a negative weight\n # being applied to counter-clockwise trianges (which means its area is\n # entirely outside the polyogon)\n latitude = 0\n longitude = 0\n centroids.each_with_index do |centroid, i|\n weight = areas[i] / total_area\n weight *= -1 unless clockwise[i]\n latitude += centroid.lat * weight\n longitude += centroid.lng * weight\n end\n\n LatLng.new(latitude, longitude)\n end", "title": "" }, { "docid": "f658e9b66d4354c53c6873829f307670", "score": "0.5970035", "text": "def polygon_center(c)\n c << c[0]\n c << c[1]\n\n a = 0\n 0.step(c.size - 4, 2) do |i|\n a += (((c[i + 2] - c[i]) * (c[i + 3] + c[i + 1])) / 2)\n end\n a = a.abs\n\n x = 0\n y = 0\n 0.step(c.size - 4, 2) do |i|\n tmp = (c[i] * c[i + 3]) - (c[i + 2] * c[i + 1])\n x += (c[i] + c[i + 2]) * tmp\n y += (c[i + 1] + c[i + 3]) * tmp\n end\n x = ((x / 6) / a).to_i\n y = ((y / 6) / a).to_i\n if x < 0\n x = -x\n y = -y\n end\n [x, y].join(',')\n end", "title": "" }, { "docid": "864513e7a062fbf0f174459fd05c590f", "score": "0.59430975", "text": "def center\n # bad: [ (x1 - x0) / 2, (y1 - y0) / 2 ]\n # good:\n # [\n # x0 + ((x1-x0)/2),\n # y0 + ((y1-y0)/2)\n # ]\n [ x0 + ((x1-x0)/2), y0 + ((y1-y0)/2) ]\n end", "title": "" }, { "docid": "0169c1efcd8379f486eda5e819fa04e9", "score": "0.5921705", "text": "def find_noninclusive_center(blob) \n sumx = 0; sumy = 0\n total = blob.length\n blob.each do |x,y|\n sumx += x \n sumy += y\n end\n xavg = sumx.to_f / total\n yavg = sumy.to_f / total \n center_pos = [xavg, yavg]\n return center_pos\n end", "title": "" }, { "docid": "0df51ddc648b701f544b5a12db94c623", "score": "0.59128296", "text": "def user_bounding_box\n [@user_xmin, @user_ymin, @user_xmax, @user_ymax]\n end", "title": "" }, { "docid": "de42c98dd90af0cf29e92adaf42db903", "score": "0.58733684", "text": "def centroids(clusters)\n clusters.values.map { |cluster_points| centroid cluster_points }\n end", "title": "" }, { "docid": "2f4fd2d3dc72b7a5fcae28d0888fe982", "score": "0.5872089", "text": "def bounding_box\n Rectangle.new(bounding_box_top_left, bounding_box_bottom_right)\n end", "title": "" }, { "docid": "2f60727f74b060994969ec1ad2a1925f", "score": "0.58456355", "text": "def calculate_center\n p1 = Point[@leftp.x, (@top_left_corner.y + @bottom_left_corner.y)/2]\n p2 = Point[@rightp.x, (@top_right_corner.y + @bottom_right_corner.y)/2]\n s = Segment[p1,p2]\n p3 = Point[(@leftp.x + @rightp.x)/2, 0]\n @center = s.x_projection(p3)\n end", "title": "" }, { "docid": "0a9cac3795af28d2b26b3dd563c67b9c", "score": "0.58255416", "text": "def center\n \tGeocoder::Calculations.geographic_center(to_a)\n end", "title": "" }, { "docid": "fc80f40626854e7a0cfd89d121843094", "score": "0.58234507", "text": "def findCenter() \n centerX = (@x * 80)\n centerY = (@y * 80)\n \n [centerX, centerY]\n end", "title": "" }, { "docid": "f9b4aa10e0ff400eb817672b7c599d24", "score": "0.5821774", "text": "def area_bounding_box\n [@xmin, @ymin, @xmax, @ymax]\n end", "title": "" }, { "docid": "367aca47c7aa6277344b2ed6e8604dca", "score": "0.58203983", "text": "def get_bounding_box\n Body.validate(self)\n bb = Geom::BoundingBox.new\n bb.add MSPhysics::Newton::Body.get_aabb(@_address)\n bb\n end", "title": "" }, { "docid": "e1c8b850272d0af0409c2822289ce2d0", "score": "0.5805923", "text": "def bbox\n BoundingBox.new(longitude, latitude, longitude, latitude)\n end", "title": "" }, { "docid": "949f4659d40944e3b3bb57d9785b3b28", "score": "0.58052874", "text": "def centroid(list)\n report(\"Centroiding....\")\n msg_cmd(@wfsock, \"centroid\", list)\n report(\"Centroiding Complete.\")\n end", "title": "" }, { "docid": "7b0c2e9b2839706f9e71226aa5119029", "score": "0.58009714", "text": "def center\n CGPointMake(centerX, centerY)\n end", "title": "" }, { "docid": "707f5f1eb4f7af129bda690f32cdfa3b", "score": "0.57949114", "text": "def center_point\n @center_point ||= [52.508283, 13.329657].freeze\n end", "title": "" }, { "docid": "5a7055227786d4595a8584cd2abb5b96", "score": "0.5790329", "text": "def center(visible_only = true)\n if atoms.empty?\n return Atom.new(0,0,0)\n else\n bounds = bounding_box(visible_only)\n x = (bounds[0].x + bounds[1].x)/2.0\n y = (bounds[0].y + bounds[1].y)/2.0\n z = (bounds[0].z + bounds[1].z)/2.0\n return Atom.new(x,y,z)\n end\n end", "title": "" }, { "docid": "0ce7c6e9858846383aa77f059cc93e34", "score": "0.57507247", "text": "def bbox\n BoundingBox.new(x, y, x + width, y + height)\n end", "title": "" }, { "docid": "e624b81fbeaf2317f6a9aadd512d0ec8", "score": "0.5739034", "text": "def center\n x = (@grid.length.to_f / 2).floor # Keep in mind off-by-one\n Coordinate.new(x, x)\n end", "title": "" }, { "docid": "cc6be3607cfc82d191a5960da7da493b", "score": "0.5726053", "text": "def bounding_box\n [\n @point_tl,\n @point_tr,\n @point_bl,\n @point_br\n ]\n end", "title": "" }, { "docid": "1420d51679262ab6107642300ec2d2dd", "score": "0.5722021", "text": "def center_lon\n center[0]\n end", "title": "" }, { "docid": "daa86284d1e6e08f19ace4fd24c8847b", "score": "0.5714369", "text": "def center\n Core::Point.new(\n absolute_position.x + width / 2,\n absolute_position.y + height / 2\n )\n end", "title": "" }, { "docid": "3bbb48943ef00422143397fbba7590b3", "score": "0.571136", "text": "def within_bounding_box(geog, min_lng, min_lat, max_lng, max_lat)\n within = ActiveRecord::Base.connection.execute(\"SELECT ST_Intersects(ST_MakeEnvelope(#{(max_lng.to_f - min_lng.to_f) * 0.1 + min_lng.to_f}, #{(max_lat.to_f - min_lat.to_f) * 0.1 + min_lat.to_f}, #{max_lng.to_f - (max_lng.to_f - min_lng.to_f) * 0.1}, #{max_lat.to_f - (max_lat.to_f - min_lat.to_f) * 0.1}, 4326)::geography, '#{geog}')\")\n return within.values[0][0]\n end", "title": "" }, { "docid": "43a0342c9312ff4dbe2940b53146c983", "score": "0.5691521", "text": "def bounding_box_top_left\n Point.new(@x + offset_x, @y + offset_y)\n end", "title": "" }, { "docid": "419d33db5fe95fd35fe935bc6eeec159", "score": "0.568734", "text": "def bounding_box(&blk)\n pdf.bounding_box(top_left, width: width, height: height, &blk)\n end", "title": "" }, { "docid": "3b18311ff4a1e5d1a7c7114a77298a71", "score": "0.5676046", "text": "def centroid(list)\n report(\"Centroiding....\")\n wfsopen\n test = msg_cmd(@wfsock, \"centroid\", list)\n wfsclose\n report(\"Centroiding Complete.\")\n return test\n end", "title": "" }, { "docid": "3b18311ff4a1e5d1a7c7114a77298a71", "score": "0.5676046", "text": "def centroid(list)\n report(\"Centroiding....\")\n wfsopen\n test = msg_cmd(@wfsock, \"centroid\", list)\n wfsclose\n report(\"Centroiding Complete.\")\n return test\n end", "title": "" }, { "docid": "eed856a885d710985bf2cc81d70e3ac5", "score": "0.5663857", "text": "def bounding_box\n x_values = @points.map { |p| p.x }\n y_values = @points.map { |p| p.y }\n bottom_left = Point[x_values.min, y_values.min]\n top_right = Point[x_values.max, y_values.max]\n [bottom_left, top_right]\n end", "title": "" }, { "docid": "e331e96c0a2459afabdb3a035cb33c41", "score": "0.56469786", "text": "def center\n\t\t# NOTE: not all shapes define \"center\" as of yet. currently, it is just Rect\n\t\t@body.local2world @shape.center\n\tend", "title": "" }, { "docid": "0494f8bb08eb07646d4cc214a81c4fcf", "score": "0.5610537", "text": "def point_bounding_box(point,radius)\n self.bounding_box(point, point, radius)\n end", "title": "" }, { "docid": "ada723bb4a6a94d8ade036f425cd4853", "score": "0.56024384", "text": "def center_point\n @center ||= @factory.unproject(@factory.projection_factory.point(*center_xy))\n end", "title": "" }, { "docid": "37d898a9d9e462088e25bddd0d1ac68c", "score": "0.55997074", "text": "def bbox()\n return @coordSystem.bboxXY() ;\n end", "title": "" }, { "docid": "e2abd4addd70f7c90e4ee8422555f6ac", "score": "0.55994254", "text": "def center_lat\n center[1]\n end", "title": "" }, { "docid": "3d336ed4dd414db5978da251138cbbff", "score": "0.55955523", "text": "def calculate_new_centroids\n # Clear centroids.\n centroids.each(&:reset)\n\n # Sum all X and Y coords into each point's centroid.\n points.each do |point|\n centroid = point.group\n centroid.add(point)\n end\n\n # And then average it to find a center.\n centroids.each(&:average)\n end", "title": "" }, { "docid": "042dc73023e21790cd06ac0b02aa7dc9", "score": "0.5593374", "text": "def center_xy\n y_ = (@y_min + @y_max) * 0.5\n if @x_min > @x_max\n x_ = @x_min + x_span * 0.5\n limits_ = @factory.projection_limits_window\n x_ -= limits_.x_span if x_ >= limits_.x_max\n else\n x_ = (@x_min + @x_max) * 0.5\n end\n [x_, y_]\n end", "title": "" }, { "docid": "7f65f93f228c605103f611e6f63f61a9", "score": "0.5589552", "text": "def centroid_gaussian(xs,ys)\n # see Caruana Fast algorithm for the Resolution of Spectra. Anal Chem. 1986\n \n # TODO: implement weighted least squares so the highest values pull\n # the largest weight in the fitting!\n ys_log = ys.map {|y_point| Math.log(y_point) }\n (a, b, c) = regress(xs, ys_log, 2)\n\n mean = -b / (2.0*c)\n area = Math.sqrt(-Math::PI / c) * Math.exp(a - (b**2 / (4*c)))\n\n [mean, area]\n end", "title": "" }, { "docid": "30a85364cba8cf7567e20b484ad2dc50", "score": "0.5586778", "text": "def center_x\n @center[0]\n end", "title": "" }, { "docid": "8f3b61a97065ad3a3d1be12a73264c95", "score": "0.55861175", "text": "def centroid stroke\n\t\t# Index is incremented by 3 to handle the stroke data format [x,y,t,x,y,t]\n\t\ti = 3\n\t\tmass = 0\n\n\t\tcentroid = Array.new\n\t\tcentroid << 0 << 0\n\t\tstroke[0..-4].each_slice(3) do |point|\n\n\t\t\t#Centroid = (x1 + x2) / 2\n\t\t\tc_x = (point[0] + stroke[i])/2.0\n\t\t\tc_y = (point[1] + stroke[i + 1])/2.0\n\n\t\t\t#Length = sqrt((dx)^2 + (dy)^2)\n\t\t\tlength = (((point[0] - stroke[i])**2) + ((point[1] - stroke[i+1])**2))**0.5\n\t\t\tmass += length\n\n\t\t\tcentroid[0] += c_x * length\n\t\t\tcentroid[1] += c_y * length \n\t\t\t#Increment helper index\n\t\t\ti += 3\n\t\tend\n\n\t\t#Centroid = sum(C_i*%mass)\n\t\tcentroid[0] /= mass\n\t\tcentroid[1] /= mass\n\n\t\treturn centroid\n\tend", "title": "" }, { "docid": "fcc51bf8677a5834a787a76459cfc414", "score": "0.5584305", "text": "def center_x\n @center_obj.nil? ? @ox : @center_obj.x\n end", "title": "" }, { "docid": "fcc51bf8677a5834a787a76459cfc414", "score": "0.5584305", "text": "def center_x\n @center_obj.nil? ? @ox : @center_obj.x\n end", "title": "" }, { "docid": "4e6f875bd1af51a14e9b60a924d457a1", "score": "0.55782664", "text": "def bounding_box\n max_x = max_y = -Float::MAX\n min_x = min_y = Float::MAX\n if with_z\n max_z, min_z = -Float::MAX, Float::MAX\n each do |point|\n max_y = point.y if point.y > max_y\n min_y = point.y if point.y < min_y\n max_x = point.x if point.x > max_x\n min_x = point.x if point.x < min_x\n max_z = point.z if point.z > max_z\n min_z = point.z if point.z < min_z\n end\n [Point.from_x_y_z(min_x, min_y, min_z), Point.from_x_y_z(max_x, max_y, max_z)]\n else\n each do |point|\n max_y = point.y if point.y > max_y\n min_y = point.y if point.y < min_y\n max_x = point.x if point.x > max_x\n min_x = point.x if point.x < min_x\n end\n [Point.from_x_y(min_x, min_y), Point.from_x_y(max_x, max_y)]\n end\n end", "title": "" }, { "docid": "b9a8c133e1d2279099c40f9144d5164f", "score": "0.5566989", "text": "def bbox\n return BoundingBox.new if @vertices.empty?\n result = @vertices.first.bbox\n @vertices[1..-1].each {|v| result.add!(v) }\n result\n end", "title": "" }, { "docid": "1597ff2059760edf03d69e2a7cc0d9b7", "score": "0.55664045", "text": "def bounding_box(point, radius, options = T.unsafe(nil)); end", "title": "" }, { "docid": "035cda981cd49d2cc9c4060b3d97a236", "score": "0.55501777", "text": "def center\n\t\t\t\tverts = each_vert.to_a\n\t\t\t\tverts.reduce(&:+) / verts.size\n\t\t\tend", "title": "" }, { "docid": "9eb4b984f475615330b3801a72206cb7", "score": "0.5544071", "text": "def box_for_coordinates(row, column)\n 3 * (row / 3) + (column / 3)\n end", "title": "" }, { "docid": "79d095dfec94fe5b36761d20cca56590", "score": "0.5527641", "text": "def center\n [lat, long]\n end", "title": "" }, { "docid": "bceff384321aa9dc36ecb6ced0ca6bef", "score": "0.5527312", "text": "def bbox()\n return @pos.bbox() ;\n end", "title": "" }, { "docid": "98d2b2a830138e86806c6d69660a5b3e", "score": "0.55206674", "text": "def calculate_area_centroid(system, consequent, height)\n fuzzy_set = systems[system.name].lv_hash[consequent.lv_name].fuzzy_sets[consequent.tag]\n \n a= fuzzy_set.a\n \n if fuzzy_set.a==fuzzy_set.b\n b=fuzzy_set.b\n else \n b= height*(fuzzy_set.b - a) + a\n end\n \n d= fuzzy_set.d\n \n if fuzzy_set.c==fuzzy_set.d\n c=fuzzy_set.c\n else\n c= d - height*(fuzzy_set.d - fuzzy_set.c)\n end\n \n big_base = d - a\n small_base = big_base -((b-a)+(d-c))\n\n #Trapezoid area= height*(big base + small base)/2\n area= height*(big_base+small_base)/2\n centroid = a + (d-a)/2\n \n return [area, centroid]\n \n end", "title": "" }, { "docid": "41234a4191dc68b24f3411c9356191b5", "score": "0.5520419", "text": "def center\n offset = @scale.idiv(2)\n [@x + offset, @y + offset]\n end", "title": "" }, { "docid": "e7158c43d7a373cec1f709597dca9107", "score": "0.55016613", "text": "def bounding_box\n # There are six potential extreme points in an arc: the place on the\n # circle at 0, 90, 180 and 270 degrees, plus the two endpoints of the arc.\n # To find the bounding box, compile the list of the potential extremities\n # that actually exist on the arc, then call PointList#bounding_box on\n # those points.\n a1, a2 = absolute_angles.map { |a| a.deg }\n range = (a1..a2)\n extremities = [0, 90, 180, 270]\n relevant_extremities = extremities.select { |a| range.include? a }\n bounding_points = (relevant_extremities << a1 << a2).map { |angle| point(angle.d) }\n PointList[*bounding_points].bounding_box\n end", "title": "" }, { "docid": "2bf5371d0bc9f3c3815495f1bade8550", "score": "0.550053", "text": "def calculate_center(x = nil, y = nil, width = nil, height = nil)\n x ||= @width / 2\n y ||= @height / 2\n width ||= @width\n height ||= @height\n\n return @coords if @coords\n return (@coords = [x, y]) if !white?(x, y)\n return if width <= 2 || height <= 2\n\n if coords = calculate_center(x - width/2, y - height/2, width/2, height/2)\n return coords\n end\n\n if coords = calculate_center(x - width/2, y + height/2, width/2, height/2)\n return coords\n end\n\n if coords = calculate_center(x + width/2, y - height/2, width/2, height/2)\n return coords\n end\n\n if coords = calculate_center(x + width/2, y + height/2, width/2, height/2)\n return coords\n end\n end", "title": "" }, { "docid": "22f356dac66a82b88501a26a879e93b6", "score": "0.54972005", "text": "def bbox\n @bbox ||= Geo.bbox(coords)\n end", "title": "" }, { "docid": "a66278d0a956e2eb2275be955cd5ec67", "score": "0.5491713", "text": "def bbox\n Geo.bbox(coords)\n end", "title": "" }, { "docid": "87a2df233523b5802419b0ef5e3e5b55", "score": "0.54890734", "text": "def bbox\n return BoundingBox.new if @polygons.empty?\n result = @polygons.first.bbox\n @polygons[1..-1].each {|v| result.add!(v.bbox) }\n result\n end", "title": "" }, { "docid": "fcaa8ba879813806537f66f982468cf5", "score": "0.548227", "text": "def rectangle_center(c)\n x = ((c[2] - c[0]) / 2).to_i\n y = ((c[3] - c[1]) / 2).to_i\n [x + c[0], y + c[1]].join(',')\n end", "title": "" }, { "docid": "0003fab2410c042d6413a0e417707ecc", "score": "0.5466676", "text": "def center_lat\n distance = (max_lat - min_lat) / 2.0\n (min_lat + distance)\n end", "title": "" }, { "docid": "f7d6c76e4daf598a929ae2b0b12a0d3e", "score": "0.54595155", "text": "def bbox\n @bbox ||= BoundingBox.new(min_lon, min_lat, max_lon, max_lat)\n end", "title": "" }, { "docid": "002f460e3e529466c59be30085bc8983", "score": "0.54578626", "text": "def center_x\n @max_x ? (@max_x + @min_x) * 0.5 : nil\n end", "title": "" }, { "docid": "002f460e3e529466c59be30085bc8983", "score": "0.54578626", "text": "def center_x\n @max_x ? (@max_x + @min_x) * 0.5 : nil\n end", "title": "" }, { "docid": "034fb354f12be51b9d8c25aa64219e47", "score": "0.54493463", "text": "def center\n\t\t\t\t# NOTE: I'm not totally sure that this will work in general, because of the shape offset. However, it should work fine within the system defined by ThoughtTrace\n\t\t\t\tCP::Vec2.new(0,0)\n\t\t\tend", "title": "" }, { "docid": "ab33ccf5f9e993f8545b3569fbd4c938", "score": "0.54477775", "text": "def computed_bounding_box(expand = 0)\n return [0, 0, 0, 0] if @cells.empty?\n MB::Geometry.bounding_box(@cells.map(&:point), expand)\n end", "title": "" }, { "docid": "37e71f3c8d846a225fbe2c582b720d86", "score": "0.5446099", "text": "def circumcenter\n @circumcenter ||= MB::Geometry.circumcenter(\n @points[0][0], @points[0][1],\n @points[1][0], @points[1][1],\n @points[2][0], @points[2][1]\n )\n end", "title": "" }, { "docid": "e9a534d9b42919d29a142a1c62cf4407", "score": "0.5436409", "text": "def bounding_box\n Geoblacklight::BoundingBox.from_rectangle(blacklight_params[:bbox])\n end", "title": "" } ]
3d803923c23a20977d596eb809ce3464
Return our full name
[ { "docid": "3935cb6327727fecb619314747115fd6", "score": "0.0", "text": "def full_name\n res = @in_class.full_name\n res << \"::\" unless res.empty?\n res << @name\n end", "title": "" } ]
[ { "docid": "5aeaf32d637775c1fa7570c1b3d9ac88", "score": "0.89645165", "text": "def full_name\n name\n end", "title": "" }, { "docid": "5aeaf32d637775c1fa7570c1b3d9ac88", "score": "0.89645165", "text": "def full_name\n name\n end", "title": "" }, { "docid": "8ed3c1e78a33e93ff67b0bd2dfedd2a4", "score": "0.88235784", "text": "def full_name\n \"#{prename} #{name}\"\n end", "title": "" }, { "docid": "8ed3c1e78a33e93ff67b0bd2dfedd2a4", "score": "0.88235784", "text": "def full_name\n \"#{prename} #{name}\"\n end", "title": "" }, { "docid": "8ed3c1e78a33e93ff67b0bd2dfedd2a4", "score": "0.88235784", "text": "def full_name\n \"#{prename} #{name}\"\n end", "title": "" }, { "docid": "7bdf6798bd224cd11531ba8b0ba3bc68", "score": "0.87497383", "text": "def fullname\n FULLNAME\n end", "title": "" }, { "docid": "487ccb87f55bba453decfc49d73eccd7", "score": "0.8737227", "text": "def full_name\n return @name\n end", "title": "" }, { "docid": "410165254c3ed36a892d24844dde74ab", "score": "0.8734821", "text": "def full_name\n name\n end", "title": "" }, { "docid": "529e799660d9ff3b68c2d655d52e2210", "score": "0.87069345", "text": "def full_name\n return \"#{first_name} #{last_name}\"\n end", "title": "" }, { "docid": "762239506235cf7f0c8cfb6e78adefab", "score": "0.867642", "text": "def full_name\r\n @full_name\r\n end", "title": "" }, { "docid": "adee988c2a797f15c6f20dc7118fec6f", "score": "0.8659005", "text": "def full_name\n \"#{name} (#{short_name})\"\n end", "title": "" }, { "docid": "beedd06735538924766c5e02748ccf35", "score": "0.86566377", "text": "def full_name\n return \"#{first_name} #{last_name}\"\n end", "title": "" }, { "docid": "fcb1f48f370ed4ba0513a3cf53822e63", "score": "0.8654814", "text": "def get_full_name\n name\n end", "title": "" }, { "docid": "fcb1f48f370ed4ba0513a3cf53822e63", "score": "0.8654814", "text": "def get_full_name\n name\n end", "title": "" }, { "docid": "fcb1f48f370ed4ba0513a3cf53822e63", "score": "0.8654814", "text": "def get_full_name\n name\n end", "title": "" }, { "docid": "36f288abf6a71145cc0f204ed0c0eeeb", "score": "0.8638292", "text": "def full_name\n names = self.names.first\n return (names.given_name || '') + \" \" + (names.family_name || '')\n end", "title": "" }, { "docid": "a80318b53c86145b3098b37790a1f6fc", "score": "0.863446", "text": "def full_name\n return \"(\" + self.name + \")@\" + self.username\n end", "title": "" }, { "docid": "dd55ae4acba8087c3eaf530d1c253312", "score": "0.8626185", "text": "def full_name\n return \"#{self.first_name} #{self.last_name}\"\n end", "title": "" }, { "docid": "46cd901b4c0199cd08a14b3e6a84218e", "score": "0.8586253", "text": "def full_name\n \"#{first_name} #{last_name}\"\n end", "title": "" }, { "docid": "46cd901b4c0199cd08a14b3e6a84218e", "score": "0.8586253", "text": "def full_name\n \"#{first_name} #{last_name}\"\n end", "title": "" }, { "docid": "46cd901b4c0199cd08a14b3e6a84218e", "score": "0.8586253", "text": "def full_name\n \"#{first_name} #{last_name}\"\n end", "title": "" }, { "docid": "46cd901b4c0199cd08a14b3e6a84218e", "score": "0.8586253", "text": "def full_name\n \"#{first_name} #{last_name}\"\n end", "title": "" }, { "docid": "46cd901b4c0199cd08a14b3e6a84218e", "score": "0.8586253", "text": "def full_name\n \"#{first_name} #{last_name}\"\n end", "title": "" }, { "docid": "46cd901b4c0199cd08a14b3e6a84218e", "score": "0.8586253", "text": "def full_name\n \"#{first_name} #{last_name}\"\n end", "title": "" }, { "docid": "46cd901b4c0199cd08a14b3e6a84218e", "score": "0.8586253", "text": "def full_name\n \"#{first_name} #{last_name}\"\n end", "title": "" }, { "docid": "46cd901b4c0199cd08a14b3e6a84218e", "score": "0.8586253", "text": "def full_name\n \"#{first_name} #{last_name}\"\n end", "title": "" }, { "docid": "ad4aeda822337eebe0f6c25384c37912", "score": "0.85798585", "text": "def full_name\n \"#{first_name} #{last_name}\"\n end", "title": "" }, { "docid": "5627675fa6f730c3fc954a1c9c8c0488", "score": "0.855232", "text": "def full_name\n \tif last_name.nil?\n \t\treturn name\n \telse\n \t\treturn name + \" \" + last_name\n \tend\n end", "title": "" }, { "docid": "5966ddf4ad6cd81c82eaea350aa9dd21", "score": "0.8520174", "text": "def full_name\n display_optional name.full\n end", "title": "" }, { "docid": "dbd76ef2da91e1532eec93f623805772", "score": "0.8515723", "text": "def full_name\n full_name = \"#{self.first_name} #{self.last_name}\"\n return full_name\n end", "title": "" }, { "docid": "044c680dcb9023e2e3104c3aa0c36a48", "score": "0.85084254", "text": "def full_name\n \"#{owner.full_name}#{name}\"\n end", "title": "" }, { "docid": "6420827963266f7ee2bd06194c862350", "score": "0.84893584", "text": "def full_name\n return \"#{@first_name} #{@last_name}\"\n end", "title": "" }, { "docid": "261b65f44c2b2580b91317c0276f8833", "score": "0.84884334", "text": "def full_name\n return( \"#{self.first_name} #{self.last_name}\".strip )\n end", "title": "" }, { "docid": "d75bfe818021a523616be1538d344b79", "score": "0.84719336", "text": "def full_name\n return \"#{first_name} #{last_name}\"\n end", "title": "" }, { "docid": "d75bfe818021a523616be1538d344b79", "score": "0.84719336", "text": "def full_name\n return \"#{first_name} #{last_name}\"\n end", "title": "" }, { "docid": "d75bfe818021a523616be1538d344b79", "score": "0.84719336", "text": "def full_name\n return \"#{first_name} #{last_name}\"\n end", "title": "" }, { "docid": "d75bfe818021a523616be1538d344b79", "score": "0.84719336", "text": "def full_name\n return \"#{first_name} #{last_name}\"\n end", "title": "" }, { "docid": "d75bfe818021a523616be1538d344b79", "score": "0.84719336", "text": "def full_name\n return \"#{first_name} #{last_name}\"\n end", "title": "" }, { "docid": "d75bfe818021a523616be1538d344b79", "score": "0.84719336", "text": "def full_name\n return \"#{first_name} #{last_name}\"\n end", "title": "" }, { "docid": "81dbf4f75fbd4cf0532d4387f37c9e3a", "score": "0.84653986", "text": "def full_name\n full_name = \"#{@first_name} #{@last_name}\"\n return full_name\n end", "title": "" }, { "docid": "e101731acb9ba1c12e4ffe7a3e0d970f", "score": "0.8461087", "text": "def full_name\n \"#{@longname} '#{php_name}'\"\n end", "title": "" }, { "docid": "544c85055edb488aa8523e8262ec7b66", "score": "0.84385824", "text": "def full_name\n @organization_name + '/' + @name\n end", "title": "" }, { "docid": "51cbab1298cebccf2c8a809386af2eaf", "score": "0.8433265", "text": "def full_name\n \"#{@owner_name}-#{@name}\"\n end", "title": "" }, { "docid": "1743eb792ceb8b28ad031c46fb1c2cf0", "score": "0.84273", "text": "def get_full_name\n (self.first_name + \" \" + self.last_name).titleize\n end", "title": "" }, { "docid": "532b21ec61dd295c8bc358dc6931c27e", "score": "0.84246665", "text": "def full_name\n name = \"#{self.first_name} #{self.last_name}\".strip\n (name.blank?) ? nil : name\n end", "title": "" }, { "docid": "7d6bc49533f5730d487ae8de09dd3a29", "score": "0.8424229", "text": "def full_name\n\t\tfull_name = \"#{first_name} #{last_name}\"\n\tend", "title": "" }, { "docid": "69babd0c080a8a9adc950b691aeb91a2", "score": "0.8424072", "text": "def full_name\n\t\t\"#{first_name} #{middle_name} #{last_name}\"\n end", "title": "" }, { "docid": "0dd511cb078738c1208daa94ef5c937c", "score": "0.8416894", "text": "def full_name\n \"#{name} | #{funny_name}\"\n end", "title": "" }, { "docid": "1b3b86f0a6ffaf0d4fc5db8dd5abb238", "score": "0.8413449", "text": "def full_name\n\t\t\"#{first_name} #{last_name}\"\n\tend", "title": "" }, { "docid": "1b3b86f0a6ffaf0d4fc5db8dd5abb238", "score": "0.8413449", "text": "def full_name\n\t\t\"#{first_name} #{last_name}\"\n\tend", "title": "" }, { "docid": "7248a32112600f0abfb938d61b5c6ec4", "score": "0.8403116", "text": "def fullname\n full_name\n end", "title": "" }, { "docid": "7248a32112600f0abfb938d61b5c6ec4", "score": "0.8403116", "text": "def fullname\n full_name\n end", "title": "" }, { "docid": "9c577ec35428d4ce472c09dbc261cc30", "score": "0.8400378", "text": "def display_name\n full_name.join(\" \")\n end", "title": "" }, { "docid": "95f3aee0bc462f98fada08651ca76025", "score": "0.8391819", "text": "def full_name\n\t\t\"#{self.first_name} #{self.last_name}\"\n\tend", "title": "" }, { "docid": "95f3aee0bc462f98fada08651ca76025", "score": "0.8391819", "text": "def full_name\n\t\t\"#{self.first_name} #{self.last_name}\"\n\tend", "title": "" }, { "docid": "cdf5d4dc9d8cb3359c9f97beea5698f0", "score": "0.83891636", "text": "def full_name\n if self.login\n return self.login.capitalize\n end\n # return self.first_name.to_s+\" \"+self.middle_name.to_s+\" \"+self.last_name.to_s\n end", "title": "" }, { "docid": "85cc242f56aafae332f20fa9fb0ce5a6", "score": "0.8380207", "text": "def get_full_name\n description\n end", "title": "" }, { "docid": "85cc242f56aafae332f20fa9fb0ce5a6", "score": "0.8380207", "text": "def get_full_name\n description\n end", "title": "" }, { "docid": "41cc0508f9eb690de31f28a628db791f", "score": "0.8377439", "text": "def full_name\n\t \"#{first_name} #{last_name}\"\n\tend", "title": "" }, { "docid": "109de242b54b5adab89de8f8c97f3995", "score": "0.8372374", "text": "def full_name\n full_name = self.first_name.capitalize + \" \" + self.last_name.capitalize\n return full_name\n end", "title": "" }, { "docid": "01f8da3792ac9f35e6fe1c9a3d73e03f", "score": "0.83722645", "text": "def full_name\r\n \"#{first_name} #{last_name}\"\r\n end", "title": "" }, { "docid": "2aaceed0ebed948f1d19205c8d13f069", "score": "0.8371948", "text": "def full_name\n return (self.first_name.to_s + \" \" + self.last_name.to_s).strip\n end", "title": "" }, { "docid": "c12da280e03bf2fff8a010563f463f2e", "score": "0.8366774", "text": "def get_full_name()\n self.name.to_s\n end", "title": "" }, { "docid": "c12da280e03bf2fff8a010563f463f2e", "score": "0.8366774", "text": "def get_full_name()\n self.name.to_s\n end", "title": "" }, { "docid": "c12da280e03bf2fff8a010563f463f2e", "score": "0.8366774", "text": "def get_full_name()\n self.name.to_s\n end", "title": "" }, { "docid": "88d7ae583dcd3c5b357328c3def078b6", "score": "0.8364753", "text": "def full_name\n\t return \"#{@real_profile.firstname} \"\n\tend", "title": "" }, { "docid": "1de9b01d9da7a0b89d397f8da5edfdf6", "score": "0.83635426", "text": "def full_name\n return \"#{self.first_name} #{self.last_name}\"\n end", "title": "" }, { "docid": "1de9b01d9da7a0b89d397f8da5edfdf6", "score": "0.83635426", "text": "def full_name\n return \"#{self.first_name} #{self.last_name}\"\n end", "title": "" }, { "docid": "ea61806b729517973fa59fe9cff31bd5", "score": "0.8361538", "text": "def full_name\n \"#{self.first_name} #{self.last_name}\"\n end", "title": "" }, { "docid": "ea61806b729517973fa59fe9cff31bd5", "score": "0.8361538", "text": "def full_name\n \"#{self.first_name} #{self.last_name}\"\n end", "title": "" }, { "docid": "ea61806b729517973fa59fe9cff31bd5", "score": "0.8361538", "text": "def full_name\n \"#{self.first_name} #{self.last_name}\"\n end", "title": "" }, { "docid": "fba01af8d170e6dd6d73f9bc1eed3557", "score": "0.8356506", "text": "def full_name\n\t\tfirst + \" \" + last\n\tend", "title": "" }, { "docid": "2740749e29f914559d523444adb2c494", "score": "0.8356402", "text": "def full_name\n\t\tself.first_name + ' ' + self.name\n\tend", "title": "" }, { "docid": "bc475b0906e431d69033e24871dbeab3", "score": "0.8356151", "text": "def full_name\n \"#{brand} #{name}\"\n end", "title": "" }, { "docid": "bc475b0906e431d69033e24871dbeab3", "score": "0.8356151", "text": "def full_name\n \"#{brand} #{name}\"\n end", "title": "" }, { "docid": "17008d74d1a7fe5b8e610e411426410f", "score": "0.8350642", "text": "def full_name\n if original_name.blank? || name.blank?\n original_name || name\n else\n \"#{original_name} - #{name}\"\n end\n end", "title": "" }, { "docid": "0e7aac170c1d0449945cae91ecdba078", "score": "0.8350496", "text": "def full_name\n self.first_name + ' ' + self.last_name\n end", "title": "" }, { "docid": "143f30a1830563d6412bb7e41be52518", "score": "0.83501583", "text": "def name\n full_name\n end", "title": "" }, { "docid": "143f30a1830563d6412bb7e41be52518", "score": "0.83501583", "text": "def name\n full_name\n end", "title": "" }, { "docid": "7146f47e58d84c41527ba2edcc868ca7", "score": "0.83443415", "text": "def full_name\n human_full_name.presence || human_name\n end", "title": "" }, { "docid": "8d050d06c57a3ed3d9de86fa31109227", "score": "0.83417946", "text": "def name_full\n name_path.join(' ')\n end", "title": "" }, { "docid": "e8d045c927e4a04c2a5596afb001225b", "score": "0.83357596", "text": "def full_name()\n\t \"#{first_name} #{last_name} #{title} #{email}\"\n\tend", "title": "" }, { "docid": "049d53d0f3a2325fa1a7041b3419d088", "score": "0.83333087", "text": "def full_name\n\t\treturn self.salutation.to_s + \" \" + self.lastname.to_s + \" \" + self.firstname.to_s\n end", "title": "" }, { "docid": "92f5fe04afe4cf0590e05f1571ee3053", "score": "0.83320993", "text": "def full_name\n \t\tp \"#{self.first_name}\" + \" #{self.last_name}\"\n \tend", "title": "" }, { "docid": "d74883eee6470794527b0010a62ec463", "score": "0.8329109", "text": "def get_full_name\n self.name.to_s\n end", "title": "" }, { "docid": "d74883eee6470794527b0010a62ec463", "score": "0.8329109", "text": "def get_full_name\n self.name.to_s\n end", "title": "" }, { "docid": "3b9bcf954ddc4a9a82822919014b4df9", "score": "0.8326899", "text": "def full_name\n \"#{first_name} #{last_name}\"\n end", "title": "" }, { "docid": "ca11483afd49f18a1bf3dde93b4d4955", "score": "0.8324599", "text": "def full_name\n \t\"#{self.first_name} #{self.middle_name} #{self.last_name}\"\n end", "title": "" }, { "docid": "9d949a55163bde139cf505d1788c1a69", "score": "0.83222586", "text": "def full_name\n \"#{self.userFName} \" \" #{self.userLName}\"\n end", "title": "" }, { "docid": "f51413f32a8b18bd61555bda4472c8fa", "score": "0.8317812", "text": "def full_name\n \"#{self.name_first} #{self.name_last}\"\n end", "title": "" }, { "docid": "59b9f5dbfb46fa3d75e2656324b19787", "score": "0.83121926", "text": "def full_name\n\t\tself.name\n\tend", "title": "" }, { "docid": "92054eb20b7a1872ca004796868ef34e", "score": "0.8306612", "text": "def full_name\n \"#{self.first_name} #{self.last_name}\"\n end", "title": "" }, { "docid": "3893b7bf73fe6eaf198ebdf59a8cf0d5", "score": "0.8303364", "text": "def full_name\n\t\tfirst_name + \" \" + last_name\n\tend", "title": "" }, { "docid": "3893b7bf73fe6eaf198ebdf59a8cf0d5", "score": "0.8303364", "text": "def full_name\n\t\tfirst_name + \" \" + last_name\n\tend", "title": "" }, { "docid": "3893b7bf73fe6eaf198ebdf59a8cf0d5", "score": "0.8303364", "text": "def full_name\n\t\tfirst_name + \" \" + last_name\n\tend", "title": "" }, { "docid": "3893b7bf73fe6eaf198ebdf59a8cf0d5", "score": "0.8303364", "text": "def full_name\n\t\tfirst_name + \" \" + last_name\n\tend", "title": "" }, { "docid": "e18b7174960b097f0a3d68df421c35dc", "score": "0.83010507", "text": "def full_name\n if self.first_name.present? && self.last_name.present?\n \"#{first_name} #{last_name}\".better_titlecase\n end\n end", "title": "" }, { "docid": "7245cfa44348de98497d957bf9e86f29", "score": "0.8300465", "text": "def fullname\n \"#{first_name} #{last_name}\"\n end", "title": "" }, { "docid": "bc6f06f181c9e9f4beb3ff7c5948b20b", "score": "0.82984966", "text": "def full_name\n name || \"\"\n end", "title": "" }, { "docid": "e62c5d849df43dbcc50ca795881cddcb", "score": "0.829736", "text": "def full_name\n\t\tself.first_name + \" \" + self.last_name\n\tend", "title": "" }, { "docid": "e62c5d849df43dbcc50ca795881cddcb", "score": "0.829736", "text": "def full_name\n\t\tself.first_name + \" \" + self.last_name\n\tend", "title": "" } ]
3acf5f6e98fe662bc560f96f8ac7f660
convert hash to form needed by cfn sdk
[ { "docid": "a6ae0af0443f9994b312546ffd7aac62", "score": "0.0", "text": "def cfn_tags_array\n @_cfn_tags_array ||= cfn_tags&.map { |k, v|\n { key: k, value: v }\n }\n end", "title": "" } ]
[ { "docid": "62c0dac855cee08f79414c831f996aee", "score": "0.7302457", "text": "def normalize_hash(hash) hash end", "title": "" }, { "docid": "62c0dac855cee08f79414c831f996aee", "score": "0.7302457", "text": "def normalize_hash(hash) hash end", "title": "" }, { "docid": "6d7ef8cd884e3116c75781c6470bd89c", "score": "0.7169917", "text": "def unpack_hexdigest(hex); end", "title": "" }, { "docid": "6d7ef8cd884e3116c75781c6470bd89c", "score": "0.7169917", "text": "def unpack_hexdigest(hex); end", "title": "" }, { "docid": "23da263170c90db19e73d8a524554b23", "score": "0.6954524", "text": "def jenkins_hash_digest(string); end", "title": "" }, { "docid": "11e30817afb0340eb3ebf1624a12f845", "score": "0.6892608", "text": "def hash2string(hash)\n hash.to_a.join.to_i(2).to_s(16)\n end", "title": "" }, { "docid": "16e8072940efd5b09f4b9b0d17e27aa7", "score": "0.6864013", "text": "def hashAsBase64\n b=Base64.encode64(@hash)\n b.tr_s!(\"+/\", \"-_\")\n b.delete!('=')\n b.strip!\n b\n end", "title": "" }, { "docid": "12e03e2f19e8569f66b5edfe84a15ea4", "score": "0.68347317", "text": "def hash_string\n hash_value.to_s(36)\n end", "title": "" }, { "docid": "7ed2cf2854ae4e0a7e4d0a26edace4c8", "score": "0.6791688", "text": "def hash\n sub(/(\\.0)+$/, '').to_s.hash\n end", "title": "" }, { "docid": "9c5b5bb0c4bf1cad3aebbec2dda8bcc1", "score": "0.67770004", "text": "def calc_hash(hashed_obj)\n Digest::SHA256.base64digest hashed_obj.to_s\n end", "title": "" }, { "docid": "391eca83e5f59cabcb99e6e296568b5d", "score": "0.67738867", "text": "def short_hash\n first_part = to_s.split(' ').first\n Digest::SHA1.hexdigest(first_part)[0..4]\n end", "title": "" }, { "docid": "8a56140892349f04fb716e9234b9bcde", "score": "0.6767773", "text": "def hash(input_str)\n hash = DEFAULT_HASH_VALUE\n input_str.split(//).each do |c|\n hash = ((hash << 5) + hash) + c.ord # hash * 33 + c:\n end\n return hash\n end", "title": "" }, { "docid": "ddbb94ceb684a6c63493caf8ac224366", "score": "0.67030597", "text": "def hash\n parts.to_s.hash\n end", "title": "" }, { "docid": "dab4a22f49c995b44f2e3a3dd480299b", "score": "0.6651358", "text": "def hexdigest; end", "title": "" }, { "docid": "dab4a22f49c995b44f2e3a3dd480299b", "score": "0.6651358", "text": "def hexdigest; end", "title": "" }, { "docid": "bde090c14d8c7d296401e9f8ce876419", "score": "0.66314006", "text": "def connect_hash_to_string(hash); end", "title": "" }, { "docid": "8a12e998720d493bacf70b3981cb1e68", "score": "0.6590174", "text": "def calc_hash(line)\n string_hash = 0\n\n # convert each character to its UTF-8 value\n line.each_char do |x|\n string_hash += @stored_chars[x]\n end\n\n string_hash = string_hash % 65_536 # mod the string_hash for the final hash value\n string_hash.to_s(16) # convert line hash value to hex\n end", "title": "" }, { "docid": "ed35ed776b2b9a329bf2112b8e5c439d", "score": "0.65694106", "text": "def trans_hash_gen\n\n self.send_components = {:formatted_dob => formatted_dob, :access_code => self.user_access_code_gen}\n\n return Digest::SHA256.hexdigest(self.send_components.values.join(\"\")) # hashes in ruby >= 1.9 are ordered in the order keys are added\n end", "title": "" }, { "docid": "a9311be15de2ea047299a558eedaa578", "score": "0.6555674", "text": "def checksum_to_hexdigest\n checksum.unpack1('m0').unpack1('H*')\n end", "title": "" }, { "docid": "591e6b17363dd41043a0033dec7d99d2", "score": "0.6535004", "text": "def hashed\n Digest::SHA256.hexdigest(to_hash.to_json)\n end", "title": "" }, { "docid": "9b02a2af527f0b86dba967d4766af0a1", "score": "0.6534202", "text": "def to_s\n algo=@@HASHSUITEID[@hashAlgo]\n if algo>0 && algo <=6\n algoString=algo.to_s\n else\n algoString=@hashAlgo.to_s\n end\n hexhash=Base16::encode(@hash)\n #@scheme + ':' + algoString + ';' + withDelimiter(hexhash, '-') + ';' + Base16::luhn(hexhash)\n @scheme + ':' + algoString + ';' + hexhash + ';' + Base16::luhn(hexhash)\n end", "title": "" }, { "docid": "00cabc63443379606fde1c41335c5bee", "score": "0.6531405", "text": "def hash\n Digest::SHA1.hexdigest to_s\n end", "title": "" }, { "docid": "f60edb94665b8bd4fa5269292810df7e", "score": "0.65308577", "text": "def at_hash\n sha256 = Digest::SHA256.new\n token = @access_token.token\n hashed_token = sha256.digest(token)\n first_half = hashed_token[0...hashed_token.length / 2]\n Base64.urlsafe_encode64(first_half).tr('=', '')\n end", "title": "" }, { "docid": "6aebf5dd71364bc7c606bb0f2807a44d", "score": "0.6525402", "text": "def toHs(hash)\n hash / 1000000\n end", "title": "" }, { "docid": "00efed525edef6afa115eb1a3598fd5d", "score": "0.652373", "text": "def to_s\n hexdigest\n end", "title": "" }, { "docid": "99188b8470caa41d932ee03b72e098e5", "score": "0.6504745", "text": "def pack_hexdigest(bin); end", "title": "" }, { "docid": "99188b8470caa41d932ee03b72e098e5", "score": "0.6504745", "text": "def pack_hexdigest(bin); end", "title": "" }, { "docid": "dba93decb79bb62e05f8674168fb33c7", "score": "0.65030915", "text": "def hash_hash(h)\n require 'digest/sha1'\n str = recursive_flatten(h).sort.join\n Digest::SHA1.hexdigest(str)\n end", "title": "" }, { "docid": "dba93decb79bb62e05f8674168fb33c7", "score": "0.65030915", "text": "def hash_hash(h)\n require 'digest/sha1'\n str = recursive_flatten(h).sort.join\n Digest::SHA1.hexdigest(str)\n end", "title": "" }, { "docid": "87932269047f0bd1bbf6f11ca525b629", "score": "0.6503071", "text": "def to_nih\n hexhash=Base16::encode(@hash)\n URI::parse(\"nih:\" + @hashAlgo.to_s + ';' + hexhash + ';' + Base16::luhn(hexhash))\n end", "title": "" }, { "docid": "73535574eec59ece5b9df22beef407e8", "score": "0.6501242", "text": "def to_s\n hexdigest()\n end", "title": "" }, { "docid": "73535574eec59ece5b9df22beef407e8", "score": "0.6501242", "text": "def to_s\n hexdigest()\n end", "title": "" }, { "docid": "5ac36d9ce0bdcb6579fc27bbf38374ff", "score": "0.6488029", "text": "def normalize_and_hash(str)\n # Remove leading and trailing whitespace and ensure all letters are lowercase\n # before hasing.\n Digest::SHA256.hexdigest(str.strip.downcase)\nend", "title": "" }, { "docid": "5ac36d9ce0bdcb6579fc27bbf38374ff", "score": "0.6488029", "text": "def normalize_and_hash(str)\n # Remove leading and trailing whitespace and ensure all letters are lowercase\n # before hasing.\n Digest::SHA256.hexdigest(str.strip.downcase)\nend", "title": "" }, { "docid": "cd593c89997716e428c0e032e8463ae4", "score": "0.64702433", "text": "def cypher_hash(cypher_string)\n cypher_string.hash.abs\n end", "title": "" }, { "docid": "b589e7e4dc299080b7b9200808e0e6cd", "score": "0.64540976", "text": "def block_hash\n byte_reverse Digest::SHA2.hexdigest(Digest::SHA2.digest(hex2bin(hashable_string)))\n end", "title": "" }, { "docid": "b916a1e05401a4fd51980e65f29d47cf", "score": "0.6434044", "text": "def hash(str)\n return djb2(str)\n end", "title": "" }, { "docid": "75532d58d27249d1457483a21a5c1c01", "score": "0.64291626", "text": "def convert_base64digest_to_hexdigest(base64digest)\n base64digest.unpack1('m0').unpack1('H*')\n end", "title": "" }, { "docid": "86e4d62f294fbc15c4f8f53d3b49b269", "score": "0.6424177", "text": "def to_s\n short_sha\n end", "title": "" }, { "docid": "b57595534585581dcad80e28672bbf0f", "score": "0.6421247", "text": "def hash\n @digest.hexdigest\n end", "title": "" }, { "docid": "7774d1f9a68b5fb2464d6cd3a87b8b92", "score": "0.64131314", "text": "def hash(s)\n total = 0\n characters = s.split('')\n characters.each do |x|\n x = x.unpack('U*')[0]\n total += ((x**3000) + (x**x) - (3**x)) * (7**x)\n end\n (total % 65_536).to_s(16)\n end", "title": "" }, { "docid": "fc4981895ed3e0b849f5d9fe932e7ca3", "score": "0.6404459", "text": "def base64_hash(hash)\n Hash[hash.map { |k,v| [k, base64(v) ] }]\n end", "title": "" }, { "docid": "9289e587053a6ce77818d6ecd25d1141", "score": "0.6381959", "text": "def hash256(hex)\n binary = [hex].pack(\"H*\")\n hash1 = Digest::SHA256.digest(binary)\n hash2 = Digest::SHA256.digest(hash1)\n result = hash2.unpack(\"H*\")[0]\n return result\nend", "title": "" }, { "docid": "f1f4bc19a00ccf0dfac6f3ca07cad06f", "score": "0.6370548", "text": "def normalize_data(hash); end", "title": "" }, { "docid": "3a338af5d275d79deaff32fca7ee024e", "score": "0.6361036", "text": "def normalize(hash)\n return hash\n # each_value(hash) do |value|\n # Utils.to_utf8(value)\n # end\n end", "title": "" }, { "docid": "06146b3517e15df4629105410dad491c", "score": "0.63540703", "text": "def hexdigest(*) end", "title": "" }, { "docid": "06146b3517e15df4629105410dad491c", "score": "0.63540703", "text": "def hexdigest(*) end", "title": "" }, { "docid": "06146b3517e15df4629105410dad491c", "score": "0.63540703", "text": "def hexdigest(*) end", "title": "" }, { "docid": "6ac85ccb25cc734d0476d126e9575a3c", "score": "0.6352947", "text": "def hash256(hex)\n binary = [hex].pack(\"H*\")\n hash1 = Digest::SHA256.digest(binary)\n hash2 = Digest::SHA256.digest(hash1)\n result = hash2.unpack(\"H*\")[0]\n return result\n end", "title": "" }, { "docid": "553adb68c66b5fd53bb111803a1522e7", "score": "0.6351648", "text": "def hash\n if @hash_value.nil?\n @hash_value = (name.hash * 53) ^ version.hash\n end\n @hash_value\n end", "title": "" }, { "docid": "8f5866b0e324916aa7aabcdc2b800e35", "score": "0.6334338", "text": "def make_hash text\n Digest::MD5.hexdigest text\n end", "title": "" }, { "docid": "939f2c909301d24cdd0c38ec2f5bedbe", "score": "0.6332605", "text": "def hash\r\n to_s.hash\r\n end", "title": "" }, { "docid": "9dfc98567c520aed96db8b968767ae7a", "score": "0.6322808", "text": "def to_s\n sha\n end", "title": "" }, { "docid": "59b308895ba0f74a0aabf20e68cc8b29", "score": "0.6320804", "text": "def normalize_and_hash(str)\n Digest::SHA256.hexdigest(str.strip.downcase)\nend", "title": "" }, { "docid": "5ca707e71dc70156924c56990f7512bd", "score": "0.6308868", "text": "def compute_hash(text, bits)\n\tsha = Digest::SHA2.new(bits)\n\treturn sha.reset.update(text).to_s\nend", "title": "" }, { "docid": "42dcd2f038777412281f9790db5b6a26", "score": "0.6305961", "text": "def secure_hash\n sha256 = OpenSSL::Digest::SHA256.new\n sha256.digest(to_s).unpack('H*')\n end", "title": "" }, { "docid": "42dcd2f038777412281f9790db5b6a26", "score": "0.6305961", "text": "def secure_hash\n sha256 = OpenSSL::Digest::SHA256.new\n sha256.digest(to_s).unpack('H*')\n end", "title": "" }, { "docid": "491011e8604b232275020ead4db31d2e", "score": "0.6291492", "text": "def coh_hash(coh_str)\n chash = Hash.new\n coh_str = coh_str.chop\n coh_str = coh_str.reverse\n coh_str = coh_str.chop\n coh_str = coh_str.reverse\n coh_str.split(':').each{|x| eqpos = x.index('=') \n chash[x.slice(0...eqpos)] = x.slice(eqpos+1..x.length-1)\n }\n chash\nend", "title": "" }, { "docid": "de6a8eebcef604fdaffb8a019392427a", "score": "0.6286911", "text": "def hash_to_hashcat(cred)\n case cred.private.type\n when 'Metasploit::Credential::NTLMHash'\n both = cred.private.data.split(\":\")\n if both[0].upcase == 'AAD3B435B51404EEAAD3B435B51404EE' #lanman empty, return ntlm\n return both[1] # ntlm hash-mode: 1000\n end\n return both[0] #give lanman, hash-mode: 3000\n when 'Metasploit::Credential::PostgresMD5' #hash-mode: 12\n if cred.private.jtr_format =~ /postgres|raw-md5/\n hash_string = cred.private.data\n hash_string.gsub!(/^md5/, '')\n return \"#{hash_string}:#{cred.public.username}\"\n end\n when 'Metasploit::Credential::NonreplayableHash'\n case cred.private.jtr_format\n # oracle 11+ password hash descriptions:\n # this password is stored as a long ascii string with several sections\n # https://www.trustwave.com/en-us/resources/blogs/spiderlabs-blog/changes-in-oracle-database-12c-password-hashes/\n # example:\n # hash = []\n # hash << \"S:8F2D65FB5547B71C8DA3760F10960428CD307B1C6271691FC55C1F56554A;\"\n # hash << \"H:DC9894A01797D91D92ECA1DA66242209;\"\n # hash << \"T:23D1F8CAC9001F69630ED2DD8DF67DD3BE5C470B5EA97B622F757FE102D8BF14BEDC94A3CC046D10858D885DB656DC0CBF899A79CD8C76B788744844CADE54EEEB4FDEC478FB7C7CBFBBAC57BA3EF22C\"\n # puts hash.join('')\n # S: = 60 characters -> sha1(password + salt (10 bytes))\n # 40 char sha1, 20 char salt\n # hash is 8F2D65FB5547B71C8DA3760F10960428CD307B1C\n # salt is 6271691FC55C1F56554A\n # H: = 32 characters\n # legacy MD5\n # T: = 160 characters\n # PBKDF2-based SHA512 hash specific to 12C (12.1.0.2+)\n when /hmac-md5/\n data = cred.private.data.split('#')\n password = Rex::Text.encode_base64(\"#{cred.public.username} #{data[1]}\")\n return \"$cram_md5$#{Rex::Text.encode_base64(data[0])}$#{password}\"\n when /raw-sha1|oracle11/ # oracle 11, hash-mode: 112\n if cred.private.data =~ /S:([\\dA-F]{60})/ # oracle 11\n # hashcat wants a 40 character string, : 20 character string\n return $1.scan(/.{1,40}/m).join(':').downcase\n end\n when /oracle12c/\n if cred.private.data =~ /T:([\\dA-F]{160})/ # oracle 12c, hash-mode: 12300\n return $1.upcase\n end\n when /dynamic_1506|postgres/\n #this may not be correct\n if cred.private.data =~ /H:([\\dA-F]{32})/ # oracle 11, hash-mode: 3100\n return \"#{$1}:#{cred.public.username}\"\n end\n when /oracle/ # oracle\n if cred.private.jtr_format.start_with?('des') # 'des,oracle', not oracle11/12c, hash-mode: 3100\n return \"#{cred.private.data}\"\n end\n when /dynamic_82/\n return cred.private.data.sub('$HEX$', ':').sub('$dynamic_82$','')\n when /mysql-sha1/\n # lowercase, and remove the first character if its a *\n return cred.private.data.downcase.sub('*','')\n when /md5|des|bsdi|crypt|bf/, /mssql|mssql05|mssql12|mysql/, /sha256|sha-256/,\n /sha512|sha-512/, /xsha|xsha512|PBKDF2-HMAC-SHA512/,\n /mediawiki|phpass|PBKDF2-HMAC-SHA1/,\n /android-sha1/, /android-samsung-sha1/, /android-md5/,\n /ssha/, /raw-sha512/\n # md5(crypt), des(crypt), b(crypt), sha256, sha512, xsha, xsha512, PBKDF2-HMAC-SHA512\n # hash-mode: 500 1500 3200 7400 1800 122 1722 7100\n # mssql, mssql05, mssql12, mysql, mysql-sha1\n # hash-mode: 131, 132, 1731 200 300\n # mediawiki, phpass, PBKDF2-HMAC-SHA1\n # hash-mode: 3711, 400, 12001\n # android-sha1\n # hash-mode: 5800\n # ssha, raw-sha512\n # hash-mode: 111, 1700\n return cred.private.data\n when /^mscash$/\n # hash-mode: 1100\n data = cred.private.data.split(':').first\n if /^M\\$(?<salt>[[:print:]]+)#(?<hash>[\\da-fA-F]{32})/ =~ data\n return \"#{hash}:#{salt}\"\n end\n when /^mscash2$/\n # hash-mode: 2100\n return cred.private.data.split(':').first\n end\n end\n nil\nend", "title": "" }, { "docid": "e2f2711249a5ceb86194cd4967c17b7e", "score": "0.6274139", "text": "def hexdigest\n process\n @digest.unpack('H*'.freeze).first\n end", "title": "" }, { "docid": "976e2425a1ca680aeb514c9251f0f83d", "score": "0.6268351", "text": "def hash_string(s)\n n = nil\n loop do\n s = algorithm.digest(s)\n n = s.unpack('H*').first.to_i(16)\n break if n < @hash_cieling\n end\n n % group.order\n end", "title": "" }, { "docid": "c9066188a663cea9e73dbbbbf61f8fe5", "score": "0.62670344", "text": "def hash\n return (self.normalize.to_s.hash * -1)\n end", "title": "" }, { "docid": "ba6fa833d10e40f18d0ae24c56d96b5a", "score": "0.6262698", "text": "def b64tohash(b64)\n Base64.decode64(b64.tr(\"-_\", \"+/\")+\"=\"); # FIXME: check for correctness\n end", "title": "" }, { "docid": "95ed967547f1ab19a41a714a9972a2c5", "score": "0.6261884", "text": "def hash\n strs = FIELDS.collect {|f| \"#{f}:#{send(f).inspect}\"}\n Digest::SHA256.hexdigest(strs.join(' '))\n end", "title": "" }, { "docid": "b0af13e3f6dceb0d7bb6c0f9dd1a23dc", "score": "0.6254343", "text": "def split_hash raw_hash\n _, version, cost, blob = raw_hash.split '$'\n [version.to_s, cost.to_i, raw_hash[0, 29].to_s, blob[-31, 31].to_s]\n end", "title": "" }, { "docid": "63a1efcae413daa6634c692d95393202", "score": "0.62481296", "text": "def hashable_string\n byte_reverse(\"%08x\" % version) +\n byte_reverse(previous_block) +\n byte_reverse(merkle_root) +\n byte_reverse(\"%08x\" % timestamp) +\n byte_reverse(\"%08x\" % bits) +\n byte_reverse(\"%08x\" % nonce)\n end", "title": "" }, { "docid": "5a8844477ce3a6198c0659012b535bea", "score": "0.6241661", "text": "def hex_hash\n update_native\n @native.hash\n end", "title": "" }, { "docid": "57f35324316a88c70cd63a9ca5ea74fd", "score": "0.62414074", "text": "def blake2_hash(*params)\n RbNaCl::Hash.blake2b(params.map{|p|even_hex(p)}.join).unpack(\"H*\").first.to_i(16)\n end", "title": "" }, { "docid": "eaf6fa4a20a500b9975e64c27c67f6b1", "score": "0.623796", "text": "def hash\n digest.hash\n end", "title": "" }, { "docid": "13bec044e71e552289cc8136e770685c", "score": "0.62379324", "text": "def hexdigest(obj); end", "title": "" }, { "docid": "a4087e2c7a6831614a40c4ce2877d0bd", "score": "0.62123924", "text": "def hexdigest(data); end", "title": "" }, { "docid": "8a0e7a713b52a45ff590a5fe570f1a31", "score": "0.6212315", "text": "def hash\r\n to_s.hash\r\n end", "title": "" }, { "docid": "e80298015e38e30cb27e74c2dec69168", "score": "0.6209647", "text": "def sha256(d); Digest::SHA256.digest(d); end", "title": "" }, { "docid": "d6bc0e2d941f5ee4f48f28673e00cc63", "score": "0.6202559", "text": "def test_hash\n (Digest::SHA256.new << str_to_hash).to_s\n end", "title": "" }, { "docid": "f4bc824d91e7f57120f56434f04e5a26", "score": "0.6197934", "text": "def convert_string_to_hash\n\tend", "title": "" }, { "docid": "6fce91741a40dd5b225f2f815c4a52eb", "score": "0.6195207", "text": "def hash_secure\n OpenSSL::Digest::SHA256.new.digest(to_json).unpack('H*').first\n end", "title": "" }, { "docid": "c1c87eda487662d7360b6750984fc254", "score": "0.61950254", "text": "def to_s\n Digest::SHA1.hexdigest(canonical_string)\n end", "title": "" }, { "docid": "a27a36640fa1db75e502bb6ef1ce7b6e", "score": "0.61924225", "text": "def hash\n data = [store.id, user.id, timestamp].join('$')\n Base64.encode64(OpenSSL::HMAC.digest('SHA256', store.private_key, data)).chomp\n end", "title": "" }, { "docid": "b47f9be20c1ca37ad62f5b2a1e013726", "score": "0.6184383", "text": "def to_hash\n\t\tif defined? @hash\n\t\t\t@hash\n\t\telse\n\t\t\tDigest::SHA2.hexdigest(Identicon.salt + @name + Identicon.salt)\n\t\tend\n\tend", "title": "" }, { "docid": "a6d4ffe0852cc4b4e0c9fa0baf0f841f", "score": "0.6181961", "text": "def hash\n self.inject(37){|memo,str| memo + 17*str.hash}\n end", "title": "" }, { "docid": "a4e02373e766881204a59e8498b5ad36", "score": "0.6180109", "text": "def calc_hash( data )\n sha = Digest::SHA256.new\n sha.update( data )\n sha.hexdigest\nend", "title": "" }, { "docid": "90b3837a95fc49ff67e705801c2fce1a", "score": "0.6180068", "text": "def to_urlSegment\n @hashAlgo.to_s + ';' + hashAsBase64\n end", "title": "" }, { "docid": "76c82ba2d29e1890ce89c3f856787242", "score": "0.6179774", "text": "def hash\n return to_s.hash\n end", "title": "" }, { "docid": "76c82ba2d29e1890ce89c3f856787242", "score": "0.6179774", "text": "def hash\n return to_s.hash\n end", "title": "" }, { "docid": "76c82ba2d29e1890ce89c3f856787242", "score": "0.6179774", "text": "def hash\n return to_s.hash\n end", "title": "" }, { "docid": "afb2ca5d0992bd6d6f3d03445118c806", "score": "0.61666715", "text": "def hexdigest_integrity_uri(hexdigest); end", "title": "" }, { "docid": "afb2ca5d0992bd6d6f3d03445118c806", "score": "0.61666715", "text": "def hexdigest_integrity_uri(hexdigest); end", "title": "" }, { "docid": "ce813d91a6392c4b04258fe8d4869238", "score": "0.6165638", "text": "def create_hash\r\n\t\tutf_array = Array.new\r\n\t\tutf_sum = 0\r\n\t\tutf_mod = 0\r\n\t\t@calculated_hash = \"\"\r\n\t\tstring_to_hash = \"#{@block_number}|#{@previous_hash}|#{@transaction_sequence}|#{@timestamp}\"\r\n\t\tutf_array = (string_to_hash.unpack('U*'))\r\n\t\tutf_array.map! do |x| (x ** 2000) * ((x + 2) ** 21) - ((x + 5) ** 3) end \r\n\t\tutf_sum = utf_array.inject(0){|sum,x| sum + x }\r\n\t\tutf_mod = utf_sum % 65536\r\n\t\t@calculated_hash = utf_mod.to_s(16)\r\n\t\t\r\n\t\t#puts @calculated_hash\r\n\t\treturn @calculated_hash\r\n\t\t\r\n\tend", "title": "" }, { "docid": "bdcaccc79e1a1d36a262824d8eb1e749", "score": "0.616261", "text": "def standardize_hash(hash)\n hash.to_h { |k, v| [k.to_s, v.to_s] }\n end", "title": "" }, { "docid": "322bf7366a92c51587d0ec5322ddb9cd", "score": "0.6157086", "text": "def split_hash(h)\n _, v, c, mash = h.split('$')\n return v, c.to_i, h #[0, 29].to_str, mash[-31, 31].to_str\n end", "title": "" }, { "docid": "13ada562a132ebe9bb90f718308d4b80", "score": "0.6156487", "text": "def hash\n return Digest::MD5.hexdigest(@state.to_s).to_sym \n end", "title": "" }, { "docid": "44c84aa119e2075f1789786803f8b714", "score": "0.61555094", "text": "def hash string\n Digest::SHA1.hexdigest string\n end", "title": "" }, { "docid": "088bab8098dfe63300865c9505b95e8a", "score": "0.6150602", "text": "def convert_puppet_input(input_hash)\n input_hash.map { |k, v| [k.to_s.tr('_', '-'), v] }.to_h\n end", "title": "" }, { "docid": "344cb59e07ce4f793d7644d21135773f", "score": "0.61376506", "text": "def hash(id)\n hash = Digest::MD5.hexdigest(id)\n [hash[0..7], hash[8..11], hash[12..15], hash[16..19], hash[20..-1]].join('-')\n end", "title": "" }, { "docid": "b9087d35bc7b47a212a7e33315b67de3", "score": "0.6132522", "text": "def name_hash(name)\n Digest::SHA1.hexdigest(name)\n end", "title": "" }, { "docid": "0efc33cf18bcedff4c20f96e9d5d65c5", "score": "0.61242807", "text": "def _calc_hash(value)\n value.hash\nend", "title": "" }, { "docid": "cd762ac258124f5ddc807f195e2542e4", "score": "0.61034656", "text": "def hexdigest(object, normalize: true)\n digest(object, normalize: normalize).unpack(\"H*\").first\n end", "title": "" }, { "docid": "24774aa034cd980bec4f762d8577ef49", "score": "0.6098431", "text": "def sha256_fingerprint\n Base64.encode64(Digest::SHA256.digest(ssh_public_key_conversion)).gsub(\"\\n\", \"\")\n end", "title": "" }, { "docid": "cd2abbc958e2d6fba0930d47208fd20f", "score": "0.6098378", "text": "def hash\n to_s.hash\n end", "title": "" }, { "docid": "cd2abbc958e2d6fba0930d47208fd20f", "score": "0.6098378", "text": "def hash\n to_s.hash\n end", "title": "" }, { "docid": "cd2abbc958e2d6fba0930d47208fd20f", "score": "0.6098378", "text": "def hash\n to_s.hash\n end", "title": "" } ]
5347b243c69f9a4f14dae9a3dae839f5
Performs the _sslverification_ command.
[ { "docid": "87c24c1b352ed9f36f75881e21713a25", "score": "0.6616285", "text": "def perform\n unless arguments.empty?\n raise ArgumentError,\n \"wrong number of arguments (#{arguments.length} for 0)\"\n end\n\n will_or_not = HTTY::Preferences.current.verify_certificates? ?\n 'will' :\n 'will not'\n puts notice(\"SSL certificates #{will_or_not} be verified\")\n end", "title": "" } ]
[ { "docid": "0ea6613dbf1e77ebf2fa4de9438ebb49", "score": "0.76246595", "text": "def ssl_verification=(_arg0); end", "title": "" }, { "docid": "d4814ffef7685e62fae8da6ddb63a69d", "score": "0.76181614", "text": "def ssl_verification; end", "title": "" }, { "docid": "402bc13f8cfc83a6d11d7c9f7839ad78", "score": "0.73498696", "text": "def cmd_ssl_verify(*args)\n if ( args.length == 0 or args.include?(\"-h\") )\n cmd_ssl_verify_help\n return\n end\n\n query = false\n enable = false\n disable = false\n\n settings = 0\n\n @@ssl_verify_opts.parse(args) do |opt, idx, val|\n case opt\n when '-q'\n query = true\n settings += 1\n when '-e'\n enable = true\n settings += 1\n when '-d'\n disable = true\n settings += 1\n end\n end\n\n # Make sure only one action has been chosen\n if settings != 1\n cmd_ssl_verify_help\n return\n end\n\n if query\n hash = client.core.get_ssl_hash_verify\n if hash\n print_good(\"SSL verification is enabled. SHA1 Hash: #{hash.unpack(\"H*\")[0]}\")\n else\n print_good('SSL verification is disabled.')\n end\n\n elsif enable\n hash = client.core.enable_ssl_hash_verify\n if hash\n print_good(\"SSL verification has been enabled. SHA1 Hash: #{hash.unpack(\"H*\")[0]}\")\n else\n print_error('Failed to enable SSL verification')\n end\n\n else\n if client.core.disable_ssl_hash_verify\n print_good('SSL verification has been disabled')\n else\n print_error('Failed to disable SSL verification')\n end\n end\n\n end", "title": "" }, { "docid": "b147c68bbfeff5bcb3bff64ab9ba80d1", "score": "0.6963897", "text": "def hook_ssl_verification\n if respond_to?(:enable_ssl_verification)\n enable_ssl_verification\n else\n true\n end\n end", "title": "" }, { "docid": "f7305a3ef95e9ead3755f8cd63b7feed", "score": "0.67727077", "text": "def ssl_verify\n head :ok\n end", "title": "" }, { "docid": "3a030335dedd96da29ae659049704c24", "score": "0.65514594", "text": "def cmd_ssl_verify_help\n print_line('Usage: ssl_verify [options]')\n print_line\n print_line('Change and query the current setting for SSL verification')\n print_line('Only one of the following options can be used at a time')\n print_line(@@ssl_verify_opts.usage)\n end", "title": "" }, { "docid": "9c4267a528b9413800e189dbb861bee7", "score": "0.65351295", "text": "def verify_ssl\n @opts.has_key?(:verify_ssl) ? @opts[:verify_ssl] : $setting.dig(:triglav, :verify_ssl)\n end", "title": "" }, { "docid": "3c29cf3e03998e254e2e580710c2fe72", "score": "0.6433676", "text": "def ensure_verification_enabled!\n node.run_state[:verification_enabled] ||= begin\n execute 'enable-cryptographic-verification' do\n command <<-EOH.gsub(/ ^{12}/, '')\n pkgutil -y -i cswpki\n cswpki --import --force\n EOH\n not_if 'gpg --homedir=/var/opt/csw/pki --list-keys | grep board@opencsw.org'\n end\n\n true\n end\n end", "title": "" }, { "docid": "d90275821296622bfe200a30b9b58338", "score": "0.6210886", "text": "def run\n @fail_cert = nil\n @failed_cert_reason = 'Unknown'\n uri = URI.parse(config[:url])\n critical \"url protocol must be https, you specified #{url}\" if uri.scheme != 'https'\n root_cert = find_root_cert(uri)\n if @failed_cert\n msg = \"Certificate verification failed.\\n Reason: #{@failed_cert_reason}\"\n critical msg\n end\n\n if validate_issuer(root_cert)\n msg = 'Root certificate in chain has expected issuer name'\n ok msg\n else\n msg = \"Root certificate issuer did not match expected name.\\nFound: \\\"#{root_cert.issuer.to_s(config[:issuer_format])}\\\"\"\n critical msg\n end\n end", "title": "" }, { "docid": "d0864185d1e8f9ba160f0b808d5bce05", "score": "0.61835444", "text": "def perform\n HTTY::Preferences.current.verify_certificates = true\n end", "title": "" }, { "docid": "e8b2a8a54dd7d13815c5931e297c9b1b", "score": "0.61654305", "text": "def ssl_verify\n 'none' # ssl_verify for secure connection\n end", "title": "" }, { "docid": "22c4e5b39975525bd8c889a9c1dc02c8", "score": "0.61481833", "text": "def verify_ssl\n @adapter.verify_ssl\n end", "title": "" }, { "docid": "1a6b75766a2c64d41889c8cbb7de6fa0", "score": "0.61379695", "text": "def no_ssl_peer_verification!\n @httpcli.ssl_config.verify_mode = OpenSSL::SSL::VERIFY_NONE\n end", "title": "" }, { "docid": "70c326eb6853969b6e17ce62a65e9162", "score": "0.6110325", "text": "def check_ssl_conn\n #Refer to child class method\n # => serial_cmd->check_ssl_conn\n # TBD:: => ilv_cmd->check_ssl_conn\n end", "title": "" }, { "docid": "0d17ad78ea1e3cd4b2a8a3a03459251c", "score": "0.60607207", "text": "def verify_ssl_certs; end", "title": "" }, { "docid": "a03fdd7da9c712cb84f78ad05d9d5158", "score": "0.60267866", "text": "def verify_ssl_host\n @opts.has_key?(:verify_ssl_host) ? @opts[:verify_ssl_host] : $setting.dig(:triglav, :verify_ssl_host)\n end", "title": "" }, { "docid": "0274524e277c05c006eeada6bcc44840", "score": "0.6022221", "text": "def cmd_verify argv\n setup argv\n response = @api.verify\n msg response\n return response\n end", "title": "" }, { "docid": "d94a85046b20636a78bc2965aef39acb", "score": "0.60098547", "text": "def on_ssl_result(result); end", "title": "" }, { "docid": "5fbb75b79b1b634d89e60c60bca75ffa", "score": "0.5992423", "text": "def validate_ssl_certificate; end", "title": "" }, { "docid": "4bdfd03ecebc902a9d87d15ffcefc6cf", "score": "0.59776497", "text": "def verify_ssl=(state)\n @adapter.verify_ssl = state\n end", "title": "" }, { "docid": "6a22125fdeb14398bba32ada51f7eb51", "score": "0.5866901", "text": "def ssh_do_verify( sig, data )\n verify( OpenSSL::Digest::SHA1.new, sig, data )\n end", "title": "" }, { "docid": "b5b42b5c088077d9518920c4ba0fbcbb", "score": "0.5851534", "text": "def certificate_verify(host, port, verified, context)\n # Now verify the entire chain.\n begin\n @logger.debug(\"Verify peer via OpenSSL::X509::Store\",\n :verified => verified, :chain => context.chain.collect { |c| c.subject },\n :context => context, :depth => context.error_depth,\n :error => context.error, :string => context.error_string)\n # Untrusted certificate; prompt to accept if possible.\n if !verified and STDOUT.tty?\n # TODO(sissel): Factor this out into a verify callback where this\n # happens to be the default.\n\n puts \"Untrusted certificate found; here's what I know:\"\n puts \" Why it's untrusted: (#{context.error}) #{context.error_string}\"\n\n if context.error_string =~ /local issuer/\n puts \" Missing cert for issuer: #{context.current_cert.issuer}\"\n puts \" Issuer hash: #{context.current_cert.issuer.hash.to_s(16)}\"\n else\n puts \" What you think it's for: #{host} (port #{port})\"\n cn = context.chain[0].subject.to_s.split(\"/\").grep(/^CN=/).first.split(\"=\",2).last rescue \"<unknown, no CN?>\"\n puts \" What it's actually for: #{cn}\"\n end\n\n puts \" Full chain:\"\n context.chain.each_with_index do |cert, i|\n puts \" Subject(#{i}): [#{cert.subject.hash.to_s(16)}] #{cert.subject}\"\n end\n print \"Trust? [(N)o/(Y)es/(P)ersistent] \"\n\n system(\"stty raw\")\n answer = $stdin.getc.downcase\n system(\"stty sane\")\n puts\n\n if [\"y\", \"p\"].include?(answer)\n # TODO(sissel): Factor this out into Agent::Trust or somesuch\n context.chain.each do |cert|\n # For each certificate, add it to the in-process certificate store.\n begin\n certificate_store.add_cert(cert)\n rescue OpenSSL::X509::StoreError => e\n # If the cert is already trusted, move along.\n if e.to_s != \"cert already in hash table\" \n raise # this is a real error, reraise.\n end\n end\n\n # TODO(sissel): Factor this out into Agent::Trust or somesuch\n # For each certificate, if persistence is requested, write the cert to\n # the configured ssl trust store (usually ~/.ftw/ssl-trust.db/) \n if answer == \"p\" # persist this trusted cert\n require \"fileutils\"\n if !File.directory?(configuration[SSL_TRUST_STORE])\n FileUtils.mkdir_p(configuration[SSL_TRUST_STORE])\n end\n\n # openssl verify recommends the 'ca path' have files named by the\n # hashed subject name. Turns out openssl really expects the\n # hexadecimal version of this.\n name = File.join(configuration[SSL_TRUST_STORE], cert.subject.hash.to_s(16))\n # Find a filename that doesn't exist.\n num = 0\n num += 1 while File.exists?(\"#{name}.#{num}\")\n\n # Write it out\n path = \"#{name}.#{num}\"\n @logger.info(\"Persisting certificate\", :subject => cert.subject, :path => path)\n File.write(path, cert.to_pem)\n end # if answer == \"p\"\n end # context.chain.each\n return true\n end # if answer was \"y\" or \"p\"\n end # if !verified and stdout is a tty\n\n return verified\n rescue => e\n # We have to rescue all and emit because openssl verify_callback ignores\n # exceptions silently\n @logger.error(e)\n return verified\n end\n end", "title": "" }, { "docid": "6755ae8add712ab66535466d4a0b6183", "score": "0.5850585", "text": "def ssl_verify_mode; end", "title": "" }, { "docid": "6755ae8add712ab66535466d4a0b6183", "score": "0.5850585", "text": "def ssl_verify_mode; end", "title": "" }, { "docid": "10d4b634df611460c133d99419a49a2d", "score": "0.58491564", "text": "def verify_site\n verification_prompt = isay(\"#{@site['id']}_Verification\")\n\n options = @ask_default_options.merge(:choices => \"1,2\")\n\n event = ask(verification_prompt, options)\n if event.name == 'choice'\n if event.value == \"1\"\n caller_info['site_verified'] = true\n else\n get_site_info\n end\n else\n log(\"received #{event.name} and #{event.value} - retrying\") if DEBUG\n get_site_info\n end\n end", "title": "" }, { "docid": "1a2347b1b9cb722e2370766f9c2f1e5d", "score": "0.58418906", "text": "def verify_ssl_option\n if test?\n OpenSSL::SSL::VERIFY_NONE\n else\n OpenSSL::SSL::VERIFY_PEER\n end\n end", "title": "" }, { "docid": "84420f6330e9a4d8b7b3a07f87801fa3", "score": "0.5790359", "text": "def cmd_auth(arg)\n if arg =~ /^tls$/i\n @tls_state = :authed\n send_response \"234 Accept security mechanism: TLS\"\n begin\n start_tls(:private_key_file => 'certs/server.key', :cert_chain_file => 'certs/server.crt', :verify_peer => false)\n rescue => e\n # rescue exception when test\n end\n else\n send_response \"504 Do not understand security mechanism: '#{arg}'\"\n end\n end", "title": "" }, { "docid": "f84131a2c77a8442886b59880a669332", "score": "0.5788469", "text": "def verify_action\n banner \"Verifying #{to_str}...\"\n elapsed = action(:verify) do |state|\n # use special handling for legacy driver\n if legacy_ssh_base_driver? && use_legacy_ssh_verifier?(verifier)\n legacy_ssh_base_verify(state)\n elsif legacy_ssh_base_driver?\n # read ssh options from legacy driver\n verifier.call(driver.legacy_state(state))\n else\n verifier.call(state)\n end\n end\n info(\"Finished verifying #{to_str} #{Util.duration(elapsed.real)}.\")\n self\n end", "title": "" }, { "docid": "fd6ca207a32110b0f7b38ecfdb1bf7bd", "score": "0.5772154", "text": "def verify_signature\n verify_with_certificates []\n end", "title": "" }, { "docid": "53869cb8cf9ab0c1c71f4d4c926a19bc", "score": "0.57629293", "text": "def verify!\n\t\t\tsay_hello\n\t\t\tmailfrom('stealout@gmail.com') # needs to be picked up from the configurations.\n\t\t\tresult = rcptto(@email)\n\n\t\t\t@telnet_conn.cmd(\"QUIT\")\n\t\t\tresult\n\t\tend", "title": "" }, { "docid": "a90db2d5597cdb40d36f3f8b3635a232", "score": "0.5742179", "text": "def verify_ssl\n middleware.ssl[:verify].nil? || !!middleware.ssl[:verify]\n end", "title": "" }, { "docid": "3a8eb05868a09fb60b7b2afce3213361", "score": "0.57239056", "text": "def verify\n forbidden! unless verified?\n render status: 200, plain: params['hub.challenge']\n end", "title": "" }, { "docid": "d0fcefbd80d76b7f2b356015b2696857", "score": "0.57224274", "text": "def ssl_verify\n # Vault CLI uses this envvar, so accept it by precedence\n if !ENV[\"VAULT_SKIP_VERIFY\"].nil?\n return false\n end\n\n if ENV[\"VAULT_SSL_VERIFY\"].nil?\n true\n else\n %w[t y].include?(ENV[\"VAULT_SSL_VERIFY\"].downcase[0])\n end\n end", "title": "" }, { "docid": "1c537f0873d0eb2613cac3e87bd83f3a", "score": "0.5717832", "text": "def verify options\n API::request(:post, 'verify', options)\n end", "title": "" }, { "docid": "f28a55d3a6e8881135b5324bbd38ff35", "score": "0.5711814", "text": "def verify!\n self.update_attribute(:status, VERIFIED)\n end", "title": "" }, { "docid": "ed3a6e965b3bf0f0aa108d7230ff0be6", "score": "0.5711298", "text": "def verify\r\n response = @client.call :verification, message: {\r\n 'api' => @api,\r\n 'amount' => @amount,\r\n 'authority' => @authority,\r\n }\r\n @response.validate(response.body)\r\n end", "title": "" }, { "docid": "e9e1934f15741eaf6e64d99d6a933b68", "score": "0.5709195", "text": "def ssl_verify\n if ENV[\"ARTIFACTORY_SSL_VERIFY\"].nil?\n true\n else\n %w{t y}.include?(ENV[\"ARTIFACTORY_SSL_VERIFY\"].downcase[0])\n end\n end", "title": "" }, { "docid": "5766bb3d36d922f3977c2214d73e744b", "score": "0.57047033", "text": "def start_ssl\n @verified_peer = false\n @ssl_requested = true\n\n ssl_opts = {}\n if ssl_opts?\n ssl_opts = {\n private_key_file: @opts[:ssl_pkey],\n cert_chain_file: @opts[:ssl_cert],\n verify_peer: true\n }\n @last_seen_cert = nil\n end\n\n # ap ssl_opts\n start_tls( ssl_opts )\n end", "title": "" }, { "docid": "c28dbee427aebf2d6a71c94ab7a46a65", "score": "0.5689446", "text": "def disable_ssl_verification\n if @endpoint =~ /^https/\n sessionm.options['protocol.http.ssl_config.verify_mode'] = nil\n envm.options['protocol.http.ssl_config.verify_mode'] = nil\n packagem.options['protocol.http.ssl_config.verify_mode'] = nil\n relocator.options['protocol.http.ssl_config.verify_mode'] = nil\n devm.options['protocol.http.ssl_config.verify_mode'] = nil\n networkm.options['protocol.http.ssl_config.verify_mode'] = nil\n proc_info.options['protocol.http.ssl_config.verify_mode'] = nil\n processm.options['protocol.http.ssl_config.verify_mode'] = nil\n up2date.options['protocol.http.ssl_config.verify_mode'] = nil\n support.options['protocol.http.ssl_config.verify_mode'] = nil\n env_samplem.options['protocol.http.ssl_config.verify_mode'] = nil\n alertm.options['protocol.http.ssl_config.verify_mode'] = nil\n authm.options['protocol.http.ssl_config.verify_mode'] = nil\n backupm.options['protocol.http.ssl_config.verify_mode'] = nil\n computerm.options['protocol.http.ssl_config.verify_mode'] = nil\n event_log.options['protocol.http.ssl_config.verify_mode'] = nil\n server_group.options['protocol.http.ssl_config.verify_mode'] = nil\n filer.options['protocol.http.ssl_config.verify_mode'] = nil\n firewallm.options['protocol.http.ssl_config.verify_mode'] = nil\n licensem.options['protocol.http.ssl_config.verify_mode'] = nil\n mailer.options['protocol.http.ssl_config.verify_mode'] = nil\n op_log.options['protocol.http.ssl_config.verify_mode'] = nil\n perf_mon.options['protocol.http.ssl_config.verify_mode'] = nil\n res_log.options['protocol.http.ssl_config.verify_mode'] = nil\n resourcem.options['protocol.http.ssl_config.verify_mode'] = nil\n scheduler.options['protocol.http.ssl_config.verify_mode'] = nil\n servicem.options['protocol.http.ssl_config.verify_mode'] = nil\n userm.options['protocol.http.ssl_config.verify_mode'] = nil\n end\n end", "title": "" }, { "docid": "4b7ce9974496da9c7c2993823b499698", "score": "0.56869626", "text": "def ssl_verify_mode\n datastore['SSLVerifyMode']\n end", "title": "" }, { "docid": "e726ea387d628f7685c1bd99e8422b10", "score": "0.56841254", "text": "def set_ssl_verify(is_enabled)\n @is_ssl_verify = is_enabled\n end", "title": "" }, { "docid": "39770abb0dc6e68cc674f479148a1d5c", "score": "0.5674709", "text": "def verify_ssl?\n !config[:vcenter_disable_ssl_verify]\n end", "title": "" }, { "docid": "c0347749729cc2e41c596b3bf847438d", "score": "0.562112", "text": "def perform\n HTTY::Preferences.current.verify_certificates = false\n end", "title": "" }, { "docid": "05beaf9a312df5337174dbaad2611312", "score": "0.56169516", "text": "def ssh_do_verify(sig, data, options = {})\n digester =\n if options[:host_key] == \"rsa-sha2-512\"\n OpenSSL::Digest::SHA512.new\n elsif options[:host_key] == \"rsa-sha2-256\"\n OpenSSL::Digest::SHA256.new\n else\n OpenSSL::Digest::SHA1.new\n end\n\n verify(digester, sig, data)\n end", "title": "" }, { "docid": "60aaa62f10e10e112790a1017918d834", "score": "0.5594754", "text": "def verify\n\t\n if valid_verify_token?(@request.params['hub.verify_token'])\n @response.write @request.params['hub.challenge']\n else\n @response.write 'Error; wrong verify token'\n end\n end", "title": "" }, { "docid": "20a75aa1df4a1eca3dbb9bd6ecd8f396", "score": "0.55622953", "text": "def perform\n add_request_if_has_response do |request|\n\n if arguments.empty?\n puts self.class.current_status request\n\n elsif !@@options.include? arguments[0]\n puts \"Arguments for #{self.class.command_line}:\"\n puts self.class.help_extended\n\n else\n case arguments[0]\n when 'on'\n request.ssl_verify = true\n when 'off'\n request.ssl_verify = false\n end\n \n puts self.class.current_status request\n end \n\n request\n end\n end", "title": "" }, { "docid": "e6f75d89dd6c37c928d9ad6c9e2b1f1d", "score": "0.55585885", "text": "def exec_openssl_ca(args)\n #args is an array of options \n cmd = \"openssl ca \" + args.join(\" \")\n status = 0\n err = ''\n out = ''\n Open3.popen3(cmd) do |stdin, stdout, stderr, wait_thr|\n stderr.each { |line| err += line }\n stdout.each { |line| out += line }\n status = wait_thr.value\n end\n if status.exitstatus != 0\n #something bad happened\n mssg = \"Error running command '\" + cmd + \": \" \n if not out.nil?\n mssg += out.to_s\n end\n if not err.nil?\n mssg += \" \" + err.to_s\n end\n raise mssg\n end\n end", "title": "" }, { "docid": "73486a1c1c9472501ae06578bd2523ae", "score": "0.55556077", "text": "def ssl_peer_fingerprint_verification!\n return unless @ssl_peer_fingerprint && !@ssl_peer_fingerprint_verified\n\n with_untrusted_ssl_connection do |connection|\n connection_cert = connection.peer_cert\n verify_ssl_fingerprint(connection_cert)\n end\n @logger.info(\"initial ssl fingerprint #{@ssl_peer_fingerprint} verified\\n\")\n @ssl_peer_fingerprint_verified = true\n no_ssl_peer_verification!\n end", "title": "" }, { "docid": "2b181962cafefea9d3daed4612af24df", "score": "0.5552433", "text": "def verify\n if valid_verify_token?(@request.params['hub.verify_token'])\n @response.write @request.params['hub.challenge']\n else\n @response.write 'Error; wrong verify token'\n end\n end", "title": "" }, { "docid": "364181178d0b9d0933e73bca13bcaf2d", "score": "0.5546032", "text": "def ssl?; end", "title": "" }, { "docid": "353a26ca59034ce4da2c0291295884a1", "score": "0.5541003", "text": "def verify(domain)\n Mailgun.submit :put, \"#{domain_url(domain)}/verify\"\n end", "title": "" }, { "docid": "bfba40bb27d87b965f9cd9c5b153d9e3", "score": "0.5530384", "text": "def email_verification; end", "title": "" }, { "docid": "7fa70b225496732c7a37d889ef378450", "score": "0.5528975", "text": "def run\n verifier = CandyCheck::PlayStore::Verifier.new(options[:client_secrets_path])\n verifier.boot!\n result = verifier.verify(@package, @product_id, @token)\n out.print \"#{result.class}:\"\n out.pretty result\n end", "title": "" }, { "docid": "412aeb3bb4949bc0c83c4570ffb166b8", "score": "0.55268145", "text": "def ssl_opts\n { verify: true }\n end", "title": "" }, { "docid": "a94a20935147bccac2be2cea12c56d24", "score": "0.5514831", "text": "def fetch_ssl_certificates\n run_command(\"ssl fetch\")\n rescue BuildNode::Exceptions::KnifeCommandFailed => e\n raise BuildNode::Exceptions::CertFetchFailed.new(e.message)\n end", "title": "" }, { "docid": "6f89b617bfd1656dcf378a771df07b30", "score": "0.5513184", "text": "def verify!\n do_verification(:abort_process)\n end", "title": "" }, { "docid": "6f89b617bfd1656dcf378a771df07b30", "score": "0.5513184", "text": "def verify!\n do_verification(:abort_process)\n end", "title": "" }, { "docid": "6f89b617bfd1656dcf378a771df07b30", "score": "0.5513184", "text": "def verify!\n do_verification(:abort_process)\n end", "title": "" }, { "docid": "6f89b617bfd1656dcf378a771df07b30", "score": "0.5513184", "text": "def verify!\n do_verification(:abort_process)\n end", "title": "" }, { "docid": "e5c69edbecc3d8d263e07ac605cbbab8", "score": "0.5506977", "text": "def test_client_cert_auth_https\n T2Server::Run.create($uri, WKF_CLIENT_HTTPS, $creds, $conn_params) do |run|\n run.add_keypair_credential(HEATER_CAUTH, USER_PK, CERTPASS, CERTNAME)\n run.add_trust(HEATER_PK)\n run.start\n assert(run.running?)\n assert_nothing_raised(T2Server::RunStateError) { run.wait }\n assert(run.finished?)\n refute(run.output_port(\"out\").error?)\n assert(run.delete)\n end\n end", "title": "" }, { "docid": "6c3ff27abb3d7e71d8aec83f7b1a6401", "score": "0.54973847", "text": "def with_openssl(code, **opts)\n assert_separately([\"-ropenssl\"], <<~\"end;\", **opts)\n #{code}\n end;\n end", "title": "" }, { "docid": "70a53e742199a9ed8a8b006458ae59cc", "score": "0.54877496", "text": "def verify_ssl=(verify)\n middleware.ssl[:verify] = !!verify\n end", "title": "" }, { "docid": "36269291032accd2593293620dd8f89f", "score": "0.5479828", "text": "def starttls(options = T.unsafe(nil), verify = T.unsafe(nil)); end", "title": "" }, { "docid": "9fbf04930d2fcdc1714640c59dab5b50", "score": "0.5479476", "text": "def verify(*args, **options); end", "title": "" }, { "docid": "3dabd61d5d5b4c0ff9b3bbaae289e41b", "score": "0.54505503", "text": "def run_verify(target_dir)\n cmd_ver_obj = commands[:verify_command]\n cmd_ver_obj.run({ :target_dir => target_dir })\n if cmd_ver_obj.findings.size == 0\n puts 'OK, system is conforming to model'.color(:green)\n else\n puts 'ERROR, detected inconsistencies/errors.'.color(:red)\n # cmd_ver_obj.findings.each do |val_error|\n # puts val_error.to_s\n # end\n end\n end", "title": "" }, { "docid": "d1751226f5c307588bcdeaf572f23acb", "score": "0.5437721", "text": "def legacy_ssh_base_verify(state)\n warn(\"Running legacy verify for '#{driver.name}' Driver\")\n # TODO: Document upgrade path and provide link\n # warn(\"Driver authors: please read http://example.com for more details.\")\n driver.verify(state)\n end", "title": "" }, { "docid": "17c99b506f207e031d2ee4b7d8ae6ea6", "score": "0.5429601", "text": "def verify\n account = Account.find_by_id_and_verification_key(params[:id], params[:verification_key])\n if account\n if account.is_pending_activation?\n account.activate!\n else\n account.is_not_pending_recovery!\n end\n head :ok\n else\n head :not_found\n end\n end", "title": "" }, { "docid": "c65141775080cdcfa84dbd8cf6ac36b8", "score": "0.5428821", "text": "def verify(*args)\n ActiveSupport::Deprecation.warn \"verify was removed from Rails and is now available as a plugin. \" \\\n \"Please install it with `rails plugin install git://github.com/sikachu/verification.git`.\", caller\n end", "title": "" }, { "docid": "2185e32161c8150dc413b9515c1c741c", "score": "0.5426531", "text": "def enable_ssl\n end", "title": "" }, { "docid": "64400f1726c81fe1d19de1e8320424ec", "score": "0.54201806", "text": "def manage_ssl_certificate\n calculate_management('ssl_certificate')\n end", "title": "" }, { "docid": "ed76217264bb228f254e856d3de176f3", "score": "0.5411936", "text": "def ssl; end", "title": "" }, { "docid": "ed76217264bb228f254e856d3de176f3", "score": "0.5411936", "text": "def ssl; end", "title": "" }, { "docid": "83220bc40eb07799094e8c69cebefb7a", "score": "0.5405239", "text": "def do_ssl_verify?\n if target_hostname == \"localhost\" ||\n target_hostname == \"a2-dev.test\" ||\n target_hostname =~ /\\d+\\.\\d+\\.\\d+\\.\\d+/\n return false\n end\n return true\n end", "title": "" }, { "docid": "b4aeabaf8d0b963a9d608ba55d8b6e3d", "score": "0.53988254", "text": "def verify!\n self.update_attribute(:verified, true)\n end", "title": "" }, { "docid": "8425d42f3ed8b4f0420c9191880c5bcc", "score": "0.5397105", "text": "def ssh_do_verify(sig, data, options = {})\n sig_r = sig[0, 20].unpack(\"H*\")[0].to_i(16)\n sig_s = sig[20, 20].unpack(\"H*\")[0].to_i(16)\n a1sig = OpenSSL::ASN1::Sequence([\n OpenSSL::ASN1::Integer(sig_r),\n OpenSSL::ASN1::Integer(sig_s)\n ])\n return verify(OpenSSL::Digest::SHA1.new, a1sig.to_der, data)\n end", "title": "" }, { "docid": "1477aa237723f7dd728d26c99b657de7", "score": "0.5384757", "text": "def verify\n end", "title": "" }, { "docid": "1e46f830c7d4b00456b44b9182b79faf", "score": "0.5377066", "text": "def need_server_cert_validation()\t \t\n if (@enable_server_cert_validation == 1)\n return 1\n else\n\treturn 0\n end\n end", "title": "" }, { "docid": "fca6ebe9fdcea4f2d0851de36f2a0f66", "score": "0.5375621", "text": "def configure_ssl(options, env); end", "title": "" }, { "docid": "5640a67c11afa4cdb33349ab649d0957", "score": "0.53733647", "text": "def verify!; end", "title": "" }, { "docid": "a9f4b1eb4ffe1b2e3e54e8636fb8a84a", "score": "0.5372386", "text": "def ssl_verify_mode\n\t\t\t\tcase self.hostname\n\t\t\t\twhen LOCALHOST\n\t\t\t\t\tOpenSSL::SSL::VERIFY_NONE\n\t\t\t\telse\n\t\t\t\t\tOpenSSL::SSL::VERIFY_PEER\n\t\t\t\tend\n\t\t\tend", "title": "" }, { "docid": "85268bfeab4fc8248099ae91048b2e2c", "score": "0.5371283", "text": "def sample_verify_callback(is_ok, ctx)\n unless is_ok\n depth = ctx.error_depth\n code = ctx.error\n msg = ctx.error_string\n STDERR.puts \"at depth #{depth} - #{code}: #{msg}\" if $DEBUG\n return false\n end\n\n cert = ctx.current_cert\n self_signed = false\n ca = false\n pathlen = nil\n server_auth = true\n self_signed = (cert.subject.cmp(cert.issuer) == 0)\n\n # Check extensions whatever its criticality is. (sample)\n cert.extensions.each do |ex|\n case ex.oid\n when 'basicConstraints'\n\t/CA:(TRUE|FALSE), pathlen:(\\d+)/ =~ ex.value\n\tca = ($1 == 'TRUE')\n\tpathlen = $2.to_i\n when 'keyUsage'\n\tusage = ex.value.split(/\\s*,\\s*/)\n\tca = usage.include?('Certificate Sign')\n\tserver_auth = usage.include?('Key Encipherment')\n when 'extendedKeyUsage'\n\tusage = ex.value.split(/\\s*,\\s*/)\n\tserver_auth = usage.include?('Netscape Server Gated Crypto')\n when 'nsCertType'\n\tusage = ex.value.split(/\\s*,\\s*/)\n\tca = usage.include?('SSL CA')\n\tserver_auth = usage.include?('SSL Server')\n end\n end\n\n if self_signed\n STDERR.puts 'self signing CA' if $DEBUG\n return true\n elsif ca\n STDERR.puts 'middle level CA' if $DEBUG\n return true\n elsif server_auth\n STDERR.puts 'for server authentication' if $DEBUG\n return true\n end\n\n return false\n end", "title": "" }, { "docid": "6e1b0f1c5fc26b261f12f1a7bf208574", "score": "0.5368021", "text": "def send_verification_sms\n send_sms\n end", "title": "" }, { "docid": "6e1b0f1c5fc26b261f12f1a7bf208574", "score": "0.5368021", "text": "def send_verification_sms\n send_sms\n end", "title": "" }, { "docid": "82d499a0bb484d7fa96897916dcbfcf6", "score": "0.53666866", "text": "def verify!\n update_attribute(:verified, true)\n end", "title": "" }, { "docid": "efad0accaabdc7e2a261315cff9cfe25", "score": "0.53634965", "text": "def default_verify_callback(is_ok, ctx)\n if $DEBUG\n puts \"#{ is_ok ? 'ok' : 'ng' }: #{ctx.current_cert.subject}\"\n end\n if !is_ok\n depth = ctx.error_depth\n code = ctx.error\n msg = ctx.error_string\n STDERR.puts \"at depth #{depth} - #{code}: #{msg}\"\n end\n is_ok\n end", "title": "" }, { "docid": "bc42c6362b7b54721faf1ac97a331709", "score": "0.53579444", "text": "def verify\n self.verified = true\n end", "title": "" }, { "docid": "025e2a9a117a4b0fc10a2aa875f7a349", "score": "0.5355322", "text": "def resend_verification_code!\n self.send_verification_code\n end", "title": "" }, { "docid": "3aebcbcd1a500785b4fa35c4c32c4c60", "score": "0.53531647", "text": "def call(env)\n cmd = env['cmd']\n if ActiveSupport::SecurityUtils.secure_compare(cmd.request.token, token)\n handler.call(env)\n else\n fail UnverifiedError\n end\n end", "title": "" }, { "docid": "accee4fd49547ecd73b662ea5cb8e779", "score": "0.53440034", "text": "def check_ssl\n #Initialize ssl result as false\n ssl_ok = false\n begin\n #Establish SSL socket\n context = OpenSSL::SSL::SSLContext.new\n context.verify_mode = OpenSSL::SSL::VERIFY_NONE\n ssl_socket = OpenSSL::SSL::SSLSocket.new(@s, context)\n ssl_socket.sync_close = true\n ssl_socket.connect\n \n #Write SSL password\n ssl_socket.write Common.packbytes(SSL_CLIENT_PWD)\n \n #WARNING: Timeout not handled\n #Receive password status\n pwd_status = ssl_socket.sysread(4)\n \n #Raise if password status not valid\n raise \"Password status not received!\" if !pwd_status \n raise \"Password status not OK!\" if pwd_status == false\n \n #Assign ssl socket to existing class variable\n @s = ssl_socket\n \n #Ping and check if device ssl connection is enabled\n ssl_ok = ping\n rescue Exception => ex\n $test_logger.log_e \"Error in check_ssl!\", ex, false\n end\n \n #Return ssl result\n ssl_ok\n end", "title": "" }, { "docid": "d73adcea0cab38071439a1d92aaaaf7a", "score": "0.53413516", "text": "def on_verification(&block)\n @verification = block\n end", "title": "" }, { "docid": "34d8ec8c861f314736605cb77267fe10", "score": "0.53381205", "text": "def on_ssl_connect\n send(\"login\")\n end", "title": "" }, { "docid": "01b788fd334476d7231c9f1f0cf9adca", "score": "0.5320108", "text": "def default_verify_callback(is_ok, ctx)\n if $DEBUG\n puts \"#{ is_ok ? 'ok' : 'ng' }: #{ctx.current_cert.subject}\"\n end\n if !is_ok\n depth = ctx.error_depth\n code = ctx.error\n msg = ctx.error_string\n STDERR.puts \"at depth #{depth} - #{code}: #{msg}\"\n end\n is_ok\n end", "title": "" }, { "docid": "8efc62fc0574d865603bec9321183e9b", "score": "0.53155565", "text": "def ssl_verify_mode\n\t\t\t\tif self.localhost?\n\t\t\t\t\tOpenSSL::SSL::VERIFY_NONE\n\t\t\t\telse\n\t\t\t\t\tOpenSSL::SSL::VERIFY_PEER\n\t\t\t\tend\n\t\t\tend", "title": "" }, { "docid": "835ed5c510fbdb15083d8a1126c4f203", "score": "0.53026885", "text": "def ssl_handshake_completed\n return if !are_we_a_client? || !ssl_opts? ||\n OpenSSL::SSL.verify_certificate_identity( @last_seen_cert, @opts[:host] )\n\n log( :error, 'SSL',\n \"The hostname '#{@opts[:host]}' does not match the server certificate.\"\n )\n\n close_connection\n end", "title": "" }, { "docid": "f399eb2f32d316007c603cd98a450b37", "score": "0.53012216", "text": "def check_ssl\n yield\n rescue OpenSSL::SSL::SSLError => e\n raise_config_error \"Invalid SSL cert\"\n end", "title": "" }, { "docid": "7a0c1e71f7aa8247487874aaa9abebd9", "score": "0.52998877", "text": "def send_verification_email\n if @user.verified?\n flash[:warning] = I18n.t('users.already_verified')\n else\n @user.reset_verification_code\n UserMailer.verification_email(@user).deliver\n flash[:notice] = I18n.t('users.sent_verification_email')\n end\n\n respond_to do |format|\n format.html { redirect_to login_path }\n end\n end", "title": "" }, { "docid": "0f2efa84ea38513b90e5ad241ce6127f", "score": "0.52871203", "text": "def ensure_ssl_available\n unless ssl_available?\n\tfail Gem::Exception, \"SSL is not installed on this system\"\n end\n end", "title": "" }, { "docid": "5064c9dcd7c266935eb571b4c5cb0efc", "score": "0.5286256", "text": "def verify_with(code)\n return (code == self.verification_code) ? self.verify! : false\n end", "title": "" }, { "docid": "d80c8276a4d2e59cd4b8c4aab85fc00d", "score": "0.52828205", "text": "def verify(context)\n context.debug(\"Checking connection to #{@connection_info[:address]}:#{@connection_info[:port]}\")\n\n raise 'authentication error' unless get_request(context, 'status').success?\n end", "title": "" }, { "docid": "c0d9311cee2993b27ac0371e76c90b18", "score": "0.5268835", "text": "def verify\n head :ok\n end", "title": "" } ]
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "c9a3560ecae5a846aac6367e408cf361", "score": "0.0", "text": "def set_presence\n @presence = Presence.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60339177", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.60135007", "text": "def on_setup_callbacks; end", "title": "" }, { "docid": "311e95e92009c313c8afd74317018994", "score": "0.59219855", "text": "def setup_actions\n domain = @apps.domain\n path_user = '/a/feeds/'+domain+'/user/2.0'\n path_nickname = '/a/feeds/'+domain+'/nickname/2.0'\n path_email_list = '/a/feeds/'+domain+'/emailList/2.0'\n path_group = '/a/feeds/group/2.0/'+domain\n\n @apps.register_action(:domain_login, {:method => 'POST', :path => '/accounts/ClientLogin' })\n @apps.register_action(:user_create, { :method => 'POST', :path => path_user })\n @apps.register_action(:user_retrieve, { :method => 'GET', :path => path_user+'/' })\n @apps.register_action(:user_retrieve_all, { :method => 'GET', :path => path_user })\n @apps.register_action(:user_update, { :method => 'PUT', :path => path_user +'/' })\n @apps.register_action(:user_delete, { :method => 'DELETE', :path => path_user +'/' })\n @apps.register_action(:nickname_create, { :method => 'POST', :path =>path_nickname })\n @apps.register_action(:nickname_retrieve, { :method => 'GET', :path =>path_nickname+'/' })\n @apps.register_action(:nickname_retrieve_all_for_user, { :method => 'GET', :path =>path_nickname+'?username=' })\n @apps.register_action(:nickname_retrieve_all_in_domain, { :method => 'GET', :path =>path_nickname })\n @apps.register_action(:nickname_delete, { :method => 'DELETE', :path =>path_nickname+'/' })\n @apps.register_action(:group_create, { :method => 'POST', :path => path_group })\n @apps.register_action(:group_update, { :method => 'PUT', :path => path_group })\n @apps.register_action(:group_retrieve, { :method => 'GET', :path => path_group })\n @apps.register_action(:group_delete, { :method => 'DELETE', :path => path_group })\n\n # special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n @apps.register_action(:next, {:method => 'GET', :path =>'' })\n end", "title": "" }, { "docid": "8315debee821f8bfc9718d31b654d2de", "score": "0.5913137", "text": "def initialize(*args)\n super\n @action = :setup\nend", "title": "" }, { "docid": "8315debee821f8bfc9718d31b654d2de", "score": "0.5913137", "text": "def initialize(*args)\n super\n @action = :setup\nend", "title": "" }, { "docid": "bfea4d21895187a799525503ef403d16", "score": "0.589884", "text": "def define_action_helpers\n super\n define_validation_hook if runs_validations_on_action?\n end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.5890051", "text": "def actions; end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.5890051", "text": "def actions; end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.5890051", "text": "def actions; end", "title": "" }, { "docid": "352de4abc4d2d9a1df203735ef5f0b86", "score": "0.5889191", "text": "def required_action\n # TODO: implement\n end", "title": "" }, { "docid": "8713cb2364ff3f2018b0d52ab32dbf37", "score": "0.58780754", "text": "def define_action_helpers\n if action == :save\n if super(:create_or_update)\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n else\n super\n end\n end", "title": "" }, { "docid": "a80b33627067efa06c6204bee0f5890e", "score": "0.5863248", "text": "def actions\n\n end", "title": "" }, { "docid": "930a930e57ae15f432a627a277647f2e", "score": "0.58094144", "text": "def setup_actions\n domain = @apps.domain\n path_base = '/a/feeds/emailsettings/2.0/'+domain+'/'\n\n @apps.register_action(:create_label, {:method => 'POST', :path => path_base })\n @apps.register_action(:create_filter, { :method => 'POST', :path => path_base })\n @apps.register_action(:create_send_as, { :method => 'POST', :path => path_base })\n @apps.register_action(:update_webclip, { :method => 'PUT', :path => path_base })\n @apps.register_action(:update_forward, { :method => 'PUT', :path => path_base })\n @apps.register_action(:set_pop, { :method => 'PUT', :path => path_base })\n @apps.register_action(:set_imap, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_vacation, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_signature, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_language, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_general, { :method => 'PUT', :path =>path_base })\n\n # special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n @apps.register_action(:next, {:method => 'GET', :path =>nil })\n end", "title": "" }, { "docid": "33ff963edc7c4c98d1b90e341e7c5d61", "score": "0.57375425", "text": "def setup\n common_setup\n end", "title": "" }, { "docid": "a5ca4679d7b3eab70d3386a5dbaf27e1", "score": "0.57285565", "text": "def perform_setup\n end", "title": "" }, { "docid": "ec7554018a9b404d942fc0a910ed95d9", "score": "0.57149214", "text": "def before_setup(&block)\n pre_setup_actions.unshift block\n end", "title": "" }, { "docid": "9c186951c13b270d232086de9c19c45b", "score": "0.5703237", "text": "def callbacks; end", "title": "" }, { "docid": "c85b0efcd2c46a181a229078d8efb4de", "score": "0.56900954", "text": "def custom_setup\n\n end", "title": "" }, { "docid": "100180fa74cf156333d506496717f587", "score": "0.56665677", "text": "def do_setup\n\t\tget_validation\n\t\tprocess_options\n\tend", "title": "" }, { "docid": "2198a9876a6ec535e7dcf0fd476b092f", "score": "0.5651118", "text": "def initial_action; end", "title": "" }, { "docid": "b9b75a9e2eab9d7629c38782c0f3b40b", "score": "0.5648135", "text": "def setup_intent; end", "title": "" }, { "docid": "471d64903a08e207b57689c9fbae0cf9", "score": "0.56357735", "text": "def setup_controllers &proc\n @global_setup = proc\n self\n end", "title": "" }, { "docid": "468d85305e6de5748477545f889925a7", "score": "0.5627078", "text": "def inner_action; end", "title": "" }, { "docid": "bb445e7cc46faa4197184b08218d1c6d", "score": "0.5608873", "text": "def pre_action\n # Override this if necessary.\n end", "title": "" }, { "docid": "432f1678bb85edabcf1f6d7150009703", "score": "0.5598699", "text": "def target_callbacks() = commands", "title": "" }, { "docid": "48804b0fa534b64e7885b90cf11bff31", "score": "0.5598419", "text": "def execute_callbacks; end", "title": "" }, { "docid": "5aab98e3f069a87e5ebe77b170eab5b9", "score": "0.5589822", "text": "def api_action!(*args)\n type = self.class.name.split(\"::\").last.downcase\n run_callbacks_for([\"before_#{type}\", :before], *args)\n result = nil\n begin\n result = yield if block_given?\n run_callbacks_for([\"after_#{type}\", :after], *args)\n result\n rescue => err\n run_callbacks_for([\"failed_#{type}\", :failed], *(args + [err]))\n raise\n end\n end", "title": "" }, { "docid": "9efbca664902d80a451ef6cff0334fe2", "score": "0.5558845", "text": "def global_callbacks; end", "title": "" }, { "docid": "9efbca664902d80a451ef6cff0334fe2", "score": "0.5558845", "text": "def global_callbacks; end", "title": "" }, { "docid": "482481e8cf2720193f1cdcf32ad1c31c", "score": "0.55084664", "text": "def required_keys(action)\n\n end", "title": "" }, { "docid": "353fd7d7cf28caafe16d2234bfbd3d16", "score": "0.5504379", "text": "def assign_default_callbacks(action_name, is_member=false)\n if ResourceController::DEFAULT_ACTIONS.include?(action_name)\n DefaultActions.send(action_name, self)\n elsif is_member\n send(action_name).build { load_object }\n send(action_name).wants.html\n send(action_name).wants.xml { render :xml => object }\n send(action_name).failure.flash \"Request failed\"\n send(action_name).failure.wants.html\n send(action_name).failure.wants.xml { render :xml => object.errors }\n else\n send(action_name).build { load_collection }\n send(action_name).wants.html\n send(action_name).wants.xml { render :xml => collection }\n send(action_name).failure.flash \"Request failed\"\n send(action_name).failure.wants.html\n send(action_name).failure.wants.xml { head 500 }\n end\n end", "title": "" }, { "docid": "dcf95c552669536111d95309d8f4aafd", "score": "0.5465574", "text": "def layout_actions\n \n end", "title": "" }, { "docid": "2f6ef0a1ebe74f4d79ef0fb81af59d40", "score": "0.5464707", "text": "def on_setup(&block); end", "title": "" }, { "docid": "8ab2a5ea108f779c746016b6f4a7c4a8", "score": "0.54471064", "text": "def testCase_001\n test_case_title # fw3_actions.rb\n setup # fw3_global_methods.rb\n \n get_page_url # fw3_actions.rb\n validate_page_title # fw3_actions.rb\n validate_page_link_set # fw3_actions.rb\n \n teardown # fw3_global_methods.rb\nend", "title": "" }, { "docid": "e3aadf41537d03bd18cf63a3653e05aa", "score": "0.54455084", "text": "def before(action)\n invoke_callbacks *options_for(action).before\n end", "title": "" }, { "docid": "6bd37bc223849096c6ea81aeb34c207e", "score": "0.5437386", "text": "def post_setup\n end", "title": "" }, { "docid": "07fd9aded4aa07cbbba2a60fda726efe", "score": "0.54160327", "text": "def testCase_001\n testTitle # fw2_actions.rb\n setup # fw2_global_methods.rb\n get_page_url # fw2_actions.rb\n validate_title # fw2_actions.rb\n teardown # fw2_global_methods.rb\nend", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.5411113", "text": "def action_methods; end", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.5411113", "text": "def action_methods; end", "title": "" }, { "docid": "9358208395c0869021020ae39071eccd", "score": "0.5397424", "text": "def post_setup; end", "title": "" }, { "docid": "cb5bad618fb39e01c8ba64257531d610", "score": "0.5392518", "text": "def define_model_action(methods,action,default_options={:validate => true})\n default_options.merge!(methods.extract_options!)\n actions = [action,\"#{action}!\".to_sym]\n actions.each do |a|\n define_method(a) do |opts = {}|\n rslt = nil\n options = default_options.merge(opts)\n options[:raise_exception] = a.to_s.match(/\\!$/)\n run_callbacks(action) do\n rslt = run_model_action(methods,options)\n end\n run_after_any\n rslt\n end\n end\n end", "title": "" }, { "docid": "c5904f93614d08afa38cc3f05f0d2365", "score": "0.5391541", "text": "def before_setup; end", "title": "" }, { "docid": "c5904f93614d08afa38cc3f05f0d2365", "score": "0.5391541", "text": "def before_setup; end", "title": "" }, { "docid": "a468b256a999961df3957e843fd9bdf4", "score": "0.5385411", "text": "def _setup\n setup_notification_categories\n setup_intelligent_segments\n end", "title": "" }, { "docid": "f099a8475f369ce73a38d665b6ee6877", "score": "0.53794575", "text": "def action_run\n end", "title": "" }, { "docid": "2c4e5a90aa8efaaa3ed953818a9b30d2", "score": "0.5357573", "text": "def execute(setup)\n @action.call(setup)\n end", "title": "" }, { "docid": "118932433a8cfef23bb8a921745d6d37", "score": "0.53487605", "text": "def register_action(action); end", "title": "" }, { "docid": "725216eb875e8fa116cd55eac7917421", "score": "0.5346655", "text": "def setup\n @controller.setup\n end", "title": "" }, { "docid": "39c39d6fe940796aadbeaef0ce1c360b", "score": "0.53448105", "text": "def setup_phase; end", "title": "" }, { "docid": "bd03e961c8be41f20d057972c496018c", "score": "0.5342072", "text": "def post_setup\n controller.each do |name,ctrl|\n ctrl.post_setup\n end\n end", "title": "" }, { "docid": "c6352e6eaf17cda8c9d2763f0fbfd99d", "score": "0.5341318", "text": "def initial_action=(_arg0); end", "title": "" }, { "docid": "207a668c9bce9906f5ec79b75b4d8ad7", "score": "0.53243506", "text": "def before_setup\n\n end", "title": "" }, { "docid": "669ee5153c4dc8ee81ff32c4cefdd088", "score": "0.53025913", "text": "def ensure_before_and_after; end", "title": "" }, { "docid": "c77ece7b01773fb7f9f9c0f1e8c70332", "score": "0.5283114", "text": "def setup!\n adding_handlers do\n check_arity\n apply_casting\n check_validation\n end\n end", "title": "" }, { "docid": "1e1e48767a7ac23eb33df770784fec61", "score": "0.5282289", "text": "def set_minimum_up_member_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end", "title": "" }, { "docid": "4ad1208a9b6d80ab0dd5dccf8157af63", "score": "0.52585614", "text": "def rails_controller_callbacks(&block)\n rails_controller_instance.run_callbacks(:process_action, &block)\n end", "title": "" }, { "docid": "63a9fc1fb0dc1a7d76ebb63a61ed24d7", "score": "0.52571374", "text": "def define_callbacks(*args)\n if abstract_class\n all_shards.each do |model|\n model.define_callbacks(*args)\n end\n end\n\n super\n end", "title": "" }, { "docid": "fc88422a7a885bac1df28883547362a7", "score": "0.52483684", "text": "def pre_setup_actions\n @@pre_setup_actions ||= []\n end", "title": "" }, { "docid": "8945e9135e140a6ae6db8d7c3490a645", "score": "0.5244467", "text": "def action_awareness\n if action_aware?\n if !@options.key?(:allow_nil)\n if @required\n @allow_nil = false\n else\n @allow_nil = true\n end\n end\n if as_action != \"create\"\n @required = false\n end\n end\n end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.52385926", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.52385926", "text": "def action; end", "title": "" }, { "docid": "7b3954deb2995cf68646c7333c15087b", "score": "0.5236853", "text": "def after_setup\n end", "title": "" }, { "docid": "1dddf3ac307b09142d0ad9ebc9c4dba9", "score": "0.52330637", "text": "def external_action\n raise NotImplementedError\n end", "title": "" }, { "docid": "5772d1543808c2752c186db7ce2c2ad5", "score": "0.52300817", "text": "def actions(state:)\n raise NotImplementedError\n end", "title": "" }, { "docid": "64a6d16e05dd7087024d5170f58dfeae", "score": "0.522413", "text": "def setup_actions(domain)\n\t\t\tpath_user = '/a/feeds/'+domain+'/user/2.0'\n\t\t\tpath_nickname = '/a/feeds/'+domain+'/nickname/2.0'\n\t\t\tpath_group = '/a/feeds/group/2.0/'+domain # path for Google groups\n\n\t\t\taction = Hash.new\n\t\t\taction[:domain_login] = {:method => 'POST', :path => '/accounts/ClientLogin' }\n\t\t\taction[:user_create] = { :method => 'POST', :path => path_user }\n\t\t\taction[:user_retrieve] = { :method => 'GET', :path => path_user+'/' }\n\t\t\taction[:user_retrieve_all] = { :method => 'GET', :path => path_user } \n\t\t\taction[:user_update] = { :method => 'PUT', :path => path_user +'/' }\n\t\t\taction[:user_rename] = { :method => 'PUT', :path => path_user +'/' }\n\t\t\taction[:user_delete] = { :method => 'DELETE', :path => path_user +'/' }\n\t\t\taction[:nickname_create] = { :method => 'POST', :path =>path_nickname }\n\t\t\taction[:nickname_retrieve] = { :method => 'GET', :path =>path_nickname+'/' }\n\t\t\taction[:nickname_retrieve_all_for_user] = { :method => 'GET', :path =>path_nickname+'?username=' }\n\t\t\taction[:nickname_retrieve_all_in_domain] = { :method => 'GET', :path =>path_nickname }\n\t\t\taction[:nickname_delete] = { :method => 'DELETE', :path =>path_nickname+'/' }\n\t\t\taction[:group_create] = { :method => 'POST', :path =>path_group }\n\t\t\taction[:group_update] = { :method => 'PUT', :path =>path_group+'/' }\n\t\t\taction[:group_delete] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:groups_retrieve] = { :method => 'GET', :path =>path_group+'?member=' }\n\t\t\taction[:all_groups_retrieve] = { :method => 'GET', :path =>path_group }\n\t\t\taction[:membership_add] = { :method => 'POST', :path =>path_group+'/' }\n\t\t\taction[:membership_remove] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:membership_confirm] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:all_members_retrieve] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:ownership_add] = { :method => 'POST', :path =>path_group+'/' }\n\t\t\taction[:ownership_remove] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:ownership_confirm] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:all_owners_retrieve] = { :method => 'GET', :path =>path_group+'/' }\n\t\n\t\t\t# special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n\t\t\taction[:next] = {:method => 'GET', :path =>nil }\n\t\t\treturn action \t\n\t\tend", "title": "" }, { "docid": "6350959a62aa797b89a21eacb3200e75", "score": "0.52226824", "text": "def before(action)\n invoke_callbacks *self.class.send(action).before\n end", "title": "" }, { "docid": "db0cb7d7727f626ba2dca5bc72cea5a6", "score": "0.521999", "text": "def process_params\n set_params_authable if process_params_authable?\n set_params_ownerable if process_params_ownerable?\n set_params_sub_action\n end", "title": "" }, { "docid": "8d7ed2ff3920c2016c75f4f9d8b5a870", "score": "0.5215832", "text": "def pick_action; end", "title": "" }, { "docid": "7bbfb366d2ee170c855b1d0141bfc2a3", "score": "0.5213786", "text": "def proceed_with(action, *arguments)\n self.class.decouplings.each do |decoupler|\n decoupler.run_on(self, action, *arguments)\n end\n end", "title": "" }, { "docid": "78ecc6a2dfbf08166a7a1360bc9c35ef", "score": "0.52100146", "text": "def define_action_helpers\n if action_hook\n @action_hook_defined = true\n define_action_hook\n end\n end", "title": "" }, { "docid": "2aba2d3187e01346918a6557230603c7", "score": "0.52085197", "text": "def ac_action(&blk)\n @action = blk\n end", "title": "" }, { "docid": "4c23552739b40c7886414af61210d31c", "score": "0.5203262", "text": "def execute_pre_setup_actions(test_instance,runner=nil)\n self.class.pre_setup_actions.each do |action|\n action.call test_instance\n end\n end", "title": "" }, { "docid": "691d5a5bcefbef8c08db61094691627c", "score": "0.5202406", "text": "def performed(action)\n end", "title": "" }, { "docid": "6a98e12d6f15af80f63556fcdd01e472", "score": "0.520174", "text": "def perform_setup\n ## Run global setup before example\n Alfred.configuration.setup.each do |setup|\n @request.perform_setup(&setup)\n end\n\n ## Run setup blocks for scenario\n setups.each { |setup| @request.perform_setup(&setup) }\n end", "title": "" }, { "docid": "d56f4ec734e3f3bc1ad913b36ff86130", "score": "0.5201504", "text": "def create_setup\n \n end", "title": "" }, { "docid": "ad33138fb4bd42d9785a8f84821bfd88", "score": "0.51963276", "text": "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "title": "" }, { "docid": "ad33138fb4bd42d9785a8f84821bfd88", "score": "0.51963276", "text": "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "title": "" }, { "docid": "7fca702f2da4dbdc9b39e5107a2ab87d", "score": "0.5191404", "text": "def add_transition_callbacks\n %w(before after).each {|type| owner_class.define_callbacks(\"#{type}_transition_#{attribute}\") }\n end", "title": "" }, { "docid": "063b82c93b47d702ef6bddadb6f0c76e", "score": "0.5178325", "text": "def setup(instance)\n action(:setup, instance)\n end", "title": "" }, { "docid": "9f1f73ee40d23f6b808bb3fbbf6af931", "score": "0.51765746", "text": "def setup( *args )\n\t\t\tself.class.setupMethods.each {|sblock|\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\tend", "title": "" }, { "docid": "b4f4e1d4dfd31919ab39aecccb9db1d0", "score": "0.51710224", "text": "def setup(resources) ; end", "title": "" }, { "docid": "b4f4e1d4dfd31919ab39aecccb9db1d0", "score": "0.51710224", "text": "def setup(resources) ; end", "title": "" }, { "docid": "b4f4e1d4dfd31919ab39aecccb9db1d0", "score": "0.51710224", "text": "def setup(resources) ; end", "title": "" }, { "docid": "7a0c9d839516dc9d0014e160b6e625a8", "score": "0.5162045", "text": "def setup(request)\n end", "title": "" }, { "docid": "e441ee807f2820bf3655ff2b7cf397fc", "score": "0.5150735", "text": "def after_setup; end", "title": "" }, { "docid": "1d375c9be726f822b2eb9e2a652f91f6", "score": "0.5143402", "text": "def before *actions, &proc\n actions = ['*'] if actions.size == 0\n actions.each { |a| @callbacks[:a][a] = proc }\n end", "title": "" }, { "docid": "c594a0d7b6ae00511d223b0533636c9c", "score": "0.51415485", "text": "def code_action_provider; end", "title": "" }, { "docid": "faddd70d9fef5c9cd1f0d4e673e408b9", "score": "0.51398855", "text": "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end", "title": "" }, { "docid": "2fcff037e3c18a5eb8d964f8f0a62ebe", "score": "0.51376045", "text": "def setup(params)\n end", "title": "" }, { "docid": "111fd47abd953b35a427ff0b098a800a", "score": "0.51318985", "text": "def setup\n make_notification_owner\n load_superusers\n admin_sets.each do |as|\n @logger.debug \"Attempting to make admin set for #{as}\"\n make_admin_set_from_config(as)\n end\n load_workflows\n everyone_can_deposit_everywhere\n give_superusers_superpowers\n end", "title": "" }, { "docid": "f2ac709e70364fce188bb24e414340ea", "score": "0.5115387", "text": "def setup_defaults\n add_help\n @handler = Cliqr::Util.forward_to_help_handler if @handler.nil? && help? && actions?\n @actions.each(&:setup_defaults)\n end", "title": "" }, { "docid": "3b4fb29fa45f95d436fd3a8987f12de7", "score": "0.5111866", "text": "def setup\n transition_to(:setup)\n end", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.5110294", "text": "def action\n end", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.5110294", "text": "def action\n end", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.5110294", "text": "def action\n end", "title": "" }, { "docid": "4c7a1503a86fb26f1e4b4111925949a2", "score": "0.5109771", "text": "def scaffold_setup_helper\n include ScaffoldingExtensions::Helper\n include ScaffoldingExtensions::MerbControllerHelper\n include ScaffoldingExtensions::PrototypeHelper\n include ScaffoldingExtensions::Controller\n include ScaffoldingExtensions::MerbController\n before :scaffold_check_nonidempotent_requests\n end", "title": "" }, { "docid": "63849e121dcfb8a1b963f040d0fe3c28", "score": "0.5107364", "text": "def perform_action(action, item)\n if action == :approve\n approve(item.fullid)\n elsif action == :remove\n remove(item.fullid)\n elsif action == :alert\n #perform_alert() check condition alert params and proceed\n else\n #something isn't cool, pass or error \n end\nend", "title": "" }, { "docid": "f04fd745d027fc758dac7a4ca6440871", "score": "0.5106081", "text": "def block_actions options ; end", "title": "" }, { "docid": "0d1c87e5cf08313c959963934383f5ae", "score": "0.51001656", "text": "def on_action(action)\n @action = action\n self\n end", "title": "" }, { "docid": "916d3c71d3a5db831a5910448835ad82", "score": "0.50964546", "text": "def do_action(action)\n case action\n when \"a\"\n @user_manager.create_user\n when \"b\"\n @user_manager.delete_user\n when \"c\"\n @user_manager.get_info\n when \"d\"\n @user_manager.list_all_users\n when \"quit\", \"exit\"\n bail\n end\n end", "title": "" }, { "docid": "076c761e1e84b581a65903c7c253aa62", "score": "0.5093199", "text": "def add_callbacks(base); end", "title": "" } ]
3496f50433103c4ef47d18b1808c6f75
DELETE /competencia/1 DELETE /competencia/1.json
[ { "docid": "8700348b2c8e81717d61bf6c7fbcd43d", "score": "0.7269687", "text": "def destroy\n @competencium.destroy\n respond_to do |format|\n format.html { redirect_to competencia_url, notice: 'Competencium was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "36641f85900fdeacd592614a2b5a426d", "score": "0.730827", "text": "def destroy\n @composante = Composante.find(params[:id])\n @composante.destroy\n\n respond_to do |format|\n format.html { redirect_to composantes_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b881cec7b6ea0c6c2755cebc23900fe8", "score": "0.72849745", "text": "def destroy\n @competence.destroy!\n render json: {status: :ok}\n end", "title": "" }, { "docid": "4778365af939a5c0cebe458bf3eaacc5", "score": "0.72794324", "text": "def destroy\n\n @compet.destroy\n respond_to do |format|\n format.html { redirect_to compets_path(@compet, egresso_id: @compet.egresso_id), notice: 'Competência adicional excluída com sucesso.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b1a17c1ee1af05c79fe156622df44818", "score": "0.71932817", "text": "def delete(path)\n begin\n response = client[path].delete :accept => 'application/json'\n rescue Exception => e\n puts e.inspect\n end\n end", "title": "" }, { "docid": "401906ed139d0fe0db1049449623a40b", "score": "0.71929616", "text": "def destroy\n @gerente_comercial = GerenteComercial.find(params[:id])\n @gerente_comercial.destroy\n\n respond_to do |format|\n format.html { redirect_to gerente_comercials_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "451ac9dc381c2ece50be79915602ed7a", "score": "0.7184131", "text": "def destroy\n @comida = Comida.find(params[:id])\n @comida.destroy\n\n respond_to do |format|\n format.html { redirect_to comidas_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "e1bd3d3988e87df90a96280648707156", "score": "0.71829814", "text": "def destroy\n @folha_competencia = Folha::Competencia.find(params[:id])\n @folha_competencia.destroy\n\n respond_to do |format|\n format.html { redirect_to(folha_competencias_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "0063393becfeea5760b7e0e3a0f34cc8", "score": "0.71824497", "text": "def destroy\n @comunidad.destroy\n respond_to do |format|\n format.html { redirect_to comunidades_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "40ffdf38b7dce490605d51b474733714", "score": "0.7163697", "text": "def destroy\n @consultorio = Consultorio.find(params[:id])\n @consultorio.destroy\n\n respond_to do |format|\n format.html { redirect_to consultorios_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "bd01164c6edd3314ec13ec01f586fae8", "score": "0.71524125", "text": "def destroy\n @pelicula = Pelicula.find(params[:id])\n @pelicula.destroy\n render json: {message: 'Eliminated'}, status: :ok\n\n end", "title": "" }, { "docid": "da55b963be04ca776f7ec62b5011dfbd", "score": "0.7150037", "text": "def destroy\n @detallecompetencia = Detallecompetencia.find(params[:id])\n @detallecompetencia.destroy\n\n respond_to do |format|\n format.html { redirect_to(detallecompetencias_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "ce9a791d7178aaa7c35a8b2801283cf7", "score": "0.7135845", "text": "def destroy\n @competency.destroy\n respond_to do |format|\n format.html { redirect_to competencies_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9716e5e96fff0d2143b16489df033009", "score": "0.7134923", "text": "def destroy\n @competence = Competence.find(params[:id])\n @competence.destroy\n\n respond_to do |format|\n format.html { redirect_to competences_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0879ade66bdab83e51e8da609fb6b45b", "score": "0.7133381", "text": "def destroy\n @resposta = Resposta.find(params[:id])\n @resposta.destroy\n\n respond_to do |format|\n format.html { redirect_to respostas_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b445c184893647d3482f8fbc6a507a52", "score": "0.71229887", "text": "def delete(path, params = {})\n path += '.json'\n res = @connection.delete(path, @header)\n parse_response(res)\n end", "title": "" }, { "docid": "d8c484ef247ad1a8ebfca1f29a66d22d", "score": "0.71211547", "text": "def destroy\n @ejercicio1 = Ejercicio1.find(params[:id])\n @ejercicio1.destroy\n\n respond_to do |format|\n format.html { redirect_to ejercicio1s_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "577dbd3f11ab803206ae9c1c32a766d2", "score": "0.71164274", "text": "def destroy\n @exercice_statique = ExerciceStatique.find(params[:id])\n @exercice_statique.destroy\n\n respond_to do |format|\n format.html { redirect_to exercice_statiques_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7452c4d15daf08108aaa5a1b728adb31", "score": "0.7115273", "text": "def destroy\n @json.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "2f34ec3e4ad665020b06b00de2d3e5fe", "score": "0.7112529", "text": "def destroy\n @est_comentario.destroy\n respond_to do |format|\n format.html { redirect_to est_comentarios_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "ca172f3ea33cd01638d72fa1612f2a17", "score": "0.7111609", "text": "def destroy\n @consultado = Consultado.find(params[:id])\n @consultado.destroy\n\n respond_to do |format|\n format.html { redirect_to consultados_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "ca5d9fc72823294dbfbdccac5066a54b", "score": "0.7101821", "text": "def destroy\n @motivo_consulta = MotivoConsulta.find(params[:id])\n @motivo_consulta.destroy\n\n respond_to do |format|\n format.html { redirect_to motivos_consulta_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "887432e4b57a71666f432ad34958877c", "score": "0.71014684", "text": "def destroy\n @solicitud = Solicitud.find(params[:id])\n @solicitud.destroy\n\n respond_to do |format|\n format.html { redirect_to root_path }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "586b2ec4bc191be6d3e9a0fcef469bd0", "score": "0.7100226", "text": "def destroy\n @proyecto.destroy\n respond_to do |format|\n format.html { redirect_to proyectos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4c27fad6c08f1095b62c9407790032d5", "score": "0.70969886", "text": "def destroy\n @competencias_empresa.destroy\n respond_to do |format|\n format.html { redirect_to competencias_empresas_url, notice: 'Competencias empresa was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "ed3f7fbc8ae5d78c9a8a87b4ae315fb7", "score": "0.709106", "text": "def destroy\n @exercice_dynamique = ExerciceDynamique.find(params[:id])\n @exercice_dynamique.destroy\n\n respond_to do |format|\n format.html { redirect_to exercice_dynamiques_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "904aa296352b2c896fee466cd2494ede", "score": "0.70794654", "text": "def destroy\n @detalleapuestum = Detalleapuestum.find(params[:id])\n @detalleapuestum.destroy\n\n respond_to do |format|\n format.html { redirect_to detalleapuesta_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "62bd83caf7ad939b7afc6e1746f25b7b", "score": "0.70792663", "text": "def delete\n @layout = \"back\"\n puts \"Destruction en attente\"\n\n @produit.delete!\n respond_to do |format|\n format.html { redirect_to produits_url, notice: 'Produit was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "01a963b6dea8c3a309e596f9b9081118", "score": "0.707896", "text": "def destroy\n @comuna = Comuna.find(params[:id])\n @comuna.destroy\n\n respond_to do |format|\n format.html { redirect_to comunas_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "1f1760d18aecf611bc39b5284acc3bab", "score": "0.70736074", "text": "def destroy\n @consulta.destroy\n respond_to do |format|\n format.html { redirect_to consultas_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2f51201a2f434321270003d593d92362", "score": "0.7071024", "text": "def destroy\n @veiculo.destroy\n respond_to do |format|\n format.html { redirect_to veiculos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c1cde2518cb592b6add14fe05ae1b37d", "score": "0.70688", "text": "def delete\n options = self.to_h \n uri = self.class.path_builder(:delete, self.id)\n data = {}\n data['id'] = self.id \n data = data.to_json\n VivialConnect::Client.instance.make_request('DELETE', uri, data)\n end", "title": "" }, { "docid": "5591c7c13a803db49946b503cab7e2cc", "score": "0.70649445", "text": "def destroy\n @consulta = Consulta.find(params[:id])\n @consulta.destroy\n\n respond_to do |format|\n format.html { redirect_to consulta_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d4f40041b3ac1555fd9c6d95c1260292", "score": "0.7064487", "text": "def destroy\n @comuna.destroy\n respond_to do |format|\n format.html { redirect_to comunas_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b2bbd6e3e2e196ddde35a3fc437fb3a2", "score": "0.70620114", "text": "def destroy\n @entrada.destroy\n respond_to do |format|\n format.html { redirect_to entradas_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "23af5f7a75275b63501651ea903adaa9", "score": "0.7061277", "text": "def destroy\n @ev_comentario.destroy\n respond_to do |format|\n format.html { redirect_to ev_comentarios_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8d67c3987ecf8860024cd87197efeb4c", "score": "0.70602345", "text": "def destroy\n @convenente.destroy\n respond_to do |format|\n format.html { redirect_to convenentes_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c2c6b37ed91e4c5f07f4bec2198d98a4", "score": "0.70542645", "text": "def destroy\n @entrega = Entrega.find(params[:id])\n @entrega.destroy\n\n respond_to do |format|\n format.html { redirect_to entregas_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c2c6b37ed91e4c5f07f4bec2198d98a4", "score": "0.70542645", "text": "def destroy\n @entrega = Entrega.find(params[:id])\n @entrega.destroy\n\n respond_to do |format|\n format.html { redirect_to entregas_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7c69461d7e64f143bf79a6b4362e580b", "score": "0.7053408", "text": "def destroy\n @estudiante = Estudiante.find(params[:id])\n @estudiante.destroy\n\n respond_to do |format|\n format.html { redirect_to estudiantes_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "467f29378d8e550820dc902d3e94fa87", "score": "0.7050654", "text": "def destroy\n @docente = Docente.find(params[:id])\n @docente.destroy\n\n respond_to do |format|\n format.html { redirect_to docentes_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6b8e72f3d76b68341ce3c28b9fdd11cb", "score": "0.704361", "text": "def destroy\n @negocio = Negocio.find(params[:id])\n @negocio.destroy\n\n respond_to do |format|\n format.html { redirect_to negocios_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "fe4896a3ffe7c5664c241e6cb08830ee", "score": "0.7039236", "text": "def destroy\n @cliente_juridico.destroy\n respond_to do |format|\n format.html { redirect_to cliente_juridicos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "dcb604c6b8ffe73ff932b6b6f3f8066f", "score": "0.70356774", "text": "def destroy\r\n @sivic_moduloescola.destroy\r\n respond_to do |format|\r\n format.html { redirect_to sivic_moduloescolas_url }\r\n format.json { head :no_content }\r\n end\r\n end", "title": "" }, { "docid": "f208b6c36426d80d818189c014d41af7", "score": "0.70273244", "text": "def destroy\n @ocorrenciaveiculo.destroy\n respond_to do |format|\n format.html { redirect_to ocorrenciaveiculos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "bbb185c2a5889733cea749b521a31f63", "score": "0.70253396", "text": "def destroy\n @douro = Douro.find(params[:id])\n @douro.destroy\n\n respond_to do |format|\n format.html { redirect_to douros_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6aacef0a41b0cab169d450bf06d67c78", "score": "0.7017061", "text": "def destroy\n @apuestum = Apuestum.find(params[:id])\n @apuestum.destroy\n\n respond_to do |format|\n format.html { redirect_to apuesta_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "775a2d1d2217cc2c33d4619067608ae2", "score": "0.70135236", "text": "def destroy\n @venta_detalle = VentaDetalle.find(params[:id])\n @venta_detalle.destroy\n\n respond_to do |format|\n format.html { redirect_to venta_detalles_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a919a26087e80e5b68cbb5f1f9cd0ed9", "score": "0.7012973", "text": "def destroy\n @questao = Questao.find(params[:id])\n @questao.destroy\n\n respond_to do |format|\n format.html { redirect_to questaos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e8854d3cc24ef61f3df4d34bce8c093b", "score": "0.70120746", "text": "def destroy\n @cliente = Cliente.find(params[:id])\n @cliente.destroy\n\n respond_to do |format|\n format.html { redirect_to clientes_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e8854d3cc24ef61f3df4d34bce8c093b", "score": "0.70120746", "text": "def destroy\n @cliente = Cliente.find(params[:id])\n @cliente.destroy\n\n respond_to do |format|\n format.html { redirect_to clientes_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e8854d3cc24ef61f3df4d34bce8c093b", "score": "0.70120746", "text": "def destroy\n @cliente = Cliente.find(params[:id])\n @cliente.destroy\n\n respond_to do |format|\n format.html { redirect_to clientes_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "abd8db5e4917b736d1809def36ca3977", "score": "0.7007696", "text": "def destroy\n @cliente.destroy\n respond_to do |format|\n format.html { redirect_to clientes_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "abd8db5e4917b736d1809def36ca3977", "score": "0.7007696", "text": "def destroy\n @cliente.destroy\n respond_to do |format|\n format.html { redirect_to clientes_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "abd8db5e4917b736d1809def36ca3977", "score": "0.7007696", "text": "def destroy\n @cliente.destroy\n respond_to do |format|\n format.html { redirect_to clientes_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "21aac01c7d75820e4e9ec969813ecce1", "score": "0.70052296", "text": "def destroy\n @desocupamiento_recinto.destroy\n respond_to do |format|\n format.html { redirect_to desocupamiento_recintos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "575599d77e158793e65aeb5830f7b2ed", "score": "0.7002705", "text": "def destroy\n @liquidacion_comision = LiquidacionComision.find(params[:id])\n @liquidacion_comision.destroy\n\n respond_to do |format|\n format.html { redirect_to liquidacion_comisions_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f66b6447dc8c35ed0f9d522bd69f1547", "score": "0.7002441", "text": "def destroy\n @contenido.destroy\n respond_to do |format|\n format.html { redirect_to contenidos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b6fc1126b3fed6b4dd06e874d1a95c3a", "score": "0.7000868", "text": "def destroy\n @sujet = Sujet.find(params[:id])\n @sujet.destroy\n\n respond_to do |format|\n format.html { redirect_to sujets_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "27d96cb91ab396167cf3f3e42844ec3b", "score": "0.70008135", "text": "def destroy\n @vigencia_ofertum = VigenciaOferta.find(params[:id])\n @vigencia_ofertum.destroy\n\n respond_to do |format|\n format.html { redirect_to vigencia_oferta_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "cfabce378480b0e03e46df020c8c0134", "score": "0.7000534", "text": "def destroy\n @comision.destroy\n respond_to do |format|\n format.html { redirect_to comisiones_url, notice: 'Comisión eliminada correctamente.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "06a6673aa7567bdf2066989a97cd0f37", "score": "0.7000448", "text": "def destroy\n @compra_venta_especial.destroy\n respond_to do |format|\n format.html { redirect_to compra_venta_especials_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9cb4a779a35ebbe178709119f6c27812", "score": "0.70001256", "text": "def destroy\n @estacion = Estacion.find(params[:id])\n @estacion.destroy\n\n respond_to do |format|\n format.html { redirect_to estaciones_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f51649e2f09509e264882cde13984172", "score": "0.6999606", "text": "def destroy\n @tipo_seguro = TipoSeguro.find(params[:id])\n @tipo_seguro.destroy\n\n respond_to do |format|\n format.html { redirect_to tipo_seguros_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f245bcabc83c5d69181fc839e9c33b4f", "score": "0.69989383", "text": "def destroy\n @ocupacion = Ocupacion.find(params[:id])\n @ocupacion.destroy\n\n respond_to do |format|\n format.html { redirect_to ocupacions_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0674f1b6f8e6fd33271b36be2baf448b", "score": "0.69986004", "text": "def destroy\n @tipo_apuestum = TipoApuestum.find(params[:id])\n @tipo_apuestum.destroy\n\n respond_to do |format|\n format.html { redirect_to tipo_apuesta_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "bc69053f362cbff109dfd6cee208bffa", "score": "0.69974375", "text": "def destroy\n @lectivo = Lectivo.find(params[:id])\n @lectivo.destroy\n\n respond_to do |format|\n format.html { redirect_to lectivos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b9f768b3abe1fcbd97780b9cae2ebf89", "score": "0.6996163", "text": "def destroy\n @cliente = Cliente.find(params[:id])\n @cliente.destroy\n\n respond_to do |format|\n format.html { redirect_to clientes_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "b9f768b3abe1fcbd97780b9cae2ebf89", "score": "0.6996163", "text": "def destroy\n @cliente = Cliente.find(params[:id])\n @cliente.destroy\n\n respond_to do |format|\n format.html { redirect_to clientes_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "57739cecd22a0530001f9e065c4d628e", "score": "0.6995628", "text": "def destroy\n @negocio_o.destroy\n respond_to do |format|\n format.html { redirect_to negocios_url, notice: 'Negocio was successfully destroyed.' }\n format.json { head :no_content }\n end\nend", "title": "" }, { "docid": "f4c12907e5176c7a55c882a4b5567a28", "score": "0.69938403", "text": "def destroy\n @oficio = Oficio.find(params[:id])\n @oficio.destroy\n\n respond_to do |format|\n format.html { redirect_to oficios_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a2bf17d23a09395a210f5dcab527a05b", "score": "0.699369", "text": "def destroy\n @gerencia = Gerencia.find(params[:id])\n @gerencia.destroy\n\n respond_to do |format|\n format.html { redirect_to gerencias_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "bcbdbdd02e54abe1d00fca401e0f8c43", "score": "0.69931966", "text": "def destroy\n @servico_cruzeiro.destroy\n respond_to do |format|\n format.html { redirect_to servico_cruzeiros_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a8146e6f459d554584eeb9cde543b53d", "score": "0.6992541", "text": "def destroy\n @detalle_compra = DetalleCompra.find(params[:id])\n @detalle_compra.destroy\n\n respond_to do |format|\n format.html { redirect_to detalles_compras_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4630800dcc0578345e184e18b9adfb6b", "score": "0.69904476", "text": "def destroy\n @comite = Comite.find(params[:id])\n @comite.destroy\n\n respond_to do |format|\n format.html { redirect_to comites_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "861bd22812949b1f87673a4a1bc9397b", "score": "0.6989594", "text": "def destroy\n @colaborador = Colaborador.find(params[:id])\n @colaborador.destroy\n\n respond_to do |format|\n format.html { redirect_to colaboradores_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "3edfb95695e18001ac48bc0b15b4f79b", "score": "0.6989584", "text": "def destroy\n @detallefactura = Detallefactura.find(params[:id])\n @detallefactura.destroy\n\n respond_to do |format|\n format.html { redirect_to detallefacturas_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "ac051b7769e46d3cbab1d5fda84d7f00", "score": "0.6987995", "text": "def destroy\n @condominios = Condominio.find(params[:id])\n @condominios.destroy\n\n respond_to do |format|\n format.html { redirect_to condominia_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "10b6fcb0224d5023bd428a95612325c2", "score": "0.6987942", "text": "def destroy\n @ventas_cliente = Ventas::Cliente.find(params[:id])\n @ventas_cliente.destroy\n\n respond_to do |format|\n format.html { redirect_to ventas_clientes_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6df378403d8e27b91055e50742cc42e8", "score": "0.6987483", "text": "def destroy\n @core_fiel_depositario = Core::FielDepositario.find(params[:id])\n @core_fiel_depositario.destroy\n\n respond_to do |format|\n format.html { redirect_to core_fiel_depositarios_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "490732ed145d1b57ebca9c40d62974d8", "score": "0.6984077", "text": "def destroy\n @inventario = Inventario.find(params[:id])\n @inventario.destroy\n\n respond_to do |format|\n format.html { redirect_to inventarios_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b8d6652cf6cd32b6b29a8b213253271d", "score": "0.69840634", "text": "def destroy\n @eleicao_chapa = Eleicao::Chapa.find(params[:id])\n @eleicao_chapa.destroy\n\n respond_to do |format|\n format.html { redirect_to eleicao_chapas_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "14213db17fe01a62a74fef427a784182", "score": "0.69839966", "text": "def destroy\n @vacante = Vacante.find(params[:id])\n @vacante.destroy\n\n respond_to do |format|\n format.html { redirect_to vacantes_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "05a0a41650f76fb5dbd9041db3e05bc5", "score": "0.6982059", "text": "def destroy\n excursao = Excursao.find params[:id]\n\n if excursao.delete\n render status: :no_content, json: {}\n else\n render status: :bad_request, json: excursao.errors.messages\n end\n end", "title": "" }, { "docid": "f0b0d7b2ca3ada62583bc621c65d978c", "score": "0.6981718", "text": "def destroy\n @economia1 = Economia1.find(params[:id])\n @economia1.destroy\n\n respond_to do |format|\n format.html { redirect_to economia1s_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "47a3c9c28e1fcd0fcae5ea58416b42bd", "score": "0.69805044", "text": "def delete(path)\n api :delete, path\n end", "title": "" }, { "docid": "387800b54c297728ea1a84e16fce8936", "score": "0.6980164", "text": "def destroy\n @questao = Questao.find(params[:id])\n @questao.destroy\n\n respond_to do |format|\n format.html { redirect_to questoes_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7dcf2b66db6f87752bd1b6f60193588b", "score": "0.69800586", "text": "def destroy\n @unidad.destroy\n respond_to do |format|\n format.html { redirect_to unidad_index_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "fb85f5a45cbea5bcaa8e1c9408f8cf91", "score": "0.6978417", "text": "def destroy\n @estudiante.destroy\n respond_to do |format|\n format.html { redirect_to estudiantes_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "1a0740e3a364c62b9a9f8fc2bb6066af", "score": "0.69744974", "text": "def destroy\n @ocorrenciaacidente.destroy\n respond_to do |format|\n format.html { redirect_to ocorrenciaacidentes_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b1c35c2a47a8798aba333cc58f34f445", "score": "0.69735855", "text": "def destroy\n @entidad.destroy\n respond_to do |format|\n format.html { redirect_to entidades_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6598dcd947ef55b3f71ca95451ebde12", "score": "0.6972813", "text": "def destroy\n @establecimiento = Establecimiento.find(params[:id])\n @establecimiento.destroy\n\n respond_to do |format|\n format.html { redirect_to establecimientos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "1abb26bf31f5093c3848b2927ff648be", "score": "0.6967442", "text": "def destroy\n @aplicacion = Aplicacion.find(params[:id])\n @aplicacion.destroy\n\n respond_to do |format|\n format.html { redirect_to aplicaciones_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "62e14356f43eeb0912586085b3f8ee01", "score": "0.6967113", "text": "def destroy\n @comentario_evento = ComentarioEvento.find(params[:id])\n @comentario_evento.destroy\n\n respond_to do |format|\n format.html { redirect_to comentario_eventos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4db526d795d9ec9da2667c8a4f2d40fb", "score": "0.6965508", "text": "def destroy\n @respuesta.destroy\n respond_to do |format|\n format.html { redirect_to respuestas_url, notice: 'Respuesta was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "097bddb35534672c87c31111ea3f6da8", "score": "0.6964635", "text": "def destroy\n @parceiros = Parceiro.all \n @novidades = Novidade.order('created_at').last(6) \n \n @contato = Contato.find(params[:id])\n @contato.destroy\n\n respond_to do |format|\n format.html { redirect_to contatos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c12d4b3a3dca1faca099dae9c943ea40", "score": "0.69623345", "text": "def destroy\n @convenio.destroy\n respond_to do |format|\n format.html { redirect_to convenios_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "be2679b2c8b21d7be52587434276edad", "score": "0.6962187", "text": "def destroy\n @sujet.destroy\n respond_to do |format|\n format.html { redirect_to sujets_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6a2f559db7176ec66268d7e1af9cdd4b", "score": "0.69615316", "text": "def destroy\n @tipo_acidente.destroy\n respond_to do |format|\n format.html { redirect_to tipo_acidentes_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e1f4bad5f55893186a3ecea321742d29", "score": "0.6960331", "text": "def destroy\n @statusentrega = Statusentrega.find(params[:id])\n @statusentrega.destroy\n\n respond_to do |format|\n format.html { redirect_to statusentregas_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "65875f15a253a4fa4f1bbe6c701c1915", "score": "0.69597065", "text": "def destroy\n @proyecto.destroy\n respond_to do |format|\n format.html { redirect_to proyectos_url, notice: 'Proyecto borrado.' }\n format.json { head :no_content }\n end\n end", "title": "" } ]
36626c23c31df4a6d41812fd971d12ed
GET /works GET /works.json
[ { "docid": "afcd958329d271ca7f9f850ce26e92b0", "score": "0.0", "text": "def index\n if params[:company_id].present?\n @company = Company.find(params[:company_id])\n @works = @company.works\n # render 'show_with_edit'\n elsif params[:user_id].present?\n @user = User.find(params[:user_id])\n @works = @user.works\n render 'indexuser'\n end\n\n # if signed_in?\n # render 'show_with_edit'\n # else\n # render 'show_without_edit'\n # end\n #@works = Work.all\n end", "title": "" } ]
[ { "docid": "207dabf2ebe89596203bf35acf67d2f0", "score": "0.79646677", "text": "def index\n @works = Work.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @works }\n end\n end", "title": "" }, { "docid": "207dabf2ebe89596203bf35acf67d2f0", "score": "0.79646677", "text": "def index\n @works = Work.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @works }\n end\n end", "title": "" }, { "docid": "b0aec7fdbfecdc66f1900b9d53430d13", "score": "0.75934905", "text": "def get_work_json\n client.make_request('/get-work-json', 'post', params: {})\n end", "title": "" }, { "docid": "8b83b723901b770b549bdb6af320ef3e", "score": "0.72762626", "text": "def all_works\n #start = numeric( params[:start], DEFAULT_START )\n #limit = numeric( params[:limit], DEFAULT_LIMIT )\n\n works = batched_get( {} )\n respond_to do |format|\n format.json do\n if works.empty?\n render_json_works_response(:not_found )\n else\n # dont provide fileset information here, it takes too long and we just want work information\n render_json_works_response(:ok, work_transform( works, EXCLUDE_FILESETS ) )\n end\n end\n format.csv do\n # provide fileset information here because this is used for work export\n render_csv_works_response( work_transform( works, INCLUDE_FILESETS ) )\n end\n end\n\n end", "title": "" }, { "docid": "4e63e274f41760f045f11db2cb528b9e", "score": "0.7270954", "text": "def get_work\n client.make_request('/get-work', 'post', params: {})\n end", "title": "" }, { "docid": "01fc3d81afb4da94559fe7ecb3ad3d4d", "score": "0.7181103", "text": "def get_work\n works = batched_get( { id: params[:id] } )\n if works.empty?\n render_json_works_response(:not_found )\n else\n # provide fileset information here\n render_json_works_response(:ok, work_transform(works, INCLUDE_FILESETS ) )\n end\n end", "title": "" }, { "docid": "63969ae5b356db53e24e571cccc47598", "score": "0.7109962", "text": "def show\n @work = Work.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @work }\n end\n end", "title": "" }, { "docid": "63969ae5b356db53e24e571cccc47598", "score": "0.7109962", "text": "def show\n @work = Work.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @work }\n end\n end", "title": "" }, { "docid": "2fbe73dfc94da1be0ae472697477a0ec", "score": "0.70475656", "text": "def search_works\n\n work_search = API::WorkSearch.new.from_json( params )\n if work_search.valid_for_search?\n\n works = do_works_search( work_search )\n respond_to do |format|\n format.json do\n if works.empty?\n render_json_works_response(:not_found )\n else\n # dont provide fileset information here, it takes too long and we just want work information\n render_json_works_response(:ok, work_transform( works, EXCLUDE_FILESETS ) )\n end\n end\n format.csv do\n # provide fileset information here because this is used for work export\n render_csv_works_response( work_transform( works, INCLUDE_FILESETS ) )\n end\n end\n else\n render_json_works_response(:bad_request, nil, 'Missing or incorrect parameter' )\n end\n\n end", "title": "" }, { "docid": "9032f1b57579c22f808273b00a832d90", "score": "0.7041275", "text": "def show\n @work = Work.find(params[:id])\n render :json => {:name => @work.name, :desc => @work.description}\n end", "title": "" }, { "docid": "e41aef882105d6776953cee10b8d460e", "score": "0.703285", "text": "def index\n @works = Work.all\n end", "title": "" }, { "docid": "e41aef882105d6776953cee10b8d460e", "score": "0.703285", "text": "def index\n @works = Work.all\n end", "title": "" }, { "docid": "e2d0fd232469afe2df3a5b68e5ecd5bd", "score": "0.69860953", "text": "def render_json_works_response( status, works = [], message = nil )\n render json: API::WorkListResponse.new( status, works, message ), :status => status\n end", "title": "" }, { "docid": "f1794834cea5486d20986ccfac330ef1", "score": "0.6954328", "text": "def show\n @work = Work.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @work.to_json(:include => {\n :teacher => {},\n :student => {},\n :thesis_changes => {},\n :tasks => {:include => :thesis_changes}\n })}\n end\n end", "title": "" }, { "docid": "8f46b44dc6b8ee822752453eaecd2775", "score": "0.6895095", "text": "def show\n\t\t@work = Work.find(params[:id])\n\n\t\trespond_to do |format|\n\t\t\tformat.html # show.html.erb\n\t\t\tformat.json { render json: @work }\n\t\tend\n\tend", "title": "" }, { "docid": "c0908751cc86605b8ae34dc27c235574", "score": "0.678585", "text": "def getwork(data = nil)\n @api.request 'getwork', data\n end", "title": "" }, { "docid": "a8980d9e601603ad5879c575517ccadf", "score": "0.67826694", "text": "def index\n @works = Work.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @works }\n end\n end", "title": "" }, { "docid": "288a55ec28793275ee9e8edaeb97611d", "score": "0.6755367", "text": "def index\n @my_posted_homeworks = MyPostedHomework.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @my_posted_homeworks }\n end\n end", "title": "" }, { "docid": "ba756df4e7549ba7d5a47aa30efaec65", "score": "0.6735344", "text": "def getwork(data)\n request :getwork, data\n end", "title": "" }, { "docid": "b743ab232382c0a1ebd288c8b980a002", "score": "0.6716553", "text": "def index\n @workshops = Workshop.past\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @workshops }\n end\n end", "title": "" }, { "docid": "72719fa792104f64ae1560a449156cc8", "score": "0.6686229", "text": "def show\n @work_id = params[:id]\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @work }\n end\n end", "title": "" }, { "docid": "ff2a95e92d3e44f607517f8d50c4264a", "score": "0.6627519", "text": "def index\n workouts = @ws.workouts\n render json: workouts\n end", "title": "" }, { "docid": "0122a0db5d9b8d8db25d1c47fd22f49a", "score": "0.66245466", "text": "def index\n @workouts = Workout.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @workouts }\n end\n end", "title": "" }, { "docid": "d320f163fe8d7072fd74515ea6cbf95b", "score": "0.6618458", "text": "def index\n @solutions = @idea.solutions.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @solutions }\n end\n end", "title": "" }, { "docid": "58e82f5e197aff528b0a004543b28b9e", "score": "0.65699595", "text": "def index\n if (current_user)\n @works = current_user.works\n end\n \n end", "title": "" }, { "docid": "53b6ae1636a02859ee8d305e6cb67d68", "score": "0.65480936", "text": "def get_work(data=nil)\n request('getwork', data)\n end", "title": "" }, { "docid": "5c200b7e4d7975a30ffc877014be4837", "score": "0.65081877", "text": "def index\n @works = Work.includes(:avalon_items).all\n end", "title": "" }, { "docid": "6a89861ca4047887c31b1fa3cd5ff225", "score": "0.6473567", "text": "def show\r\n @second_work = SecondWork.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @second_work }\r\n end\r\n end", "title": "" }, { "docid": "125608880fb46b6ffca737c32a4b3387", "score": "0.6458187", "text": "def perform_works_request\n Faraday.send(:get, request_url(type: :works, put_code: work_codes.join(\",\")), nil, headers)\n end", "title": "" }, { "docid": "498c897e360fafefa3684cddca16dcb6", "score": "0.64366156", "text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @work_has_subject }\n end\n end", "title": "" }, { "docid": "37e2a8828285d2290a7cb329c217bf67", "score": "0.6423953", "text": "def index\n @journal = Journal.find(params[:journal_id])\n\n render json: @journal.workouts\n end", "title": "" }, { "docid": "aa374b1f238606cc3193a39f1777df3d", "score": "0.6423386", "text": "def index\n @workstations = Workstation.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @workstations }\n end\n end", "title": "" }, { "docid": "4a1f3d34e3876c3ee329a42d1a299eae", "score": "0.64171875", "text": "def index\n @howitworks = Howitwork.all\n end", "title": "" }, { "docid": "2b7106d5934982f2aba0328a8b2070f1", "score": "0.64136326", "text": "def all\n @works = Work.all\n render :index\n end", "title": "" }, { "docid": "6a14fd6eca15598d64621b0641b762f2", "score": "0.64126676", "text": "def index\n @workouts = Workout.all \n render 'index.json.jbuilder', status: :created\n end", "title": "" }, { "docid": "70dc90e71dd362a27f7bc82ccf7dbe93", "score": "0.64118266", "text": "def index\n\n if params['filter'] === nil\n @works = Work.all\n else\n @works = Work.where(params['filter'])\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @works.to_json(:include => {\n :student => {only: [ :last_name, :name, :middle_name ]},\n :teacher => {only: [ :id ]}\n })}\n end\n end", "title": "" }, { "docid": "8f27d60ba48b91fb6590059b5af21830", "score": "0.640751", "text": "def show\n @locations=@work.locations\n map\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @work }\n end\n end", "title": "" }, { "docid": "8383370d30341adfc040d4f690bdff06", "score": "0.6406385", "text": "def show\n @my_posted_homework = MyPostedHomework.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @my_posted_homework }\n end\n end", "title": "" }, { "docid": "cd2b978474d17da7ec630336d42ce793", "score": "0.6401784", "text": "def get_works\n tag = params['query']\n\n @articles = get_articles(tag)\n \n @found = 1 \n if @articles.nil?\n @msg = \"None found, try again...\"\n @found = 0\n @articles = []\n end\n\n render \"articles\"\n\n end", "title": "" }, { "docid": "8020007eb5b0187c4f581b0c6c007aa0", "score": "0.6401311", "text": "def show\n @work_entry = WorkEntry.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @work_entry }\n end\n end", "title": "" }, { "docid": "a791b6fb10fce8877390e58257720251", "score": "0.6386649", "text": "def show\n render json: @laboratory\n end", "title": "" }, { "docid": "b6ec73af3fb346a4c79ad0bcd5c7082f", "score": "0.63840675", "text": "def new\n @work = Work.new\n\n respond_to do |format|\n format.json { render json: @work }\n end\n end", "title": "" }, { "docid": "66900db2440f1c9f4e089d4d9401fb2c", "score": "0.6355574", "text": "def show\n @myworkout = Myworkout.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @myworkout }\n end\n end", "title": "" }, { "docid": "31382a74a978d17fbbb1c9b352dd03c1", "score": "0.63353837", "text": "def index\n @witnesses = Witness.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @witnesses }\n end\n end", "title": "" }, { "docid": "1e532a57e97a172da8be1d9296985fa2", "score": "0.6320045", "text": "def index\n @workdetails = Workdetail.where(\"task_id = ?\", params[:id])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @workdetails }\n end\n end", "title": "" }, { "docid": "52ae9b1804a8cbebc2562829b691ec10", "score": "0.6295839", "text": "def show\r\n @stages_work = StagesWork.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @stages_work }\r\n end\r\n end", "title": "" }, { "docid": "cff1973f3a48f46704371057129e7779", "score": "0.6290122", "text": "def index\n @link_name = \"horas\"\n @time_work = TimeWork.new\n @time_works = TimeWork.all_by_user_session user_web\n\n respond_to do |format|\n respond_msg\n format.html # index.html.erb\n format.json { render json: {time_works: @time_works, time_work: @time_work} }\n end\n end", "title": "" }, { "docid": "2b84c1a78cd690e5483a21ec81d706c2", "score": "0.6265397", "text": "def index\n @experiments = Experiment.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @experiments }\n end\n end", "title": "" }, { "docid": "f19e16674a0dea1a422cb81c99c5fc49", "score": "0.62641466", "text": "def works\n\t\t@works = StoriesDecorator.decorate(Story.with_filters(index_params, current_user))\n\tend", "title": "" }, { "docid": "e6d8f8e7babfb407a67220d11bc71838", "score": "0.6237909", "text": "def new\n @work = Work.new\n\n logger.info @work.be.user_projects('nois3lab')\n\n @tags = Tag.all\n @media_asset = MediaAsset.all\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @work }\n end\n end", "title": "" }, { "docid": "1208836523df851d5eb578367b7b5d31", "score": "0.62303424", "text": "def show\n @work_activity = WorkActivity.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @work_activity }\n end\n end", "title": "" }, { "docid": "72db7ad550bab4358f0f8f3c217b4cbd", "score": "0.6228419", "text": "def latest\n @works = Work.latest\n render :index\n end", "title": "" }, { "docid": "7dac6175a1e047dae96abcda5543924f", "score": "0.62256145", "text": "def new\n @work = Work.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @work }\n end\n end", "title": "" }, { "docid": "7dac6175a1e047dae96abcda5543924f", "score": "0.62256145", "text": "def new\n @work = Work.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @work }\n end\n end", "title": "" }, { "docid": "99c785df59f240a1366fc5b333c05fc4", "score": "0.6196867", "text": "def new\n @work = Work.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @work }\n end\n end", "title": "" }, { "docid": "d5ad99924f99935c7915e2d38cbe1fc9", "score": "0.6189289", "text": "def index\n @works = Work.all #.is_in_parking se quita para proeubas en angular\n render_default_format(@works, true, 200)\n end", "title": "" }, { "docid": "91d2d9e3a5580f2b6e49428eef735765", "score": "0.61831504", "text": "def show\n @work_log = WorkLog.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @work_log }\n end\n end", "title": "" }, { "docid": "4967b3787793835e35f618a1c80807d2", "score": "0.61742264", "text": "def show\r\n @scientific_work = ScientificWork.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @scientific_work }\r\n end\r\n end", "title": "" }, { "docid": "e160963ba8e472aac0616c16e517140a", "score": "0.61685467", "text": "def submitted\n @works = Work.submitted\n render :index\n end", "title": "" }, { "docid": "44949df1c33e66ddb379bfae6e6cb8ce", "score": "0.61629254", "text": "def show\n @research = Research.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @research }\n end\n end", "title": "" }, { "docid": "d17d005f09d72de3677a51d5fe2c9c39", "score": "0.6137946", "text": "def show\n @gym_workout = GymWorkout.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @gym_workout }\n end\n end", "title": "" }, { "docid": "3ab2e6350f0f714a9dc0424b3122be36", "score": "0.6116107", "text": "def show\n @workshop = Workshop.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @workshop }\n end\n end", "title": "" }, { "docid": "fd601d08fc1feb17db80ffaaef6734fa", "score": "0.6108303", "text": "def index\n\n @wfid = params[:wfid]\n @query = params[:q] || params[:query]\n\n @workitems = if @wfid\n OpenWFE::Extras::Workitem.find_all_by_wfid(@wfid)\n elsif @query\n OpenWFE::Extras::Workitem.search(@query)\n else\n OpenWFE::Extras::Workitem.find(:all)\n end\n\n respond_to do |format|\n\n format.html\n # => app/views/workitems/index.html.erb\n\n format.json do\n render(:json => OpenWFE::Json.workitems_to_h(\n @workitems, :linkgen => linkgen).to_json)\n end\n\n format.xml do\n render(:xml => OpenWFE::Xml.workitems_to_xml(\n @workitems, :indent => 2, :linkgen => linkgen))\n end\n end\n end", "title": "" }, { "docid": "2a695ce99dd517e0556fde5ad61fedef", "score": "0.6105355", "text": "def show\r\n @academic_work = AcademicWork.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @academic_work }\r\n end\r\n end", "title": "" }, { "docid": "4414bb64780083e2c3b8b94b7b79e064", "score": "0.61030006", "text": "def find_work\n work_id = params[:id]\n @work = Work.find_by_id(params[:id])\n head :not_found unless @work\nend", "title": "" }, { "docid": "c46fb533c0212d2b653541ec3e11b137", "score": "0.60929316", "text": "def index\n @our_works = OurWork.all #.is_in_parking se quita para proeubas en angular\n render_default_format(@our_works, true, 200)\n end", "title": "" }, { "docid": "4a14ccc3a51e3acaed00dfe4b8f655fc", "score": "0.6091686", "text": "def index\n @title = \"Studies\"\n\n respond_to do |format|\n format.html do\n @my_studies = Study.with_user(current_user.netid)\n end\n format.json do\n render :json => Study.with_user(current_user.netid).to_json\n end\n end\n end", "title": "" }, { "docid": "b7550bf6b7c3246a93938e270151dfaa", "score": "0.6089575", "text": "def index\n if request.referrer.split('/').last == \"preview\"\n @deleted_from_preview = true\n end\n\n @homeworks = Homework.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @homeworks }\n end\n end", "title": "" }, { "docid": "5ef7e58993c89498f13d579d681a0690", "score": "0.6087678", "text": "def show\n @solution = @idea.solutions.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @solution }\n end\n end", "title": "" }, { "docid": "5ef7e9f2f3cecca5c84c2b60a6fb57b7", "score": "0.60746676", "text": "def show\n render 'works/show'\n end", "title": "" }, { "docid": "6e1c8b3ce32d68597a5e4cd11b19fa6e", "score": "0.60690725", "text": "def index\n @jobs = current_user.works\n end", "title": "" }, { "docid": "73bf441971f81e46d2b4653f311c328d", "score": "0.60658675", "text": "def index\n @homeworks = Homework.all\n end", "title": "" }, { "docid": "9e56a5cbdde57390913e3f0d9c53dbce", "score": "0.6065603", "text": "def index\n render json: Story.all\n end", "title": "" }, { "docid": "6446f69b1803f2b4a42f07369a8ba10b", "score": "0.6063968", "text": "def show\n render_default_format(@our_works, true, 200)\n rescue Exception => e\n puts e.inspect\n end", "title": "" }, { "docid": "6f08663bb23a60c898e24d2c8639c590", "score": "0.60564834", "text": "def works\n\t\t@works = StoryLinksDecorator.decorate(StoryLink.with_filters(index_params, current_user))\n\tend", "title": "" }, { "docid": "f7d7ac9c811a6c5a58fb9679a2c9fd6d", "score": "0.605561", "text": "def index\n @training_contents = TrainingContent.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @training_contents }\n end\n end", "title": "" }, { "docid": "f7b55add3f60fa21e4c1ecec4d45452b", "score": "0.604679", "text": "def show\n @homework_item = HomeworkItem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @homework_item }\n end\n end", "title": "" }, { "docid": "9392a5340f6d10e30290cee6368339e3", "score": "0.60421246", "text": "def index\n @pending_works = PendingWork.all\n\n end", "title": "" }, { "docid": "391d3131917f1e72736ef341d41407cb", "score": "0.60412455", "text": "def index\n get_work; get_subject\n if @work\n @work_has_subjects = @work.work_has_subjects.page(params[:page])\n elsif @subject\n @work_has_subjects = @subject.work_has_subjects.page(params[:page])\n else\n @work_has_subjects = WorkHasSubject.page(params[:page])\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @work_has_subjects }\n end\n end", "title": "" }, { "docid": "9d94f849f30cccd60e41f8b93e9d8f6d", "score": "0.6035029", "text": "def index\n @wigs = Wig.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @wigs }\n end\n end", "title": "" }, { "docid": "7b5209990ec1590627e06039064ef5d9", "score": "0.6034787", "text": "def index\n @problems = Problem.all\n\n render json: @problems\n end", "title": "" }, { "docid": "80bcdc259e4411d3ae8b59757b353bf5", "score": "0.6034136", "text": "def show\n @work_day = WorkDay.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @work_day }\n end\n end", "title": "" }, { "docid": "ddfe747e341bb297242390819e0d74e1", "score": "0.6020577", "text": "def show\n @submissions = Contests.get_contest_submissions(params[:id])\n unless @submissions.nil?\n render json: @submissions\n return\n end\n end", "title": "" }, { "docid": "98348c4a9cacfd8e5de62eab9380d121", "score": "0.60194373", "text": "def index\n @admin_workshops = Admin::Workshop::Workshop.all.paginate(page: params[:page])\n\n respond_to do |format|\n format.html\n format.json { render json: @admin_workshops.map { |i| { value: i.id, text: i.to_s } }, status: :ok }\n end\n end", "title": "" }, { "docid": "167650bf2cb7ba0fc7e055e1966d3708", "score": "0.60142803", "text": "def index\n @work_merge_lists = WorkMergeList.page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @work_merge_lists }\n end\n end", "title": "" }, { "docid": "0625c2433416f3ae2b7e99edc516dd29", "score": "0.6011088", "text": "def show\n @workout = Workout.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @workout }\n end\n end", "title": "" }, { "docid": "f49eda85f5d1c8094c9331bde3f3d1a8", "score": "0.60044944", "text": "def index\n @specialties = Specialty.all\n\n render json: @specialties\n end", "title": "" }, { "docid": "d630364f3ee942ebb865792b16d07ae9", "score": "0.6004452", "text": "def index\n @stories = Story.all\n render json: @stories, root: false\n end", "title": "" }, { "docid": "60883f770dd7ee2886d8b14bc3693543", "score": "0.60001487", "text": "def show\n @team = Team.find(params[:team_id])\n @workout = @team.workouts.find(params[:workout_id])\n @practice = @workout.practices.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @practice }\n end\n end", "title": "" }, { "docid": "5eb79d7b733ac87ce4c73baf36cbe6e1", "score": "0.5996817", "text": "def optional_only\n @works = Work.optional_only\n render :index\n end", "title": "" }, { "docid": "757f283026956f99dfe32abff24532a5", "score": "0.59940434", "text": "def new\n\t\t@work = Work.new\n\n\t\trespond_to do |format|\n\t\t\tformat.html # new.html.erb\n\t\t\tformat.json { render json: @work }\n\t\tend\n\tend", "title": "" }, { "docid": "3b33be0db7f49601a09b14b9f41379ab", "score": "0.5979743", "text": "def works\n\t\t@works = NonfictionDecorator.decorate(Work.nonfiction.with_filters(index_params, current_user))\n\tend", "title": "" }, { "docid": "8ed8f26de8d9fa0ea3f43b91b1f1c969", "score": "0.5978843", "text": "def index\n @art_works = ArtWork.all\n end", "title": "" }, { "docid": "a83730b65ceaefadc49a3ce371b518df", "score": "0.5978771", "text": "def index\n @labs = Lab.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @labs }\n end\n end", "title": "" }, { "docid": "a83730b65ceaefadc49a3ce371b518df", "score": "0.5978771", "text": "def index\n @labs = Lab.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @labs }\n end\n end", "title": "" }, { "docid": "7ca53c57715f97041929a647d4876fcd", "score": "0.59775937", "text": "def show\n @work_merge_list = WorkMergeList.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @work_merge_list }\n end\n end", "title": "" }, { "docid": "70aa99b10700f062d2d00528fd6f908e", "score": "0.59528476", "text": "def index\n @do_exercises = DoExercise.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @do_exercises }\n end\n end", "title": "" }, { "docid": "ca0118ae970e74ad67791bed604b8d1e", "score": "0.59461194", "text": "def show\n @client_workout = ClientWorkout.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @client_workout }\n end\n end", "title": "" }, { "docid": "c17f21a170b8330b65ec98690611bc63", "score": "0.5942156", "text": "def index\n @workout_days = WorkoutDay.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @workout_days }\n end\n end", "title": "" }, { "docid": "8d0eaa33ea724bba6bece169b38950ea", "score": "0.5937439", "text": "def index\n @studies = Study.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @studies }\n end\n end", "title": "" }, { "docid": "625f2505fde28b5d5556175518987f84", "score": "0.5937337", "text": "def index\n @gets = Get.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @gets }\n end\n end", "title": "" } ]
637d2793998b04f902b63f609fef3321
def desert_option user_goal puts "" anim('As you approach the pyramid, you push on the heavy metal door and make your way inside. You spot a door on the other side of the room with the intent to head towards it. Right as you are taking the first step, you realize the middle of the room is littered with traps. You decide to choose a path: left or right') desert_path = gets.chomp if desert_path == 'left' anim('As you follow the left path along the wall to avoid the trap, you proceed with caution. As you get partly through the room, a scarab climbs on your shoulder startling you, making you lose your footing and fall on a trap. As you try to get up, you feel your body deteriorating. The pyramid has now claimed another body.') elsif desert_path == 'right' anim('') end end
[ { "docid": "78e6d7c048cb7777944b7b437833532d", "score": "0.80965954", "text": "def lake_option user_goal\n anim('You stumble upon a foggy lake and progress towards a dock where before you sits a lonely boat. Do you choose to ride the boat across the lake, or swim?')\n lake_path = gets.chomp.downcase\n if lake_path == 'boat'\n anim('You hop on the boat and begin slowly sailing across the quiet water. You cross half of the lake when a thunderous rumbling begins to sound under the water. As you hold on to the shaking boat you see a giant lake monster apear from below, when you look down you notice a bow and arrow on floor of the boat. Do you choose to stay passive or attack the monster.')\n boat_option user_goal\n elsif lake_path == 'swim'\n anim('You start swimming and quickly realize you are no match for the frigid waters of the lake. You start feeling your body being pulled into the depths, as you try to kick to avoid this sensation you are dragged down into the dead quiet of the dark waters. As you struggle holding your last breath, another tug yanks you through a dark hole at the bottom. You close your eyes out of fear and before you know it the water is gone. You look around only to notice youre now in the middle of a blazing desert, and realise you are trapped.')\n # desert_option user_goal\n\n else\n anim('Please choose boat or swim.')\n lake_option user_goal\n end\nend", "title": "" } ]
[ { "docid": "f7684aa83cef54c891a11e871cd50eb2", "score": "0.7356326", "text": "def entrance\n puts \"You are standing alone on a road and there is an intersection.\"\n puts \"There are paths going left, right, and straight on.\"\n puts \"Which path would you like to take?\"\n\n print \"> \"\n choice = $stdin.gets.chomp\n\n if choice.include? \"left\"\n left_path\n elsif choice.include? \"right\"\n right_path\n elsif choice.include? \"straight\"\n straight_path\n else\n puts \" \", \"I don't know what that means.\", \" \"\n entrance\n end\nend", "title": "" }, { "docid": "c148206333ead70431a6f70055b68f04", "score": "0.7113924", "text": "def path1()\n\tstoryboard(\"path1\")\n\tinput = prompt(1, 3)\n\tcase input[0]\n\twhen 1\n\t\tputs \"Hurtling down you fail to find anything to grab and are intimately\"\n\t\tputs \"introduced with the spikes\"\n\t\tdead(\"You lie there impaled, your life slowly slipping away... and you are\")\n\twhen 2\n\t\tputs \"You manage to assume a sky diving position horizontal to the ground\"\n\t\tputs \"Carefully shifting your weight, you position yourself in a manner\"\n\t\tputs \"that makes the wind have a downwards force component.\"\n\t\tputs \"Combined with gravity you finally touch the grown and are quickly\"\n\t\tputs \"flat against it.\"\n\t\tputs \"As if sensing your attempt, the wind dies down.\"\n\t\tpassageway()\n\twhen 3\n\t\tputs \"As you tumble towards your doom, you try and impale everything\"\n\t\tputs \"and anything with your pickaxe to find purchase, but you fail\"\n\t\tputs \"The spikes loom ahead, gleaming dangerously in the dark light\"\n\t\tdead(\"You have an encouter with the spikes. The spikes win and you are...\")\n\telse\n\t\terror()\n\tend\nend", "title": "" }, { "docid": "efed66608d76328ecd1867515d65582a", "score": "0.66865695", "text": "def room_one\n puts \"You've entered room one.\"\n puts \"It seems rather ordinary except it has 3 doors:\"\n puts \"door II is (N)orth, door III is (E)ast, and door IV is (W)est.\"\n puts \"Which direction do you take?\"\n \n print \"> \"\n choice = $stdin.gets.chomp\n \n if (choice === \"N\" || choice === \"n\")\n room_two\n elsif (choice === \"E\" || choice === \"e\")\n room_three\n elsif (choice === \"W\" || choice === \"w\")\n room_four\n else\n dead(\"You succumb to random trap in the room.\")\n end\nend", "title": "" }, { "docid": "3aefba059dfe7637cc7671f67a37065c", "score": "0.6651136", "text": "def direction1\n puts \"After walking for a short time, the passageway splits!\"\n puts \"Do you want to go Left or Right?\"\n player_choice1 = gets.chomp.downcase\n insert\n if player_choice1 == \"left\"\n puts \"You walk down a long narrow path until you fall into a deep cavern: You can try climbing Up or explore the path Down?\"\n elsif player_choice1 == \"right\"\n puts \"You walk down a narrow path until you come to at set of stairs:\"\n else player_choice1 == \"left\"\n puts \"Lets just say you went left...After walking somemore, you come to a set of stairs: \"\n end\n insert\nend", "title": "" }, { "docid": "730b9ceb69394bf89a49cff9adee09b3", "score": "0.6593191", "text": "def aground\n puts \"Casique runs hard aground!\"\n puts \"It's 10 hours until high tide!\"\n puts \" Y -[Y]es\"\n puts \" N -[N]o\"\n print \"Do you start drinking beer?>\"\n beer = gets.chomp.downcase\n if beer == \"y\"\n drunk\n elsif beer == \"n\"\n choose_compass\n else\n aground\n end\nend", "title": "" }, { "docid": "0af91fb49676da919900238cc93f228e", "score": "0.65878177", "text": "def direction2\n puts \"Do you want to go Up or down?\"\n player_choice2 = gets.chomp.downcase\n insert\n if player_choice2 == \"up\"\n puts \"You come to a large chamber bursting with treasure, you see two items in the distance that catch your eye.\"\n puts \"A Large Diamond protected by a moat and a Golden Idol that can only be reached by swinging across vines:\"\n elsif player_choice2 == \"down\"\n puts \"You find a large chamber filled with treasure, you see two items that look extremely valuable, a Large Diamond and a Golden Idol:\"\n else player_choice2 == \"up\"\n puts \"For the sake of argument, we'll say you went up...You find a chamber containing a Golden Idol and a Large Diamond:\"\n end\n insert\nend", "title": "" }, { "docid": "8f1a574876a33437f7da7a3af46a5ee9", "score": "0.6561531", "text": "def right_room\n puts \"Stuff happens, you have to react.\"\n puts \"Do you stay or do you flee?\"\n\n print $prompt\n choice = $stdin.gets.chomp\n\n if choice == \"stay\"\n dead(\"Dude, you shoulda ran when you had the chance - you were brave but now you're dead.\")\n elsif choice == \"flee\"\n puts \"It was wise to run, you can now start the game from the beginning again.\"\n start\n else\n dead(\"I don't understand what you want to do...so you die.\")\n end\nend", "title": "" }, { "docid": "fda6aa24d1a5cc805fceda0fe4dedd00", "score": "0.6545555", "text": "def forest_tribe\n puts \"Welcome to the 'Forest Tribe' we must eat\"\n puts \"If you answer our array riddle correctly,\"\n puts \"we won't eat you and you will be our king \"\n puts \"But if you get it wrong, we spit roast you...mmm\"\n puts \"What do you think? Play or Run?\"\n\n print $user_input\n choice = $stdin.gets.chomp.downcase\n\n if choice == \"play\"\n forest_game\n elsif choice == \"run\"\n start\n else\n dead(\"mmm spit roasted #{$user_name} is tasty\")\n end\nend", "title": "" }, { "docid": "032e1b35b34d6b339feef9fa4278f1ce", "score": "0.65382653", "text": "def main()\n\t\n\tstoryboard(\"main\")\n\t\n\tinput = prompt(1, 5)\n\t\n\tputs \"You start walking towards path no. #{input[0]}\"\n\t\n\tcase input[0]\n\twhen 1\n\t\tpath1()\n\twhen 2\n\t\tpath2()\n\twhen 3\n\t\tpath3()\n\twhen 4\n\t\tpath4()\n\twhen 5\n\t\tpath5()\n\telse\n\t\terror()\n\tend\n\t\nend", "title": "" }, { "docid": "921d41b46a416d2da7df878fa615125a", "score": "0.65255964", "text": "def final_boss\n puts \"There is a final boss here.\"\n puts \"and the boss is not well armoured\"\n puts \"and is slow.\"\n puts \"but it will insta kill you\"\n\n puts \"> \"\n choice = $stdin.gets.chomp\n\n if choice.include? \"flee\" # if it flee then it will run start def\n start\n elsif choice.include? \"dodge\" # if its head then you will die and runs the dead def\n puts \"Nicely dodged and the boss is impressed by your speed and rewarded with gold!\"\n exit(0)\n else # else will keep runing the cthulhu_room def # i like this meathod normally i will create a while loop but this method is lit\n dead (\"hmmm......tasty\")\n end\n\nend", "title": "" }, { "docid": "57ba7ba1cd4b3c55d98ceefa7e519b60", "score": "0.65092963", "text": "def first_obstacle\n\n puts 'Your favorite barber is only a few blocks away. How do you want to get there?'\n def first_obstacle_options\n #****************FIRST Obstacle OPTIONS***************\n puts render_ascii_art './bike.txt'\n puts '\n a. Drive your car\n b. Public transportation\n c. Walk\n\n Enter your choice, a, b, or c:'\n\n # get the users's choice\n user_choice = gets.chomp.downcase\n puts `clear`\n\n\n if user_choice == 'a'\n puts render_ascii_art './car.txt'\n puts 'Your battery is dead since you havent driven in 3 weeks...TRY AGAIN!\n Hit enter to continue.'\n gets\n puts `clear`\n first_obstacle_options\n elsif user_choice == 'b'\n puts render_ascii_art './bus.txt'\n puts 'Someone sneezes on you and you go home to shower...TRY AGAIN!\n Hit enter to continue.'\n gets\n puts `clear`\n first_obstacle_options\n elsif user_choice == 'c'\n puts \"You promptly start walking down the sidewalk thinking to yourself, \\\"This won't take very long!\\\"\"\n second_obstacle\n else\n puts 'Not a valid input try again'\n first_obstacle_options\n end\n end\n first_obstacle_options\nend", "title": "" }, { "docid": "09ae3d31bcfd26da552ffe2dfc550640", "score": "0.6498915", "text": "def show_menu\n puts \"Whatchya wanna do now yo?\"\n puts \"\"\n puts \"\"\n unless Shredder.last.name == Ride.last.shredder.name\n puts \"[If you had any rides, you'd be able to see the trail leaderboard for your last run here...]\"\n puts \"[If you had any rides, you'd be able to delete your last one here...Get some rides in yo!]\"\n else\n puts \"Enter 1 to see the leaderboard for the last run you did on #{Ride.last.trail.name}.\"\n puts \"Enter 2 to delete your last ride on #{Ride.last.trail.name} of #{Ride.last.time} seconds.\"\n end\n puts \"Enter 3 to hit the slopes again for another sesh.\"\n puts \"Enter 4 to reset your skill level of #{Shredder.last.skill}.\"\n puts \"Enter 5 to quit. Then, go grab a fresh one at the mountain bar and spread your stoke.\"\n puts \"\"\n puts \"\"\n user_menu_input = gets.chomp.strip.to_i\n unless user_menu_input.between?(1, 5)\n puts \"\"\n show_menu\n else\n if user_menu_input == 1\n Ride.see_leaderboard\n elsif user_menu_input == 2\n Ride.delete_ride\n elsif user_menu_input == 3\n ride\n elsif user_menu_input == 4\n Shredder.set_skill\n else\n return\n end\n show_menu\n end\nend", "title": "" }, { "docid": "0ee98af953f2c54eed956664e51b4614", "score": "0.6485254", "text": "def selections\n puts \"Here Are Your Options\".bold.blue.on_light_green\n puts \"1. Show Stats\".italic\n puts \"2. Show Weapons\".italic\n puts \"3. Show Completed Quests\".italic\n puts \"4. Do a Quest\".italic\n puts \"5. Fight Another Player\".italic\n puts \"6. Exit Game\".italic\n puts \"\"\n puts \"\"\n puts \"Your Selection, Sire?\".bold.white.on_light_blue\n input = gets.chomp\nend", "title": "" }, { "docid": "cd5aa496ed50b9c0cd0d09db981ab2d8", "score": "0.64815557", "text": "def start\n puts \"You are dropped into the middle of an unfamiliar room.\"\n puts \"The impact makes you rub your wonded ass.\"\n puts \"In the middle of soothing your sore ass...\"\n puts \"Rabid donkey llamas start hurrling towards you out of nowhere.\"\n puts \"How do you react?\"\n puts \"1. Make a mad dash away from the donkey llamas.\"\n puts \"2. Run towards the rabid donkey llamas while flailing your arms.\"\n puts \"3. Continue to rub your ass and smile.\"\n \n choice = $stdin.gets.chomp\n \n if choice == \"1\"\n option1\n else if choice == \"2\"\n option2\n else if choice == \"3\"\n option3\n else\n dead\n end\n end\n end\n end", "title": "" }, { "docid": "2feab3034be57d378f471a8821e598ff", "score": "0.6464922", "text": "def choose_goal\n puts \"What \" + \"goal\".colorize(@key_text_color) + \" would you like to set today? \" \n input = gets.chomp \n @vi_ref.empty?(input) ? choose_goal : @goal = input\n end", "title": "" }, { "docid": "35cc3d9811799febf2ec2bb2ad168085", "score": "0.6451829", "text": "def options\n puts 'Are you depressed yet?'\n user_input2 = gets.strip.downcase\n if user_input2 == 'yes'\n depression\n elsif user_input2 == 'kind of'\n puts 'Cheer up man/woman, and least you are alive!'\n option_1\n else\n puts 'Good that makes me happy!'\n option_1\n end\n end", "title": "" }, { "docid": "031398b5a7966526ffbe15fa1ad9de61", "score": "0.6424223", "text": "def forest(hero, stuff)\n puts \"You are in a deep dark forest to get more information about Loki and Odins Armour.\"\n puts \"There are 2 ways to go left and right. Which one will you take?\"\n puts \"----------------------------------------------------------------------------------\"\n print \"> \"\n choice = $stdin.gets.chomp\n\n if choice == \"left\"\n goblins_village(hero, stuff)\n elsif choice == \"right\"\n bear_ghost(hero, stuff)\n else\n forest(hero, stuff)\n\n end\nend", "title": "" }, { "docid": "3d927fa0dc03f8d945dc6e98351c60e7", "score": "0.6418805", "text": "def jungle_place()\n\tputs \"you reached the jungle, would you like to follow the chimp of the zebra?\"\n\tprompt; next_move=gets.chomp\n\tif next_move== \"chimp\" \n\t\tputs \"you've followed the chimp to some old ruins...\"\n\telsif next_move == \"zembra\"\n\t\tputs \"you've followed the zebra to an open field...\"\n\telse\n\t\tdead(\"wrong choice, chose chimp or zebra\")\n\tend\nend", "title": "" }, { "docid": "8f1f9ffafbfc4b1e533d31ed484df276", "score": "0.6397758", "text": "def options()\n puts\n puts \"---- Please make a selection: ----\"\n puts \"1. View planet details\"\n puts \"2. View summary for all planets\"\n puts \"3. Add a planet\"\n puts \"4. Exit program\"\n puts \"Please make a selection: \"\n user_selection = gets.chomp.capitalize\n\n return user_selection\nend", "title": "" }, { "docid": "b1a2bd48b898d7b2ef8cda847cbfd68d", "score": "0.63838696", "text": "def start\r\n\tputs \"You enter a small room, not too small but quite small\"\r\n\tputs \"There are 3 doors to choose from. \"\r\n\tputs \"...how original\"\r\n\tputs \"which one do you choose? 1 2 or 3 ?\"\r\n\tprint \"> \"\r\n\tdoor = $stdin.gets.chomp\r\n\r\n\tif door == \"1\"\r\n\t\tputs \"ah good choice, sucker...\"\r\n\t\tdoor1\r\n\telsif door == \"2\"\r\n\t\tputs \"As you look at the door you notice hyroglyphys of weapons..\"\r\n\t\tdoor2\r\n\telsif door == \"3\"\r\n\t\tputs \"Something seems spooky about this...\"\r\n\t\tdoor3\r\n\telse\r\n\t\tputs \"poor choice, you fell on some spikes and died.\"\r\n\tend\r\nend", "title": "" }, { "docid": "286427c8de3a317ac844bfa239d9e58a", "score": "0.637166", "text": "def select_action\n while (true)\n puts \"n = Go North\"\n puts \"s = Go South\"\n puts \"e = Go East\"\n puts \"w = Go West\"\n puts \"c = Where am I?\"\n puts \"p = Pick up item\"\n puts \"d = Drop off item\"\n puts \"i = List items in satchel\"\n puts \"q = Quit game\"\n print \"Please select an action: \"\n input = gets.chomp.downcase\n if (input != 'n' && input != 's' && input != 'e' && input != 'w' && input != 'p' && input != 'd' && input != 'i' && input != 'q' && input != 'c')\n puts \"Invalid input. Only (n/s/e/w/p/d/i/q/c)\"\n elsif (input == 'w') && (find_room_in_direction(:west) == nil)\n print_dashes\n print \"No room in the west direction.\\n\\n\"\n elsif (input == 'e') && (find_room_in_direction(:east) == nil)\n print_dashes\n print \"No room in the east direction.\\n\\n\"\n elsif (input == 's') && (find_room_in_direction(:south) == nil)\n print_dashes\n print \"No room in the south direction.\\n\\n\"\n elsif (input == 'n') && (find_room_in_direction(:north) == nil)\n print_dashes\n print \"No room in the north direction.\\n\\n\"\n elsif (input == 'p') && (!treasure?)\n print_dashes\n print \"No treasure to pick up in this room.\\n\\n\"\n elsif (input == 'd') && (!treasure_in_satchel?)\n print_dashes\n print \"No treasure in your satchel to drop off.\\n\\n\"\n elsif (input == 'i') && (!treasure_in_satchel?)\n print_dashes\n print \"Your satchel is empty.\\n\\n\"\n else\n break\n end\n end\n return input\n end", "title": "" }, { "docid": "2428e08fa1d9ae661608de1334d7a4ca", "score": "0.6364388", "text": "def bed()\n puts \"Do you climb the bedspread to get on top of the bed, or explore underneath?\"\n\n prompt; next_move = gets.chomp\n\n if next_move.include? \"q\"\n lose(\"Quitting now.\")\n elsif next_move.include? \"climb\" or next_move.include? \"top\"\n on_top_bed()\n elsif next_move.include? \"explore\" or next_move.include? \"under\"\n under_bed()\n elsif $typo < $typo_max\n $typo += 1\n puts \"I didn't understand that.\"\n hall()\n else\n lose(\"Maybe you could type better if you were fuzzy-butted.\")\n end \nend", "title": "" }, { "docid": "d1b7372f12a2e7a9e66acee4d80e8001", "score": "0.6358727", "text": "def lobby()\n\tputs \"You are in a room with three doors.\"\n\tprint_options([\"left door\",\"middle door\",\"right door\"])\n\tchoice = $stdin.gets.chomp\n\tif choice == \"1\"\n\t\tmonster_room\n\telsif choice == \"2\"\n\t\tpit_room\n\telsif choice == \"3\"\n\t\ttransporter_room\n\telse\n\t\tputs \"Try a number, I don't speak your language.\"\n\tend\nend", "title": "" }, { "docid": "d3e48d4128fe9307ccb1e9b32703ddb6", "score": "0.6345384", "text": "def corridor\n\n\tputs \"\\nYou're on a corridor, that stretches off to both your left and right, turning a corner at both ends. There are no other doors, just a lot of disconcerting 70s artwork on brown wall-paper. The smell of lavender is thick in the air.\"\n\tputs \"\\nDo you turn left or right?\"\n\tprint \"> \"\n\n\tchoice = $stdin.gets.chomp\n\n\tif choice.downcase == \"left\"\n\t\tputs \"You walk quietly down the dingy corridor to the left and turn the corner and down a staircase.\"\n\t\tstairs_into_custard\n\telsif choice.downcase == \"right\"\n\t\tputs \"You pad gently to the right, turn the corner at the end of the corridor and take a staircase down a level\"\n\telse\n\t\tputs \"\\nYou clearly want to go back to bed, so go back inside.\"\n\t\tdungeon_room\n\tend\n\nend", "title": "" }, { "docid": "3798661726e8fafb58bb101be182b5ca", "score": "0.63359237", "text": "def start\n puts \"You are in a dark room.\"\n puts \"There is a door to your right and left.\"\n puts \"Which one do you take?\"\n\n print \"> \"\n choice = $stdin.gets.chomp\n\n if choice == \"left\"\n bear_room\n elsif choice == \"right\"\n cthulhu_room\n else\n dead(\"You stumble around the room until you starve.\")\n end\nend", "title": "" }, { "docid": "a3f809ad3c316fa2f850fe83207dac83", "score": "0.63341486", "text": "def menu \n selection = user_input \n\n if selection == 'y' \n starships_list\n menu \n elsif selection == 'exit'\n goodbye\n else \n invalid\n end \n\n end", "title": "" }, { "docid": "568122e2ed31a17f06f71b78f9ca466f", "score": "0.6330714", "text": "def menu_options\n puts \"Your options are:\n - show animals,\n - show clients,\n - add animal,\n - add client,\n - exit.\n What would you like to do?\n \"\n to_do = gets.chomp\n if to_do == \"show animals\"\n show_animals\n elsif to_do == \"show clients\"\n show_clients\n elsif to_do == \"add animal\"\n create_animal_log\n elsif to_do == \"add client\"\n create_client_log\n elsif to_do == \"exit\"\n exit_program\n end\nend", "title": "" }, { "docid": "9789b6ae2b72e9108da035d7b8070b3e", "score": "0.63241184", "text": "def start\n puts \"\\vYou are in a dark room.\"\n puts \"There is a door to your left and to your right.\"\n puts \"Which one do you take?\"\n\n print \"\\a\\v> \"\n # storing the user input in to the variable\n choice = $stdin.gets.chomp\n\n if choice == \"left\"\n bear_room\n elsif choice == \"right\"\n cthulhu_room\n else\n dead(\"You stumble around the room until you starve.\")\n end\nend", "title": "" }, { "docid": "178588af3be975f20942bd24d382bdc8", "score": "0.63216746", "text": "def menu\n\t# puts \"Please make a selection from the following:\"\n # print Rainbow(\"(b)asic, (a)dvanced calculions\").yellow\n # choice = gets.chomp.downcase\n # if choice[0] == \"b\"\n # \tbasic_calc\n # elsif choice[0] == \"a\"\n # \tadvanced_calc\n # else\n # \tputs \"Hi!\"\n # end\n\nend", "title": "" }, { "docid": "6d9af7005f289067e5d0039e54d2fc98", "score": "0.6285402", "text": "def invalid_bearings\n puts \"The Direction command you have selected is invalid.\"\n prompt = TTY::Prompt.new\n choices = [\n {name: 'Yes', value: 1},\n {name: 'No', value: 2},\n ]\n players_input = prompt.select(\"Would You Like to Reselect your commands?\", choices) \n case players_input\n when 1\n execute_game\n when 2\n main_menu\n end \nend", "title": "" }, { "docid": "852fe61dc070337a60cea1dd70906207", "score": "0.6277988", "text": "def start\n # prints out these stringz:\n puts \"You are in a dark room.\"\n puts \"There is a door to your right and left.\"\n puts \"Which one do you take?\"\n puts \"* right\"\n puts \"* left\"\n\n# prints an arrow for a prompt\n print \"> \"\n # creates a variable called \"choice\" and allows the user to input a string for it\n choice = $stdin.gets.chomp\n\n# creats an if statement\n# if the variable \"choice\" is equal to left...\n if choice == \"left\"\n # run the \"bear_room\" method\n bear_room\n #otherwise, if the \"choice\" variable is right...\n elsif choice == \"right\"\n # run the \"cthulhu_room\" method\n cthulhu_room\n # otherwise, do this...\n else\n # run the \"dead\" method and pass in this string as an argument:\n dead(\"You stumble around the room until you starve.\")\n # ends the if statement\n end\n# ends the start method\nend", "title": "" }, { "docid": "76d9ba29498aa0ca430a6abfbc092eeb", "score": "0.62757534", "text": "def room_4\n puts \"This is a very mysterious room\"\n puts \"You can hear lots of strange sounds\"\n puts \"You can see lots of ancient artifacts\"\n \n print \"Do you want to explore or go through door? \"\n ans = $stdin.gets.chomp.downcase\n \n if (ans.include? \"explore\") || (ans.include? \"door\")\n if (ans.include? \"explore\")\n puts \"You explore some of these ancient artifacts\"\n puts \"You begin to hear a strange noise\"\n puts \"You look up and see a demon has appeared!\"\n print \"Run away or hide? \"\n ans2 = $stdin.gets.chomp.downcase\n \n if (ans2.include? \"run\")\n question_room\n end\n \n if (ans2.include? \"hide\")\n dead\n end\n elsif (ans.include? \"door\")\n room_5\n else\n puts \"You didn't make a decision quick enough!\"\n dead\n end\n else\n puts \"You didn't make a decision quick enough!\"\n dead\n end\nend", "title": "" }, { "docid": "ad44dac50981ec590524b41bf010c935", "score": "0.6237391", "text": "def cthulhu_room\n puts \"\\vHere you see the great evil Cthulhu.\"\n puts \"He, it, whatever stares at you and you go insane.\"\n puts \"Do you flee for your life or eat your head?\"\n # puts \"flee or head??\"\n print \"\\a\\v> \"\n #storing the user input in to the variable \"choice\"\n choice = $stdin.gets.chomp\n\n if choice.include? \"flee\"\n start\n elsif choice.include? \"head\"\n dead(\"Well that was tasty!\")\n else\n cthulhu_room\n end\nend", "title": "" }, { "docid": "670ea00554b0136a3d926e8767c47044", "score": "0.6236105", "text": "def room_5\n puts \"You see a corridor up ahead\"\n puts \"You can either through the door on the left hand side or the right hand side...? \"\n ans = $stdin.gets.chomp.downcase\n if (ans.include? \"left\")\n question_room_final\n else (ans.include? \"right\")\n dead\n end\nend", "title": "" }, { "docid": "340c5810e79149fc55239d34bbca9a52", "score": "0.62342614", "text": "def cthulhu_room\n # prints out these strings:\n puts \"Here you see the great evil Cthulhu.\"\n puts \"He, it, whatever stares at you and you go insane.\"\n puts \"Do you flee for your life or eat your head?:\"\n puts \"* flee\"\n puts \"* eat your head\"\n\n# Prints a prompt arrow:\n print \"> \"\n # makes a variable called \"choice\" and allows you to input a string\n choice = $stdin.gets.chomp\n\n# creates an if branch\n# if the user enters in \"flee\" as a string, do this:\n if choice == \"flee\"\n # runs the start method\n start\n # otherwise, if the string includes the \"head\" string\n elsif choice == \"eat your head\"\n # run the dea method and pass in the string in the argument\n dead(\"Well that was tasty!\")\n # otherwise, do this:\n else\n # run the cthulhu_room method\n cthulhu_room\n # ends the if statement\n end\n# ends the cthulhu_room method\nend", "title": "" }, { "docid": "faf40de70ddf4f23e802aeee66a95c0f", "score": "0.6232845", "text": "def detour\n puts \"---------------------------------------------------------------------------------------------------------------------------------------------------------\".colorize(:red)\n puts \" \"\n puts \"Eager to get back right on track, Stanley took the first open door on his left.\".colorize(:color => :cyan)\n puts \" \"\n puts \"----------------------------------------------------------------------------------------------------------------------------------------------------------\".colorize(:red)\n puts \" \"\n puts \"Commands: turn left, go straight\"\n print \"> \"\n input = gets.downcase.chomp\n\n while (input != \"turn left\" && input != \"go straight\")\n puts \"I don't understand that.\"\n print \"> \"\n input = gets.downcase.chomp\n end\n\n if (input == \"turn left\") then\n meetingroom\n elsif (input == \"go straight\") then\n colourdoors\n end\nend", "title": "" }, { "docid": "8ac39ad38b9a3f7e9e74359942df6b48", "score": "0.6232632", "text": "def fight_choice\n puts \"Fight or run?\"\n fight_input = gets.chomp.downcase\n if fight_input == \"fight\"\n until @enemy.health <= 0\n fight_enemy\n end\n puts \"You've killed the \" + @enemy.name\n elsif fight_input == \"run\"\n run_away\n else\n puts \"You have to do something!\"\n fight_choice\n end\n end", "title": "" }, { "docid": "8caf643b12d0eff589af470d1783dbb3", "score": "0.62313545", "text": "def hit_or_stay\n if player_bust\n game_over\n else\n puts \"\\nDo you want to 'Hit' or 'Stay'?\"\n desire = gets.chomp.downcase\n if desire == 'hit'\n another_player_deal\n else\n dealer_game\n end\n game_over\n end\n end", "title": "" }, { "docid": "677f43c6fb843e8935f3f65ff86be39c", "score": "0.62236625", "text": "def start_menu\n puts \"Please select from the follow options:\"\n puts \"Add a (t)enant,\"\n puts \"Add a (b)uilding,\"\n puts \"Add an (a)partment\"\n puts \"OR\"\n puts \"View all (bu)ildings,\"\n puts \"View all (ap)artments,\"\n puts \"View all (te)nants\"\n puts \"(Q)uit\"\n\n menu_choice = gets.chomp.downcase\n\n if menu_choice == 't'\n add_tenant\n elsif menu_choice == 'b'\n add_building\n elsif menu_choice == 'a'\n add_apartment\n elsif menu_choice == 'bu'\n view_all_buildings\n elsif menu_choice == 'ap'\n view_all_apartments\n elsif menu_choice == 'te'\n view_all_tenants\n elsif menu_choice == 'q'\n puts \"SEE YA!\"\n Kernel.exit\n else\n puts \"Unknown option, restarting.\"\n start_menu\n end\nend", "title": "" }, { "docid": "9e753ea9cc45e56c254281f39f527eb2", "score": "0.6217796", "text": "def menu\n\tprint \"(b)asic, (a)dvanced, (q)uit\"\n\t$user_menu_choice = gets.chomp\nend", "title": "" }, { "docid": "3fd2af3ee3d8c9b7d27a48cb60edeba2", "score": "0.62135005", "text": "def menu\n puts \"Choose a calculator: (a)dvanced or (b)asic\"\n choice = gets.chomp.to_s\n if choice == \"a\"\n advanced_calc\n elsif choice == \"b\"\n basic_calc\n elsif choice == \"q\"\n exit(0)\n else\n puts \"invalid choice, try again. *hint either a or b (maybe even q?)*\"\n end\nend", "title": "" }, { "docid": "a4fa4d2e8387017ee809e8f6986b8590", "score": "0.6180575", "text": "def start\n puts \"This is the start of the game.\"\n puts \"Do you want to go 'left' or 'right'?\"\n\n print $prompt\n choice = $stdin.gets.chomp\n\n if choice == \"left\"\n left_room\n elsif choice == \"right\"\n right_room\n else\n dead(\"You don't even get to play because you didn't choose 'right' or 'left'!\")\n end\nend", "title": "" }, { "docid": "949610307f99afa7ab4871545c16b1a2", "score": "0.617431", "text": "def menu\n print \"Do you want (b)asic caluclations or (a)dvanced calculations or to (q)uit: \"\n response = gets.chomp\n if response == \"b\"\n basic_calc\n elsif response == \"a\"\n advanced_calc\n elsif response == \"q\"\n \"q\"\n else\n \"Invalid response: enter \\\"b\\\", \\\"c\\\", or \\\"q\\\"\"\n end\nend", "title": "" }, { "docid": "06e652146837961f6d7d884738f72f47", "score": "0.6170535", "text": "def rob_room\n puts \"You sneak into Rob's room, where you know he hoards his secret treasures in a safe under his bed. The crafty little beggar.\"\n puts \"You can take a look at the safe or head back to the landing - what do you want to do?\"\n \n def safe\n print \" >\"\n choice = $stdin.gets.chomp\n \n if choice.downcase.include? \"landing\"\n upstairs\n elsif choice.downcase.include? \"safe\"\n if $coast_clear == false\n puts \"Woah, woah, woah! You can't risk Harbron returning as you try to bust into the safe! You need to make sure he's distracted first.\"\n safe\n elsif $coast_clear == true\n cracking\n \n end\n else \n puts \"I didn't understand that!\"\n safe\n end\n \n end\n safe\n \nend", "title": "" }, { "docid": "ff88c8a8c26a0da1ad786a5b18dfa564", "score": "0.61689407", "text": "def start\n puts 'You come in search of treasure and you stand outside a cave'\n puts 'There is a door to your right and left.'\n puts 'Which one do you take?'\n print '>>> '\n choice = $stdin.gets.chomp\n\n if choice == 'left'\n devil_cave\n elsif choice == 'right'\n lion_cave\n else\n die(\"You keep wandering around the cave you won't find the treasure\")\n end\nend", "title": "" }, { "docid": "24db806f17f1a524a6de98be861c3e51", "score": "0.616268", "text": "def win_place\n puts \"That was a good thing to do, you might just win...\"\n puts \"You have one final choice to make: 'circle' or 'square'\"\n\n print $prompt\n choice = $stdin.gets.chomp\n\n if choice == \"circle\"\n puts \"Congratulations, you win!\"\n exit(0)\n elsif choice == \"square\"\n dead(\"So close but you picked the wrong one so you're dead!\")\n else\n dead(\"You were so close but you died because you still could follow the rules and type a valid choice!\")\n end\nend", "title": "" }, { "docid": "bf137e46d79788b3d8344bc9f861573a", "score": "0.61565584", "text": "def menu_choice()\n option = gets.chomp\n if option == \"a\"\n puts \"\\n\"\n @human_player.search_weapon\n elsif option == \"s\"\n puts \"\\n\"\n @human_player.search_health_pack\n elsif option == option.to_i.to_s\n @enemies.each_with_index do |v, i|\n if option.to_i == i+1\n puts \"koooooooooooo\"\n @human_player.attacks(v)\n v.show_state\n end\n if v.life_points <= 0\n kill_player(v)\n end\n end\n end\n end", "title": "" }, { "docid": "4a0d24a48f87756579e6fbce8eba8c52", "score": "0.6151474", "text": "def upstairs\n puts \"You can enter any room you like - Will's, Sanj's, Rob's, the bathroom or the small toilet room\"\n \n print \" >\"\n choice = $stdin.gets.chomp\n \n if choice.downcase.include? \"will\"\n will_room\n elsif choice.downcase.include? \"sanj\"\n sanj_room\n elsif choice.downcase.include? \"rob\"\n rob_room\n elsif choice.downcase.include? \"bathroom\"\n bathroom\n elsif choice.downcase.include? \"toilet\"\n toilet_room\n else \n puts \"Sorry I didn't understand that!\"\n upstairs\n end\n \nend", "title": "" }, { "docid": "1e3a2905d6a033bfd47c4dd825fb7f7e", "score": "0.6149835", "text": "def origin\n\tmenu\n\tuser_choice = gets.chomp\n\tputs \"You have selected #{ user_choice }\"\n\tuser_choice \nend", "title": "" }, { "docid": "1e3a2905d6a033bfd47c4dd825fb7f7e", "score": "0.6149835", "text": "def origin\n\tmenu\n\tuser_choice = gets.chomp\n\tputs \"You have selected #{ user_choice }\"\n\tuser_choice \nend", "title": "" }, { "docid": "8e2db89b24403048d6e467616d1e9d97", "score": "0.61466473", "text": "def run_game\n\n #first of all, the method prints the menu to display to the user\n puts %Q{\n**********************\n* CHESS GAME *\n**********************\n}\n\nputs %Q{Choose an option:\n 1- Start a new game.\n 2- Load a saved game.\n 3- Remove a saved games\n 4- Quit\n}\n @option = 0\n loop do\n @option = gets.chomp\n if @option.to_i.between?(1,4)\n break\n else\n puts \"Incorrect option, you must choose an available option (1, 2, 3 or 4).\"\n end\n end\n\n #depending on the choosen option we run the next method\n case @option\n when '1'\n start_new_game\n when '2'\n load_saved_game\n when '3'\n remove_saved_game\n when '4'\n puts 'Bye!'\n exit\n end\n end", "title": "" }, { "docid": "d640bd515f840308a32d04fddd45cef4", "score": "0.6144922", "text": "def options\n # Enter options for what to do\n puts \"Please enter a command:\"\n puts \"- N: New game\"\n puts \"- L: Leaderboard\"\n puts \"- X: Exit\"\n gets.chomp\n end", "title": "" }, { "docid": "b615426ea7a1a317a42c0cfd6c6f703c", "score": "0.6127925", "text": "def cthulhu_room\n puts \"Here you see the great evil Cthulhu.\"\n puts \"He, it, whatever stares at you and you go insane\"\n puts \"Do you flee for your life or eat your head?\"\n\n print \"> \"\n choice = $stdin.gets.chomp\n\n# If statement - if the user's answer includes the word 'flee', the start function is called\n# If the user's answer includes the word 'head', the dead function is called. Else, the cthulhu_room function is called\n if choice.include? \"flee\"\n start\n elsif choice.include? \"head\"\n dead(\"Well that was tasty!\")\n else\n cthulhu_room\n end\nend", "title": "" }, { "docid": "f61c1cdc8e569f45e1c40991a48b6aa0", "score": "0.6123505", "text": "def menu\n\n print \"Welcome to the calculator\\n\\n\"\n print \"Please select an option below.\"\n print Rainbow(\"\\n(B)\").yellow + \"asic Caculator\"\n print Rainbow(\"\\n(A)\").yellow + \"dvanced Calculator\"\n print Rainbow(\"\\n(Q)\").yellow + \"uit\"\n selection = gets.strip.downcase\n case selection\n when \"b\"\n basic_calc\n when \"a\"\n advanced_calc \n when \"q\"\n abort\n else \n print \"Wrong character, please choose a selection\"\n end \nend", "title": "" }, { "docid": "79a3a78a3fcb65e91d248329b2f3c1a7", "score": "0.61233854", "text": "def destination_choice\n case gets.chomp.downcase\n when \"t\"\n puts \"Han Solo: \\\"Fine, buddy, but dont expect me to come back for you when you're lost in the desert again.\\\"\"\n puts\n sleep(2)\n puts \"The Millenium Falcon turns around and lands in a dusty desert. You get out of the ship to find yourself alone.\"\n puts\n game_over\n when \"a\"\n puts \"Han Solo: \\\"That's what I like to hear. Hey Chewy get in here, we're headed to Alderaan!\\\"\"\n puts\n sleep(2)\n puts \"The large wookie enters the control room.\"\n puts\n sleep(2)\n puts \"Chewbaca: \\\"Rrrrlllggghlllghgh rrrlllgghhgh!!\\\"\"\n puts\n sleep(2)\n puts \"Han Solo: \\\"I know you don't trust him yet Chewy, neither do I, but he might be able to help us.\\\"\"\n puts\n sleep(2)\n puts \"Chewbaca: \\\"Rrrllgghhh!!\\\"\"\n puts\n sleep(2)\n puts \"Han Solo: \\\"I'm watchin' him Chewy, I'm the pilot, remember? If he acts up I give you persmission to send him back to the med bay, lets play some cards.\\\"\"\n puts\n sleep(2)\n display_choices { \"(y)es, (n)o\" }\n card_game\n else\n destination_choice\n end\n end", "title": "" }, { "docid": "716f9cd2222315c587be1e7f39acc1f2", "score": "0.6122872", "text": "def bedroom()\n puts \"On the far wall are two windows, with a chest of drawers and a laundry hamper in between.\"\n puts \"To your right is a bed with a nightstand.\"\n puts \"On your left is a mirror.\"\n puts \"Do you go right, left, or straight ahead?\"\n puts \"Or do you turn around and go back down the hall?\"\n\n prompt; next_move = gets.chomp\n\n if next_move.include? \"q\"\n lose(\"You decided to quit.\")\n elsif next_move.include? \"l\"\n mirror()\n elsif next_move.include? \"r\"\n bed()\n elsif next_move.include? \"s\"\n chest_of_drawers()\n elsif next_move.include? \"hall\"\n hall()\n elsif $typo < $typo_max\n $typo += 1\n puts \"I didn't understand that.\"\n hall()\n else\n lose(\"Perhaps your ferret could help you with your answers.\")\n end\nend", "title": "" }, { "docid": "58eb3438a7b2ac63ac24399cf79f930c", "score": "0.6120689", "text": "def shoot\n options = [\"rock\", \"paper\", \"scissors\"]\n puts \"#{@name} please enter rock, paper or scissors: (or 'quit' to exit)\"\n selection = STDIN.noecho(&:gets).chomp\n if options.include?(selection)\n selection\n elsif selection.downcase == \"quit\"\n exit\n else\n puts \"I'm sorry, that wasn't a valid selection.\"\n shoot\n end\n end", "title": "" }, { "docid": "c9dfc6409d80fc1bc06252c5611551a5", "score": "0.6114611", "text": "def menu\n print \"(b)asic, (a)dvanced or (q)uit: \"\n return gets.chomp\nend", "title": "" }, { "docid": "ee95023450db27588af6c8eeea58691a", "score": "0.6113662", "text": "def options\n\t\tuser_input = nil\n\t\twhile user_input != \"exit\"\n\t\tputs\t\"-------------------------------------------\"\n\t\tputs \"Please enter the meal you would like to see recipes for: breakfast, lunch, dinner. Or enter exit if done.\" \n\t\tuser_input = gets.downcase.strip\n\t\tif user_input == \"breakfast\"\n\t\t\tprint_breakfast\n\t\telsif user_input == \"lunch\"\n\t\t\tprint_lunch\n\t\telsif user_input == \"dinner\"\n\t\t\tprint_dinner\n\t\t# elsif user_input == \"exit\"\n\t\t# \tgoodbye\n\t\t\t# else\n\t\t\t# \tputs \"Invalid entry. Please enter the meal you would like to see recipes for: breakfast, lunch, dinner. If you are done with meal planning, please type exit.\"\n\t\t\t# end\n\t\tend\n\t\tend\n\t\tgoodbye\n\tend", "title": "" }, { "docid": "e44d7c97b41ef1182ee04ffacdfb2974", "score": "0.61099887", "text": "def prompt\n puts \"Would you like to display your 'balance', 'withdraw' or 'deposit'?\"\n action = gets.chomp\n case action\n when \"balance\"\n check_balance\n when \"deposit\"\n deposit\n when \"withdraw\"\n withdraw\n else\n puts \"That is not a valid option. Go fuck yourself.\"\n end\nend", "title": "" }, { "docid": "b06cd0ddc1b698304d379b1d83db1a62", "score": "0.60946476", "text": "def take_turn\n #output the dealer's hand\n puts self.dealer\n #output current hand \n puts self\n #print options \n options\n input = gets.chomp.to_i\n #set option if its valid or set it to invalid\n option = options_array[input].nil? ? \"invalid\" : options_array[input]\n #preform the option if its a valid option\n #else recurse until a vaild option is selected\n unless option == \"invalid\"\n send option\n else\n puts \"Invalid Input Please Try again\"\n end\n #recures until the user has busted or decided to stand\n self.take_turn unless @stand || self.busted?\n end", "title": "" }, { "docid": "a90406f6e38967a7b8ca501b9adef92e", "score": "0.6093232", "text": "def cave_pace()\n\tputs \"you reached the cave, would you like walk in or walk out?\"\n\tprompt; next_move=gets.chomp\n\tif next_move.include? \"in\" \n\t\tputs \"you've walked in and found a treasure...\"\n\t\tProcess.exit(0)\n\telsif next_move.include? \"out\"\n\t\tputs \"you've walked out, and met and old lady who tells you some pearl of wisdom\"\n\t\tProcess.exit(0)\n\telse\n\t\tdead(\"wrong choice, chose in or out\")\n\tend\nend", "title": "" }, { "docid": "596dff37a6dadeca2ec504fcdfd17f7c", "score": "0.6090094", "text": "def menu\n\tputs \"(b)asic calulations, (a)dvanced calculations\"\n\tputs \"What would you like to do?\" \n\tmain_menu = gets.chomp.to_s\n\n\t#User's entry determines menu\n\tcase main_menu\n\twhen \"b\"\n\t\tbasic_calc\n\twhen \"a\"\n\t\tadvanced_calc\n\telse\n\t\tputs \"You didn't enter a valid selection - try again.\"\n\tend\n\nend", "title": "" }, { "docid": "881d99feb599589ebf72d0b5e50e49e0", "score": "0.6090003", "text": "def room_3\n puts \"There are monsters in this room\"\n puts \"Do you hide of run?\"\n ans = $stdin.gets.chomp.downcase\n if (ans.include? \"hide\")\n puts \"You've chosen to hide\"\n puts \"But the monster found you\"\n puts \"Do you fight or try to escape?\"\n ans2 = $stdin.gets.chomp.downcase\n if (ans2.include? \"fight\")\n puts \"Do you want to punch or kick the monster?\"\n ans3 = $stdin.gets.chomp.downcase\n if (ans3.include? \"kick\")\n puts \"You've managed to stun the monster\"\n puts \"You run through the nearest door\"\n room_4\n elsif (ans3.include? \"punch\")\n puts \"The punch wasn't strong enough\"\n puts \"The monster now grabs you\"\n dead\n else\n puts \"You didn't make a move quick enough\"\n dead\n end\n elsif (ans2.include? \"escape\")\n puts \"You couldn't escape it!\"\n dead\n else\n puts \"You didn't make a decision fast enough!\"\n dead\n end\n elsif (ans.include? \"run\")\n puts \"You manage to lose it, but you're back to where you began!\"\n starting_room\n else\n puts \"You didn't make a decision quick enough and the monster killed you!\"\n dead\n end\nend", "title": "" }, { "docid": "df888095b489aa6471102ae5ad60eda3", "score": "0.6089011", "text": "def character_info\n puts \"What would you like to know?\"\n\n if $round == 1\n puts\n \"1. Marital status\n 2. 1st appearance\n 3. Dead or alive?\"\n\n choice = gets.chomp\n\n if choice == \"1\"\n marital_status\n\nelsif choice == \"2\"\n first_appearance\nelsif choice == \"3\"\n dead_or_alive\n end\nquiz_choices\nend\nend", "title": "" }, { "docid": "72533dee60c024bdf31d7159f6b1a1cd", "score": "0.6086123", "text": "def treasure_room\n puts \"Do you go for the Diamond or the Idol?\"\n player_choice3 = gets.chomp.downcase\n insert\n end_scenerios = [\"Congratualations! You managed to grab your treasure and make it out alive!\", \"You managed to grab the treasure...unfortunately, that angered the family of attack gorillas guarding it and you're now dinner..\", \"As soon as you grab the artifact the entire temple starts to collapse and you are burried alive...\"]\n if player_choice3 == \"diamond\"\n # outputs a diamond if the user selects \"diamond\"\n diamond\n puts end_scenerios.sample\n elsif player_choice3 == \"idol\"\n puts end_scenerios.sample\n else player_choice3 == \"idol\"\n puts \"Fine, you went for the Golden Idol\" + \" \" + end_scenerios.sample\n end\n insert\nend", "title": "" }, { "docid": "a376c7106ccb2e0fa8e37fd6ba87d16d", "score": "0.60814357", "text": "def menu\n puts `clear`\n puts \"********Welcome to the Pet Adoption Center********\"\n puts \"Choose an option\"\n puts \" 1: Create an animal\"\n puts \" 2: Create a client\"\n puts \" 3: Display all animals\"\n puts \" 4: Display all clients\"\n puts \" 5: Adopt an animal\"\n puts \" 6: Return an animal\"\n puts \" 7: Quit\"\n response = gets.chomp\n return response\nend", "title": "" }, { "docid": "6b44207c0fb7e6a0cdf5ba2f7540e8bf", "score": "0.60812396", "text": "def ask_player\n case gets.chomp.upcase\n when \"G\"\n puts <<-END\nYou step through the door, go about your life as usual with\na nagging feeling in the back of your mind that there was something\nyou wanted but can no longer remember. Finally, at your death bed,\nyou remember. But by then...\n\n END\n sleep(2)\n $death_count += 1\n\n when \"S\"\n puts <<-END\nYou decide staying in the room is much better than leaving the room.\nBut you quickly get bored and go through the door. Life happens. Then\nyou die.\n\n END\n sleep(2)\n $death_count += 1\n\n when \"I\"\n puts <<-END\nYou close your eyes and focus on your breath.\nAs you breathe in...and out.... you travel to the planes\nof the inner mind.\n\n END\n sleep(2)\n else\n puts <<-END\nYou die from incompetence.\n\n END\n sleep(2)\n $miss += 1\n $death_count += 1\n end\nend", "title": "" }, { "docid": "bc4ade5a2be8bd6dafa30320de1882ca", "score": "0.6073076", "text": "def menu\n puts \"whatcha wanna do wit me?\"\n puts \"(b)asic, (a)dvanced, or (q)uit:\"\n response = gets.chomp.downcase\n case response\n when 'b'\n basic_calc\n when 'a'\n advanced_calc\n when 'q'\n puts \"goodbye!\"\n else\n puts \"that wasn't one of the options, idiot!\"\n puts \" \"\n menu\n end\n end", "title": "" }, { "docid": "b465613d9192d558a8bda7b6ed6ad032", "score": "0.6072906", "text": "def menu\n selection = user_input\n\n if selection == 'y'\n houses_list\n elsif selection == 'n'\n bye\n else \n invalid\n menu\n end \n end", "title": "" }, { "docid": "a122a3a9d5e26d29f3227a32f2adc31d", "score": "0.60714793", "text": "def menu\n puts `clear`\n puts \"********Welcome to GA********\"\n puts \"Choose an option\"\n puts \" 1: View building details\"\n puts \" 2: Add an apartment to the building\"\n puts \" 3: Add a tenant\"\n puts \" 4: List the apartment directory for the building\"\n puts \" 5: Quit\"\n response = gets.chomp\n return response\nend", "title": "" }, { "docid": "d3044f2d42e1092d67c3be2958a238d2", "score": "0.60692257", "text": "def inside\n puts \"You are inside an old house, it looks like no one has been here for a while.\" \n puts \"It's a little dark and hard to see everything properly.\"\n puts \"There is a thick layer of dust on most surfaces.\"\n puts \"Looking around you can see a number of things in the room.\"\n puts \"There is a bed, a small table with an oil lamp, and against one wall, an empty bookcase.\", \" \"\n puts \"What would you like to do?\"\n\n print \"> \"\n choice = $stdin.gets.chomp\n\n # break this out to it's own method as well with the option for 2 paths\n # path 1: lamp not lit\n # path 2: lamp is lit\n # also, include 'bed_used = true/false' as an option \n # this will allow for two versions depending on what the player has done\n if choice.include? \"bed\"\n inside_bed\n # see if we can have it return a value for lamp = true to be used for the room later on in the decision tree\n elsif choice.include? \"table\"\n inside_table\n elsif choice.include? \"case\"\n puts \"You look more closely at the bookcase, but unfortunately it's too dark to make out much aside from the fact there is no books there.\", \" \"\n inside\n else \"I don't know what that means, what would you like to do?\"\n inside\n end\nend", "title": "" }, { "docid": "2408098f80ed2a55f98c31f48bf4b1c8", "score": "0.6064293", "text": "def menu\n puts \"Please choose to use the basic (c)alculator, the (a)dvanced_calc or enter (q) to quit\"\n choice = gets.chomp()\n case choice\n when \"c\"\n basic_calc\n when \"a\"\n advanced_calc\n when \"q\"\n return 'q'\n else\n puts \"Sorry that's not an option.\"\n end\nend", "title": "" }, { "docid": "868fb38ba173af0b8526f852b335c45c", "score": "0.6057691", "text": "def start()\n\tputs \"You are in a dark room.\"\n\tputs \"There is a door to your right and left.\"\n\tputs \"Which one do you take?\"\n\n\tprompt; next_move = gets.chomp\n\n\tif next_move == \"left\"\n\t\tbear_room()\n\telsif next_move == \"right\"\n\t\tcthulhu_room()\n\telse\n\t\tdead(\"You stumble around the room until you starve.\")\n\tend\nend", "title": "" }, { "docid": "76e3fcc0f635ebe12bf53e84ce19432c", "score": "0.6055394", "text": "def menu\n # puts `clear`\n puts \"Welcome to #{@airport.name}\"\n puts \"Choose a number for the operation you want to perform?\"\n puts \"\\t1. Add a flight\"\n puts \"\\t2. List flights\"\n puts \"\\t3. Add a passenger to a flight\"\n puts \"\\t4. List passengers on a flight\"\n puts \"\\tQ. Quit\"\n puts \"\\nEnter now: \"\n gets.chomp\nend", "title": "" }, { "docid": "4e5acff47ed8ee15df9b098aa54d4368", "score": "0.60508186", "text": "def menu\n puts \"(C)-New Client\\n(A)-New Animal\\n(Q)-Quit\"\n puts \"(DC)-Display Clients\\n(DA)Display Animals\"\n puts \"(AA)-Adopt Animal\\n(SA)-Surender Animal\"\n gets.chomp.downcase\nend", "title": "" }, { "docid": "8e640c1db3fd4d99a945fe9c5e9b8c92", "score": "0.6049448", "text": "def where_do_you_go\n puts \"Where do you go?\"\n\n prompt; next_move = gets.chomp\n\n if next_move.include? \"q\"\n lose(\"You decided to quit.\")\n elsif next_move.include? \"TV\" or next_move.include? \"tv\" \n tv_stand()\n elsif next_move.include? \"living\" or next_move.include? \"lr\"\n living_room()\n elsif next_move.include? \"sofa\"\n sofa()\n elsif next_move.include? \"coffee table\"\n coffee_table()\n elsif next_move.include? \"dining\" or next_move.include? \"dr\"\n dining_room()\n elsif next_move.include? \"hall\"\n hall()\n elsif $typo < $typo_max\n $typo += 1\n puts \"I didn't understand that.\"\n living_room()\n else\n lose(\"Perhaps your ferret could help you with your answers.\")\n end\nend", "title": "" }, { "docid": "19bcfd5d337ae5063bd4dd58a5ff4bf1", "score": "0.6048356", "text": "def stafflounge\n puts \"---------------------------------------------------------------------------------------------------------------------------------------------------------\".colorize(:red)\n puts \" \"\n puts \"Stanley realised that this wasn't the right way to the meeting room.\".colorize(:color => :cyan)\n puts \"Perhaps he wanted to go to the staff lounge.\".colorize(:color => :cyan)\n puts \"Stanley entered the lounge.\".colorize(:color => :cyan)\n puts \"Wow. Such a magnificent staff lounge. With a vending machine by the entrance as you enter, couple of sofas arranged neatly at the center of the lounge, surrounding a coffee tab-\".colorize(:color => :cyan)\n puts \"Wait a minute. Stop wasting time and get out of there.\".colorize(:color => :cyan)\n puts \" \"\n puts \"----------------------------------------------------------------------------------------------------------------------------------------------------------\".colorize(:red)\n puts \" \"\n puts \"Commands: exit lounge\"\n print \"> \"\n input = gets.downcase.chomp\n \n while (input != \"exit lounge\")\n puts \"I don't understand that.\"\n print \"> \"\n input = gets.downcase.chomp\n end\n\n if (input == \"exit lounge\") then\n detour\n end\nend", "title": "" }, { "docid": "9abbc63e74e03ed0d0bc9a9e2996870d", "score": "0.60446227", "text": "def real_world\n puts \"\\nYou slowly open your eyes and find yourself back in your room.\"\n puts \"You turn and see your #{@selected_weapon} leaning on your night stand.\"\n puts \"Fin\"\n puts \"\\nMade by Paul Smailis!\"\n puts \"\\nWant to play again? Y / N\"\n print \">> \"\n confirm = gets.chomp.downcase\n if confirm.include?('y')\n start_game\n else\n puts \"\\nThanks for playing!\"\n end\nend", "title": "" }, { "docid": "38d1c54bd650b8bf0d22a16003b684da", "score": "0.60430574", "text": "def menu\n puts \"\\n\\n*** HappiTails Shelter Directory ***\\n\\n\"\n puts \"(1) Display all animals\"\n puts \"(2) Display all clients\"\n puts \"(3) Add an animal\" \n puts \"(4) Add a client\"\n puts \"(5) Put an animal up for adoption\"\n puts \"(6) Quit\\n\\n\"\n puts \n gets.chomp.downcase\n end", "title": "" }, { "docid": "4a735b0f4ed1ae7447b55c81a47cedd5", "score": "0.6040915", "text": "def menu\n puts \"(B)asic or (A)dvanced Calculator?\"\n choice = gets.chomp.downcase\n return choice\nend", "title": "" }, { "docid": "35acbb06424d8fe187d5cb5e8ef94c5c", "score": "0.6040764", "text": "def under_bed()\n if $bed_stash.empty?\n puts \"Do you want to go somewhere else or crawl into the sleep sack?\"\n else\n puts \"Under the bed you see a snuggly sleep sack and #{$bed_stash.join(\", \")}.\"\n puts \"Do you want to steal something, go somewhere else or crawl into the sleep sack?\"\n end\n\n prompt; next_move = gets.chomp\n\n if next_move.include? \"q\"\n lose(\"Quitting now.\")\n elsif next_move.include? \"crawl\" or next_move.include? \"sack\"\n lose(\"Feeling very sleepy. Falling asleep on the job.\")\n elsif next_move.include? \"steal\"\n steal_thing($bed_stash)\n elsif next_move.include? \"go\"\n puts \"You come out from under the bed to find yourself near the door of the bedroom.\"\n bedroom()\n elsif $typo < $typo_max\n $typo += 1\n puts \"What? I don't think you're typing straight.\"\n hall()\n else\n lose(\"Maybe you could type better if you were fuzzy-butted.\")\n end \nend", "title": "" }, { "docid": "6b33117f9e5b6659f859c41cd6031856", "score": "0.6038498", "text": "def transfer_options (input)\n puts \"You have selected the #{input.capitalize} loyalty program\"\n puts \"You can transfer your points to the following airlines and hotel chains:\"\n puts \" \"\n\n if input == \"amex\" || input == \"Amex\"\n puts AMEX\n return AMEX\n\n elsif input == \"chase\" || input == \"Chase\"\n puts CHASE\n return CHASE\n\n elsif input == \"citi\" || input == \"Citi\"\n puts CITI\n return CITI\n\n end #ends if/else statement\nend", "title": "" }, { "docid": "bb60c9ec916c64e66fbb058ad4fe2cdb", "score": "0.60370076", "text": "def cargo_bay()\n puts \"The Gothons have invaded another one of your ships! You appear to be the last surviving member. You've been here before; you know what to do. Right now you have no weapons to kill and defend yourself. You head over to the weapons cache when suddenly a Gothon jumps out in front of you, blocking the door to the get to weapons cache and about to pull their phaser.\"\n puts \"\\n\"\n puts \"What do you do?\"\n puts \"\\n\"\n puts \"1. football tackle it?\"\n puts \"2. grab the gun off it?\"\n puts \"3. go back to the cargo bay and hide?\"\n \n prompt()\n action = gets.chomp()\n\n if action == \"1\"\n puts \"You let out a Braveheart cry as you run towards the Gothon and attempt to wrap your arms over its 4 legs. Unbeknownst to you, Gothons have the ability to generate electrical charges at will. You feel a sudden pinch and an undescribable amount of pain and heat as a surge of electricity surges through your body, contracting your muscles. The Gothon is staring at you through it's bulging head; it's eyes are nowhere to be seen but it's jaws are salivating are it moves in to bite your neck.\"\n return :death\n\n elsif action == \"2\"\n puts \"You leap towards to Gothon; both of your arms focused on pushing the phaser towards its body. You land on top of the creature as you both wrestle to get possession of the weapon. A jostle here and there and you headbutt it as you grap and shot the Gothon with the phaser 4 times. As you do, it's blood splatters across your chest and face. You feel a stinging and burning sensation and realize their blood is caustic like acid. The pain increases as it continues to burn you but then the creature unleashes a surge of electricity during it's dying breath. Your muscles contract and you wrythe in agony.\"\n return :death\n \n else \n puts \"The distance and time for you to reach for the Gothon's phaser is risky to you quickly retreat back to the cargo bay. The Gothon shoots at you as your dodge left and right. You are now back in the cargo bay; a large room containing numerous boxes of crates with minimal lighting. You duck behind a crate, trying make a sound and control your breathing. The Gothon has reached the entrance and is scouring the room. You look around the crates to find a weapon of some sort you could use in the meantime. There's nothing. You are desperate. The creature is now creeping around looking for you. Suddenly you see the button to open the hachet door and your have an idea. You look around for something to throw towards the door but there is nothing. You then remove your left boot and throw it as hard as you can towards to hachet door. Thud! The sound attracts the Gothon towards the direction as it investigates. You grab a harness and press the button; the hachet door slowly opens and a vacuum grows in strength. You grab onto the netting and one by one, you watch the crates get sucked out into space. The Gothon is using its claws, scratching the ground as it desperately tries to cling on. The Gothon lets out a cry as it is unable to hold on and like a feather in the wind, gets sucked into the black void\"\n puts \"You've won!\"\n Process.exit(0)\n end\nend", "title": "" }, { "docid": "2ae31c52c50091dc07b74539b7dd79cd", "score": "0.6036766", "text": "def location_menu(name, age, skill) ###### BEGIN LOCATION MENU - NEW USER SIGNUP ##########\n system('clear')\n puts \n puts \"WOW #{name}, you're #{age} years old and a #{skill}? That's great!\"\n puts location_prompt\n print ': '\n location = case STDIN.getch\n \n when '1'\n 'Bay Area'\n when '2'\n 'Yosemite'\n when '3'\n \"SoCal\"\n when '4'\n \"New York\"\n when '5'\n \"International\"\n end\n\n if location\n location\n else\n puts \n puts \"That's an invalid selection. Please try again.\"\n puts\n pause\n location_menu(name, age, skill)\n end\nend", "title": "" }, { "docid": "285289fcea7486c9b7299b1eda8e9870", "score": "0.6032589", "text": "def get_menu_selection\n puts menu\n input = gets\n return unless input\n input.chomp!\n if input == \"1\"\n add_person\n elsif input == \"2\"\n add_injury\n elsif input == \"3\"\n puts \"Who is injured?\"\n else\n puts \"'#{input}' is not a valid selection\"\n get_menu_selection\n end\nend", "title": "" }, { "docid": "285289fcea7486c9b7299b1eda8e9870", "score": "0.6032589", "text": "def get_menu_selection\n puts menu\n input = gets\n return unless input\n input.chomp!\n if input == \"1\"\n add_person\n elsif input == \"2\"\n add_injury\n elsif input == \"3\"\n puts \"Who is injured?\"\n else\n puts \"'#{input}' is not a valid selection\"\n get_menu_selection\n end\nend", "title": "" }, { "docid": "a55d0efad64ce57e6dad0e9935396261", "score": "0.6030199", "text": "def fight_or_flight_response(usr)\n case usr\n when \"fight\" || \"investigate noise\"\n puts \"You run down the hallway and you see your best friend blindfolded and standing at the edge of a stairwell.\"\n save_shout\n when \"flight\" || \"run home\"\n puts \"You sprint out of the building and you are stopped by your best friend laughing in front of their car, you've realized they've pulled the ultimate prank.\"\n puts \"\\nGAME OVER\"\n else\n puts \"You see a tall man dressed in a black suit walking towards you.\"\n alt_ending\n end\nend", "title": "" }, { "docid": "e5173ed306ac42e5978125ee5ff0bae0", "score": "0.6026191", "text": "def start()\n\tputs\"you are a knight on a quest\"\n\tputs \" but what is your quest?\"\n\tputs \" you chose, meanwhile while you think about it, do you want to get on the horse?\"\n\nprompt; next_move=gets.chomp\n\nif next_move == \"yes\"\n\tjungle_cave_place_choice()\n\telsif\n\t\tnext_move == \"no\"\n\t\tputs \"what kind of knight doesn't want to get on their horse? \"\n\t\tstart()\n\telse\n\t\tputs\"I don't understand what you say, just say 'yes' \"\n\t\tstart()\nend\nend", "title": "" }, { "docid": "d4c5c468703fdd9424b5c38b899280c7", "score": "0.60182047", "text": "def start_game\n puts 'Welcome to Hangman! Would you like to start a new game or load a game? (Type: load/new)'\n game_option = gets.chomp.downcase\n if game_option == \"load\"\n load_game\n else \n hidden_display\n user_guess\n end\n end", "title": "" }, { "docid": "6cc8b5c9d3d71753fc8bf25ba132167f", "score": "0.6017375", "text": "def menu \n puts \"Please choose a function basic, advanced, or quit\"\n return gets.chomp\nend", "title": "" }, { "docid": "60f8b98c87161800b12d9fd2f2221e52", "score": "0.60166067", "text": "def option\r\n input = nil\r\n while choice_check(input) == false\r\n puts \"[1] update tables [2] book [3] owner [4] reader [5] wish list [0] end\"\r\n\r\n #puts \"Would you like to [1] View your watchlist [2] Add a symbol to your watchlist [3] Remove a symbol from your watchlist [0] Exit from your watchlist.\"\r\n input = gets.chomp\r\n puts \"Invalid selection. Please enter a valid selection\" if choice_check(input) == false\r\n end\r\n return input\r\nend", "title": "" }, { "docid": "d82e679cdb5c42a25e7d5682a7a33566", "score": "0.60145456", "text": "def user_options(input)\n case input\n when /\\d/\n bottle(input.to_i)\n output = \"You just paid $#{@bottles[:cash]}. That'll get you #{@bottles[:cash] / 2} bottle(s) of pop.\"\n when 'caps'\n if @bottles[:bottle_caps] >= 4\n output = \"You can redeem your caps for #{@bottles[:bottle_caps] / 4} full bottle(s) of pop.\"\n else\n output = \"Sorry, you don't have enough caps to redeem.\"\n end\n when 'empties'\n if @bottles[:empty_bottles] >= 2\n output = \"You can redeem your empties for #{@bottles[:full_bottles] / 2} full bottle(s) of pop.\"\n else\n output = \"Sorry, you don't have enough empties to redeem.\"\n end\n when 'total'\n output = \"You've paid a total of $#{@bottles[:total_cash]} today.\"\n when 'total'\n output = \"You paid $#{@bottles[:total_cash]} today for a total of #{@bottles[:full_bottles]} full bottles of pop. You'll be able to get back #{@bottles[:full_bottles] / 2} full bottles from your empties and #{@bottles[:bottle_caps] / 4} full bottles from your caps!\"\n when 'exit'\n puts \"Exiting program\".red\n exit\n else \n output = \"Command not recognized. Please try again.\"\n end\n puts \"#{output}\".green\nend", "title": "" }, { "docid": "4c30ae007d7f096cf6a74a5badee9dd6", "score": "0.60133487", "text": "def hallway\n puts \"You can go to the kitchen, the living room, or upstairs. Where do you want to go?\"\n \n print \" >\"\n choice = $stdin.gets.chomp\n \n if choice.downcase.include? \"living room\"\n living_room\n elsif choice.downcase.include? \"kitchen\"\n kitchen\n elsif choice.downcase.include? \"upstairs\"\n upstairs\n else\n puts \"Sorry, I don't understand that!\"\n hallway\n end\n \nend", "title": "" }, { "docid": "4ce68789205ad155dc5a3adfb82ef3a1", "score": "0.6005665", "text": "def menu\n puts \"Choose \\\"b\\\" for basic calculations add, subtract, multiply or divide.\"\n puts \"Choose \\\"a\\\" for advanced calculations power, sqrt and factorial.\"\n puts \"Choose \\\"q\\\" to exit calculator.\"\n print \"Please enter your choice (a,b or q): \"\n menu_item = gets.chomp\n\n if menu_item == \"b\"\n basic_calc \n elsif menu_item == \"a\"\n advanced_calc\n end \n\n menu_item\n\nend", "title": "" }, { "docid": "0eee9e2c6437ea1c0d7b0de0b1be63e5", "score": "0.600332", "text": "def update_goal\n puts \"What is your fitness goal (weight loss, muscle gain, or endurance)? Please choose one. \"\n goal = gets.chomp\n self.goal = goal\n end", "title": "" }, { "docid": "10160a6273fe1875ac4f41b95b908c6b", "score": "0.5992767", "text": "def starting_prompt()\n apartments = data[:apartments]\n tenants = data[:tenants]\n\n puts \"Welcome to MyAppartmentManager.com\"\n puts \"1) To View All Apartments\"\n puts \"2) To View All Tenants\"\n puts \"3) To Exit\"\n\n selection = gets.chomp.to_i\n\n if selection == 1\n puts apartments\n elsif selection == 2\n puts tenants\n else\n puts \"Thanks for using MyAppartmentManager.com!\"\n puts \"If you would like to use our service again,\"\n puts \"please reload this page.\"\n end\nend", "title": "" }, { "docid": "362ea5d6e96cc00b2727778154fb860b", "score": "0.59919834", "text": "def cthulhu_room\n\tputs \"Here you see the great evil Cthulhu.\"\n\tputs \"He, it, whatever stares at you and you go insane.\"\n\tputs \"Do you flee for your life or eat your head?\"\n\n\tputs \"1. flee\"\n\tputs \"2. head\"\n\n\tprint \"> \"\n\tchoice = $stdin.gets.chomp\n\n\tif choice.include? \"1\"\n\t\tstart\n\telsif choice.include? \"2\"\n\t\tdead(\"Well that was tasty!\")\n\telse\n\t\tcthulhu_room\n\tend\nend", "title": "" }, { "docid": "2d9d1f1170fbb0b67f4ff34e3164ec5d", "score": "0.5991649", "text": "def menu\n # Clear the screen, and present the user with a menu\n puts `clear`\n puts \"*** Calc-U-L8R ***\"\n puts \"Please choose whether to keep it simple, or push the boundaries\"\n print \"(b)asic, (a)dvanced, (m)ore or (q)uit: \"\n gets.chomp.downcase\nend", "title": "" }, { "docid": "beef97111d87b52d1f3dfb87466d3170", "score": "0.59878916", "text": "def menu\n puts \"(a) - addition\" # make a new line\n puts \"(s) - subtraction\"\n puts \"(d) - division\"\n puts \"(m) - multiply\"\n puts \"(sr) - square_root\"\n puts \"(ex) - exponent\"\n puts \"(bmi) - BMI\"\n puts \"(trp) - Trip\"\n puts \"(mo) - Mortage\"\n puts \"(q) - quitting\"\n print \"Enter your choice: \" #allow user to type next to it\n return gets.chomp() # ask the user for an input, and we implicity return that\nend", "title": "" } ]
a2099a77c85e91272ae2f9e35b937953
Only allow a trusted parameter "white list" through.
[ { "docid": "44a80470b86abf47982a0f2d088d13ac", "score": "0.0", "text": "def alternative_answer_params\n params.require(:alternative_answer).permit(:text, :alternative_question_id, :survey_id, :email)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7943618", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "f6060519cb0c56a439976f0c978690db", "score": "0.69572574", "text": "def permitted_params\n params.permit!\n end", "title": "" }, { "docid": "3d346c1d1b79565bee6df41a22a6f28d", "score": "0.6887521", "text": "def strong_params\n params.require(:resource).permit(param_whitelist)\n end", "title": "" }, { "docid": "1685d76d665d2c26af736aa987ac8b51", "score": "0.67666084", "text": "def permitted_params\n params.permit!\n end", "title": "" }, { "docid": "e291b3969196368dd4f7080a354ebb08", "score": "0.6733912", "text": "def permitir_parametros\n \t\tparams.permit!\n \tend", "title": "" }, { "docid": "aa06a193f057b6be7c0713a5bd30d5fb", "score": "0.671326", "text": "def strong_params\n params.require(:listing).permit(param_whitelist)\n end", "title": "" }, { "docid": "b63e6e97815a8745ab85cd8f7dd5b4fb", "score": "0.6705381", "text": "def excluded_from_filter_parameters; end", "title": "" }, { "docid": "c436017f4e8bd819f3d933587dfa070a", "score": "0.66612333", "text": "def filtered_parameters; end", "title": "" }, { "docid": "c72da3a0192ce226285be9c2a583d24a", "score": "0.66164786", "text": "def strong_params\n params.require(:post).permit(param_whitelist)\n end", "title": "" }, { "docid": "91bfe6d464d263aa01e776f24583d1d9", "score": "0.66156906", "text": "def permitir_parametros\n params.permit!\n end", "title": "" }, { "docid": "84bd386d5b2a0d586dca327046a81a63", "score": "0.65888846", "text": "def good_params\n permit_params\n end", "title": "" }, { "docid": "fad8fcf4e70bf3589fbcbd40db4df5e2", "score": "0.6575757", "text": "def allowed_params\n # Only this one attribute will be allowed, no hacking\n params.require(:user).permit(:username)\n end", "title": "" }, { "docid": "603f4a45e5efa778afca5372ae8a96dc", "score": "0.6572969", "text": "def param_whitelist\n [:role]\n end", "title": "" }, { "docid": "236e1766ee20eef4883ed724b83e4176", "score": "0.6572365", "text": "def param_whitelist\n [\n :name,\n :tagline, :contact, :summary, :stage,\n :website, :facebook, :twitter, :linkedin, :github,\n :founded_at,\n community_ids: [],\n sectors: [\n :commercial,\n :social,\n :research\n ],\n privacy: [\n contact: [],\n kpis: []\n ],\n permission: [\n listings: [],\n profile: [],\n posts: [],\n kpis: []\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end", "title": "" }, { "docid": "f5e3a87909b3e5022047b4b0a64ca154", "score": "0.65321475", "text": "def parameter_params\n params.require(:parameter).permit(:name, :code, :description, :user_id, :value, :cargapp_model_id, :active)\n end", "title": "" }, { "docid": "b453d9a67af21a3c28a62e1848094a41", "score": "0.65129966", "text": "def strong_params\n params.require(:kpi).permit(param_whitelist)\n end", "title": "" }, { "docid": "58d1451e57b0e767db2fc6721dfaa6be", "score": "0.65128386", "text": "def allowed_parameters\n parameters.keys\n end", "title": "" }, { "docid": "2c8e2be272a55477bfc4c0dfc6baa7a7", "score": "0.64990044", "text": "def strong_params\n params.require(:community_member).permit(param_whitelist)\n end", "title": "" }, { "docid": "52d4c66cc205503f7ad6a4feaedab9b8", "score": "0.6491305", "text": "def parameter_params\n params.require(:parameter).permit(:name, :value, :description)\n end", "title": "" }, { "docid": "a3dc8b6db1e6584a8305a96ebb06ad21", "score": "0.6489574", "text": "def need_params\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.6476191", "text": "def strong_params\n params.require(:request).permit(param_whitelist)\n end", "title": "" }, { "docid": "e64490ed35123aafa1b4627bd165517d", "score": "0.645836", "text": "def allowed_params\n [:title, :description, :is_template, :template_id, :user_id, :color]\n end", "title": "" }, { "docid": "aa0aeac5c232d2a3c3f4f7e099e7e6ff", "score": "0.64389294", "text": "def parameters\n params.permit(permitted_params)\n end", "title": "" }, { "docid": "bfb292096090145a067e31d8fef10853", "score": "0.6431918", "text": "def param_whitelist\n whitelist = [\n :title, :description, :skills,\n :positions, :category, :salary_period,\n :started_at, :finished_at,\n :deadline,\n :salary_min, :salary_max, :hours,\n :equity_min, :equity_max,\n :privacy,\n :owner_id, :owner_type,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n unless action_name === 'create'\n whitelist.delete(:owner_id)\n whitelist.delete(:owner_type)\n end\n \n whitelist\n end", "title": "" }, { "docid": "8c384af787342792f0efc7911c3b2469", "score": "0.642512", "text": "def whitelisted_vegetable_params\n params.require(:vegetable).permit(:name, :color, :rating, :latin_name)\n end", "title": "" }, { "docid": "0f69d0204a0c9a5e4a336cbb3dccbb2c", "score": "0.6420569", "text": "def allowed_params\n params.permit(:campaign_id,:marketer_id,:creator_id,:status)\n end", "title": "" }, { "docid": "0f69d0204a0c9a5e4a336cbb3dccbb2c", "score": "0.6420569", "text": "def allowed_params\n params.permit(:campaign_id,:marketer_id,:creator_id,:status)\n end", "title": "" }, { "docid": "bd826c318f811361676f5282a9256071", "score": "0.63804525", "text": "def filter_parameters; end", "title": "" }, { "docid": "6c4620f5d8fd3fe3641e0474aa7014b2", "score": "0.63736504", "text": "def white_listed_parameters\n params\n .require(:movie)\n .permit(:title, :description, :year_released)\n end", "title": "" }, { "docid": "fc43ee8cb2466a60d4a69a04461c601a", "score": "0.6355191", "text": "def check_params; true; end", "title": "" }, { "docid": "fc43ee8cb2466a60d4a69a04461c601a", "score": "0.6355191", "text": "def check_params; true; end", "title": "" }, { "docid": "cac0774e508766d2f487cbca3db95df0", "score": "0.6336598", "text": "def allow_params?\n definition[:param_tokens]\n end", "title": "" }, { "docid": "37d1c971f6495de3cdd63a3ef049674e", "score": "0.6319846", "text": "def param_whitelist\n whitelist = [\n :name,\n :overview,\n :website, :facebook, :twitter,\n :privacy,\n :avatar_id, :community_id, :category_ids,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n unless action_name === 'create'\n whitelist.delete(:community_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "55aa899fab0dfa44916f71c499998ca8", "score": "0.63113743", "text": "def parameter_params\n params.require(:parameter).permit(:key, :value)\n end", "title": "" }, { "docid": "b63ab280629a127ecab767e2f35b8ef0", "score": "0.6292978", "text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end", "title": "" }, { "docid": "b63ab280629a127ecab767e2f35b8ef0", "score": "0.6292978", "text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end", "title": "" }, { "docid": "585f461bf01ed1ef8d34fd5295a96dca", "score": "0.6291", "text": "def param_whitelist\n whitelist = [\n :message,\n :privacy,\n :author_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:author_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "585f461bf01ed1ef8d34fd5295a96dca", "score": "0.6291", "text": "def param_whitelist\n whitelist = [\n :message,\n :privacy,\n :author_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:author_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "64ea65f903dbe0c9c0cc0e9a20ed2e7f", "score": "0.6290657", "text": "def good_option_params\n permit_params\n end", "title": "" }, { "docid": "e012d7306b402a37012f98bfd4ffdb10", "score": "0.62724084", "text": "def strong_params\n params.require(:team).permit(param_whitelist)\n end", "title": "" }, { "docid": "157e773497f78353899720ad034a906a", "score": "0.6266407", "text": "def white_list_params\n params.require(:white_list).permit(:ip, :comment)\n end", "title": "" }, { "docid": "572f75fa86537d103ddf7b5503f06515", "score": "0.6265082", "text": "def parameter_params\n params.require(:parameter).permit(:title)\n end", "title": "" }, { "docid": "2d2af8e22689ac0c0408bf4cb340d8c8", "score": "0.6262119", "text": "def allowed_params\n params.require(:user).permit(:name, :email)\n end", "title": "" }, { "docid": "b4ac8bc6941a87425ac2dc42a226295f", "score": "0.6258491", "text": "def filtered_params_config; end", "title": "" }, { "docid": "d18a36785daed9387fd6d0042fafcd03", "score": "0.6243215", "text": "def white_listed_parameters\n params\n .require(:company)\n .permit(:company_name, :company_avatar)\n end", "title": "" }, { "docid": "63944d10aa4cde014b8332874db87cb9", "score": "0.62372005", "text": "def excluded_from_filter_parameters=(_arg0); end", "title": "" }, { "docid": "67fe19aa3f1169678aa999df9f0f7e95", "score": "0.6228103", "text": "def list_params\n params.permit(:name)\n end", "title": "" }, { "docid": "6fc2bac4c842e4285d685333ba68e5e9", "score": "0.6226018", "text": "def admin_parameter_params\n params.require(:admin_parameter).permit(:name, :inss_hour_price, :private_hour_price, :is_eval)\n end", "title": "" }, { "docid": "d8b02fce801fc219417d86d0ca117836", "score": "0.6225602", "text": "def _valid_params\n valid_params # method private cause needed only for internal usage\n end", "title": "" }, { "docid": "d8b02fce801fc219417d86d0ca117836", "score": "0.6225602", "text": "def _valid_params\n valid_params # method private cause needed only for internal usage\n end", "title": "" }, { "docid": "36956168ba2889cff7bf17d9f1db41b8", "score": "0.62250364", "text": "def set_param_whitelist(*param_list)\n self.param_whitelist = param_list\n end", "title": "" }, { "docid": "6008e8707eafce375988b3c7ccf098c3", "score": "0.62147176", "text": "def original_params; end", "title": "" }, { "docid": "4ba8f5cdb0399571d60b7242794ce47f", "score": "0.62035644", "text": "def permitted_resource_params\n params[resource.object_name].present? ? params.require(resource.object_name).permit! : ActionController::Parameters.new\n end", "title": "" }, { "docid": "356c5fd5dcbe9214f1330792fa2e18b5", "score": "0.61931455", "text": "def param_whitelist\n whitelist = [\n :name,\n :details,\n :completed,\n :started_at, :finished_at,\n :team_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:team_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "b977c2daceb28f26ee659336b2b98aa9", "score": "0.618889", "text": "def params\n raise \"Override protected method `params'.\"\n end", "title": "" }, { "docid": "cc1542a4be8f3ca5dc359c2eb3fb7d18", "score": "0.6180647", "text": "def strong_params\n params.require(:message).permit(param_whitelist)\n end", "title": "" }, { "docid": "706df0e25391ed2b932f54a646bb0a10", "score": "0.6180104", "text": "def list_name_param opts={}\n params.require(:list).permit(:name)\n end", "title": "" }, { "docid": "7646659415933bf751273d76b1d11b40", "score": "0.6175616", "text": "def whitelisted_observation_params\n return unless params[:observation]\n\n params[:observation].permit(whitelisted_observation_args)\n end", "title": "" }, { "docid": "d3732ff42abd0a618a006d1f24e31e38", "score": "0.61731255", "text": "def add_to_filter_parameters; end", "title": "" }, { "docid": "8e54eaded22dd280d836e96375fed9a4", "score": "0.61730814", "text": "def paramun_params\n params.require(:parametre).permit!\n end", "title": "" }, { "docid": "f8c05c05fb596260a51d3ab4fb42243d", "score": "0.6172509", "text": "def required_parameters\n [ ]\n end", "title": "" }, { "docid": "19080b9212dc7ba3727f80cc9430e426", "score": "0.6172386", "text": "def special_params\n params.require(:special).permit(:name, :description, :function)\n end", "title": "" }, { "docid": "3f5347ed890eed5ea86b70281803d375", "score": "0.6163843", "text": "def user_params\n params.permit!\n end", "title": "" }, { "docid": "3da9117a80cdfd040f0f0ed9d3ffed55", "score": "0.6146083", "text": "def allowable_params(unfiltered_params)\n unfiltered_params.permit(:property_id, :branch_id, :client_name, :branch_name,\n :department, :reference_number, :address_name, :address_number, :address_street,\n :address2, :address3, :address4, :address_postcode, :country, :display_address,\n :property_bedrooms, :property_bathrooms, :property_ensuites, :property_reception_rooms,\n :property_kitchens, :display_property_type, :property_type, :property_style,\n :property_age, :floor_area, :floor_area_units, :property_feature1, :property_feature2,\n :property_feature3, :property_feature4, :property_feature5, :property_feature6,\n :property_feature7, :property_feature8, :property_feature9, :property_feature10,\n :price, :for_sale_poa, :price_qualifier, :property_tenure, :sale_by,\n :development_opportunity, :investment_opportunity, :estimated_rental_income,\n :availability, :main_summary, :full_description, :date_last_modified,\n :featured_property, :region_id, :latitude, :longitude,\n flags_attributes: [:title],\n images_attributes: [:url, :modified],\n floorplans_attributes: [:url, :modified],\n epc_graphs_attributes: [:url, :modified],\n epc_front_pages_attributes: [:url, :modified],\n brochures_attributes: [:url, :modified],\n virtual_tours_attributes: [:url, :modified],\n external_links_attributes: [:url, :description, :modified])\n end", "title": "" }, { "docid": "b9e34b5ac2955add85639f9ca0a07b7f", "score": "0.6145458", "text": "def resource_params\n permits = resource_whitelist\n params.require(model_symbol).permit(permits)\n end", "title": "" }, { "docid": "d646c7ba579499db9edadb606c8b9910", "score": "0.61444825", "text": "def permitted_params\n logger.warn \"#{self}: please override `permitted_params` method.\"\n params.require(resource_request_name).permit!\n end", "title": "" }, { "docid": "4425e2f97b4355b14334b9744f19c412", "score": "0.6143515", "text": "def additional_permitted_params\n []\n end", "title": "" }, { "docid": "4425e2f97b4355b14334b9744f19c412", "score": "0.6143515", "text": "def additional_permitted_params\n []\n end", "title": "" }, { "docid": "9b76b3149ac8b2743f041d1af6b768b5", "score": "0.61364955", "text": "def filter_params\n params.permit(\n\t\t\t\t:name,\n\t\t\t\t:sitedefault,\n\t\t\t\t:opinions,\n\t\t\t\t:contested,\n\t\t\t\t:uncontested,\n\t\t\t\t:initiators,\n\t\t\t\t:comments,\n\t\t\t\t:following,\n\t\t\t\t:bookmarks,\n\t\t\t\t:lone_wolf,\n\t\t\t\t:level_zero,\n\t\t\t\t:level_nonzero,\n\t\t\t\t:private,\n\t\t\t\t:public_viewing,\n\t\t\t\t:public_comments,\n\t\t\t\t:has_parent,\n\t\t\t\t:has_no_parent,\n\t\t\t\t:today,\n\t\t\t\t:last_week,\n\t\t\t\t:last_month,\n\t\t\t\t:last_year,\n\t\t\t\t:sort_by_created_at,\n\t\t\t\t:sort_by_updated_at,\n\t\t\t\t:sort_by_views,\n\t\t\t\t:sort_by_votes,\n\t\t\t\t:sort_by_scores,\n\t\t\t\t:who_id)\n end", "title": "" }, { "docid": "c4a951d3ba89c6d098a96d3d5a2b8643", "score": "0.61280644", "text": "def collection_permitted_params\n params.permit(:format, :page, :per_page, :sort, :include, :locale, fields: {}, filter: {})\n end", "title": "" }, { "docid": "13e3cfbfe510f765b5944667d772f453", "score": "0.6113519", "text": "def admin_security_params\n params.require(:security).permit(:name, :url, :commonplace_id)\n end", "title": "" }, { "docid": "34fb76d8decc10cd29ada824ff70ae63", "score": "0.6112032", "text": "def permitted_resource_params\n p params[object_name].present? ? params.require(object_name).permit! : ActionController::Parameters.new\n end", "title": "" }, { "docid": "9736586d5c470252911ec58107dff461", "score": "0.6106793", "text": "def params_without_classmate_data\n params.clone.permit!.except(*(CLASSMATE_PARAM_NAMES + DEBUG_PARAMS))\n end", "title": "" }, { "docid": "11f5f8959aba1f4022c60509f20e40af", "score": "0.61061025", "text": "def permit_params\n params[:permit]\n end", "title": "" }, { "docid": "45791845cef485d15b7014088dd0be8d", "score": "0.6105072", "text": "def allowed_params\n %i[title body]\n end", "title": "" }, { "docid": "4632c7949842c8534d66b50254032add", "score": "0.6092409", "text": "def parameterization_params\n params.permit(:name, :user_id, :number_value, :money_value)\n end", "title": "" }, { "docid": "bfa951108b69c8eed106b7ad8acbcbfd", "score": "0.60909486", "text": "def data_param\n params.permit(:value)\n end", "title": "" }, { "docid": "0bdcbbe05beb40f7a08bdc8e57b7eca8", "score": "0.60895824", "text": "def filter_params\n end", "title": "" }, { "docid": "63f5e4e9733f9e6b3f98d5e069440292", "score": "0.6083517", "text": "def black_list_params\r\n params.require(:black_list).permit(:user)\r\n end", "title": "" }, { "docid": "6af3741c8644ee63d155db59be10a774", "score": "0.6081807", "text": "def allowed_params\n %i[\n lock_version\n comments\n organization\n job_title\n pronouns\n year_of_birth\n gender\n ethnicity\n opted_in\n invite_status\n acceptance_status\n registered\n registration_type\n can_share\n registration_number\n can_photo\n can_record\n name\n name_sort_by\n name_sort_by_confirmed\n pseudonym\n pseudonym_sort_by\n pseudonym_sort_by_confirmed\n ]\n end", "title": "" }, { "docid": "f70301232281d001a4e52bd9ba4d20f5", "score": "0.6079226", "text": "def room_allowed_params\n end", "title": "" }, { "docid": "44a1ec524e77d2a2c4b85e8341df27db", "score": "0.6077248", "text": "def product_params\n params.permit(:visible)\n end", "title": "" }, { "docid": "07bc0e43e1cec1a821fb2598d6489bde", "score": "0.60767365", "text": "def accept_no_params\n accept_params {}\n end", "title": "" }, { "docid": "c31ef48e8fd467d94158d7ac7f405a3f", "score": "0.60746986", "text": "def list_params\n params.permit(:id, :public_id, :name, :list, :visibility, values: [])\n end", "title": "" }, { "docid": "6bf3ed161b62498559a064aea569250a", "score": "0.60703695", "text": "def require_params\n return nil\n end", "title": "" }, { "docid": "b29cf4bc4a27d4b199de5b6034f9f8a0", "score": "0.6070048", "text": "def safe_params\n params\n .require( self.class.model_class.name.underscore.to_sym )\n .permit( self.class.params_list )\n end", "title": "" }, { "docid": "a50ca4c82eaf086dcbcc9b485ebd4261", "score": "0.6069783", "text": "def white_listed_parameters\n params\n .require(:story)\n .permit(:title, :link, :upvotes, :category)\n end", "title": "" }, { "docid": "c1f13277dbc8ff3a9f65df027f9d915a", "score": "0.6063365", "text": "def permitted_params(unpermitted_params)\n unpermitted_params.permit(\n :controller,\n :action,\n :site_id,\n :format,\n :type,\n :path_contains,\n :new_url_contains,\n :tagged,\n )\n end", "title": "" }, { "docid": "cf963fb451b51d62fcc986deb020a044", "score": "0.6047726", "text": "def permit_params\n\t\t\t\teval(@configuration.get_params)\n\t\t\tend", "title": "" }, { "docid": "77b78ffc267fcf03379cf09c63ad361c", "score": "0.60399187", "text": "def gallery_params\n params.require(:gallery).permit(:name, :white_list)\n end", "title": "" }, { "docid": "be92e82ba93b35cac91b7c02d6a445f7", "score": "0.6033119", "text": "def get_params\r\n #params.require(:view_adm).permit(:name, :action_scope,:caps,:cols)\r\n params.require(:view_adm).permit!\r\n end", "title": "" }, { "docid": "8fa507ebc4288c14857ace21acf54c26", "score": "0.6029004", "text": "def strong_params\n # to dooo\n end", "title": "" }, { "docid": "5b72cb3f5ae45681ff116df46f5da01b", "score": "0.6025425", "text": "def provider_params\n params.permit(:name)\n end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.60199857", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.60199857", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.6019158", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.6019158", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.6019158", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.6019158", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.6019158", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.6019158", "text": "def params; end", "title": "" } ]
c061d9988b4f77e38e8d5179b7acdeca
Colors Print strings in the console with style
[ { "docid": "1b76745e45e2ffe0d35b2471d3420462", "score": "0.7214002", "text": "def red; colorize(self, \"\\e[1m\\e[31m\"); end", "title": "" } ]
[ { "docid": "e63d2068a7e932092bd710bbf7532a9c", "score": "0.8027682", "text": "def puts_blue(string)\n puts \"\\033[34m\" + string + \"\\033[0m\"\nend", "title": "" }, { "docid": "9ffd3c01203689bab165dc4cf85926f2", "score": "0.7808393", "text": "def red(text)\n puts \"\\033[0;31;40m#{text}\\033[0m\"\nend", "title": "" }, { "docid": "25ccf2af430a3d0d63ae34d49940e9f4", "score": "0.7742146", "text": "def green(text)\n puts \"\\033[0;32;40m#{text}\\033[0m\"\nend", "title": "" }, { "docid": "8afc581d3c01822f9f7a971734d0d6ea", "score": "0.77189755", "text": "def make_red(str)\n \"\\033[41m\" + str + \"\\033[0m\"\nend", "title": "" }, { "docid": "ef49f3394dc996556aa8ffd6c74e0452", "score": "0.76673424", "text": "def green(string)\n \"\\033[0;32m#{string}\\e[0m\"\nend", "title": "" }, { "docid": "ef49f3394dc996556aa8ffd6c74e0452", "score": "0.76673424", "text": "def green(string)\n \"\\033[0;32m#{string}\\e[0m\"\nend", "title": "" }, { "docid": "ef49f3394dc996556aa8ffd6c74e0452", "score": "0.76673424", "text": "def green(string)\n \"\\033[0;32m#{string}\\e[0m\"\nend", "title": "" }, { "docid": "ef49f3394dc996556aa8ffd6c74e0452", "score": "0.76673424", "text": "def green(string)\n \"\\033[0;32m#{string}\\e[0m\"\nend", "title": "" }, { "docid": "2400c647ef902f5a29ce63308cba6bd8", "score": "0.75565225", "text": "def puts str\n super \"\\e[1m#{str}\\e[22m\"\nend", "title": "" }, { "docid": "9f75e699884941ecf15f70b767d6204c", "score": "0.75451547", "text": "def bash_green(string)\n return \"\\033[1m\\033[32m#{string}\\033[0m\\033[22m\"\nend", "title": "" }, { "docid": "b64a18061bb0d400258433ba46754d13", "score": "0.75441617", "text": "def color_box(text_color, background, string)\n print \"\\e[#{text_color};#{background}m#{string}\\e[0m\"\n end", "title": "" }, { "docid": "f9fc03e7d17b46421a41a352956b5182", "score": "0.75438976", "text": "def normal(string)\n \"\\033[30m#{string}\\033[0m\"\nend", "title": "" }, { "docid": "4144858ff1cda74c0cc1ee5ab38518d6", "score": "0.75320244", "text": "def print_colored_text(text, color)\n print \"\\e[#{color}m#{text}\\e[0m\"\n end", "title": "" }, { "docid": "ecbbdca753dfa4b10d9616aba5077bc3", "score": "0.75165135", "text": "def blue(string) \n \"\\e[34m#{string}\\e[0m\"\n end", "title": "" }, { "docid": "73ffd216d678961bf2e1b16fe1db0838", "score": "0.7510783", "text": "def console(string, color = nil, line_end = \"\\n\")\n if String.public_method_defined?(:red)\n case color\n when :red then\n print string.red\n when :green then\n print string.green\n when :brown then\n print string.brown\n else\n print string\n end\n else\n print string\n end\n print line_end\n nil\n end", "title": "" }, { "docid": "73ffd216d678961bf2e1b16fe1db0838", "score": "0.7510783", "text": "def console(string, color = nil, line_end = \"\\n\")\n if String.public_method_defined?(:red)\n case color\n when :red then\n print string.red\n when :green then\n print string.green\n when :brown then\n print string.brown\n else\n print string\n end\n else\n print string\n end\n print line_end\n nil\n end", "title": "" }, { "docid": "8d45c330b3d9f8dad14b755c753bcf8a", "score": "0.74966335", "text": "def red(string)\n \"\\033[0;31m#{string}\\e[0m\"\nend", "title": "" }, { "docid": "8d45c330b3d9f8dad14b755c753bcf8a", "score": "0.74966335", "text": "def red(string)\n \"\\033[0;31m#{string}\\e[0m\"\nend", "title": "" }, { "docid": "8d45c330b3d9f8dad14b755c753bcf8a", "score": "0.74966335", "text": "def red(string)\n \"\\033[0;31m#{string}\\e[0m\"\nend", "title": "" }, { "docid": "8d45c330b3d9f8dad14b755c753bcf8a", "score": "0.74966335", "text": "def red(string)\n \"\\033[0;31m#{string}\\e[0m\"\nend", "title": "" }, { "docid": "9c40f8dea115b676840a0760e8e88cbf", "score": "0.7492452", "text": "def write_color(str, console = STDOUT)\n console.write str\nend", "title": "" }, { "docid": "35e6b4cd3680a30b0e091c6f5f59119f", "score": "0.74907094", "text": "def cprint(text, colors={}, options={})\n printf colorize(text, colors, options)\n end", "title": "" }, { "docid": "f224d0e26da8dd60dab242798beedac5", "score": "0.7485433", "text": "def purple(input)\n puts \"\\e[95m#{input}\\e[0m\"\nend", "title": "" }, { "docid": "582812a67fd0bfefb3fb42662f32c414", "score": "0.74642277", "text": "def red(text); \"\\033[31m#{text}\\033[0m\" end", "title": "" }, { "docid": "4cd94e576866033c8bd98cb46207ee13", "score": "0.7458142", "text": "def green(msg)\n \"\\033[0;32m#{msg}\\033[0;37m\"\nend", "title": "" }, { "docid": "4cd94e576866033c8bd98cb46207ee13", "score": "0.7458142", "text": "def green(msg)\n \"\\033[0;32m#{msg}\\033[0;37m\"\nend", "title": "" }, { "docid": "b74fc0417d058708a10f09d19caf86d9", "score": "0.74335027", "text": "def red text; \"\\033[0;31m#{text}\\033[0m\"; end", "title": "" }, { "docid": "77ee36a5867c6948b2e33e5a8f5a9495", "score": "0.74255455", "text": "def black(text) ; \"\\033[30m#{text}\\033[0m\" ; end", "title": "" }, { "docid": "bcd60dfb8a7cfd21ea06c1cb5a561942", "score": "0.74168307", "text": "def yellow(string)\n \"\\033[0;33m#{string}\\e[0m\"\nend", "title": "" }, { "docid": "bcd60dfb8a7cfd21ea06c1cb5a561942", "score": "0.74168307", "text": "def yellow(string)\n \"\\033[0;33m#{string}\\e[0m\"\nend", "title": "" }, { "docid": "bcd60dfb8a7cfd21ea06c1cb5a561942", "score": "0.74168307", "text": "def yellow(string)\n \"\\033[0;33m#{string}\\e[0m\"\nend", "title": "" }, { "docid": "bcd60dfb8a7cfd21ea06c1cb5a561942", "score": "0.74168307", "text": "def yellow(string)\n \"\\033[0;33m#{string}\\e[0m\"\nend", "title": "" }, { "docid": "ad4263215cf425260fbbf7575075e318", "score": "0.7399742", "text": "def red(msg)\n \"\\033[0;31m#{msg}\\033[0;37m\"\nend", "title": "" }, { "docid": "ad4263215cf425260fbbf7575075e318", "score": "0.7399742", "text": "def red(msg)\n \"\\033[0;31m#{msg}\\033[0;37m\"\nend", "title": "" }, { "docid": "24c813163ae5f1b68fd97b585922bc80", "score": "0.73849493", "text": "def blue; colorize(self, \"\\e[1;34m\"); end", "title": "" }, { "docid": "07604b4d37ea73b6ac1c44184542f809", "score": "0.736631", "text": "def print(message, color = :white)\n puts colorize(message, color)\n end", "title": "" }, { "docid": "dd5a7735ad04f4f2ffe3c7fc25e2851e", "score": "0.7365938", "text": "def puts_color( msg, color=nil )\n color_set( color ); puts msg; color_end\n end", "title": "" }, { "docid": "7419b6b84b48ccfa13644c91b7840992", "score": "0.73579085", "text": "def green; colorize(self, \"\\e[1;32m\"); end", "title": "" }, { "docid": "9df788f011b35208ce8334bd63ce0b29", "score": "0.7353596", "text": "def red(string)\n ::Nucleon::Util::Console.red(string)\n end", "title": "" }, { "docid": "19de0f2cb58ee2dc27574a354244311b", "score": "0.7349716", "text": "def puts_blue(string)\n puts strip(string).blue\n end", "title": "" }, { "docid": "2ba28bf4293d9f363a06da98df7afde8", "score": "0.7348932", "text": "def red(str)\n \"\\e[31m#{str}\\e[0m\"\nend", "title": "" }, { "docid": "2ba28bf4293d9f363a06da98df7afde8", "score": "0.7348932", "text": "def red(str)\n \"\\e[31m#{str}\\e[0m\"\nend", "title": "" }, { "docid": "2ba28bf4293d9f363a06da98df7afde8", "score": "0.7348932", "text": "def red(str)\n \"\\e[31m#{str}\\e[0m\"\nend", "title": "" }, { "docid": "2ba28bf4293d9f363a06da98df7afde8", "score": "0.7348932", "text": "def red(str)\n \"\\e[31m#{str}\\e[0m\"\nend", "title": "" }, { "docid": "2ba28bf4293d9f363a06da98df7afde8", "score": "0.7348932", "text": "def red(str)\n \"\\e[31m#{str}\\e[0m\"\nend", "title": "" }, { "docid": "2ba28bf4293d9f363a06da98df7afde8", "score": "0.7348932", "text": "def red(str)\n \"\\e[31m#{str}\\e[0m\"\nend", "title": "" }, { "docid": "2ba28bf4293d9f363a06da98df7afde8", "score": "0.7348932", "text": "def red(str)\n \"\\e[31m#{str}\\e[0m\"\nend", "title": "" }, { "docid": "2ba28bf4293d9f363a06da98df7afde8", "score": "0.7348932", "text": "def red(str)\n \"\\e[31m#{str}\\e[0m\"\nend", "title": "" }, { "docid": "2ba28bf4293d9f363a06da98df7afde8", "score": "0.7348932", "text": "def red(str)\n \"\\e[31m#{str}\\e[0m\"\nend", "title": "" }, { "docid": "f848a9b2a87baf4f09bd6da52b53a863", "score": "0.7346779", "text": "def red(text); colorize(text, \"\\033[31m\"); end", "title": "" }, { "docid": "408581e19285f83d2199f1ca5d2d241f", "score": "0.7335489", "text": "def red(string)\n if $options.color\n \"\\e[1;31m#{string}\\e[0m\"\n else\n string\n end\nend", "title": "" }, { "docid": "ae5aff0cea2989005878cebbd719eaad", "score": "0.7327282", "text": "def red( text ); colorize( text, \"\\e[31m\" ); end", "title": "" }, { "docid": "41b4b9bf2691f61d52eadbeaded6cc93", "score": "0.7322359", "text": "def colorize(str, color)\n colors = {red: 31, green: 32, blue: 34}\n \"\\e[#{colors[color]}m #{str}\\e[0m\"\n end", "title": "" }, { "docid": "dc3cfd0b9f9f4f4595ca842a9b4a2696", "score": "0.73086214", "text": "def colorize(text, color_code); \"#{color_code}#{text}\\033[0m\"; end", "title": "" }, { "docid": "f62fd45188c546d2d1cf436922b32937", "score": "0.730494", "text": "def green(text)\n puts \" #{text.chomp}\".green\n end", "title": "" }, { "docid": "c619019c2c95c86ce92910de5e70b279", "score": "0.7293486", "text": "def blue(string)\n ::Nucleon::Util::Console.blue(string)\n end", "title": "" }, { "docid": "68e453d1e92616b86068ee5e3eddc6da", "score": "0.7289661", "text": "def color_square(font, background, string)\n print \"\\e[#{font};#{background}m#{string}\\e[0m\"\n end", "title": "" }, { "docid": "9f0b1199b1b58be9d2ed4258e5afa8bd", "score": "0.7277013", "text": "def colorize(text, color_code); \"#{color_code}#{text}\\e[0m\"; end", "title": "" }, { "docid": "9f0b1199b1b58be9d2ed4258e5afa8bd", "score": "0.7277013", "text": "def colorize(text, color_code); \"#{color_code}#{text}\\e[0m\"; end", "title": "" }, { "docid": "9f0b1199b1b58be9d2ed4258e5afa8bd", "score": "0.7277013", "text": "def colorize(text, color_code); \"#{color_code}#{text}\\e[0m\"; end", "title": "" }, { "docid": "637ca439dd055635206cae3c9e5759cb", "score": "0.72769654", "text": "def make_color(str, color)\n colors = {:red => 31, :green => 32, :yellow => 33, :blue => 34}\n puts \"\\e[#{colors[color]}m#{str}\\e[0m\" #you can replace str->self, so that you can call this method using: \"String\".make_color(:red)\nend", "title": "" }, { "docid": "b10686039e8be2e0c38f2fdc1e71c2c3", "score": "0.7275235", "text": "def green(text)\n \"\\e[32m#{text}\\e[0m\"\nend", "title": "" }, { "docid": "9de33893b595527e9c6f7dd6ef568274", "score": "0.72612983", "text": "def out(s, c = :green)\n z = {:green => 33, :red => 31}; %{\\e[#{z[c] || c}m#{s}\\e[0m}\n end", "title": "" }, { "docid": "0f6e3ffda01c9f8051cdf725985c8708", "score": "0.72532725", "text": "def colours(text, color_code)\n \"\\e[#{color_code}m#{text}\\e[0m\"\nend", "title": "" }, { "docid": "6a72d5b4c7a20f06b5daa56b5d1c88fe", "score": "0.7229702", "text": "def colorize(text, color = \"default\")\n color_code = COLORS[color]\n \"\\033[#{color_code}m#{text}\\033[0m\"\nend", "title": "" }, { "docid": "b39bed2db942bd1ca3d7836ac880ebc1", "score": "0.7226086", "text": "def color(type=1, color=32)\n printf \"\\033[#{color}m\"\n yield\n printf \"\\033[#{type}m\"\nend", "title": "" }, { "docid": "a5441c65fcf187b3412002ae245deed2", "score": "0.72162247", "text": "def display\n print color + \"|\"\n end", "title": "" }, { "docid": "4a7b7f08a4fd77c63537cc8f0b84b2d9", "score": "0.7212956", "text": "def yellow; colorize(self, \"\\e[1;33m\"); end", "title": "" }, { "docid": "e0ce7727ad8a9456d2c00f801ed216a6", "score": "0.72119194", "text": "def color_string value\n \"\\e[#{value}m\" + self + \"\\e[0m\"\n end", "title": "" }, { "docid": "ae061e6b66b5be740273bab9b86d659b", "score": "0.7199598", "text": "def red(text); colorize(text, 31); end", "title": "" }, { "docid": "0390dcd3395a02e156652391ab159e77", "score": "0.71952903", "text": "def green(string)\n if $options.color\n \"\\e[1;32m#{string}\\e[0m\"\n else\n string\n end\nend", "title": "" }, { "docid": "c9bddbadab64d2a20ef07337c7624fbb", "score": "0.7195256", "text": "def green(text); colorize(text, 32);end", "title": "" }, { "docid": "200488b23460b6eff1c4215703c99555", "score": "0.7191453", "text": "def colorize(string, color_code)\n \"\\e[#{color_code}m#{string}\\e[0m\"\nend", "title": "" }, { "docid": "60eecc90a3c5ed77f9142d224c6417d7", "score": "0.7186192", "text": "def colorize_blue(text)\n \"\\e[34m\" + text + \"\\e[0m\"\nend", "title": "" }, { "docid": "7d6b0a7fed678c98e86363b55cc2460a", "score": "0.71837777", "text": "def colorize(text, color_code) \n\"#{color_code}#{text}\\e[0m\"\nend", "title": "" }, { "docid": "3886180872c0bf666c8bf95a6f4065b4", "score": "0.71826583", "text": "def print_colour(msg, colour, method = :puts)\n colour_id = ANSI_COLORS[colour] || 39\n send(method, \"\\033[0;#{colour_id}m#{path} #{msg}\\033[0m\")\n end", "title": "" }, { "docid": "71899b98cc706cc039c90808d67ee665", "score": "0.7180182", "text": "def colorize_blue(text)\n \"\\e[34m\" + text + \"\\e[0m\" # where did they find these things ?!?\nend", "title": "" }, { "docid": "1a0a59613b1a9806858e4afb98866249", "score": "0.7175953", "text": "def red(input)\n puts \"\\e[31m#{input}\\e[0m\"\nend", "title": "" }, { "docid": "4d9fa45310bff1bb9a63c617b41c6797", "score": "0.7171294", "text": "def cyan(string)\n \"\\033[0;36m#{string}\\033[0m\"\nend", "title": "" }, { "docid": "56cc13db84504675c3d7d9eb781ec7df", "score": "0.7164561", "text": "def color_chart\n [0, 1, 4, 5, 7].each do |attr|\n puts '----------------------------------------------------------------'\n puts \"ESC[#{attr};Foreground;Background\"\n 30.upto(37) do |fg|\n 40.upto(47) do |bg|\n print \"\\033[#{attr};#{fg};#{bg}m #{fg};#{bg} \"\n end\n puts \"\\033[0m\"\n end\n end\n end", "title": "" }, { "docid": "5db6008a44bf1fc211f7ea60bb0e2f33", "score": "0.71578765", "text": "def colored_text1(bg, fg, st)\n esc=\"\\033[\"\n\n \"#{esc}#{fg};#{bg}m#{st}#{esc}0m\"\nend", "title": "" }, { "docid": "7978896879f39b297635fd65c0647bc9", "score": "0.7144019", "text": "def colorize(text, color_code)\n \"\\033[#{color_code}m#{text}\\033[0m\"\nend", "title": "" }, { "docid": "525f6e28b94bf549e8397e3135867108", "score": "0.71352977", "text": "def red(text)\n \"\\e[31m#{text}\\e[0m\"\nend", "title": "" }, { "docid": "7059ce20f04376ab5967c3439a5c0782", "score": "0.7132949", "text": "def color(str, c)\n ENV['NO_COLOR'] ? str : \"\\033[#{c}m#{str}\\033[0m\"\n end", "title": "" }, { "docid": "1501caf931b154680f194a755f57bac9", "score": "0.7132188", "text": "def cyan(text)\n puts \"\\033[0;36;40m#{text}\\033[0m\"\nend", "title": "" }, { "docid": "60c5ac1d2790ce9614981dee9a0ed133", "score": "0.7124686", "text": "def colorize(text, color_code)\n \"\\e[1;#{color_code};40m#{text}\\e[0m\"\nend", "title": "" }, { "docid": "55f9c999d411285819c9d06653c84ec9", "score": "0.71196085", "text": "def green_cell(string)\n # Here is hidden symbol \"\u001b\" before \u001b[32m and \u001b[0m\n \"\u001b[32m #{string} \u001b[0m\"\n end", "title": "" }, { "docid": "7b382d3a3e5c8a48405437ab24f5d9e5", "score": "0.7113488", "text": "def bg_red(str)\n colorize(str, 41)\n end", "title": "" }, { "docid": "3867e19e87d8c018ed7949040199dbef", "score": "0.71066797", "text": "def colour(msg)\n puts msg.colorize(:red)\n end", "title": "" }, { "docid": "dfa10cb53d007978965970a85e616c17", "score": "0.7103046", "text": "def puts(*args)\n Kernel.puts(*self.color(*args))\n end", "title": "" }, { "docid": "997770220c176e83cac796b5ba243d0c", "score": "0.7099923", "text": "def color(message, color)\n raise \"Unknown color #{color.inspect}\" unless [:green, :red, :blue].include?(color)\n return message unless use_color\n constants = {:green => \"\\e[32m\", :red => \"\\e[31m\", :blue => \"\\e[34m\"}\n @java_console.putString(\"#{constants[color]}#{message}\\e[0m\") if @java_console\n \"#{constants[color]}#{message}\\e[0m\"\n end", "title": "" }, { "docid": "5dfdb8e55b40abda3d5dd29c9c7846f9", "score": "0.70972115", "text": "def red(text); colorize(text, 31);end", "title": "" }, { "docid": "c59b767cbe318ca772bae9850237a5b6", "score": "0.7091862", "text": "def color_title(text); \"\\e[1;36;40m#{text}\\e[0m\"; end", "title": "" }, { "docid": "2c08113a11d70a8c3f87a65827fe8b0e", "score": "0.7072668", "text": "def cyan(string)\n \"\\n\\033[0;36m#{string}\\033[0m\"\nend", "title": "" }, { "docid": "7a34582d4301bb013d8c7811a4c00993", "score": "0.7064503", "text": "def colors\n 0.upto(100) do |code|\n pcc \"Text with code #{code}\", code\n end\n end", "title": "" }, { "docid": "966d65639c3350070b99c19d34563db7", "score": "0.70522755", "text": "def green(string)\n ::Nucleon::Util::Console.green(string)\n end", "title": "" }, { "docid": "5023319dce302a0c8eacd1532159a6ff", "score": "0.70522094", "text": "def puts_with_color(color, msg) \n begin\n puts msg.colorize(color.to_sym)\n rescue ColorizeError => e\n raise LightBoxClient::LbcError.new(\"Print colorized message with exception #{e}\")\n end\n end", "title": "" }, { "docid": "104d8ffb7bb4230c6c7f348d867f2bb3", "score": "0.7045854", "text": "def status(message)\n puts \"\\e[0;1;32m#{message}\\e[0m\"\nend", "title": "" }, { "docid": "d003235db82e496d0e5d083b61563a2f", "score": "0.7045229", "text": "def colorize(string:, color:, bkgrnd: 'default', bold: 0)\n text = txt_color(color)\n background = bg_color(bkgrnd)\n \"\\033[#{bold};#{background};#{text}m#{string}\\33[0m\"\nend", "title": "" }, { "docid": "d31acbe59de18a6ed4d4eee7a63df4a6", "score": "0.70241475", "text": "def status(string, *arguments)\n puts(colorize(color, sprintf(string, *arguments)))\n end", "title": "" } ]
a9a636a099e6ef24c3a7679282a81cfa
Validate that the date is not earlier than the previous trip
[ { "docid": "157e4dfce0ffd4e2d6ea5ba375dd77a5", "score": "0.8397991", "text": "def later_than_last_trip\n # don't run this validation if other validations have failed\n return unless errors.blank?\n unless self.first_trip?\n if last_trip.date > date\n errors.add(:date, \"Date cannot be earlier than date of previous trip\")\n end\n end\n end", "title": "" } ]
[ { "docid": "0e2f39c0b921d80acca4cb9ec45bc553", "score": "0.7292052", "text": "def pickup_date_time_cannot_be_past\n arrival_date_time = (date.to_s + \" \" + arrival_time.to_s).to_datetime\n if pickup_time.present? && pickup_time.strftime('%Y%m%dT%H%M') < arrival_date_time.strftime('%Y%m%dT%H%M')\n errors.add(:pickup_time, \"can't be before arrival time\")\n end\n\n end", "title": "" }, { "docid": "f9191610561374297837429f085e7137", "score": "0.72493047", "text": "def datetime_cannot_be_before_now\n true if trip_datetime.count(nil) == 2\n if trip_datetime[0] < Date.today\n errors.add(:outbound_trip_date, TranslationEngine.translate_text(:trips_cannot_be_entered_for_days))\n false\n end\n if trip_datetime[0] < Time.current\n errors.add(:outbound_trip_time, TranslationEngine.translate_text(:trips_cannot_be_entered_for_times))\n false\n end\n if is_round_trip == 1\n if trip_datetime[1] < Date.today\n errors.add(:return_trip_date, TranslationEngine.translate_text(:trips_cannot_be_entered_for_days))\n false\n end\n if trip_datetime[1] < Time.current\n errors.add(:return_trip_time, TranslationEngine.translate_text(:trips_cannot_be_entered_for_times))\n false\n end\n end\n true\n end", "title": "" }, { "docid": "3b7b894c3bb3f804ce7bf94137d2abff", "score": "0.7218433", "text": "def verify_reservation_is_in_future\n unless Date.today < date\n self.errors[:date] << 'must be in future. No time travel allowed!'\n end\n end", "title": "" }, { "docid": "d77af128c813b804c8b45fe46c62cf46", "score": "0.71402764", "text": "def datetime_cannot_be_before_now\n return true if trip_datetime.nil?\n if trip_datetime < Date.today\n errors.add(:trip_date, I18n.translate(:trips_cannot_be_entered_for_days))\n return false\n elsif trip_datetime < Time.current\n errors.add(:trip_time, I18n.translate(:trips_cannot_be_entered_for_times))\n return false\n end\n true\n end", "title": "" }, { "docid": "4fc43a5069081307b5eb41185e917a72", "score": "0.7116412", "text": "def arrival_date_cannot_be_in_the_future\n errors.add(:arrival_date, \"can't be in the future\") if arrival_date > Date.today\n end", "title": "" }, { "docid": "8b57b564cac957ba10f620e4b5f5a1e1", "score": "0.70944226", "text": "def consistent_dates\n if checkout && checkin && checkout <= checkin\n errors.add(:checkout, \"must be later than checkin\")\n end\n end", "title": "" }, { "docid": "4ba17d27a3df403c661d1e09db04e7bc", "score": "0.70700735", "text": "def reasonable_timeframe\n if valid_from > valid_through\n errors.add(:valid_through, \"date must be later than 'valid from' date\")\n end\n end", "title": "" }, { "docid": "c2575c6716de22ebb5b520d2bd84a0b0", "score": "0.70284015", "text": "def datecheck\n if date.present? && date < Date.current\n errors.add(:date, \"must be in the future\")\n end\n end", "title": "" }, { "docid": "c140a4a1a168b4daf9df05fa6a2fda9d", "score": "0.70271176", "text": "def valid_date\n validation = date.to_time\n if validation.past?\n errors.add(:restaurant_id, 'Reservation MUST be an Upcoming Date')\n else\n return true\n end\n end", "title": "" }, { "docid": "ea712624264d03167e0c57df6b988afd", "score": "0.6983432", "text": "def tour_date_cannot_be_today\n if tour_date.present? &&\n (tour_date < (DateTime.current.beginning_of_day + 1.day).change(hour: 0))\n\n errors.add(:tour_date, \"tours cannot be booked for same day appointments\")\n end\n end", "title": "" }, { "docid": "2469f531ac079d689d529a95c0cf61f5", "score": "0.6890905", "text": "def start_date_cannot_be_in_the_past\n if self.start_date && self.start_date < DateTime.now\n errors.add(:date, \"invalid. Start date can't be in the past\")\n end\n end", "title": "" }, { "docid": "01e8028342a54cc1172e105fc7712aa0", "score": "0.6886059", "text": "def date_cannot_be_in_the_past\n if self.start < Date.today\n self.errors[:base] << \"Cannot choose a date in the past\"\n end\n if self.start >= self.end\n self.errors[:base] << \"Dates not chronological\"\n end\n end", "title": "" }, { "docid": "aee0a408f797e9d17e4846c317b2da17", "score": "0.68653846", "text": "def checkout_is_later_than_checkin\n if (checkout && checkin) && (checkout <= checkin)\n errors.add(:guest_id, \"Sorry: checkout date needs to be later than checkin date\")\n end\n end", "title": "" }, { "docid": "e526d4aff6c7af9d077a0bdec00e6701", "score": "0.68202245", "text": "def arrive_on_is_greather_or_equal_than_today?\n if self.arrive_on < Time.now.to_date \n # error\n errors.add(:arrive_on,'should not be in the past')\n end\n end", "title": "" }, { "docid": "cfee018f9f78b9bc80a7a06eccc00ebc", "score": "0.6815015", "text": "def in_the_past?\n if self.date < Date.today\n errors.add(:date, \"of reservation cannot be in the past.\")\n end\n end", "title": "" }, { "docid": "485b7b99bce71557e8dda794a29a2db5", "score": "0.6813034", "text": "def date_cannot_be_in_the_past\n if self.date < Date.today\n self.errors[:base] << \"Cannot choose a date in the past\"\n end\n end", "title": "" }, { "docid": "a094af4845ee8709e116a05f1950af82", "score": "0.67911214", "text": "def time_must_be_pressent_and_in_future\n if self.date.present? && self.date < Time.now\n errors.add(:date, 'needs to be in the future')\n end\n end", "title": "" }, { "docid": "415fc4b81f9dde043d3fabfeed99777a", "score": "0.6774682", "text": "def validate_date\n validate_presence(:date, :blank)\n if @record.earliest_date_before_reporder\n validate_on_or_after(@record.earliest_date_before_reporder - 2.years, :date, :too_long_before_earliest_reporder)\n end\n validate_on_or_after(Settings.earliest_permitted_date, :date, :not_before_earliest_permitted_date)\n validate_not_in_future(:date)\n end", "title": "" }, { "docid": "176fddca3bf64f6f9cc2b63e1d97935e", "score": "0.6708463", "text": "def validate_checkout_date\n checkin = Date.parse(checkin_date.to_s)\n checkout = Date.parse(checkout_date.to_s)\n puts \"is date #{checkout} before #{checkin}\"\n errors.add(:checkout_date, \"can't be before checkin date\") if checkout < checkin\n end", "title": "" }, { "docid": "5c1cd559b915ac31db75fd27c0698436", "score": "0.6699029", "text": "def check_date\n if date < Date.today\n errors.add(:booking, \"Can't book a date in the past\")\n end\n end", "title": "" }, { "docid": "e1a9e80928fe06e49274f59eb58bf483", "score": "0.66822565", "text": "def start_date_cannot_be_in_the_past\n\n if start_date.present? && start_date < Date.today\n\n errors.add(:start_date, \"L'évènement ne peut pas être créer dans le passé.\")\n\n end\n\n end", "title": "" }, { "docid": "55035147ae4b5a109f9660e922f2b3b7", "score": "0.6681875", "text": "def stop_date_is_not_before_start_date\n errors.add(:stop_date_time, 'must come after start time') if (start_date_time && stop_date_time && (start_date_time > stop_date_time))\n end", "title": "" }, { "docid": "2c7784f6d85d9b854154fc10618c62c3", "score": "0.6681835", "text": "def start_time_cannot_be_less_than_past\n if start_time.present? && start_time.to_date < Date.today\n errors.add(:start_time, 'should not be past date')\n end\n end", "title": "" }, { "docid": "294cab54b27947d4d657f5278effe415", "score": "0.6679535", "text": "def start_date_cannot_be_in_the_past #Hier wird die Methode/Bedingung für die Validation festgelegt\n \terrors.add(:start_date, \"Projektstart muss in der Zukunft liegen\") if !start_date.blank? && start_date < Date.today\n\tend", "title": "" }, { "docid": "39cb6cd948e85581ba9dcbb46708d900", "score": "0.66794944", "text": "def date_cannot_be_in_the_past\n if date.present? && date < Date.today\n errors.add(:date, \"can't be in the past\")\n end\n end", "title": "" }, { "docid": "39cb6cd948e85581ba9dcbb46708d900", "score": "0.66794944", "text": "def date_cannot_be_in_the_past\n if date.present? && date < Date.today\n errors.add(:date, \"can't be in the past\")\n end\n end", "title": "" }, { "docid": "b5db07934f5d6f7d2918ac8160842174", "score": "0.6676373", "text": "def date_order_validation\n if self[:ends_at] && self[:starts_at]\n if self[:ends_at] < self[:starts_at]\n errors[:ends_at] << \"should be after start date\"\n return false\n end\n end\n end", "title": "" }, { "docid": "b5db07934f5d6f7d2918ac8160842174", "score": "0.6676373", "text": "def date_order_validation\n if self[:ends_at] && self[:starts_at]\n if self[:ends_at] < self[:starts_at]\n errors[:ends_at] << \"should be after start date\"\n return false\n end\n end\n end", "title": "" }, { "docid": "41c53cd47f7e0f4befbb015b19141064", "score": "0.66571933", "text": "def start_date_cannot_be_in_the_past\n errors.add(:start_date, \"L'evenetment est deja passe \") if\n !start_date.blank? and start_date < Date.today\nend", "title": "" }, { "docid": "9ee602ea24aae76837e3e3e85dfaf26c", "score": "0.66530347", "text": "def start_date_cannot_be_in_the_past\n if start_date.present? && start_date < Date.today\n errors.add(:start_date, \"L'évènement ne peut pas être créer dans le passé.\")\n end\n end", "title": "" }, { "docid": "681d50b1726602b661a14c9cfdb9e906", "score": "0.6636189", "text": "def start_date_cannot_be_in_the_past\n if start_date < Date.today\n errors.add(:expiration_date, \"You cannot go back in time\")\n end\n end", "title": "" }, { "docid": "c86699f1be5076b4adae4cff06be37ef", "score": "0.6626795", "text": "def not_past_date\n if self.date && self.date < Date.today\n errors.add(:date, 'can not be in the past')\n end\n end", "title": "" }, { "docid": "6768c1109b64333c0785b9ab95fe84ee", "score": "0.66235834", "text": "def transfer_date_cannot_be_in_the_past\n if !transfer_date.blank? and transfer_date < Date.today\n errors.add(:transfer_date, \"can't be in the past\")\n end\n end", "title": "" }, { "docid": "29925ea39fe68e77589eb85ef008f0f4", "score": "0.66234493", "text": "def start_date_cannot_be_in_the_past\n errors.add(:start_date, 'cannot be in the past') if\n start_date < Time.zone.today\n end", "title": "" }, { "docid": "29925ea39fe68e77589eb85ef008f0f4", "score": "0.66234493", "text": "def start_date_cannot_be_in_the_past\n errors.add(:start_date, 'cannot be in the past') if\n start_date < Time.zone.today\n end", "title": "" }, { "docid": "72af53560011a4bef670198653f28b12", "score": "0.6600422", "text": "def start_date_must_be_later_than_date_of_creation\n if start_date < Date.today\n errors.add(:start_date, \"start date must be later than date of creation\")\n end\n end", "title": "" }, { "docid": "a19dfc72c88cdba6d752106a208846db", "score": "0.6598545", "text": "def date_cannot_be_in_the_past\n if date && date < Date.today\n errors.add :date, \"can't be set in the past\"\n end\n end", "title": "" }, { "docid": "7720ae5fe31965ac9d51964abfb1965c", "score": "0.65799564", "text": "def is_in_the_future\n if self.date && self.date < Time.now\n errors.add(:date, \"can't be in the past\")\n end\n end", "title": "" }, { "docid": "cc8a487c039db73239c39adc2ecd4e23", "score": "0.65710664", "text": "def order_date_cannot_be_in_the_past\n if order_date && order_date < Date.today\n errors.add(:order_date, \"can't be in the past\")\n end\n end", "title": "" }, { "docid": "fd188ea7a9abfbb6313c274431649544", "score": "0.65466404", "text": "def check_date\n if start_at.present? && end_at.present?\n errors.add(:start_at, \"must be less then end date\") if self.start_at > self.end_at\n end\n end", "title": "" }, { "docid": "ef8602e86ccec726dea8208b943a68db", "score": "0.65330887", "text": "def dr_note_date_cannot_be_in_the_future\n\t\tif dr_note_date.present? && dr_note_date > Date.today\n\t\t\terrors.add(:dr_note_date, \"Can't be in the future!\")\n\t\tend\n\tend", "title": "" }, { "docid": "be7e41921dbf2e340b5e3d7eac1a4c3e", "score": "0.65293574", "text": "def start_date_cannot_be_in_the_past\n if !start.blank? and start < Time.now\n errors.add(:start, \"Start Time can't be in the past\")\n end\n end", "title": "" }, { "docid": "d5ff0038d1bb335253e8cb6df6bc446b", "score": "0.6519752", "text": "def validate_follow_up_date\n self.errors.add(:follow_up,:follow_up_date) if self.created_at && self.follow_up && self.follow_up.to_date < self.created_at.to_date\n self.errors.add(:follow_up,:follow_up_date)if !self.id && self[:follow_up].present? && self[:follow_up].to_date < Time.zone.now.to_date\n\n end", "title": "" }, { "docid": "4166d4b2d71295e14a9ca3aec402c5c1", "score": "0.6516368", "text": "def date_is_possible? #cant create an event that already happened\n return if date.blank?\n if date < Time.zone.today\n errors.add(:date, 'must be possible (not in the past)')\n end\n end", "title": "" }, { "docid": "ab29145f03ecba48d66f500b97bc05df", "score": "0.65154713", "text": "def validate_return_trip_time\n if return_trip_datetime && (return_trip_datetime <= outbound_trip_datetime)\n errors.add(:return_trip_time, TranslationEngine.translate_text(:return_trip_time_before_start))\n end\n end", "title": "" }, { "docid": "8c01f38ab6244abb8c6cec46b78cfbae", "score": "0.6512435", "text": "def validate_available_dates\n trip = self.user.trips.in_dates(self.date_from, self.date_to, self.id)\n errors.add(:base, trip.days_busy) if trip\n end", "title": "" }, { "docid": "bfb66e2b421e20e861d6bf0493370091", "score": "0.65059996", "text": "def must_be_future_date\n \tif date.present? && date <= Date.today\n \t\terrors.add(:date, \"must be in the future\")\n \tend\n end", "title": "" }, { "docid": "771851aab4849c2798b1283c86537d93", "score": "0.65058184", "text": "def date_cannot_be_in_past\n if start_date.present? && start_date < Date.today\n errors.add(:start_date, \"can't be in past\")\n end\n\n if end_date.present? && end_date < Date.today\n errors.add(:end_date, \"can't be in past\")\n end\n\n if due_date.present? && due_date < Date.today\n errors.add(:due_date, \"can't be in past\")\n end\n end", "title": "" }, { "docid": "d540582d8fc2b0ef3d8d0bc60bbfbac5", "score": "0.65013874", "text": "def checkin_before_checkout\n if self.checkin && self.checkout && self.checkin >= self.checkout\n errors.add(:guest, \"Your checkin date must be before your checkout date\")\n end\n end", "title": "" }, { "docid": "d7e8cb781bb2ff2da49c6ad403011116", "score": "0.6495952", "text": "def check_dates\n if start_date.present? && start_date < Date.today\n errors.add(:check_in_date, message:\"This date can't be in the past!\")\n end\n end", "title": "" }, { "docid": "4d9f9eec4480162d152efa3f05b5be55", "score": "0.6488929", "text": "def validate\n errors.add(\"departure before arrival \") if self.end_date < self.start_date\n #errors.add(\"first booking date is the first of July\" if self.end_date ==)\n end", "title": "" }, { "docid": "fe999ba0280e3365a3b8dceea39ab0b4", "score": "0.6482299", "text": "def start_date_cannot_be_in_the_past\n errors.add(:start, \" måste vara ett framtida datum\") if\n !self.start.blank? and self.start.past?\n end", "title": "" }, { "docid": "cf1b688cb2306569611ab7ab0fe3e1a7", "score": "0.6469967", "text": "def check_dates\n if self.start.present? && self.start < Date.today\n errors.add(:start, \"can not be in the past\")\n end\n if self.stop.present? && self.stop < self.start\n errors.add(:stop, \"can not be before end date\")\n end\n end", "title": "" }, { "docid": "2ac5ec56bf0e4d50d55e4c5cee73ad09", "score": "0.64538306", "text": "def check_correct_date\n false if starts_at > ends_at\n end", "title": "" }, { "docid": "316781feb09f95e676403571077cce85", "score": "0.64510626", "text": "def good_date\n # Unless if similar to \"if/not\". This statement says if this comparison is false then add this message to error array\n if date\n errors.add(:date, \"Event can't be scheduled for the past\") unless self.date >= Date.today\n else\n errors.add(:date,) unless self.date != nil\n end\n\n end", "title": "" }, { "docid": "b065a23fb2cf0cc9f2f248bedc5a2050", "score": "0.64483494", "text": "def check_dates\n\t\tif self.start_date > self.end_date \n\t\t\terrors.add(:date_error, \"Start date must be before end date\")\n\t\t\t# p Reservation.errors.messages\n\t\tend\n\tend", "title": "" }, { "docid": "aabdeb16a38a1ba64221ed931880c519", "score": "0.6437239", "text": "def start_date_cant_be_in_the_past\n if start_date.present? && start_date < DateTime.now\n return \"L'évènement ne peut pas être créé dans le passé. Veuillez réessayer\"\n end\n end", "title": "" }, { "docid": "ec004fe1fc4b5b5941c54546625cef56", "score": "0.6436033", "text": "def offerstartdate_cannot_be_in_the_past\n\t\terrors.add(:offerstartdate, \"Offer Start Date cannot be less than Todays date :( ! \") if offerstartdate < Date.today\n\tend", "title": "" }, { "docid": "310077ff67fb22a5b3a04dab044736b4", "score": "0.6435612", "text": "def event_date_cannot_be_in_past\n\t \tif !startDate.blank? and startDate < Date.today\n\t errors.add(:startDate, \"can't be in the past\")\n\t end\n end", "title": "" }, { "docid": "6832147290f1d9cd3a61c3da028a3a0e", "score": "0.6432441", "text": "def check_in_cannot_be_in_the_past\n if check_in.present? && check_in < Date.today\n errors.add(:check_in, \"can't be in the past\")\n end\n end", "title": "" }, { "docid": "f638eb64f402ef89e83c75a0c144745e", "score": "0.64215946", "text": "def date_obtained_no_future\n if date_obtained.present? && date_obtained > Date.today\n errors.add(:date_obtained, \"can't be in the future\")\n end\n end", "title": "" }, { "docid": "f3519740ac66f0802ded53b9af45d43f", "score": "0.6419082", "text": "def must_be_taken_before?\n return true if @take_before.include? @date.wday\n return false\n end", "title": "" }, { "docid": "8f42f390f52ff80884f1104b834c158e", "score": "0.6418883", "text": "def is_already_invalid?(date)\n\t\t\t\t\treturn !self.valid_to.nil? && self.valid_to <= date\n\t\t\t\tend", "title": "" }, { "docid": "8f42f390f52ff80884f1104b834c158e", "score": "0.6418883", "text": "def is_already_invalid?(date)\n\t\t\t\t\treturn !self.valid_to.nil? && self.valid_to <= date\n\t\t\t\tend", "title": "" }, { "docid": "a79ecb6afe672e2354220a2562100831", "score": "0.6408706", "text": "def start_date_cannot_be_in_the_future\n return unless start_date > Time.now\n\n errors.add(:start_date, ' cannot be in the future')\n end", "title": "" }, { "docid": "6e01c5946c006b0bc827130b0e0acebd", "score": "0.64082456", "text": "def date_validation\n if check_out_on.present? && check_in_on.present? && check_out_on < check_in_on\n errors.add(:check_out_on, \"can't be before check-in\")\n end\n end", "title": "" }, { "docid": "a74c02dcf5f1b48fc138c24655426b12", "score": "0.6407446", "text": "def date_is_in_future\n \tif date < Date.today\n \t\terrors.add(:date_error, \"Time slot must be in the future.\")\n \tend\n end", "title": "" }, { "docid": "b7308f8dabb7a2e88056823b75924cdc", "score": "0.64050347", "text": "def date_cannot_be_in_the_past\n if lesson_date.present?\n # if lesson_date.present? && lesson_date < Date.today\n # errors.add(:lesson_date, \": 過去の日付は使用できません\")\n # end\n end\n end", "title": "" }, { "docid": "354258bbca96212f743bae2526a22df3", "score": "0.6399382", "text": "def date_time_cannot_be_in_the_past\n if date_time < DateTime.now\n errors.add(:date_time, \"can't be in the past\")\n end\nend", "title": "" }, { "docid": "0ddd584f9953fbea2f4255ebaf38da8e", "score": "0.6397217", "text": "def is_yet_invalid?(date)\n\t\t\t\t\treturn !self.valid_from.nil? && self.valid_from > date\n\t\t\t\tend", "title": "" }, { "docid": "0ddd584f9953fbea2f4255ebaf38da8e", "score": "0.6397217", "text": "def is_yet_invalid?(date)\n\t\t\t\t\treturn !self.valid_from.nil? && self.valid_from > date\n\t\t\t\tend", "title": "" }, { "docid": "ad52033b1bcb24883f614ffef370ab77", "score": "0.639664", "text": "def from_date_cannot_be_in_the_past?(date)\n date <= Date.today ? true : false\n end", "title": "" }, { "docid": "f2744210b64adaaa35cb01626dbaef2d", "score": "0.6393831", "text": "def start_date_cannot_be_in_the_past\n errors.add(:start_date, \"can't be in the past\") if\n !start_date.blank? and start_date < Date.today\nend", "title": "" }, { "docid": "277b587b7fa2cbfb31ee9dc531a4587c", "score": "0.63752085", "text": "def start_date_is_before_end_date\n return if self.dtstart.nil? or self.dtend.nil? # This should be caught by another validation\n errors.add(:dtend, \"date/time can't be before start date/time\") unless self.dtstart <= self.dtend\n end", "title": "" }, { "docid": "98287742d030458b346cb1eecff830bf", "score": "0.63713366", "text": "def validate\n self.start_time < self.end_time\n self.date.class == Date\n end", "title": "" }, { "docid": "18feced401135ebd834e20f4d33e6a06", "score": "0.6366112", "text": "def event_date_is_valid\n if date_of_event < DateTime.now\n errors.add(:date_of_event, \": Uuum! Unfortunately you cannot create an event in the past.. This isn't back to the future. Please select a date that is still to come.\")\n end\n end", "title": "" }, { "docid": "2e1b012aaad4a2ed30a57627252a7fcc", "score": "0.636577", "text": "def validate_current_date\n\t\tif self.date\n\t\t\tif self.date < Date.today\n\t\t\t\terrors.add(:date, \"cannot be set before today's date.\")\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "ff47f1ace7bbf6bb7dd5cd386aa61222", "score": "0.6348637", "text": "def appointment_date_cannot_be_in_the_past\n if appt_day.present? && appt_day < Date.today\n errors.add(:appointment, \"appointment cannot be in the past\")\n end\n end", "title": "" }, { "docid": "53304d90d4aff12482b9d2000d5840c7", "score": "0.63397557", "text": "def valid_dates\n purchase_order = PurchaseOrder.find(purchase_order_id)\n current_date= Date.today\n if self.on_date.present? \n self.errors.add :on_date, \"Invoice date can't be future\" if self.on_date > current_date\n self.errors.add :on_date, \"Invoice date should be onwards #{purchase_order.on_date}\" if self.on_date < purchase_order.on_date\n end\n end", "title": "" }, { "docid": "bf39365f55bdf6ce2dfe6b4cdb4d800b", "score": "0.6337528", "text": "def date_checker_not_past_start\n\t\t\treturn if start_date.nil?\n\n\t\t\tif (self.start_date.to_date >= Time.now.to_date)\n\t\t\t\treturn true\n\t\t\telse \n\t\t\t\terrors.add(:start_date, \"start_date or end_date is in the past\")\n\t\t\t\treturn false \n\t\t\tend\n\t\tend", "title": "" }, { "docid": "9a52b61bce636fa7d154e83c4e04d74e", "score": "0.6329961", "text": "def is_race_date_valid?\n\t\terrors.add(:race_date, \"can't be in the past\") if\n\t self.race_date < Date.today\n\tend", "title": "" }, { "docid": "ec236bf7d3f7e654550a685dd47bf28d", "score": "0.6322232", "text": "def has_valid_date?\n if self.date\n self.date < Time.now.advance(days: 1) ? false : true\n end\n end", "title": "" }, { "docid": "d7052e71221141918808797068003341", "score": "0.6320864", "text": "def cannot_change_the_past\n\tif start_date.present? && start_date < Date.today\n\t\terrors.add(:start_date, \"You can't change the past\")\n\tend\nend", "title": "" }, { "docid": "8c52e233750d147ca960a7106919099c", "score": "0.6319319", "text": "def already_invalid(date)\n\t\t\t\t\t\twhere(\"valid_to <= :date\", date: date)\n\t\t\t\t\tend", "title": "" }, { "docid": "8c52e233750d147ca960a7106919099c", "score": "0.6319319", "text": "def already_invalid(date)\n\t\t\t\t\t\twhere(\"valid_to <= :date\", date: date)\n\t\t\t\t\tend", "title": "" }, { "docid": "8ee8114b4347cdc892680c1437d3e3d9", "score": "0.6305491", "text": "def validate_retrial_started_at\n validate_on_or_after(@record.trial_concluded_at, :retrial_started_at, :check_not_earlier_than_trial_concluded)\n validate_retrial_start_and_end(:retrial_started_at, :retrial_concluded_at, inverse: false)\n end", "title": "" }, { "docid": "842ed9f2c8bc0e4a172c20aad12b5969", "score": "0.6292411", "text": "def end_date_cannot_be_less_than_start_date\n if end_date.present? && end_date < start_date\n errors.add(:end_date, \"can't be less than start date\")\n end\n end", "title": "" }, { "docid": "033779079dcfafdb3137dbc05e50fbb6", "score": "0.62880284", "text": "def in_trip?\n start_date.to_date <= Date.today && end_date.to_date >= Date.today\n end", "title": "" }, { "docid": "c21e08ffa6d1aa646d0db39c7d7d3eb0", "score": "0.6275108", "text": "def end_date_not_before_start_date\n\t\tif start_date\n\t\t\tif start_date > end_date\n\t errors.add(:end_date, \"End date cannot be before Start Date\")\n\t \t\tend\n\t \tend\n \tend", "title": "" }, { "docid": "d687fa015e8cbfa7a3df1f1eab6ba270", "score": "0.627117", "text": "def end_date_must_not_be_less_than_start_date\n if self.start_date.present? && self.end_date.present?\n errors.add(:end_date, \"can't be before the start date\") if self.end_date < self.start_date\n end\n end", "title": "" }, { "docid": "4231d788f02caa591bcabd4e97eed33e", "score": "0.6267464", "text": "def must_be_in_the_past\n\n unless observed_on.nil? || observed_on <= Date.today\n errors.add(:observed_on, \"can't be in the future\")\n end\n true\n end", "title": "" }, { "docid": "69f24cc2d103668fa6eca1f97fc501e3", "score": "0.62631315", "text": "def start_date_cannot_be_in_the_past\n if start_time && start_time < DateTime.now + (15.minutes)\n errors.add(:start_time, 'Booking must start at least 15 minutes from present time')\n end\n end", "title": "" }, { "docid": "1425d2bfb86bae79845ff7566a17c4e5", "score": "0.6262372", "text": "def validate_checkin_date\n checkin = Date.parse(checkin_date.to_s)\n checkout = Date.parse(checkout_date.to_s)\n puts \"is date #{checkin} after #{checkout}\"\n errors.add(:checkin_date, \"can't be after checkout date\") if checkin > checkout\n end", "title": "" }, { "docid": "5457754d70a1a949bfbfd14d9013f49f", "score": "0.62599087", "text": "def yet_invalid(date)\n\t\t\t\t\t\twhere(\"valid_from > :date\", date: date)\n\t\t\t\t\tend", "title": "" }, { "docid": "5457754d70a1a949bfbfd14d9013f49f", "score": "0.62599087", "text": "def yet_invalid(date)\n\t\t\t\t\t\twhere(\"valid_from > :date\", date: date)\n\t\t\t\t\tend", "title": "" }, { "docid": "74c94f39d92ca0a3ab67e758012e7400", "score": "0.6258957", "text": "def valid_deletion\n if Date.current + 7 >= self.start_date\n errors.add(:status, \"cannot cancel a reservation 7 days prior to start date\")\n return false\n end\n end", "title": "" }, { "docid": "58587eaa94eec6f34e2d0a200026879d", "score": "0.6258113", "text": "def validate_on_date\n quotation = Quotation.find(self.quotation_id)\n current_date = Date.today\n if self.on_date.present?\n self.errors.add :on_date, \"Purchase order date can't be future\" if self.on_date > current_date\n self.errors.add :on_date, \"Purchase order date should be onwards #{quotation.on_date}\" if self.on_date < quotation.on_date\n end\n end", "title": "" }, { "docid": "fd46a081d0be8425350c87cbe23a6a32", "score": "0.62511283", "text": "def valid_dates\n\n if resign_date.present? && resign_date < join_date\n self.errors.add :resign_date, 'Resign Date must be after join date'\n end\n end", "title": "" }, { "docid": "0a7f85180f2ff500e91e176cf659fa73", "score": "0.62465596", "text": "def posting_date_should_be_in_past\n if posting_date > Date.today\n error.add(:posting_date, \"must be in past\")\n end\n end", "title": "" }, { "docid": "160f9743f08c9550b9f503c05d0fba32", "score": "0.62367725", "text": "def valid_get_check_in_date\n return if check_in_date.nil?\n if !check_in_date.is_a?(Date) || (check_in_date.future? ||\n (!created_at.nil? && check_in_date < get_check_out_date) ||\n check_in_date < customer.registered_at ||\n check_in_date < movie.release_date )\n errors.add(:check_in_date, \"Invalid check-in\")\n end\n end", "title": "" } ]
cfacd9b07915755ba85559a2781a85c3
Return a DATE_TIME value representing the last second of the month containing the receiver
[ { "docid": "399ff0737d2ed7e8956ec32f103604bc", "score": "0.59262097", "text": "def end_of_month\n change(:day => days_in_month, :hour => 23, :min => 59, :sec => 59)\n end", "title": "" } ]
[ { "docid": "fbf683081eccd94969e3f7e6bf718185", "score": "0.7052748", "text": "def end_of_last_month\n now= Time.now\n dd= Date.new now.year, now.month\n dd-1\n end", "title": "" }, { "docid": "39c0371ca48fb81a96682d849269bced", "score": "0.6826726", "text": "def last_month; end", "title": "" }, { "docid": "39c0371ca48fb81a96682d849269bced", "score": "0.6826726", "text": "def last_month; end", "title": "" }, { "docid": "791625914be182431e18c44f4cc5b294", "score": "0.67443544", "text": "def last_day\n first_of_next_month = first_day + 32\n Date.new(first_of_next_month.year, first_of_next_month.month, 1) - 1 # back off one day from first of that month\n end", "title": "" }, { "docid": "bacdd2a0088fe2a8f1ca0f7491b95077", "score": "0.66199833", "text": "def last_month_trade_day\n self.last_trade_day.months_ago(1)\n end", "title": "" }, { "docid": "df5b716f3bb97611068de979c633a642", "score": "0.6564709", "text": "def last_day_of_month\n if leap? && february?\n 29\n else\n MONTH_WITH_DAY[MONTH_WITH_SEQUENCE.key(month)]\n end\n end", "title": "" }, { "docid": "234c0070a3ff80c33f846306e2f349e5", "score": "0.65602446", "text": "def end_of_month\r\n last_day = ::Time.days_in_month( self.month, self.year )\r\n self.acts_like?(:time) ? change(:day => last_day, :hour => 23, :min => 59, :sec => 59) : change(:day => last_day)\r\n end", "title": "" }, { "docid": "a4f4a8475420ec3a9b23eaa12f2cd8e7", "score": "0.6517426", "text": "def end_of_this_month\n end_of_month( today )\n end", "title": "" }, { "docid": "fd9edad57875b5efbfdc0aa199ecd366", "score": "0.64988285", "text": "def end_of_bimonth\n if month.odd?\n (self + 1.month).end_of_month\n else\n end_of_month\n end\n end", "title": "" }, { "docid": "9d5ff047af8df0b96395cf7654aba856", "score": "0.64779943", "text": "def get_end_date\n if ((!self.end_pay) || (self.end_pay == 0))\n return Time.at(MyDate::MAX_DATE)\n else\n return Time.at(self.end_pay)\n end\n end", "title": "" }, { "docid": "97c1997199defc4682c806a39822010d", "score": "0.6477538", "text": "def end_of_month\n last_day = ::Time.days_in_month(month, year)\n last_hour(days_since(last_day - day))\n end", "title": "" }, { "docid": "92b7037a7466c74eb275e777d58b9946", "score": "0.6463653", "text": "def end_of_last_month\n end_of_this_month << 1\n end", "title": "" }, { "docid": "226c5916873f06a307a51decf11c0bb2", "score": "0.6391643", "text": "def second_to_last; end", "title": "" }, { "docid": "ffc4d101f7c52fd2e095289eafa4f282", "score": "0.63776445", "text": "def end_of_month\n return self.end_of_day.delta(days:days_in_month - day)\n end", "title": "" }, { "docid": "ffc4d101f7c52fd2e095289eafa4f282", "score": "0.63776445", "text": "def end_of_month\n return self.end_of_day.delta(days:days_in_month - day)\n end", "title": "" }, { "docid": "cf1c55253b759bc04e1f737e4bb6bc31", "score": "0.6332831", "text": "def ending_of_month\n self.class.new(year, month, last_day_of_month)\n end", "title": "" }, { "docid": "55b9319ad39c7d5f6ee65302f2931589", "score": "0.6332591", "text": "def last_month\n months = [\"JAN\",\"FEB\",\"MAR\",\"APR\",\"MAY\",\"JUN\",\"JUL\",\"AUG\",\"SEP\",\"OCT\",\"NOV\",\"DEC\"]\n index = months.index(current_month)\n return months[index-1]\n end", "title": "" }, { "docid": "f72b0d68d54d4ecf4467dc120005f54b", "score": "0.63221234", "text": "def end_of_month( y, m )\n Date.new( y, m, 1 ).next_month.prev_day\n # ( Date.new( y, m , 1 ) - 1 ) >> 1\n end", "title": "" }, { "docid": "112810876ff9bdfec15f318adf5dada8", "score": "0.631651", "text": "def end_of_month\n @date.end_of_month\n end", "title": "" }, { "docid": "c4904cb31fe751f8411fd971786c21bf", "score": "0.62290347", "text": "def at_end_of_month; end", "title": "" }, { "docid": "c4904cb31fe751f8411fd971786c21bf", "score": "0.62290347", "text": "def at_end_of_month; end", "title": "" }, { "docid": "fe688d019be66adbba12f1a23b00ef3d", "score": "0.61812705", "text": "def end_of_month; end", "title": "" }, { "docid": "fe688d019be66adbba12f1a23b00ef3d", "score": "0.61812705", "text": "def end_of_month; end", "title": "" }, { "docid": "d7f7973c342d98a84129da3c299d56c1", "score": "0.61811936", "text": "def get_last_wday_in_month(year, month, wday)\n last_day_in_month = Date.new(year, month, -1)\n wday_of_last_day = last_day_in_month.wday\n wday_of_last_day += 7 if wday_of_last_day < wday\n difference = wday_of_last_day - wday\n date = last_day_in_month - difference\n date\n end", "title": "" }, { "docid": "70f87d1b6fc38d81ba7fe9300a76857d", "score": "0.6165902", "text": "def to_end_of_last_month(date)\n d = to_date_obj(date)\n d = d - d.day\n return d.strftime('%Y-%m-%d')\n end", "title": "" }, { "docid": "1d8cf58383b3db4113076027b36d680a", "score": "0.61632776", "text": "def last_day_of_month(month=nil)\n month ||= @month\n case month\n when 2\n if (((@year.remainder(4)) == 0) && ((@year.remainder(100)) != 0)) ||\n ((@year.remainder(400)) == 0)\n 29\n else\n 28\n end\n when 4, 6, 9, 11\n 30\n else\n 31\n end\n end", "title": "" }, { "docid": "acbb00f3ef6a9243e0c03ba5953474bf", "score": "0.6161132", "text": "def second_to_last\n retrieve_nth_to_last(1)\n end", "title": "" }, { "docid": "f3d3856ff1828b0f940bbc3ceabf5746", "score": "0.61439675", "text": "def second_to_last!; end", "title": "" }, { "docid": "d4a7ae8d014125b4d2ff225389342029", "score": "0.6127458", "text": "def end_of_update_period\n 2.days.from_now.strftime('%Y%m%d')\n end", "title": "" }, { "docid": "d4a7ae8d014125b4d2ff225389342029", "score": "0.6127458", "text": "def end_of_update_period\n 2.days.from_now.strftime('%Y%m%d')\n end", "title": "" }, { "docid": "b8fec1a3a279b7e298c0ace5176b14b5", "score": "0.60857505", "text": "def end_of_month( date )\n ( start_of_month( date ) >> 1 ) - 1\n end", "title": "" }, { "docid": "d5009fa01ead8b92fa60b83ac30921e0", "score": "0.6084776", "text": "def ends_on\n Date.new(year, month, -1).wday\n end", "title": "" }, { "docid": "e6e3f6211f657ef984edf8befc730360", "score": "0.60777146", "text": "def get_last_day(year, month, option = :current)\n case option\n when :current\n y = year\n m = month\n when :last\n m = month - 1\n if month == 1\n m = 12\n y = year - 1\n else\n y = year\n end\n when :next\n m = month + 1\n if month == 12\n m = 1\n y = year + 1\n else\n y = year\n end\n end\n Date.new(y, m, -1).day\n end", "title": "" }, { "docid": "97229ac65ed68381e655a0d1241cd1ee", "score": "0.60422236", "text": "def second_to_last\n self[-2]\n end", "title": "" }, { "docid": "97229ac65ed68381e655a0d1241cd1ee", "score": "0.60422236", "text": "def second_to_last\n self[-2]\n end", "title": "" }, { "docid": "ca81a0fda21939ad9cb7d2a2cbda147c", "score": "0.60344774", "text": "def last_month\n 1.month.ago.strftime(\"%B\") << 1.month.ago.strftime(\"%Y\") \n end", "title": "" }, { "docid": "8531e88b99643d91f87db507ae6e1914", "score": "0.59784365", "text": "def end_of_month\n @end_of_month ||= calendar.end_of_month(year, merch_month)\n end", "title": "" }, { "docid": "dc534b0750af481df48faf2bc3258348", "score": "0.5948149", "text": "def end_date\n Date.today + 1.month\n end", "title": "" }, { "docid": "053118c9e279be4ae7e8eebc6c5f2723", "score": "0.5941379", "text": "def stop_date\n std = stop_time_date\n Time.gm(std.year, std.month, std.day)\n end", "title": "" }, { "docid": "8fec007ac581ef87a2e95da755a4d0a3", "score": "0.59358203", "text": "def to_end_of_month(date)\n s = date.split(\"-\");\n return ((Date.new(s[0].to_i,s[1].to_i,1)>>1)-1).strftime(\"%Y-%m-%d\")\n end", "title": "" }, { "docid": "69901e390149b0bdad158830101c323a", "score": "0.5861738", "text": "def start_of_last_month\n start_of_this_month << 1\n end", "title": "" }, { "docid": "e23525386f85c464e738d81cb7e756bd", "score": "0.58539295", "text": "def end_of_month\n change(:day => days_in_month, :hour => 23, :min => 59, :sec => 59)\n end", "title": "" }, { "docid": "aeaea184df29d5eaa516405d06daa4d2", "score": "0.58441824", "text": "def date_for_month(month)\n months[month - 1]\n end", "title": "" }, { "docid": "de9d614ce0a24f14e4df4d14129b1145", "score": "0.58094233", "text": "def next_depreciation_date\n (current_depreciation_date + depreciation_interval_type.months.months).end_of_month\n end", "title": "" }, { "docid": "1fa24ade1f3bed0d756a8fd209a74bac", "score": "0.5795884", "text": "def end_of_year\n change(:month => 12).end_of_month\n end", "title": "" }, { "docid": "30aa48cd979cbe8c5a4edbd78e2c4eb4", "score": "0.5793026", "text": "def end_date\n start_date = @start_date\n start_date.next_month(@month_count) # Advance by no. of months\n end", "title": "" }, { "docid": "37dd0ba656012cba8eb6a1a6e08f85f6", "score": "0.578242", "text": "def last_day\n end_date + 1.day\n end", "title": "" }, { "docid": "37dd0ba656012cba8eb6a1a6e08f85f6", "score": "0.578242", "text": "def last_day\n end_date + 1.day\n end", "title": "" }, { "docid": "37dd0ba656012cba8eb6a1a6e08f85f6", "score": "0.578242", "text": "def last_day\n end_date + 1.day\n end", "title": "" }, { "docid": "452f7d8966590125f278a626046841c5", "score": "0.5781159", "text": "def last(day = nil)\n (day.nil?) ? Date.new(@date.year,@date.month,-1) : every(day).last\n end", "title": "" }, { "docid": "546b0c973f5376e276da17a90c424461", "score": "0.5775923", "text": "def end_of_semimonth\n if day <= 15\n ::Date.new(year, month, 15)\n else\n end_of_month\n end\n end", "title": "" }, { "docid": "4fbff57efcdf9d1f30a0e86a021dcc67", "score": "0.57548755", "text": "def date_end\n year_end = self.date.year + (self.nb_month_amort / 12)\n return Date.new(year_end, self.date.month, self.date.day)\n end", "title": "" }, { "docid": "5f387741dd907b3a2185ac5944d7981e", "score": "0.574932", "text": "def get_last_date\t\n\t\tlatest_order = self.mws_orders.order('last_update_date DESC').first\n\t\tif !latest_order.nil?\n\t\t\treturn latest_order.last_update_date.since(1)\n\t\telse\n\t\t\treturn Time.now.ago(60*60*3)\n\t\tend\n\tend", "title": "" }, { "docid": "5f387741dd907b3a2185ac5944d7981e", "score": "0.574932", "text": "def get_last_date\t\n\t\tlatest_order = self.mws_orders.order('last_update_date DESC').first\n\t\tif !latest_order.nil?\n\t\t\treturn latest_order.last_update_date.since(1)\n\t\telse\n\t\t\treturn Time.now.ago(60*60*3)\n\t\tend\n\tend", "title": "" }, { "docid": "0c389237f3468e8be7a55514c7e6f8a5", "score": "0.5726514", "text": "def end_of_month(year, merch_month)\n if merch_month == 12\n end_of_year(year)\n else\n start_of_month(year, merch_month + 1) - 1\n end\n end", "title": "" }, { "docid": "0c389237f3468e8be7a55514c7e6f8a5", "score": "0.5726514", "text": "def end_of_month(year, merch_month)\n if merch_month == 12\n end_of_year(year)\n else\n start_of_month(year, merch_month + 1) - 1\n end\n end", "title": "" }, { "docid": "c8da13ce1483bfa4b4b90db742cc2422", "score": "0.57262725", "text": "def calculate_next_entitlement_period_end_date()\n latest_entitlement = find_latest_entitlement\n if latest_entitlement.nil?\n Date.new(Date.today.next_year.year, Date.today.next_month.month, 1)\n else\n latest_entitlement.end_date.next_year\n end\n end", "title": "" }, { "docid": "aff654503351719e22cc0237d5d318d0", "score": "0.5723873", "text": "def last_twelve_months\n plm = @period.list_months.collect {|my| my}\n plm = plm.slice(-12,12) if plm.size > 12\n plm\n end", "title": "" }, { "docid": "231184fde4db528e753218be97a7daab", "score": "0.57171065", "text": "def last_day(month, year)\n case month\n when 1 then 31\n when 2 then leap(year)\n when 3 then 31\n when 4 then 30\n when 5 then 31\n when 6 then 30\n when 7 then 31\n when 8 then 31\n when 9 then 30\n when 10 then 31\n when 11 then 30\n when 12 then 31\n else 31\n end\n end", "title": "" }, { "docid": "9402feb8b1383ac205a0beaed6ee2cfc", "score": "0.57144886", "text": "def last_scheduled_occurrence\n get_timestamp \"last\"\n end", "title": "" }, { "docid": "a0308d595771b96248a9744775d1a683", "score": "0.57123876", "text": "def last_day_of_month(year, month)\n month_days = [nil,31,28,31,30,31,30,31,31,30,31,30,31]\n result = month_days[month]\n if is_leap_year(year) && (month == 2)\n result += 1\n end\n return result\n end", "title": "" }, { "docid": "b3623e1c2a69bbdb0e9835e32a787b1e", "score": "0.5709428", "text": "def stop_time_date\n Time.moc(stop_time_moc)\n end", "title": "" }, { "docid": "a1ab6aed68601f673938af5e3e14afff", "score": "0.5684867", "text": "def second_premium_collection_month\n return unless initial_draw_date\n initial_draw_date.advance(months: 3).strftime('%m/%Y')\n end", "title": "" }, { "docid": "0370eb38c82c02d608d733874d3497ec", "score": "0.56711036", "text": "def last_day\n if @next_day.nil?\n return self.day\n else\n return @next_day.last_day\n end\n end", "title": "" }, { "docid": "fa89c5c6296bf9933fb7df9f51e40f3e", "score": "0.56646985", "text": "def checkin_at_last_month\n Time.now.ago(1.month).ago(from_9_am)\n end", "title": "" }, { "docid": "9f007a567d865b326ef571a40376dba7", "score": "0.5656777", "text": "def last_month_calspersec\n total = 0.0\n self.calspersecs.each do |x|\n if x.created_at.in_time_zone(self.time_zone).strftime(\"%Y%m\").to_i == (Time.now.in_time_zone(self.time_zone) - 1.month).strftime(\"%Y%m\").to_i\n total += x.calories_persec\n end\n end\n return total.to_i\n end", "title": "" }, { "docid": "abd9b78b341c2e4131cb21aaa37ca12c", "score": "0.5648775", "text": "def last_day_of_month(h_month = self.month, h_year = self.year)\n if [IYYAR, TAMMUZ, ELUL, TEVET, ADARII].include?(h_month) ||\n ((h_month == ADAR) && !leap_year?(h_year)) ||\n ((h_month == MARHESHVAN) && !long_marheshvan?(h_year)) ||\n ((h_month == KISLEV) && short_kislev?(h_year))\n return 29\n else\n return 30\n end\n end", "title": "" }, { "docid": "3b422f9b1e2027c09c501ebe0e3ebf28", "score": "0.5647075", "text": "def last_schedule_time\n period_unit = PERIOD_TO_UNIT_TABLE[period].first\n period_days = PERIOD_TO_UNIT_TABLE[period].last\n if first_send_at.past?\n days_past = ((Time.now - first_send_at)/(3600*24)).round\n periods_past = days_past / period_days\n first_send_at + periods_past * 1.send(period_unit)\n else\n first_send_at\n end\n end", "title": "" }, { "docid": "5dcb009d78f1d3615a3ec23793c7e27a", "score": "0.5641222", "text": "def last_month_workoutsecs\n seconds = 0\n self.workoutsecs.each do |x|\n if x.created_at.in_time_zone(self.time_zone).strftime(\"%Y%m\").to_i == (Time.now.in_time_zone(self.time_zone) - 1.month).strftime(\"%Y%m\").to_i\n seconds += 1\n end\n end\n workout_time_formatting(seconds)\n end", "title": "" }, { "docid": "ffeac5962d3db497b16cdf7506c6dab3", "score": "0.5630269", "text": "def max_date\n Time.now.utc.to_date - 1\n end", "title": "" }, { "docid": "ed2df3b5cd517f205b38e05558e84100", "score": "0.56136477", "text": "def midday\r\n Time.new(2000, 1, 1, 12, 0)\r\n end", "title": "" }, { "docid": "3da417a23f6c522c4088612b07e226b0", "score": "0.55958045", "text": "def timestamp\n ((DateTime.now) << 12 * 31).to_time.to_f\n end", "title": "" }, { "docid": "0478254cfc496bad1ea5a6bdde6890d5", "score": "0.55946475", "text": "def get_last_day_cal\n #there has to be a better way to do this\n @day = @first_day\n @days_in_cal_month = []\n @days_in_cal_month << @day\n i = 0\n while i < 35\n @day = @day.tomorrow\n @days_in_cal_month << @day\n i += 1\n end\n @last_day = @day\n end", "title": "" }, { "docid": "ea3570e6b56418832583298f266b683c", "score": "0.55885375", "text": "def fetch_vote_date_eom(mnth)\n\t\treturn Rails.application.config.vote_display_eom ? mnth.months.ago.end_of_month : mnth.months.ago\n\tend", "title": "" }, { "docid": "14b9cfb8ead402962f864c98734a74ee", "score": "0.5585787", "text": "def end_time\n Time.xmlschema(@end_time).getlocal\n end", "title": "" }, { "docid": "a8c42eec79cc6a0ced923ff7e8f78104", "score": "0.5563637", "text": "def end_time\n \tself.timeslots.order(end_time: :asc).last.end_time.localtime\n end", "title": "" }, { "docid": "281c86ace76abb07ebd5206c09367b14", "score": "0.55546415", "text": "def wday_in_month_reverse\n (self.days_in_month - self.mday).div(7)\n end", "title": "" }, { "docid": "e995d3849b5359f3bf8d8417a2c33b39", "score": "0.5545758", "text": "def checkout_at_last_month\n Time.now.ago(1.month).ago(till_18_pm)\n end", "title": "" }, { "docid": "47c2eaf4574a0499fc879a818891e9c5", "score": "0.55344033", "text": "def month_interval(first, second)\n mon_interval = second.mon - first.mon\n year_interval = second.year - first.year\n if mon_interval == 0 && year_interval == 0\n month_interval = 0\n else\n month_interval = (year_interval * 12) + mon_interval\n end\n end", "title": "" }, { "docid": "6380512130101c0514cf0ca8f457bb8b", "score": "0.5530847", "text": "def last_weekday(desired_weekday, month, year)\n days = days_in_month(year, month)\n day_of_month = days - (day_of_week(Date.new(year, month, days)) - desired_weekday + 7) % 7\n Date.new(year, month, day_of_month)\n end", "title": "" }, { "docid": "53ff33e85e55174085f5c5d652e9cefb", "score": "0.5528303", "text": "def last_day_of_month(year, month)\n\n year = year.to_i\n month = month.to_i\n\n if (month == 1) or (month == 3) or (month == 5) or (month == 7) or (month == 8) or (month == 10) or (month == 12)\n day = '31'\n else\n if (month == 4) or (month == 6) or (month == 9) or (month == 11)\n day = '30'\n else\n if year % 4 == 0\n day = '29'\n else\n day = '28'\n end\n end\n end\n day\n end", "title": "" }, { "docid": "a2e32437d7bb2487b76d43fc306318fd", "score": "0.55123216", "text": "def test_date_time_last_period_dates\n date = Date.new(2015,4,3)\n date_from = date.prev_month.at_beginning_of_month\n date_to = date.prev_month.at_end_of_month\n dates = date.last_period_dates\n assert_equal dates[0], date_from\n assert_equal dates[1], date_to\n end", "title": "" }, { "docid": "b7301b158df589dcde4e5b0d8f3aab30", "score": "0.5502789", "text": "def fim_do_trimestre\n case self.month\n when 1..3 then self.change(month: 3).end_of_month\n when 4..6 then self.change(month: 6).end_of_month\n when 7..9 then self.change(month: 9).end_of_month\n when 10..12 then self.change(month: 12).end_of_month\n end\n end", "title": "" }, { "docid": "09a942c4288d300cb7e11f82f6ad5067", "score": "0.54931253", "text": "def end_date_time\n return @end_date_time\n end", "title": "" }, { "docid": "a61b1861f079da5313b3f4911da1faef", "score": "0.5491175", "text": "def fim_do_bimestre\n case self.month\n when 1..2 then self.change(month: 2).end_of_month\n when 3..4 then self.change(month: 4).end_of_month\n when 5..6 then self.change(month: 6).end_of_month\n when 7..8 then self.change(month: 8).end_of_month\n when 9..10 then self.change(month: 10).end_of_month\n when 11..12 then self.change(month: 12).end_of_month\n end\n end", "title": "" }, { "docid": "b63d1341c2951785cd128ed51ea770be", "score": "0.5490672", "text": "def end_of_day\r\n to_time.end_of_day\r\n end", "title": "" }, { "docid": "eda5aae59f66028ba6a2492d647ee811", "score": "0.54748535", "text": "def end_of_month(year, month_param)\n merch_month = get_merch_month_param(month_param)\n retail_calendar.end_of_month(year, merch_month)\n end", "title": "" }, { "docid": "173e442d420c8c37445f4452035e38d3", "score": "0.54697436", "text": "def expire_date\n # have to put in the day-of-the-month to make ruby 1.8.5 (neon) happy\n Date.strptime(\"#{year}-#{month}-01\", \"%Y-%m-%d\").end_of_month\n end", "title": "" }, { "docid": "63b566f5b03cb331ee9ad2d27b375c63", "score": "0.5437511", "text": "def last_download\n downloads = Download.where(download_type: \"payments\").order(downloaded_at: :desc)\n downloads.empty? ? Date.new(2000,1,1).to_time : downloads.first.downloaded_at\n end", "title": "" }, { "docid": "9da3e2fcfc0d86e6cfea46de07265e52", "score": "0.5430824", "text": "def fim_do_semestre\n case self.month\n when 1..6 then self.change(month: 6).end_of_month\n when 7..12 then self.change(month: 12).end_of_month\n end\n end", "title": "" }, { "docid": "0f9caa530cbf5dd9f44d269f8b711c63", "score": "0.5416712", "text": "def end_of_day\n return self.delta(days: 1).start_of_day\n end", "title": "" }, { "docid": "98d5ecd97c1f5b1a6fe6695a140a0897", "score": "0.54148287", "text": "def find_month time\n\t\tyear = time.year\n\t\tmonth = time.month\n\t\tmonth_timestamp = Date.new(year,month,1).to_time.to_i\n\t\tmonth_timestamp\n\tend", "title": "" }, { "docid": "89db9a3adf24defae022f3804cf1e9a3", "score": "0.5410433", "text": "def month\n month_time\n end", "title": "" }, { "docid": "e7aa2463e1b416a8b20a52cac3eb8989", "score": "0.5408342", "text": "def last_six_month_trade_day\n self.last_trade_day.months_ago(6)\n end", "title": "" }, { "docid": "227aa4ff50ffe7cf8a3af2da692af7f1", "score": "0.54035705", "text": "def local_end\n local_end_at.to_datetime\n end", "title": "" }, { "docid": "227aa4ff50ffe7cf8a3af2da692af7f1", "score": "0.54035705", "text": "def local_end\n local_end_at.to_datetime\n end", "title": "" }, { "docid": "4fbe3cc72fdd93855948921e26e29a7c", "score": "0.5394673", "text": "def seconds_until_end_of_day; end", "title": "" }, { "docid": "4fbe3cc72fdd93855948921e26e29a7c", "score": "0.5394673", "text": "def seconds_until_end_of_day; end", "title": "" }, { "docid": "4fbe3cc72fdd93855948921e26e29a7c", "score": "0.5394673", "text": "def seconds_until_end_of_day; end", "title": "" }, { "docid": "4fbe3cc72fdd93855948921e26e29a7c", "score": "0.5394673", "text": "def seconds_until_end_of_day; end", "title": "" } ]
efd62885e75ed45686a696da6c40c6ea
The subapp list may only be of size 1 and actually contains this app. This returns true if there are indeed sub apps that that differ from this object.
[ { "docid": "4fe2de288b0a69e844e416d585ba8d02", "score": "0.780824", "text": "def has_sub_apps?\n if batch_connect_app?\n sub_app_list.size > 1 || sub_app_list[0] != batch_connect\n else\n false\n end\n end", "title": "" } ]
[ { "docid": "b193c0199c3c124ea327bba338f3085c", "score": "0.66880965", "text": "def sub_app_list\n if batch_connect.sub_app_list.size == 1\n batch_connect.sub_app_list\n else\n batch_connect.sub_app_list.select { |app| app.sub_app == sub_app_name }\n end\n end", "title": "" }, { "docid": "85a1f7b6eb2e5764026479951a4d7434", "score": "0.629206", "text": "def sub_programs_balanced?\n duplicate_count = @sub_programs.count do |program| \n program.total_weight == @sub_programs[0].total_weight\n end\n duplicate_count == 0 || duplicate_count == @sub_programs.size\n end", "title": "" }, { "docid": "305dbae2475b3ee8a35e88782af6050f", "score": "0.6031551", "text": "def sub_app_list\n @sub_app_list ||= build_sub_app_list\n end", "title": "" }, { "docid": "1dd286173585a66f9d2d9eaa99d8e0c3", "score": "0.6015426", "text": "def subsets?\n not subsets.empty?\n end", "title": "" }, { "docid": "7ed622d7e79f045849e9998e3a547c27", "score": "0.5972186", "text": "def include?(app)\n @apps.include?(app)\n end", "title": "" }, { "docid": "14df18b8ba180d7e321a64c12c6741be", "score": "0.5848828", "text": "def in_subgame_array?(subgame)\n return true if @valid_subgames[subgame] = subgame\n return false\n end", "title": "" }, { "docid": "2fbb74c9ba1404e52abca5918d658c5d", "score": "0.5795349", "text": "def has_subdirs\n\t\treturn @subdirs.length > 0\n\tend", "title": "" }, { "docid": "c415b42e925348809d798b4af3134848", "score": "0.5673399", "text": "def app_type_valid?\n app_type_id.in? accessible_app_type_ids\n end", "title": "" }, { "docid": "ea4ca9b59de8ef36fcad52af2d6b1e27", "score": "0.5663917", "text": "def subpods?\n @subpods and @subpods.any?\n end", "title": "" }, { "docid": "fc339f1f28f6b477e7fd752c4acb1510", "score": "0.563144", "text": "def multiple_applications_allowed?\n return false unless settings\n settings.multiple_applications.visible?\n end", "title": "" }, { "docid": "c5f65f33dfe038e40fb132e9109a55fa", "score": "0.56227815", "text": "def same_sublength(array)\n\t\t# ensures that all sub arrays have the same length\n testLength = array[0].length\n array.each do |subarray|\n if(subarray.length != testLength)\n\t\t\t\treturn false\n end\n end\n return true\n end", "title": "" }, { "docid": "0417396a75b65df78019a7de3a7e23a1", "score": "0.56064576", "text": "def contained_apps\n return @contained_apps\n end", "title": "" }, { "docid": "3b91055a695bd39e83d107920394e84f", "score": "0.559086", "text": "def subclients?\n subclients.any?\n end", "title": "" }, { "docid": "b92b3d97c2eb9ce9e9caf16b161ee6e5", "score": "0.5562356", "text": "def sc_manifests?\n ! sc_manifests.empty?\n end", "title": "" }, { "docid": "1cfbf3fb4fa7d79e630ce6d4fb9a9f2c", "score": "0.55227613", "text": "def iiif_manifests?\n ! iiif_manifests.empty?\n end", "title": "" }, { "docid": "1ea9f313d1093884d00561d2285fe982", "score": "0.5494896", "text": "def ok_to_view_past_application?(past_app)\n applications_for_review.each do |a|\n return true if a.past_applications.collect(&:id).include?(past_app.id)\n end\n return false\n end", "title": "" }, { "docid": "7dba2f2e56ef2e341538dc224d2eb4a8", "score": "0.54641795", "text": "def no_more_apps?\n count = apps_owned.count\n if account_capacity[:apps] < count\n count\n end\n end", "title": "" }, { "docid": "689945d43a40c97d3b3d3ea25d29f624", "score": "0.5462064", "text": "def have_suborders?\n suborders.size > 0\n end", "title": "" }, { "docid": "ff1e5260371fd6363bc5ee6fddc494c8", "score": "0.5436927", "text": "def is_app_uploaded?(appname)\n all_apps = get_all_apps()\n return app_list.include?(appname)\n end", "title": "" }, { "docid": "975c80b6fc9a549f5ae0fd9a2722350d", "score": "0.54326", "text": "def proper_subset?(other)\n return false if other.size <= size\n all? { |item| other.include?(item) }\n end", "title": "" }, { "docid": "def0852012115a99a053f1351903926e", "score": "0.5410338", "text": "def child_apps\n return @child_apps\n end", "title": "" }, { "docid": "1e4909535a69f1332fb9f832b4df9f03", "score": "0.53944623", "text": "def subset?(other)\n return false if other.size < size\n all? { |item| other.include?(item) }\n end", "title": "" }, { "docid": "434056ffe2fdfd49c9c56c33a876c2fd", "score": "0.53923815", "text": "def sub_sites_check\n if self.sub_sites.count > 0\n update_sub_sites( self )\n end\n end", "title": "" }, { "docid": "7e05a83c2446f3fb2bc6c1fd9eb80f0e", "score": "0.5384306", "text": "def different?(items)\n !same?(items)\n end", "title": "" }, { "docid": "da997f46e13e6c09da957e0aeeed2d9b", "score": "0.53757524", "text": "def allow_add_remove_apps\n return @allow_add_remove_apps\n end", "title": "" }, { "docid": "6bbce6205f68c99f49016c78528c9c21", "score": "0.53736585", "text": "def can_be_removed_from_app?(app)\n case\n when app.requests.present.with_env_id(self.id).exists? then\n false\n when app.routes.not_default.filter_by_environment_id(self.id).exists? then\n false\n when app.default_route.active_plans.any? then\n false\n else\n true\n end\n end", "title": "" }, { "docid": "39076810726425cc8eb8aee276815250", "score": "0.53632295", "text": "def confirm_subscriptions?\n\t\treturn ! ( self.listdir + 'nosubconfirm' ).exist?\n\tend", "title": "" }, { "docid": "d4b443e89b0f2a4a31de36b6722a48c4", "score": "0.5362531", "text": "def disjoint?(other)\n if size < other.size\n each { |item| return false if other.include?(item) }\n else\n other.each { |item| return false if include?(item) }\n end\n true\n end", "title": "" }, { "docid": "d060cc7b3a66a5dcd1add71a77591eb2", "score": "0.53621674", "text": "def has_app?\n !!@app_dir\n end", "title": "" }, { "docid": "35ed92ef60169bef4fb6f73ef2a6bfbd", "score": "0.5324365", "text": "def unrelated_list?(entry, parent_list)\n # Ignore if no parent list is given or the entry is not a list/child\n return false unless parent_list\n # Ignore if the entry is not a list\n return false unless entry.list?(strict: false)\n # Ignore if the entry is a child of (or the same as) the parent list\n return false if entry.child_of?(parent_list, strict: false)\n # Otherwise the entry is a list unrelated to the parent list\n msg = \"#{entry.url} ignored, not related to #{parent_list.url}\"\n cache.logger.debug(msg)\n true\n end", "title": "" }, { "docid": "d27e1e07d1ef3e0107459039b9c3bf8d", "score": "0.5324093", "text": "def in_external_app?\n # FIXME: once you click away in an iframe app, you are considered to be an external app\n # TODO: read up on the hacks for avoiding nested iframes\n return (params and params[\"fb_sig\"] == nil and !in_facebook_frame?)\n end", "title": "" }, { "docid": "70b90670eeef4f9e5391d8aaee851b38", "score": "0.5281515", "text": "def satisfies?( value )\n if value != nil\n if value.is_a?( Array )\n return ( @items - value ).empty?\n end\n end\n\n return false\n end", "title": "" }, { "docid": "4ddca052ff956482503ff74886117352", "score": "0.5279945", "text": "def pbCheckItems(array)\n for i in 0...array.length\n next if !array[i].hasItem?\n for j in i+1...array.length\n return false if array[i].item==array[j].item\n end\n end\n return true\n end", "title": "" }, { "docid": "193f154184a111dc75e9a60beb37e3db", "score": "0.52675503", "text": "def error_if_has_applications?\n shf_applications.reload\n\n if shf_applications.where.not(state: 'being_destroyed').any?\n errors.add(:base, 'activerecord.errors.models.company.attributes.company_has_active_memberships')\n # Rails 5: must throw\n throw(:abort)\n end\n true\n end", "title": "" }, { "docid": "e82fd06098a6b1a3cba605b2e7f417ba", "score": "0.5258807", "text": "def has_items?(item_list)\n (item_list - items.values.flatten.map(&:keys).flatten).empty?\n end", "title": "" }, { "docid": "0921555ad0e6603997fdee9bb364e143", "score": "0.5246897", "text": "def questions_after_ubound?\n return false if parent_questions.empty?\n valid_questions.last.qid != parent_questions.last.qid\n end", "title": "" }, { "docid": "540f8aad15e84856efba33d2d4c00a12", "score": "0.52455205", "text": "def has_sub?\n #note: if the later part of a shift has been taken, self.sub still returns true so we also need to check self.sub.new_user.nil?\n !self.sub_requests.empty? #and sub.new_user.nil? #new_user in sub is only set after sub is taken. shouldn't check new_shift bcoz a shift can be deleted from db. -H\n end", "title": "" }, { "docid": "540f8aad15e84856efba33d2d4c00a12", "score": "0.52455205", "text": "def has_sub?\n #note: if the later part of a shift has been taken, self.sub still returns true so we also need to check self.sub.new_user.nil?\n !self.sub_requests.empty? #and sub.new_user.nil? #new_user in sub is only set after sub is taken. shouldn't check new_shift bcoz a shift can be deleted from db. -H\n end", "title": "" }, { "docid": "38c7c77128f23f914cadd7cd5de3657b", "score": "0.52321845", "text": "def confirm_unsubscriptions?\n\t\treturn ! ( self.listdir + 'nounsubconfirm' ).exist?\n\tend", "title": "" }, { "docid": "88386756f6d174e8963505985e6d95b1", "score": "0.52300894", "text": "def shares_programme?(other_item)\n (programmes & other_item.programmes).any?\n end", "title": "" }, { "docid": "bfaa1b13c1489673992a2b8452252f28", "score": "0.5227597", "text": "def superset?(other)\n other.subset?(self)\n end", "title": "" }, { "docid": "bfaa1b13c1489673992a2b8452252f28", "score": "0.5227597", "text": "def superset?(other)\n other.subset?(self)\n end", "title": "" }, { "docid": "6b944955c7c56baba34b2066de21f904", "score": "0.52241796", "text": "def has_subframes\n\t\treturn self.relations_hash[ \"Has Subframe(s)\" ].frames\n\tend", "title": "" }, { "docid": "6c0b0ae9da9bddd4c609818003414844", "score": "0.5218127", "text": "def validate_base_apps\n validate_apps *BASE_APPS\n end", "title": "" }, { "docid": "09736543f1b306831e243f471202aa44", "score": "0.5213071", "text": "def has_subcommands?\n not(@subcommand.values.compact.empty?)\n end", "title": "" }, { "docid": "738b67b6a24a50ab8e438307de4826a7", "score": "0.5211875", "text": "def has_subpages?\n return false unless self.index_page?\n return self.subpages.empty? ? false : true\n end", "title": "" }, { "docid": "9b526b5699bf0fc6d00ee7d11cccc8ec", "score": "0.5206472", "text": "def app_has_name?\n !@vcap_application.nil? && !vcap_app_name.nil? && !vcap_app_name.empty?\n end", "title": "" }, { "docid": "1e58ba71691b96942a3821b0d081f037", "score": "0.5197292", "text": "def disjoint?(other)\n if other.size <= size\n other.each { |item| return false if include?(item) }\n else\n # See comment on #subset?\n if other.size >= 150 && @trie.size >= 190 && !(other.is_a?(Immutable::Set) || other.is_a?(::Set))\n other = ::Set.new(other)\n end\n each { |item| return false if other.include?(item) }\n end\n true\n end", "title": "" }, { "docid": "e74b41331a4e209363059615ed8f5141", "score": "0.5186854", "text": "def is_app?\n !!@config[:app]\n end", "title": "" }, { "docid": "48ded78c22beec8876c68db0f5d12e0f", "score": "0.518022", "text": "def exclude_applications\n return @exclude_applications\n end", "title": "" }, { "docid": "07e68a6d00e8be3ddbc32c0930438d72", "score": "0.5176839", "text": "def leaf_relation?\n subsets.empty?\n end", "title": "" }, { "docid": "1f5570b54f7a78f30859071cb5197d69", "score": "0.51720446", "text": "def any?\n !!diff_array.find{|i| Array === i }\n end", "title": "" }, { "docid": "f20d4d63077878548c0f6831c0c159c4", "score": "0.5161501", "text": "def merge?\n @parents.size > 1\n end", "title": "" }, { "docid": "8802cddb5bbabae7b7892ebd6ce6b68f", "score": "0.5159704", "text": "def validate_apps *apps\n apps.flatten.each do |appname|\n validate_app appname\n end\n end", "title": "" }, { "docid": "06e392e6e82c055c3420c6ebb8fbf532", "score": "0.515569", "text": "def proper_superset?(other)\n other.proper_subset?(self)\n end", "title": "" }, { "docid": "06e392e6e82c055c3420c6ebb8fbf532", "score": "0.515569", "text": "def proper_superset?(other)\n other.proper_subset?(self)\n end", "title": "" }, { "docid": "906a5dba594d6fda79394cf5442a34d5", "score": "0.51527953", "text": "def contained_apps=(value)\n @contained_apps = value\n end", "title": "" }, { "docid": "d6cf45a1e70251337fd7eed851016986", "score": "0.5150323", "text": "def is_app_running?(app_name)\n found = select_apps_by_line do |line|\n line.start_with?(\"#{app_name} \") && line.include?('started')\n end\n return found.count > 0\n end", "title": "" }, { "docid": "0402cf7dc6ee2b204eb0909120df2901", "score": "0.51489156", "text": "def proper_subset?(other)\n Rangops::Set.proper_subset?(self, other)\n end", "title": "" }, { "docid": "4498e86adb3afb44278b6f50e5c983ec", "score": "0.51458305", "text": "def manifests?\n ! manifests.empty?\n end", "title": "" }, { "docid": "c96235d45f3adfa305ae35d78b0aa099", "score": "0.51397914", "text": "def are_there_unclosed_suborders?\n suborders.unclosed_only.count > 0 ? true : false\n end", "title": "" }, { "docid": "77e01be525a4833c3c8e530d51440a69", "score": "0.513962", "text": "def include? (app_id, run_id)\n # If there is no app, then return false and do nothing\n return false if @ph[app_id].nil?\n # Otherwise check the runs array\n @ph[app_id]['runs'].include? run_id\n end", "title": "" }, { "docid": "14938fc1a15c688ec9ea34a8a937f28f", "score": "0.5139602", "text": "def equal?\n versions.reject { |v| v == versions.first }.length.zero?\n end", "title": "" }, { "docid": "3eb209970b3c7089c372726575f2a8eb", "score": "0.51393193", "text": "def check_if_environment_can_be_removed_from_app\n environment.can_be_removed_from_app?(app)\n end", "title": "" }, { "docid": "a6053340813842f37674958e666f2ba4", "score": "0.513151", "text": "def has_children?\n @items.length > 0\n end", "title": "" }, { "docid": "93e7fa6293c4dbea9539be002e1a0d0f", "score": "0.5130463", "text": "def tenant_not_on_list? item_in\n\t\t!item_in.request_id_list.include?(current_user.id)\n\t\t# item_in.tenant_id == nil && item_in.request_id_list.length == 0\n\tend", "title": "" }, { "docid": "57dbfc271ec1ff3fce7e00470a42ec18", "score": "0.5127923", "text": "def subset?(other)\n Rangops::Set.subset?(self, other)\n end", "title": "" }, { "docid": "eaec381553347c967d35a4c67bf73a25", "score": "0.51228124", "text": "def can_see_app?(system)\n matched_roles = self.roles.split(' ').delete_if{|r| (r.index(system.to_s+'_').nil? && r.index('all_').nil?)}\n #Rails.logger.debug(\"* User.can_see_app? - system:#{system}, roles:#{self.roles}, matched_role:#{matched_roles}\")\n return matched_roles.size > 0\n end", "title": "" }, { "docid": "0b662b2a5b6707b4ee3e42f99108db30", "score": "0.51223654", "text": "def error_if_has_applications?\n shf_applications.reload\n\n if shf_applications.where.not(state: 'being_destroyed').any?\n errors.add(:base, 'activerecord.errors.models.company.attributes.company_has_active_memberships')\n # Rails 5: must throw\n throw(:abort)\n end\n\n true\n\n end", "title": "" }, { "docid": "a9e540ac93d3ad9230a99431357461d4", "score": "0.51169443", "text": "def matches_bundle?(bundle)\n group_products = @items.collect(&:product)\n bundle_products = bundle.products\n return (group_products.size == bundle_products.size && group_products.sort == bundle_products.sort)\n end", "title": "" }, { "docid": "d2669a6e24b5fdfd51501b145c1ebae0", "score": "0.51141334", "text": "def has_subsidy?\n usage_subsidy && usage_subsidy > 0\n end", "title": "" }, { "docid": "cf92f275b8ef76e5484da7c9aef474ff", "score": "0.5113713", "text": "def possible?\n entries.size > 1\n end", "title": "" }, { "docid": "8ed736ff7ecbe2a4a9d8422b8a61e499", "score": "0.51060176", "text": "def app_has_name?\n !@vcap_application.nil? && !@vcap_application[APPLICATION_NAME_KEY].nil? && !@vcap_application[APPLICATION_NAME_KEY].empty?\n end", "title": "" }, { "docid": "88f02c693efdf0586fd3a54aad6a6cdf", "score": "0.51032436", "text": "def pbCheckItems(array) # Unused\n for i in 0...array.length\n next if !array[i].hasItem?\n for j in i+1...array.length\n return false if array[i].item==array[j].item\n end\n end\n return true\n end", "title": "" }, { "docid": "743b233b92c8ba7c1e2ef5081c64efd8", "score": "0.509894", "text": "def hasItems\n return @ucItemsList.size > 0\n end", "title": "" }, { "docid": "ff1d45734027b2ae006af3e03d8ab569", "score": "0.50979537", "text": "def subfolders_locked?\n @attributes[:subfolders_locked?]\n end", "title": "" }, { "docid": "3131b44e2b1ac34b7ce1b6c8a6a52fb1", "score": "0.50964314", "text": "def proper_subset?(other)\n other.size > size and subset?(other)\n end", "title": "" }, { "docid": "600f5659f9a9325b4ee9ef1d0916a31a", "score": "0.50957906", "text": "def proper_superset?(other)\n other.size < size and superset?(other)\n end", "title": "" }, { "docid": "9a9005a417cf3035bb87413f3b5c1ead", "score": "0.50930303", "text": "def has_appointments?(gsi)\n gsi.appointments_count > 0\n end", "title": "" }, { "docid": "054b06a21aaf71f08004e63c8f08eb4b", "score": "0.50921524", "text": "def member?(sub)\n sub.mailing_lists.each do |mlist|\n if mlist.data(:id) == self.data(:id)\n return true\n end\n end\n\n return false\n end", "title": "" }, { "docid": "641774767781d2e6865a427cd1b0e4b7", "score": "0.5090506", "text": "def proper_superset?(other)\n Rangops::Set.proper_superset?(self, other)\n end", "title": "" }, { "docid": "aa5cce5277a289d70ef0e92f6b6f77ab", "score": "0.50803757", "text": "def is_subset_of?(other)\r\n\t\tif (\r\n\t\t\tlist_subjects.collect{|list_subject| list_subject.subject.id}.to_set == other.list_subjects.collect{|list_subject| list_subject.subject.id}.to_set && # check subjects\r\n\t\t\tlist_columns.collect(&:id).to_set.subset?(other.list_columns.collect(&:id).to_set)\r\n\t\t) then\r\n\t\t\tlist_subjects.each do |list_subject|\r\n\t\t\t\tother_list_subject = other.list_subjects.select{|item| item.subject.id == list_subject.subject.id}.first\r\n\t\t\t\tif (!(list_subject.data_filters.to_set == other_list_subject.data_filters.to_set))\r\n\t\t\t\t\treturn false\r\n\t\t\t\tend\r\n\t\t\tend\r\n\t\t\treturn true\r\n\t\tend\r\n\t\treturn false\r\n\tend", "title": "" }, { "docid": "d4e0602d0b5a3b1df1808e37b9b9734c", "score": "0.5080157", "text": "def same_or_subpackage_of?(packages)\r\n packages.find {|pkg| @package == pkg } != nil || subpackage_of?(packages)\r\n end", "title": "" }, { "docid": "b0ace52f1c71deb148a6f92155477074", "score": "0.50786257", "text": "def integrity_of_applicant_objects\n\n applicants_in_application_group = self.applicants - [nil]\n\n # puts applicants_in_application_group.map(&:id).inspect\n\n tax_household_applicants_valid = are_arrays_of_applicants_same?(applicants_in_application_group.map(&:id), self.households.flat_map(&:tax_households).flat_map(&:tax_household_members).map(&:applicant_id))\n\n coverage_applicants_valid = are_arrays_of_applicants_same?(applicants_in_application_group.map(&:id), self.households.flat_map(&:coverage_households).flat_map(&:coverage_household_members).map(&:applicant_id))\n\n tax_household_applicants_valid && coverage_applicants_valid\n end", "title": "" }, { "docid": "0c9fcc14e3aa086f5b1a86de062c6171", "score": "0.50701255", "text": "def is_deletable?\n is_not_lent = old_lend_out.nil?\n has_more_than_one_instance = old_folder.old_folder_instances.count > 1\n is_not_lent && has_more_than_one_instance\n end", "title": "" }, { "docid": "0a40211cc4419d26c4875b4dc3fbf208", "score": "0.50693554", "text": "def superset?(other)\n intersection(other) == other\n end", "title": "" }, { "docid": "cf62e53ec14282f54d496e6f7290c822", "score": "0.5067001", "text": "def updates_for? subscription\n updates_for(subscription).any? { |kind, new_items| new_items.any? }\n end", "title": "" }, { "docid": "7a37b1716689709fbc8311418d56e3dc", "score": "0.5055271", "text": "def can_be_shared_without_nesting?\n # An array with the ids of all ancestors and descendants\n ancestor_and_descendant_ids = []\n ancestor_and_descendant_ids << self.descendant_ids if self.is_folder? && !self.descendant_ids.empty?\n ancestor_and_descendant_ids << self.ancestor_ids if !self.ancestor_ids.empty?\n\n # If it exist a sharing, it returns true\n if RepositoryManager::Sharing.where(repo_item_id: ancestor_and_descendant_ids).count > 0\n false\n else\n true\n end\n end", "title": "" }, { "docid": "eb3d5d0d5ae85c07d2f36d44a47fc1ae", "score": "0.50529754", "text": "def merge?\n parents.size > 1\n end", "title": "" }, { "docid": "d891cb51c018ff7258afc328f20e4e2d", "score": "0.50524074", "text": "def shared?\n !self.shared_folders.empty?\n end", "title": "" }, { "docid": "7a1f0e86c56dd44f91aabb5e85160d6c", "score": "0.5049561", "text": "def app?\n @roles.include?('application')\n end", "title": "" }, { "docid": "624f602bdb749579042a162be7cdbfe4", "score": "0.5048032", "text": "def appgroups_attached_to_zones?\n objects_attached_to_zones? 'appgroups'\n end", "title": "" }, { "docid": "f0b217caa3f833560963ceb504885bb2", "score": "0.5042376", "text": "def ==(other_mb)\n\t\t# Check that all base elements equal... first basePathFyi\n\t\tif(@basePath != other_mb.basePath)\n\t\t\treturn false\n\t\tend\n\t\t# Then for this array, first ensure same size, then comp el-el\n\t\tif(other_mb.infoList.length != @infoList.length)\n\t\t\treturn false\n\t\tend\n\t\t0.upto(@infoList.length-1) { |i|\n\t\t\tif(@infoList[i][:status] != other_mb.infoList[i][:status])\n\t\t\t\treturn false\n\t\t\telsif(@infoList[i][:action] != other_mb.infoList[i][:action])\n\t\t\t\treturn false\n\t\t\telsif(@infoList[i][:filename] != other_mb.infoList[i][:filename])\n\t\t\t\treturn false\n\t\t\telsif(@infoList[i][:path] != other_mb.infoList[i][:path])\n\t\t\t\treturn false\n\t\t\telsif(@infoList[i][:size] != other_mb.infoList[i][:size])\n\t\t\t\treturn false\n\t\t\telsif(@infoList[i][:checksum] != other_mb.infoList[i][:checksum])\n\t\t\t\treturn false\n\t\t\tend\n\t\t}\n\t\treturn true\n\tend", "title": "" }, { "docid": "247582f7a4575d0de9663331f8b8077b", "score": "0.5040989", "text": "def superset?(other)\n Rangops::Set.superset?(self, other)\n end", "title": "" }, { "docid": "42dbddc6ab2729411f03897bba8a7955", "score": "0.5040874", "text": "def isExtensionBapp\n _check_and_callback(:isExtensionBapp)\n end", "title": "" }, { "docid": "fa7b65b54c81e170a0ae1e1489276617", "score": "0.50357914", "text": "def subset?(other)\r\n !(self - other).accepting?\r\n end", "title": "" }, { "docid": "c4c4248619480b1bd5ca3b16e1971c3f", "score": "0.5035167", "text": "def is_parent?\n return (@child_folders.length > 0)\n end", "title": "" }, { "docid": "c2be6f2cc8e15960523897029429e967", "score": "0.503433", "text": "def has_enabled_app?(app, version)\n params = %(app:list | egrep \"#{app}: )\n params << %(.*#{version}) if version\n params << %(\"')\n ret = run_powershell_command_with(params)\n (ret.exit_status == 0 ? true : false)\n end", "title": "" }, { "docid": "faf6cfe89f9fd01e87bb03be4121d35d", "score": "0.50321233", "text": "def app_exist?(host_id, app_name)\n get_app_id(host_id, app_name) ? true : false\n end", "title": "" }, { "docid": "2ca0816dd7ae5c6fbb4971143ca2aa5e", "score": "0.5024463", "text": "def empty?\n SDL::Base::Type.subtypes_recursive.count == 2 &&\n SDL::Base::Type.instances_recursive.to_a.empty?\n end", "title": "" } ]
c8cee821ec5ce27c1c3d8e9cfeb8796e
Extract a hash pair with a given literal key.
[ { "docid": "4d723221e6d2dc82abcdfc0c6396721a", "score": "0.6951166", "text": "def extract_hash_pair(node, key)\n node.children.detect do |child|\n next unless child.type == :pair\n\n key_node = child.children[0]\n %i[sym str].include?(key_node.type) && key_node.children[0].to_s == key\n end\n end", "title": "" } ]
[ { "docid": "fa0f0a45afdd20bc38c078e3187465ee", "score": "0.71540886", "text": "def extract_hash_pair(node, key); end", "title": "" }, { "docid": "c472dfd6b0b40e364cc7c07a69bd811a", "score": "0.6673146", "text": "def extract_hash_tag(key)\n s = key.index('{')\n\n return key unless s\n\n e = key.index('}', s + 1)\n\n return key unless e\n\n key[s + 1..e - 1]\n end", "title": "" }, { "docid": "abfa68b5d59ecb1be9ceeaecd22e1dcb", "score": "0.66675305", "text": "def hash_access hash, key\n if key.is_a? Symbol\n key = Sexp.new(:lit, key)\n end\n\n if index = hash.find_index(key) and index > 0\n return hash[index + 1]\n end\n\n nil\n end", "title": "" }, { "docid": "acfaf2975bf7642314beaef183589824", "score": "0.65906966", "text": "def extract(key)\n ->(h) { h[key] }\n end", "title": "" }, { "docid": "dd5020c6cb62ef6d25583b306b5d320d", "score": "0.653523", "text": "def extract_hash_tag(key)\n s = key.index('{')\n e = key.index('}', s.to_i + 1)\n\n return '' if s.nil? || e.nil?\n\n key[s + 1..e - 1]\n end", "title": "" }, { "docid": "fca40551de61c0d26be4a784ea5bdd46", "score": "0.6417141", "text": "def hash_value(key)\n pair_nodes =\n case sexp_type\n when :bare_assoc_hash\n self[1]\n when :hash\n self[1][1]\n else\n\n end\n\n pair_nodes.size.times { |i| return pair_nodes[i][2] if key == pair_nodes[i][1].to_s } if pair_nodes\n CodeAnalyzer::Nil.new\n end", "title": "" }, { "docid": "31b9b5e9830b7dc4d581ea3c7bc35923", "score": "0.640443", "text": "def hget(hash_name, key)\n get(\"#{hash_name}_#{key}\")\n end", "title": "" }, { "docid": "39c018153cc847ec9206dab7b7f60ebb", "score": "0.63878703", "text": "def extract(key)\n self[key.to_s] || self[key.to_sym]\n end", "title": "" }, { "docid": "f1a268e8c38d442727a12fbd91ea9fca", "score": "0.62638205", "text": "def hash_key_for(token)\n lbrack_token = token.next_code_token\n return '' unless lbrack_token && lbrack_token.type == :LBRACK\n\n key_token = lbrack_token.next_code_token\n return '' unless key_token && HASH_KEY_TYPES.include?(key_token.type)\n\n key_token.value\n end", "title": "" }, { "docid": "c11c7f68cfd7b38ebc2c08d439d5709a", "score": "0.6100404", "text": "def extract_from_hash(key, value)\n if value.key?(key)\n value[key]\n elsif value.key?(key.to_s)\n value[key.to_s]\n end\n end", "title": "" }, { "docid": "c944496c0a2633d775c42a80b81e9c83", "score": "0.6090038", "text": "def [](key)\n key = key.to_sym if key.respond_to?(:to_sym)\n return @hash[key]\n end", "title": "" }, { "docid": "3764f21324e8ec151b5d9f345ad11172", "score": "0.6082699", "text": "def get key\n clean_cache!\n @hash[key][1]\n end", "title": "" }, { "docid": "029366622e3d38c0e6c1caff5f2e3633", "score": "0.59661055", "text": "def get(key)\n @hash[key]\n end", "title": "" }, { "docid": "145e119ffe92431754caf6a56d2faa03", "score": "0.59600383", "text": "def key key\n tuple = find_tuple_for(@relation_hash, key)\n tuple.empty? ? nil : tuple\n end", "title": "" }, { "docid": "15ec37e6f9debb1fecf95a2de47a21d0", "score": "0.59551096", "text": "def key key\n tuple = find_tuple_for(@relation_hash, key)\n tuple.empty? ? nil : tuple\n end", "title": "" }, { "docid": "3ed8f21d3164c5a1631ff4f93a993101", "score": "0.59540147", "text": "def get_entry(key)\n @bucket.find { |pair| pair[0] == key }\n end", "title": "" }, { "docid": "1342df4594ed2c34a08be02e2efb6abf", "score": "0.5946584", "text": "def fetch(*key); end", "title": "" }, { "docid": "79b35f3badc31e80936ff2a13443b924", "score": "0.5922282", "text": "def key(hash, &block)\n @key_hash.merge!(hash)\n block_given? ? fetch(&block) : self\n end", "title": "" }, { "docid": "0a011c3c0559a86e041c8388f1b5352c", "score": "0.59217346", "text": "def [](key)\n @hash[key.to_s]\n end", "title": "" }, { "docid": "7e3ab6787ef1beee3e390952f9ab917a", "score": "0.5920869", "text": "def slot_for_key(key)\n if key\n key = key.to_s\n if (s = key.index('{'))\n if (e = key.index('}', s + 1)) && e != s+1\n key = key[s+1..e-1]\n end\n end\n crc16(key) % HASH_SLOTS\n end\n end", "title": "" }, { "docid": "95bd1d9a3c9f4e9821762baf565c51b8", "score": "0.59014916", "text": "def fetch(key); end", "title": "" }, { "docid": "b6740dec31afde33845a13a3279c1904", "score": "0.589622", "text": "def hash_lookup(char)\n HASHED_VALS[char]\nend", "title": "" }, { "docid": "98064f9917b85c797b890122b6b42132", "score": "0.58805114", "text": "def parse_key(key)\n end", "title": "" }, { "docid": "6ac76b4fedd90fed55da7f55703330e4", "score": "0.58763397", "text": "def extract key\n self.tap do\n @extracted, @metadata = @skeleton['children'][0].fetch! key\n end\n end", "title": "" }, { "docid": "e5c50d70574c4e21ab52fc45296a11cb", "score": "0.58622086", "text": "def decoded_hash_key(hash_key)\n bin_code = Zlib::Inflate.inflate(hash_key.to_s).chars.map(&:to_i)\n Numo::Bit[*bin_code]\n end", "title": "" }, { "docid": "9f244fd6960925d474853167c77e5534", "score": "0.5853654", "text": "def get_hash_value(hash, key)\n if hash[key]\n return hash[key]\n else\n new_key = '\"' + key + '\"'\n if hash[new_key]\n return hash[new_key]\n end\n end\n return nil\n end", "title": "" }, { "docid": "8c393e0e82f983422557e5dd96ee1138", "score": "0.5841021", "text": "def hash_get(name, key)\n res = connection { |redis| redis.hget name.to_s, key.to_s }\n return if res == \"\"\n res\n end", "title": "" }, { "docid": "90c9b1366b8dacfaa40c4d43752dc527", "score": "0.58237493", "text": "def [](key)\n hash[key]\n end", "title": "" }, { "docid": "90c9b1366b8dacfaa40c4d43752dc527", "score": "0.58237493", "text": "def [](key)\n hash[key]\n end", "title": "" }, { "docid": "90c9b1366b8dacfaa40c4d43752dc527", "score": "0.58237493", "text": "def [](key)\n hash[key]\n end", "title": "" }, { "docid": "9f518ec47a1dc107f7d8ce115bb5820b", "score": "0.5817919", "text": "def [](key)\n hash = Cdb.hash(key)\n table = tables[hash % Cdb::NUM_HASHTABLES]\n return nil if table.empty?\n key_from_table(table, key, hash)\n end", "title": "" }, { "docid": "9e4707fdfab1e934017435775c65daad", "score": "0.58158714", "text": "def parse_key(key)\n end", "title": "" }, { "docid": "9e4707fdfab1e934017435775c65daad", "score": "0.58158714", "text": "def parse_key(key)\n end", "title": "" }, { "docid": "5f647f6ada00a2ea1cf009a27ab0f8cf", "score": "0.5781544", "text": "def internal_hash key\n key.hash.abs\n end", "title": "" }, { "docid": "afef454703d793c7f606d34b641805c4", "score": "0.57760817", "text": "def extract_key(keypair)\n keypair[/\"([^\"]*)\"/].gsub(\"\\\"\", \"\")\nend", "title": "" }, { "docid": "0b49113b51cce31c2aedee01586f3d44", "score": "0.57722217", "text": "def [](key)\n @hash[key.to_s]\n end", "title": "" }, { "docid": "7f5430aa1e0e71c8f19a83d1a9fc167f", "score": "0.57609993", "text": "def [](key)\n @mutex.synchronize do\n @hash[key.to_s]\n end\n end", "title": "" }, { "docid": "331f72722238d0d24efa581b942e9526", "score": "0.5752545", "text": "def [] key\n @hash[ key ]\n end", "title": "" }, { "docid": "3baf906457b2d65f692e85abb1b49ac5", "score": "0.5746068", "text": "def [](key)\n if hash.key?(key) then hash[key]\n elsif hash.key?(key.to_sym) then hash[key.to_sym]\n elsif hash.key?(key.to_s) then hash[key.to_s]\n end\n end", "title": "" }, { "docid": "38ac1a67f636da6ece1ed18bb0d920f3", "score": "0.57413954", "text": "def get(key)\n sync.synchronize(:SH) { hash[key] }\n end", "title": "" }, { "docid": "6942d235fd0298adfee4fbf877e2010c", "score": "0.57137185", "text": "def value_of(key)\n @cache.hget(@@hash_name, key)\n end", "title": "" }, { "docid": "0731d4cc834c61ae218d806787a22502", "score": "0.56966025", "text": "def fetch(key, *a, &b)\n @hash.fetch(key, *a, &b)\n end", "title": "" }, { "docid": "f798de4346c7e34d69b2c0281a870ea7", "score": "0.56696165", "text": "def match(key)\n return key, fetch(key) {\n raise AmbiguousArgument, catch(:ambiguous) {return complete(key)}\n }\n end", "title": "" }, { "docid": "4ae573cf29e931c63f0f0f02db366701", "score": "0.5647689", "text": "def fetch_key(key)\n string_key = key.to_s\n keys.detect { |k| k.to_s.casecmp(string_key) == 0 }\n end", "title": "" }, { "docid": "2e0cb5fc6d53e0d3a0ec0748256c0cab", "score": "0.563324", "text": "def [](key)\n @hash[key]\n end", "title": "" }, { "docid": "2e0cb5fc6d53e0d3a0ec0748256c0cab", "score": "0.563324", "text": "def [](key)\n @hash[key]\n end", "title": "" }, { "docid": "2e0cb5fc6d53e0d3a0ec0748256c0cab", "score": "0.563324", "text": "def [](key)\n @hash[key]\n end", "title": "" }, { "docid": "12c9b7ea14d43172f0d7d1c6ca08e359", "score": "0.563132", "text": "def hash_function key\r\n\t\treturn (key[1].ord + key[3].ord + key[5].ord)%20\r\n\tend", "title": "" }, { "docid": "a3125e92d390f9639ee941da77a3765f", "score": "0.5628777", "text": "def get(key); end", "title": "" }, { "docid": "a3125e92d390f9639ee941da77a3765f", "score": "0.5628777", "text": "def get(key); end", "title": "" }, { "docid": "a3125e92d390f9639ee941da77a3765f", "score": "0.5628777", "text": "def get(key); end", "title": "" }, { "docid": "a3125e92d390f9639ee941da77a3765f", "score": "0.5628777", "text": "def get(key); end", "title": "" }, { "docid": "a3125e92d390f9639ee941da77a3765f", "score": "0.5628777", "text": "def get(key); end", "title": "" }, { "docid": "a3125e92d390f9639ee941da77a3765f", "score": "0.5628777", "text": "def get(key); end", "title": "" }, { "docid": "a3125e92d390f9639ee941da77a3765f", "score": "0.5628777", "text": "def get(key); end", "title": "" }, { "docid": "a3125e92d390f9639ee941da77a3765f", "score": "0.5628777", "text": "def get(key); end", "title": "" }, { "docid": "a3125e92d390f9639ee941da77a3765f", "score": "0.5628777", "text": "def get(key); end", "title": "" }, { "docid": "a3125e92d390f9639ee941da77a3765f", "score": "0.5628777", "text": "def get(key); end", "title": "" }, { "docid": "a3125e92d390f9639ee941da77a3765f", "score": "0.5628777", "text": "def get(key); end", "title": "" }, { "docid": "a3125e92d390f9639ee941da77a3765f", "score": "0.5628777", "text": "def get(key); end", "title": "" }, { "docid": "a3125e92d390f9639ee941da77a3765f", "score": "0.5628777", "text": "def get(key); end", "title": "" }, { "docid": "a3125e92d390f9639ee941da77a3765f", "score": "0.5628777", "text": "def get(key); end", "title": "" }, { "docid": "a3125e92d390f9639ee941da77a3765f", "score": "0.5628777", "text": "def get(key); end", "title": "" }, { "docid": "d68e026a026fd611f97838a8e2056f83", "score": "0.56169355", "text": "def [] key; @hash[key] end", "title": "" }, { "docid": "67191743db65a7a32253defc0dfbc344", "score": "0.56059444", "text": "def [](key)\n if RUBY_ENGINE == 'opal'\n @hash[key]\n else\n @mutex.synchronize { @hash[key] }\n end\n end", "title": "" }, { "docid": "d912e372fc96204a8a183aa0fcca6d84", "score": "0.5581655", "text": "def [](key)\n @hash[key]\n end", "title": "" }, { "docid": "d912e372fc96204a8a183aa0fcca6d84", "score": "0.5581655", "text": "def [](key)\n @hash[key]\n end", "title": "" }, { "docid": "011316dbfc83979451a95ac395ac5bbf", "score": "0.55768794", "text": "def [] key\n @hash[key]\n end", "title": "" }, { "docid": "9082d6e650a44543df4af1d3bb6c6cfa", "score": "0.5567193", "text": "def get(k)\n obj = KeyValueHash.new(StringHash.new(k),nil)\n n = @hashTable.get(obj)\n return n.value\n end", "title": "" }, { "docid": "9082d6e650a44543df4af1d3bb6c6cfa", "score": "0.5567193", "text": "def get(k)\n obj = KeyValueHash.new(StringHash.new(k),nil)\n n = @hashTable.get(obj)\n return n.value\n end", "title": "" }, { "docid": "590418e7795a3455ae1bcadb465b37f2", "score": "0.55652624", "text": "def [](key)\n to_hash[key]\n rescue\n nil\n end", "title": "" }, { "docid": "795891262cbe9c14afe9d55a8e9887b1", "score": "0.55628675", "text": "def read_from_hash(hash, key)\n hash.fetch(key, default = nil)\n # return the correct value using the hash and key parameters\nend", "title": "" }, { "docid": "342f51137c6bdbba71c5e4142f40b17a", "score": "0.55619127", "text": "def ruby19_hash_key?(exp)\n exp.sexp_type == :lit && exp.length == 2 && RUBY_19_HASH_KEY === exp[1].to_s\n end", "title": "" }, { "docid": "2526c2426d8456b32b65139b68effeab", "score": "0.5556944", "text": "def [](key)\n key = key_for(key, false)\n @hash[key] if key\n end", "title": "" }, { "docid": "c1461a7f971ed33db57b879f3c67294b", "score": "0.5548404", "text": "def ssh_key_triple_for(key)\n begin\n IO.read(key).chomp.split\n rescue Errno::ENOENT => e\n raise ::RHC::KeyFileNotExistentException.new(\"File '#{key}' does not exist.\")\n rescue Errno::EACCES => e\n raise ::RHC::KeyFileAccessDeniedException.new(\"Access denied to '#{key}'.\")\n end\n end", "title": "" }, { "docid": "5a45cc4f72685a329ec2b116a12a272b", "score": "0.5544338", "text": "def hash_for(key)\r\n Zlib.crc32(key)\r\n end", "title": "" }, { "docid": "afe428d6d1b02523b3d7100f993ea46d", "score": "0.55226785", "text": "def [](key)\n connection.hget(key_label, key.to_s)\n end", "title": "" }, { "docid": "70a7024c8bf1353f2195642a9a4f37f5", "score": "0.55158967", "text": "def extract_key!(array, key)\n map_array!(array, -> v { v[key] })\n end", "title": "" }, { "docid": "81dff473c2177940939729f4e2cf4db9", "score": "0.55120623", "text": "def read_from_hash(hash, key)\n hash[key]\nend", "title": "" }, { "docid": "81dff473c2177940939729f4e2cf4db9", "score": "0.55120623", "text": "def read_from_hash(hash, key)\n hash[key]\nend", "title": "" }, { "docid": "81dff473c2177940939729f4e2cf4db9", "score": "0.55120623", "text": "def read_from_hash(hash, key)\n hash[key]\nend", "title": "" }, { "docid": "81dff473c2177940939729f4e2cf4db9", "score": "0.55120623", "text": "def read_from_hash(hash, key)\n hash[key]\nend", "title": "" }, { "docid": "81dff473c2177940939729f4e2cf4db9", "score": "0.55120623", "text": "def read_from_hash(hash, key)\n hash[key]\nend", "title": "" }, { "docid": "81dff473c2177940939729f4e2cf4db9", "score": "0.55120623", "text": "def read_from_hash(hash, key)\n hash[key]\nend", "title": "" }, { "docid": "322bf7366a92c51587d0ec5322ddb9cd", "score": "0.5508758", "text": "def split_hash(h)\n _, v, c, mash = h.split('$')\n return v, c.to_i, h #[0, 29].to_str, mash[-31, 31].to_str\n end", "title": "" }, { "docid": "46a651ba480ef81fc518978427dbf4e7", "score": "0.5495432", "text": "def [](key)\n if Symbol === key\n has_key?(key) ? orig_fetch(key) : orig_fetch(key.to_s)\n else\n orig_fetch(key)\n end\n end", "title": "" }, { "docid": "56fc0689f50c5745620e21cfeb001778", "score": "0.5494207", "text": "def [](key)\n to_h[key]\n end", "title": "" }, { "docid": "56fc0689f50c5745620e21cfeb001778", "score": "0.5494207", "text": "def [](key)\n to_h[key]\n end", "title": "" }, { "docid": "1335df21ed713f8fe3bf4c530c224f9f", "score": "0.5494195", "text": "def [](key)\n to_hash[key]\n end", "title": "" }, { "docid": "bffaa513620385fdd9b942df181fbe0e", "score": "0.5489303", "text": "def hash_value_for_key(hsh, key)\n if hsh.has_key?(key)\n matched = hsh[key] || ''\n else\n hsh.keys.each do |sub_key|\n sub_key_value = hsh[sub_key]\n matched = hash_value_for_key(sub_key_value, key) if sub_key_value.is_a?(Hash)\n break if matched\n end\n end\n matched\n end", "title": "" }, { "docid": "5d6f778ba228d33b3369c1b96a079323", "score": "0.54801595", "text": "def [](key)\n _hash[key]\n end", "title": "" }, { "docid": "c7b1d21dddb331482a5b2b15077d8280", "score": "0.54784805", "text": "def []( key ) @h[to_key(key)] end", "title": "" }, { "docid": "e8715e7da5bf99ca2bb46051034fa361", "score": "0.54779434", "text": "def fetch\n value_of @key\n end", "title": "" }, { "docid": "fe3e21ec5a40a4a0c04d46896f589c7a", "score": "0.54738474", "text": "def hget(key, field); end", "title": "" }, { "docid": "fe3e21ec5a40a4a0c04d46896f589c7a", "score": "0.54738474", "text": "def hget(key, field); end", "title": "" }, { "docid": "2f595339f39eb155384aa99bb665a459", "score": "0.546881", "text": "def read_hash(key)\n hash_name = self.class.instance_variable_get('@hash_name')\n hash = instance_variable_get(\"@#{hash_name}\")\n\n hash[key] if hash.key?(key)\n end", "title": "" }, { "docid": "8b7bdc74c977a125ed2ba028ef0704b7", "score": "0.54686505", "text": "def parse_key(match)\n key = match[0]\n key.slice!(0) if ':' == key[0]\n key = key[1..-2] if %w(' \").include?(key[0])\n key\n end", "title": "" }, { "docid": "484024748318db5a1c3fb8ce741795d6", "score": "0.5468101", "text": "def hash\n key.hash\n end", "title": "" }, { "docid": "484024748318db5a1c3fb8ce741795d6", "score": "0.5468101", "text": "def hash\n key.hash\n end", "title": "" } ]
3bf54f33f1170001bb29d7a2242d45b8
Retrives palettes as an array of hashes, same options as all but ordered by dateCreated
[ { "docid": "fb6a664196e90f68ffaed8aa6b1cbe2e", "score": "0.0", "text": "def new(options) \n Client.get(\"/palettes/new\", :query => options)\n end", "title": "" } ]
[ { "docid": "e039fab7efca72c4796bd857606e5cda", "score": "0.57349867", "text": "def index\n @palettes = Palette.all\n end", "title": "" }, { "docid": "232cca3a544a67e7b471cfa14126f78a", "score": "0.56953293", "text": "def get_palettes( template )\n\n Rails.logger.info 'partials_helper - get_palettes()'\n palettes = {}\n prompts = get_prompts_object( template )\n tag_settings = prompts[ PROMPTS_KEY_TAG_SETTINGS ]\n\n tag_settings.each do |t|\n use_palette = t[ 1 ][ 'use_palette' ]\n palette_id = t[ 1 ][ 'palette_id' ]\n\n if use_palette == 'checked'\n begin\n palette = Palette.find( palette_id )\n palettes[ t[0] ] = palette.colors\n\n rescue ActiveRecord::RecordNotFound\n palettes[ t[0] ] = Color.all\n end\n else\n palettes[ t[0] ] = Color.all\n end\n end # each tag setting\n\n color_settings = prompts[ PROMPTS_KEY_COLOR_SETTINGS ]\n\n# Rails.logger.info 'partials_helper - get_palettes() color_settings: '\\\n# + JSON.pretty_generate( color_settings )\n\n color_settings.each do |c|\n use_palette = c[ 1 ][ PROMPTS_KEY_REPLACE_COLOR_USE_PALETTE ]\n palette_id = c[ 1 ][ PROMPTS_KEY_REPLACE_COLOR_PALETTE_ID ]\n\n if use_palette === 'checked'\n begin\n\n palette = Palette.find( palette_id )\n palettes[ c[0] ] = palette.colors\n rescue ActiveRecord::RecordNotFound\n palettes[ c[0] ] = Color.all\n end\n else\n palettes[ c[0] ] = Color.all\n end\n\n\n end # each color setting\n\n\n# Rails.logger.info 'PartialsHelper - get_palettes() - palettes: '\\\n# + JSON.pretty_generate( palettes )\n\n palettes\n end", "title": "" }, { "docid": "632dd2663acfbf55e195f7f74e550df1", "score": "0.54429597", "text": "def paragraphes_as_to_hash\n (@paragraphes||[]).collect{|p|p.to_hash}\n end", "title": "" }, { "docid": "44f265cfbc30660d172afdf6250874c3", "score": "0.5346891", "text": "def pizzas\n [\n {name: \"Margerita\", price: \"5\"},\n {name: \"Hawai\", price: \"7\"},\n {name: \"Quattro Formaggi\", price: \"7\"},\n {name: \"Calzone\", price: \"8\"}\n ]\nend", "title": "" }, { "docid": "6aabbdd702b895dec55fc2a1f281ca65", "score": "0.5326901", "text": "def find_all options_for_render = {}\n \n options_for_render[:per_page] ||= 5\n options_for_render[:page] ||= 1\n \n result = []\n \n #@flickr = Rails.cache.fetch('flickr_recent', :expires_in => 1800)\n \n flickr.people.getPublicPhotos(\n :user_id => FLICKR_USER_ID,\n :per_page => options_for_render[:per_page],\n :page => options_for_render[:page]\n ).each do |photo|\n flick = FlickPic.new\n flick.open(photo)\n result << flick\n end\n \n return result\n \n end", "title": "" }, { "docid": "1a2110174e6799a4495d85d37400a6eb", "score": "0.52129954", "text": "def list\n order = 0\n dates = []\n list = {}\n\n @cpdb.query(\"select date from checkpoints group by date order by date asc\").each do |row|\n dates << row.first\n end\n\n dates.each do |date|\n order += 1\n list[order] = date\n end\n\n list\n end", "title": "" }, { "docid": "a46dd252d765e7bdba215b2f83f4c408", "score": "0.5209091", "text": "def to_a\n a = []\n \n @collection.each do |e|\n a << e.style \n end\n \n return a\n end", "title": "" }, { "docid": "8a3e952ce925edadff5f673f80a1909d", "score": "0.5164214", "text": "def planets\n ret = []\n @planets.each do |item|\n ret.push(item.attributes)\n end\n return ret\n end", "title": "" }, { "docid": "11b1f8c4357f4907e0a2e40b8b7495e0", "score": "0.5140996", "text": "def export_preset_list\n http_get('content/ea/api/exportpresets.v1.json')\n end", "title": "" }, { "docid": "441d2531c476f419c0e588fbf93a1412", "score": "0.5122714", "text": "def titles_pictures\n @titles = []\n Articles.all.each do |article|\n title = []\n title[0] = article.title\n title[1] = article.picture\n @titles << title\n end\n return @titles\nend", "title": "" }, { "docid": "441d2531c476f419c0e588fbf93a1412", "score": "0.5122714", "text": "def titles_pictures\n @titles = []\n Articles.all.each do |article|\n title = []\n title[0] = article.title\n title[1] = article.picture\n @titles << title\n end\n return @titles\nend", "title": "" }, { "docid": "842b824d481c418ada4438849a3f076b", "score": "0.509588", "text": "def titles_pictures\r\n @titles = []\r\n Articles.all.each do |article|\r\n title = []\r\n title[0] = article.title\r\n title[1] = article.picture\r\n @titles << title\r\n end\r\n return @titles\r\nend", "title": "" }, { "docid": "17e843a3b04a08c1ccbb7e5a933bf596", "score": "0.5089571", "text": "def get_styles\n # what is self? ==> painter instance\n\n self.paintings.map do |painting|\n # return the array with just the style string\n # paintng.style\n\n # return hash for a painting title and style\n {style: painting.style, title: painting.title}\n end.uniq\n\n end", "title": "" }, { "docid": "4ae3030f4aadcf59a19ad303592b07ab", "score": "0.50824875", "text": "def tweets_pictures\n @titles = []\n Articles.all.each do |article|\n title = []\n title[0] = article.tweet_message\n title[1] = article.picture\n @titles << title\n end\n return @titles\nend", "title": "" }, { "docid": "4ae3030f4aadcf59a19ad303592b07ab", "score": "0.50824875", "text": "def tweets_pictures\n @titles = []\n Articles.all.each do |article|\n title = []\n title[0] = article.tweet_message\n title[1] = article.picture\n @titles << title\n end\n return @titles\nend", "title": "" }, { "docid": "74a517832a530415b8027990e3da9f4e", "score": "0.50659865", "text": "def poke_history\n poke_history = []\n count = 0\n self.pokes.order(\"created_at ASC\").each do |poke|\n poke_history << {time: poke.created_at, count: count}\n count += 1\n end\n return poke_history\n end", "title": "" }, { "docid": "09c65b568843a0c1d36027e5db291ba2", "score": "0.5047295", "text": "def extract_stylePeriodSet\n stylePeriodSet_array = {}\n self.find_by_terms('//vra:stylePeriodSet/vra:display').each do |stylePeriodSet_display|\n insert_solr_field_value(stylePeriodSet_array, \"stylePeriodSet_display_tesim\", stylePeriodSet_display.text)\n end\n\n # Add a facet for each period\n self.find_by_terms('//vra:stylePeriodSet/vra:stylePeriod').each do |stylePeriod|\n insert_solr_field_value(stylePeriodSet_array, \"stylePeriod_tesim\", stylePeriod.text)\n insert_solr_field_value(stylePeriodSet_array, \"stylePeriod_facet\", stylePeriod.text)\n end\n\n return stylePeriodSet_array\n end", "title": "" }, { "docid": "b4bbb210dfcbdd2c64f7d72d11e38611", "score": "0.50378", "text": "def tweets_pictures\r\n @titles = []\r\n Articles.all.each do |article|\r\n title = []\r\n title[0] = article.tweet_message\r\n title[1] = article.picture\r\n @titles << title\r\n end\r\n return @titles\r\nend", "title": "" }, { "docid": "3cc6685112f966c69d6cd439cfedb3e0", "score": "0.5027511", "text": "def generate_style_array\n styles = Array.new\n\n #extract the styles from the hash\n get_styles.each do |k,v|\n styles.push(v)\n end\n\n return styles\n end", "title": "" }, { "docid": "280a47ff153d82182dbf4a6f7d9e824b", "score": "0.49824965", "text": "def presets options = {}\n perform_get(\"/me/presets\", options)\n end", "title": "" }, { "docid": "ab3ce5aef6f60cb9e0bc0dcf38fdd473", "score": "0.49619156", "text": "def generate_asset_hash(assets)\n assets_array = []\n assets.each do |asset|\n assets_array << { title: asset.title, play_link: play_link_for(asset) } if asset.title\n end\n assets_array\n end", "title": "" }, { "docid": "a6bef4b17451ab5483d9609f3739647b", "score": "0.49423146", "text": "def get_every_slideshow_seed\n Slideshow.pluck(:seed).to_set\n end", "title": "" }, { "docid": "f082e07415bfff6c7fd84ccf20b699e9", "score": "0.49260384", "text": "def list\n @list ||= chart.keys.sort\n end", "title": "" }, { "docid": "60d3968b7e71d23b2c887869023fe22d", "score": "0.49220157", "text": "def pets\n self.operations.preload(:pets).where(\"state = 'В приюте'\").map(&:pet)\n end", "title": "" }, { "docid": "0beff42614c0b35fd736063f12e1c9e7", "score": "0.4913025", "text": "def slides_as_arrays\n return [] if @slides.nil?\n @slides.map { |s| [s[\"title\"], s[\"subtitle\"]] }\n end", "title": "" }, { "docid": "2be0783112a3da9d8a3d752e9ea1bbd4", "score": "0.49051324", "text": "def presets\n presets_by_key :presets\n end", "title": "" }, { "docid": "c75cf2ebaf7a1d99ab1997bdf416a0f5", "score": "0.48999798", "text": "def items_array\n array = []\n self.excerpts.each do |object|\n array.push object\n end\n self.quotes.each do |object|\n array.push object\n end\n self.terms.each do |object|\n array.push object\n end\n self.people.each do |object|\n array.push object\n end\n return array\n end", "title": "" }, { "docid": "c75cf2ebaf7a1d99ab1997bdf416a0f5", "score": "0.48999798", "text": "def items_array\n array = []\n self.excerpts.each do |object|\n array.push object\n end\n self.quotes.each do |object|\n array.push object\n end\n self.terms.each do |object|\n array.push object\n end\n self.people.each do |object|\n array.push object\n end\n return array\n end", "title": "" }, { "docid": "00602e35d8fd1a3832e0f5eb784d34c7", "score": "0.4897627", "text": "def select_files\n Hash[scanned_resource_presenters.map { |volume| [volume.to_s, volume.thumbnail_id] }]\n end", "title": "" }, { "docid": "9f2bed02c0c3adced7ea23d39184af59", "score": "0.48922405", "text": "def paradatrayectos\n\t\t\t@_paradatrayectos = ParadaTrayecto.load_data if @_paradatrayectos.nil?\n\t\t\treturn @_paradatrayectos\n\t\tend", "title": "" }, { "docid": "516f432697e9f239a2939bed02a231ce", "score": "0.4886398", "text": "def getPolls()\r\n\tp_arr = []\r\n\tdb = openDB()\r\n\tcurrent_polls = db.execute('SELECT user, first_choice, second_choice, third_choice FROM Class')\r\n\r\n\tcurrent_polls.each { |user|\r\n\t\tp_hash = Hash.new\r\n\t\tp_hash[:user] = user[0]\r\n\t\tp_hash[:first] = user[1]\r\n\t\tp_hash[:second] = user[2]\r\n\t\tp_hash[:third] = user[3]\r\n\r\n\t\tp_arr.push(p_hash)\r\n\t}\r\n\treturn p_arr\r\nend", "title": "" }, { "docid": "e15657c8e49eb88fd12616633451136d", "score": "0.488561", "text": "def get_list_of_all_planets_hash\n list = []\n i = 0\n @planets.each do |planet|\n list << \"##{i + 1}. #{planet[:name]}\"\n i += 1\n end\n return list\n end", "title": "" }, { "docid": "e0c4de9a12a9ee8f990cc42736929c02", "score": "0.48706338", "text": "def galleries \n paintings.map { |paint| paint.gallery }.uniq\n end", "title": "" }, { "docid": "8bd2eef42937c3ed8d4c50b4c4c3253d", "score": "0.4854337", "text": "def planets\n @planets.values\n end", "title": "" }, { "docid": "8bd2eef42937c3ed8d4c50b4c4c3253d", "score": "0.4854337", "text": "def planets\n @planets.values\n end", "title": "" }, { "docid": "8bd2eef42937c3ed8d4c50b4c4c3253d", "score": "0.4854337", "text": "def planets\n @planets.values\n end", "title": "" }, { "docid": "81abe78d6c8219ed26a4cf6d08f64fb3", "score": "0.48475993", "text": "def sort_palette\n @color_palette = Array.new\n @color_map = @color_map.sort_by {|k,v| v}.reverse\n @color_map.each{|key, value|\n @color_palette << key\n }\n # color_palette.each{|color| puts color}\n return @color_palette\n end", "title": "" }, { "docid": "da3f2e29edcbc7824183afa18a667caa", "score": "0.48436219", "text": "def top(options) \n Client.get(\"/palettes/top\", :query => options)\n end", "title": "" }, { "docid": "7f00165e8ae5bff79be5375eee1515d5", "score": "0.48429996", "text": "def archive_data\n # For SQLite you can use strftime(\"%Y\", created_at) as year, strftime(\"%m\", created_at) as month\n @archive_data ||= Page.select('extract(year from created_at) as year, extract(month from created_at) as month').distinct\n end", "title": "" }, { "docid": "14b6d43b2e1a6f53e0c47797c30b7ebb", "score": "0.48361117", "text": "def particles\n @particles ||= selected_data.to_h { |v| [v.downcase, v] }\n end", "title": "" }, { "docid": "6fe8f5ad488e2105d97f1d90611dc0f3", "score": "0.48342583", "text": "def plastics()\n sql = \"SELECT plastics.* FROM plastics INNER JOIN products ON products.plastic_id = plastics.id WHERE products.tag_id = $1;\"\n values= [@id]\n results= SqlRunner.run(sql, values)\n return results.map{|plastic| Plastic.new(plastic)}\nend", "title": "" }, { "docid": "0db259508e3c658674f5b6bf7b2c525a", "score": "0.48253936", "text": "def index\n @options = @asset.options.asc(:expiration, :strike).page params[:page]\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @asset.options.asc(:expiration, :strike) }\n end\n end", "title": "" }, { "docid": "f9beab338bb72dca733d6e004c96d9f4", "score": "0.48192737", "text": "def created_items\n assets_creators.map(&:asset).uniq.compact\n end", "title": "" }, { "docid": "71c84fae1e8655b124387923c5fc2aa5", "score": "0.48036638", "text": "def galleries\n paintings.map{|p| p.gallery}.uniq\n end", "title": "" }, { "docid": "3f8735690db40c0209527289b85d7028", "score": "0.4795397", "text": "def background\n\t\tarray = []\n\t\tcomments.each do |c|\n\t\t\tarray << c\n\t\tend \n\t\treports.each do |r|\n\t\t\tarray << r\n\t\tend\n\n\t\tarray.sort_by {|x| x.created_at }.reverse\n\tend", "title": "" }, { "docid": "6d993083f592436287ae4c157aa726cd", "score": "0.4792968", "text": "def galleries\n paintings.map {|painting| painting.gallery}\n \n end", "title": "" }, { "docid": "d12708f9392866a728cf7f9c398c806f", "score": "0.47910258", "text": "def index\n @values = @asset.values.asc(:timestamp).page params[:page]\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @asset.values.asc(:timestamp) }\n end\n end", "title": "" }, { "docid": "1d2e94b174c1e113641f7a525c1251da", "score": "0.47907043", "text": "def fetch_all_portions(query, fields)\n slices = []\n loop do\n slice = ResponsePortion.new(fetch_json(query), fields)\n slices << slice\n return slices if slice.exhaustive_for?(query)\n\n query.set_param(:before, slice.last_item_creation_time)\n end\n end", "title": "" }, { "docid": "a987284f39beb9d7720170468856e075", "score": "0.4764486", "text": "def to_array\n self.class::PROPERTIES.map { |name| @data[name] }\n end", "title": "" }, { "docid": "60783d1ed42f5bc3889682eb25e1c68e", "score": "0.4761132", "text": "def read_all\n colors_map.values.clone.sort_by { |color| color[:name] }\n end", "title": "" }, { "docid": "2c8e6b39452a032fb7f833e8e6e98aa2", "score": "0.47512752", "text": "def galleries\n paintings.map {|painting| painting.gallery}\n end", "title": "" }, { "docid": "dc5ad82e56483fe8ef327bdd66caca4b", "score": "0.47403768", "text": "def hmt_list(hmt)\n l = []\n hmt.each do |k|\n# puts \"just before adding to array: #{k}\"\n l << k.variable_id unless k.marked_for_destruction?\n end\n return l.sort.to_yaml\n end", "title": "" }, { "docid": "dc5ad82e56483fe8ef327bdd66caca4b", "score": "0.47403768", "text": "def hmt_list(hmt)\n l = []\n hmt.each do |k|\n# puts \"just before adding to array: #{k}\"\n l << k.variable_id unless k.marked_for_destruction?\n end\n return l.sort.to_yaml\n end", "title": "" }, { "docid": "070264eff6a291f9cd2137ac8077b8e5", "score": "0.4733031", "text": "def piezas\n values.flat_map { |columna_hash| columna_hash.values.compact }\n end", "title": "" }, { "docid": "68db2f0271e9a163b5bd69a1cd9c0992", "score": "0.4732718", "text": "def profile_options\n result={}\n profiles.set.each do |piv|\n result[piv.path]=piv.value\n result[\"#{piv.path}Unit\"]=piv.unit.label unless piv.unit.nil?\n result[\"#{piv.path}PerUnit\"]=piv.per_unit.label unless piv.per_unit.nil?\n end\n if contents[:start_date] && !contents[:start_date].value.blank?\n result[:start_date] = contents[:start_date].value\n end\n if contents[:end_date] && !contents[:end_date].value.blank?\n result[:end_date] = contents[:end_date].value\n end\n return result\n end", "title": "" }, { "docid": "e8469ae2d50745615f0aecaf8dedf82c", "score": "0.47314274", "text": "def hash\n [from_page, pages_count, pages, watermark_options, width, height, dpi, password, margin_top, margin_bottom, margin_left, margin_right, pdf_format, remove_pdfa_compliance, zoom, linearize, link_duplicate_streams, remove_unused_objects, remove_unused_streams, compress_images, image_quality, unembed_fonts, grayscale, center_window, direction, display_doc_title, fit_window, hide_menu_bar, hide_tool_bar, hide_window_ui, non_full_screen_page_mode, page_layout, page_mode, rotate].hash\n end", "title": "" }, { "docid": "37f18419a3b20c8984429e9606f844a4", "score": "0.47272712", "text": "def pessoas()\n return @pessoas\n end", "title": "" }, { "docid": "2c0a6dece9ea410874ca119fc1a4328b", "score": "0.47245577", "text": "def getpreset(type)\n presetarray = Array.new\n \n # Go through govsites data\n if type === \"govsites\"\n sites = JSON.parse(File.read(\"public/sites.json\"))\n sites[\"data\"].each do |d|\n presetarray.push(d[8])\n end\n end\n\n return presetarray\nend", "title": "" }, { "docid": "36b8fcf588dd400955d3440ea48aa853", "score": "0.4723818", "text": "def generate_selected_pokemon_array(page_id)\n if $pokedex.national?\n @selected_pokemons = []\n 1.step(GameData::Pokemon.all.size - 1) do |i|\n @selected_pokemons << i if $pokedex.pokemon_seen?(i)\n end\n else\n selected_pokemons = []\n 1.step(GameData::Pokemon.all.size - 1) do |i|\n selected_pokemons << i if $pokedex.pokemon_seen?(i) && GameData::Pokemon[i].id_bis > 0\n end\n selected_pokemons.sort! { |a, b| GameData::Pokemon[a].id_bis <=> GameData::Pokemon[b].id_bis }\n @selected_pokemons = selected_pokemons\n end\n @selected_pokemons.compact!\n @selected_pokemons << 0 if @selected_pokemons.empty?\n # Index ajustment\n if page_id\n @index = @selected_pokemons.index(page_id)\n unless @index\n @selected_pokemons << page_id\n @index = @selected_pokemons.size - 1\n end\n # @index -= 1\n else\n @index = 0\n end\n end", "title": "" }, { "docid": "9ace2241cdd62f9c3a8b3481d68c5f88", "score": "0.47231084", "text": "def clouds\n content.keys.sort if content\n end", "title": "" }, { "docid": "be2d9a7fd64450251f56172444b30212", "score": "0.47208196", "text": "def index\n @bike_colors = BikeColor.all.order(\"updated_at DESC\").order(\"created_at DESC\")\n\n render json: @bike_colors\n end", "title": "" }, { "docid": "c2f1dc13c7eea2e352bfe54858ee3b4c", "score": "0.47163925", "text": "def index\n @paintings ||= Painting.order(created_at: :desc)\n @profiles ||= Profile.all\n @categories ||= PaintingCategory.all\n end", "title": "" }, { "docid": "1ff12f0d8c2b9c700f5bd5989a0d3d08", "score": "0.4711355", "text": "def fragments_list\n retVal = Watermark.select(:account_id, :fragment, :key).order(\"account_id ASC, fragment ASC\").to_json(:except => :id)\n render json: retVal, \n status: 200\n end", "title": "" }, { "docid": "a476d32c2afad8b27f0d5e7664d1cfc3", "score": "0.471065", "text": "def galleries\n paintings.map do |painting|\n painting.gallery\n end\n end", "title": "" }, { "docid": "a476d32c2afad8b27f0d5e7664d1cfc3", "score": "0.471065", "text": "def galleries\n paintings.map do |painting|\n painting.gallery\n end\n end", "title": "" }, { "docid": "0064653ffeb4b6807592810210712138", "score": "0.47073355", "text": "def to_yaml_properties\n return ['@id','@report_type','@name','@fields','@filters','@limit','@sql','@created_by_master','@friendly_url_key', '@stats']\n end", "title": "" }, { "docid": "8a70351ebaf5e529af83ba7750b25665", "score": "0.47049803", "text": "def posts_template_data(post_items)\n if post_items.nil?\n return []\n end\n\n template_data = post_items.map do |post|\n {\n :title => post.data['title'],\n :filename => post.name,\n :date => post.date\n }\n end\n\n template_data.sort! { |x,y| y[:date] <=> x[:date] }\n\n template_data\n end", "title": "" }, { "docid": "b1d02ce255813d7fd8a736504ac588bd", "score": "0.47021285", "text": "def presets options = {}\n perform_get(\"/users/#{get_id}/presets\")\n end", "title": "" }, { "docid": "5b38bc5f030357a21a410c0846ad980f", "score": "0.4701237", "text": "def to_paired_array\n #little JSON trick to get a hash of our object\n hash = JSON.parse(self.to_json, {symbolize_names: true});\n \n #remove the values we don't want (remenants of database)\n hash.reject! { |key, val| key == :id };\n hash.reject! { |key, val| key == :tournament_id };\n hash.reject! { |key, val| key == :created_at };\n hash.reject! { |key, val| key == :updated_at };\n hash.reject! { |key, val| key == :format }; ##this is temp\n \n #make array and return\n arr = hash.map { |key,val| [key, val] };\n\t return arr;\n end", "title": "" }, { "docid": "496a3eed8d05e92d69ff1886a3749beb", "score": "0.4697585", "text": "def get_pictures(month, year)\n pictures = Picture.where(month: month, year: year).to_a\n pictures = pictures.reject { |pic| pic.user.disabled? }\n\n # Sort by photographer\n pictures.sort_by! { |pic| pic.user.fullname }\n end", "title": "" }, { "docid": "4ac08370c8fcfacd5a35e71c0d0f69a2", "score": "0.46901557", "text": "def random\n Client.get(\"/palettes/random\")\n end", "title": "" }, { "docid": "fda79ad08058f563c45d3132575bb450", "score": "0.4682159", "text": "def get_all_posts\n postings = Post.all\n @posts = []\n postings.each do |posting|\n posting_hash = posting.to_hash\n author_name = posting.user.name\n loc_hash = posting.location.to_hash\n posting_hash[:author]=author_name\n posting_hash[:created_at]=posting.created_at\n posting_hash[:location]=loc_hash\n @posts << posting_hash\n end\n return\n end", "title": "" }, { "docid": "c402145549d99ddeec42e2787f9d63b6", "score": "0.46804252", "text": "def galleries\n self.paintings.map { |paint| paint.gallery }\n end", "title": "" }, { "docid": "4efacf46c2785bc74ced2c0ec1e83dca", "score": "0.46776155", "text": "def create_presets\n Preset.create!(\"venture_id\": self.id, name: \"Test\", data: [{level: \"main\", identifier: \"sales\", color: 1}, {level: \"main\", identifier: \"costs\", color: 2}].to_json)\n end", "title": "" }, { "docid": "1d71449ea528f17cd01cf50a9c18ff74", "score": "0.4664887", "text": "def computed prop\n a = []\n \n # dummy lookup\n @collection.each do |e|\n a << e.style[prop.to_s] \n end\n \n a\n end", "title": "" }, { "docid": "bec8ae8ccb191a400a174e44092af650", "score": "0.4661805", "text": "def preferences platform\n result=[]\n @preference_set.map{|pref| pref[:name]}.uniq.each { |pref_name|\n pref = preference_object(pref_name, platform)\n result << pref if pref\n }\n result\n end", "title": "" }, { "docid": "6e6c2dd3cf66fc6c4fdaabc037598488", "score": "0.46611395", "text": "def take_scene_list\n @scene_hash.keys.sort!\n end", "title": "" }, { "docid": "9af5fee1d84eebd50dfcd5cab6ad065d", "score": "0.46608385", "text": "def index\n @curves = Curve.all.order(\"created_at DESC\")\n end", "title": "" }, { "docid": "b0460b62c06f57b7f8b57d57682ff7dd", "score": "0.46589175", "text": "def galleries\n paintings.map do |painting|\n painting.gallery \n end\n end", "title": "" }, { "docid": "f224b345dbc29a6bd679994db4e26248", "score": "0.46574673", "text": "def galleries \n galleries = paintings.map do |painting|\n painting.gallery\n galleries.uniq\n end \nend", "title": "" }, { "docid": "eb8697cdbe536b3f1d11dd0d0d8a09f0", "score": "0.46532062", "text": "def painting_category_list\n @painting_categories ||= PaintingCategory.order(created_at: :desc)\n end", "title": "" }, { "docid": "8579d877533a7d559d73cb4587ae41da", "score": "0.46480054", "text": "def get_all_objects\n get_all_named_objects('p')\n end", "title": "" }, { "docid": "fd600d6112dc7130dd84decfd2c75770", "score": "0.46454898", "text": "def index\n @price_presets = PricePreset.all.order(quest_item_id: :asc, daytype_id: :asc, t0: :asc)\n end", "title": "" }, { "docid": "b701565570512515482ada3dd0708d98", "score": "0.46429846", "text": "def songs\n songs = []\n return songs if !self.object.songs \n\n self.object.songs.each do |song|\n # songs[song.title] = url_for(song.track)\n # songs[song.title] = [\"title\": song.title, \"track\": url_for(song.track), \"art\": url_for(song.album.album_cover)]\n songs.push(\"id\": song.id, \"title\": song.title, \"track\": url_for(song.track), \"art\": url_for(song.album.album_cover), \"album\": { \"title\": song.album.title, \"id\": song.album.id, \"album_cover\": url_for(song.album.album_cover)})\n end\n songs\n end", "title": "" }, { "docid": "72a0578e3153778b0aaf5dfd2d4a6e2d", "score": "0.4640518", "text": "def painting_style\n self.all.map do |painting|\n painting.style.uniq\n end\n end", "title": "" }, { "docid": "e0e98bf461402a952d03386c08542bcc", "score": "0.46384913", "text": "def get_properties_organized_by_language\r\n #Create a hash\r\n property_files = {}\r\n PropertyFileAttributes::LOCALES.each do |l|\r\n property_files[l] = []\r\n end\r\n @property_files.each do |p|\r\n property_files[p.language].push(p)\r\n end\r\n #Sort the file arrays based on the filenames\r\n property_files.each_value do |v|\r\n v.sort!{|x,y| x.filename <=> y.filename}\r\n end\r\n property_files\r\n end", "title": "" }, { "docid": "3b12eb17a50f444c5abb54cda741f06a", "score": "0.46334758", "text": "def my_galleries\n self.my_paintings.map do |painting|\n painting.gallery\n end.uniq\n end", "title": "" }, { "docid": "da7c2c0ae7ac48fce9bb595bd9d21130", "score": "0.4631582", "text": "def to_a\n @styles.dup\n end", "title": "" }, { "docid": "ffbfbaa2e163cfda80bc6d213be50885", "score": "0.46310708", "text": "def prefectures\n self.prefecture_ids.map {|prefecture_id| Prefecture.find prefecture_id}\n end", "title": "" }, { "docid": "197cc81095867e90a0658b8e617b0124", "score": "0.4624563", "text": "def planets_and_values\n planets = Planet.find_all(@matchers)\n planets.sort! if @spec[:sort]\n values = planets.map { |p| [yield(p)] }\n\n [planets, values]\n end", "title": "" }, { "docid": "ca4137e2600e19c3ab9cd91cdf9eb536", "score": "0.46235326", "text": "def all_people_with_stories\n people_array = []\n people.each do |person|\n people_array << person.to_layout_hash\n end\n people_array\n end", "title": "" }, { "docid": "d3e69cc474b82484cc3d2bc7934804d6", "score": "0.46230698", "text": "def to_a\n [\n @id,\n @id_twitter,\n @theme,\n @author,\n @text,\n @cleaned_text,\n @date,\n @criteria,\n @notation,\n @verified\n ] \n end", "title": "" }, { "docid": "fe5a92c4ff2f09910b9c59b5e1ab702c", "score": "0.46223828", "text": "def category_get_properties_array\n\t\t\tgroups = []\n return [] if self.nil?\n\t\t\tself.property_groups.get_active.each do |group|\n\t\t\t\trow = {}\n\t\t\t\trow[:name] = group.name\n\t\t\t\trow[:values] = []\n\t\t\t\tgroup.properties.get_properties_for_filter.each do |property|\n\t\t\t\t\tvalues = property.properties_values.get_property_values_for_filter.map {|pv| pv }\n\t\t\t\t\trow[:values] += values if !values.empty?\n\t\t\t\tend\n\t\t\t\tgroups << row if !row[:values].empty?\n\t\t\tend\n\n\t\t\treturn groups\n\t\tend", "title": "" }, { "docid": "7ad9d3df5485285b7a12134d84a55806", "score": "0.4620034", "text": "def user_avatar_object\n avatars = self.user_avatars.where(is_active: true).order(:order)\n result = Array.new \n avatars.each do |a|\n avatar_json = {\n avatar: a.origin_url,\n thumbnail: a.thumb_url,\n default: (!a.order.nil? and a.order == 0),\n avatar_id: a.id,\n order: (a.order.nil? ? 100 : a.order)\n }\n result << avatar_json\n end\n return result\n end", "title": "" }, { "docid": "8264912f23af92f46b04eb83bc16a861", "score": "0.46190917", "text": "def all\n PresetCollection.new(unique_preset_scenarios.map { |id| Turk::Preset.new(id) })\n end", "title": "" }, { "docid": "7d48adc9e19c0439cc674c8f88231767", "score": "0.46172073", "text": "def prints_data\r\n prints = []\r\n self.prints.each do |p|\r\n print = {\r\n id: p.id,\r\n filename: p.filename,\r\n path: p.path,\r\n relative_path: p.relative_path,\r\n filesize: p.filesize,\r\n filament: p.filament,\r\n approved: p.completed,\r\n created_at: p.created_at,\r\n status: p.status\r\n }\r\n prints.push(print)\r\n end\r\n prints\r\n end", "title": "" }, { "docid": "0fa57d9f3e46eec26b3131916b0dd9af", "score": "0.46090296", "text": "def index\n @parishes = Parish.order('name').all\n end", "title": "" }, { "docid": "ca443d7cbbd6b9b4a2091f55fe23b908", "score": "0.4604372", "text": "def get_portfolio_stock_list()\n portfolio_stock_list = []\n portfolio_hash = get_portfolio_hash()\n # Need to make array of all the portfolio hash keys\n portfolio_stock_list = portfolio_hash.keys\n return portfolio_stock_list\nend", "title": "" }, { "docid": "a63a9a2faad3fb4347eb6053bbfcf6fd", "score": "0.46032792", "text": "def colors\n results = []\n ['red','orange','yellow','green','blue','purple'].each do |color|\n Photo.search(:tags => color, :user_id => flickr_user_id) do |p|\n results << p\n puts p.inspect if @client.verbose\n end\n end\n results\n end", "title": "" }, { "docid": "c9c082f928c3d6d52355cbd205d11816", "score": "0.46002844", "text": "def feelings_to_array\n FEELINGS.map { |k, v| [v, k] }\n end", "title": "" }, { "docid": "de1a96c89dc683d49cb2ec4b71d91e9b", "score": "0.45994577", "text": "def index\n self.skip_secondary = true\n @papers = Paper.order(\"created_at DESC\").all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @papers }\n end\n end", "title": "" } ]
44dbc3a9844fce86000de0a397377a6e
POST /plans POST /plans.json
[ { "docid": "0c5c9619fff27b5e91f425563d1c2715", "score": "0.0", "text": "def create\n @plan = @book.plans.new(plan_params)\n if plan_params[:reference_id] != \"\"\n @reference_plan = Plan.find_by_id(plan_params[:reference_id]) \n end\n\n respond_to do |format|\n if @plan.save\n # copy all the riders, and coverages to the new plan\n if @reference_plan != nil\n # copy riders\n @reference_plan.riders.each do |rider|\n new_rider = @plan.riders.new(rider.copied_attributes)\n new_rider.save\n\n # copy coverage\n rider.coverages.each do |coverage|\n new_coverage = new_rider.coverages.new(coverage.copied_attributes)\n new_coverage.save\n end\n end\n end\n\n format.json { render :show, status: :created, location: api_v1_book_plan_url(@plan.book, @plan) }\n else\n format.json { render json: @plan.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
[ { "docid": "f853bc95a50a1f388ebadd3f2d500b9c", "score": "0.77876526", "text": "def create_plan(options = {})\n build_response(make_request(:post, url: 'plans', options: options))\n end", "title": "" }, { "docid": "bfa94849d3292c0021b711bc7f8dacc3", "score": "0.7672708", "text": "def create\n @plan = Plan.new(plan_params)\n\n if @plan.save\n render json: @plan, status: :created\n else\n render json: @plan.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "21a433fb159b189282f3f0cf191706c0", "score": "0.7620931", "text": "def create\n @plan = Plan.new(plan_params)\n\n if @plan.save\n render json: @plan, status: :created, location: @plan\n else\n render json: @plan.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "8f2e7adee02d10e8fb178dce2d2c7ec8", "score": "0.7512967", "text": "def create\n @plan = current_user.plans.build(plan_params)\n\n respond_to do |format|\n if @plan.save\n format.html { redirect_to plans_url, notice: 'Plan was successfully created.' }\n format.json { render :show, status: :created, location: @plan }\n else\n format.html { render :new }\n format.json { render json: @plan.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cfe686e379b13c23262c694c9324577c", "score": "0.7511888", "text": "def create\n @plan = Plan.new(params[:plan])\n\n respond_to do |format|\n if @plan.save\n format.html { redirect_to plans_url, notice: 'Plan was successfully created.' }\n format.json { render json: @plan, status: :created, location: @plan }\n else\n format.html { render action: \"new\" }\n format.json { render json: @plan.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5e9f1080ce27eafea8b038c2909fa5af", "score": "0.7462016", "text": "def create\n @plan = current_user.plans.build(plan_params)\n\n respond_to do |format|\n if @plan.save\n format.html { redirect_to @plan, notice: 'Plan was successfully created.' }\n format.json { render :show, status: :created, location: @plan }\n else\n format.html { render :new }\n format.json { render json: @plan.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "15882b7b574af35e4bfad2a5b6638634", "score": "0.74597496", "text": "def create\n @plan = Plan.new(plan_params)\n unit_plans = params[\"plan\"][\"unit_plans\"]\n unit_plans_objs = UnitPlan.where(id: unit_plans)\n unit_plans_objs.each do |l|\n @plan.unit_plans << l\n end\n\n @plan.user = current_user\n\n\n respond_to do |format|\n if @plan.save\n format.html { redirect_to @plan, notice: 'Plan was successfully created.' }\n format.json { render :show, status: :created, location: @plan }\n else\n format.html { render :new }\n format.json { render json: @plan.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "df67d3c6e1773f303934e693055bc84e", "score": "0.74524057", "text": "def create\n @plan = Plan.new(plan_params)\n\n if @plan.save\n respond_with(@plan, location: plans_url, notice: 'Plan was successfully created.')\n else\n respond_with(@plan)\n end\n end", "title": "" }, { "docid": "2ce499e7a9327f611d1c43e99c3b3d4f", "score": "0.7451773", "text": "def create\n @plan = Plan.new(plan_params)\n if user_signed_in?\n current_user.plans << @plan\n end\n respond_to do |format|\n if @plan.save\n format.html { redirect_to @plan, notice: 'Plan was successfully created.' }\n format.json { render :show, status: :created, location: @plan }\n else\n format.html { render :new }\n format.json { render json: @plan.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f3d6d3d44ea2781b84b3861eb6363b06", "score": "0.74252033", "text": "def create\n @plan = @enterprise.plans.new(plan_params)\n\n if @plan.save\n render :show, status: :created, location: enterprise_plan_url(@enterprise, @plan)\n else\n render json: @plan.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "0a09ba1268d460aa5d52879f82e961fc", "score": "0.74159145", "text": "def create\n params[:plan][\"user\"] = current_user\n @plan = Plan.new(params[:plan])\n\n respond_to do |format|\n if @plan.save\n format.html { redirect_to @plan, notice: 'Plan was successfully created.' }\n format.json { render json: @plan, status: :created, location: @plan }\n else\n format.html { render action: \"new\" }\n format.json { render json: @plan.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2a4aeca6f8308b8acfc6a5fb90e2a0ba", "score": "0.7408976", "text": "def create\n @plan = Plan.new(params[:plan])\n\n respond_to do |format|\n if @plan.save\n format.html { redirect_to @plan, notice: 'Plan was successfully created.' }\n format.json { render json: @plan, status: :created, location: @plan }\n else\n format.html { render action: \"new\" }\n format.json { render json: @plan.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "30b9dc70676d468ff1d2187d3d4f2dba", "score": "0.7331516", "text": "def create\n @plan = Plan.new(plan_params)\n\n respond_to do |format|\n if @plan.save\n format.html { redirect_to @plan, notice: 'Plan was successfully created.' }\n format.json { render :show, status: :created, location: @plan }\n else\n format.html { render :new }\n format.json { render json: @plan.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7a0281f11d67c14528312a8486eff364", "score": "0.73229516", "text": "def create\n @plan = Plan.new(params[:plan])\n @plan.project = @project\n\n respond_to do |format|\n if @plan.save\n format.html { redirect_to @plan, notice: 'Plan was successfully created.' }\n format.json { render json: @plan, status: :created, location: @plan }\n else\n format.html { render action: \"new\" }\n format.json { render json: @plan.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5bf2d65ddd7490702227e71861fea953", "score": "0.7322358", "text": "def create\n @plan = Plan.new(plan_params)\n\n respond_to do |format|\n if @plan.save\n format.html { redirect_to @plan, notice: \"Plan was successfully created.\" }\n format.json { render :show, status: :created, location: @plan }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @plan.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8db02aaee18fe82bb5a8d6027ad48864", "score": "0.72900456", "text": "def create\n add_plans params\n redirect_to '/plans?depratement=1'\n end", "title": "" }, { "docid": "bd19f5daad740d8108aa0579b5526086", "score": "0.72863847", "text": "def create\n @plan = Plan.new(plan_params)\n if user_signed_in?\n current_user.plans << @plan\n end\n respond_to do |format|\n if @plan.save\n format.html { redirect_to :action => :dashboard, plan_id: @plan }\n format.json { render :show, status: :created, location: @plan }\n else\n format.html { render :new }\n format.json { render json: @plan.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "eeffb39ed777f9e61f164bb6f1c839f4", "score": "0.7248465", "text": "def create\n @plan = Plan.new(plan_params)\n\n respond_to do |format|\n if @plan.save\n format.html { redirect_to plans_path, notice: 'План создан!' }\n format.json { render :show, status: :created, location: @plan }\n else\n format.html { render :new }\n format.json { render json: @plan.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2b2ffe0cd1d649ad8bbdb050f182cdd6", "score": "0.72460794", "text": "def create\n\n if admin_signed_in?\n @plan = Plan.new(plan_params)\n\n Stripe.api_key = Rails.configuration.stripe[:secret_key]\n\n plan = Stripe::Plan.create(\n :amount => (@plan.cost * 100).to_i,\n :interval => 'month',\n :name => @plan.description,\n :currency => 'usd',\n :id => @plan.stripe_id\n )\n\n respond_to do |format|\n if @plan.save\n format.html { redirect_to @plan, notice: 'Plan was successfully created.' }\n format.json { render :show, status: :created, location: @plan }\n else\n format.html { render :new }\n format.json { render json: @plan.errors, status: :unprocessable_entity }\n end\n end\n end\n end", "title": "" }, { "docid": "21e5f989c2d14728d2393bd9c2134cea", "score": "0.72444534", "text": "def create(options = nil)\n request = Request.new(@client)\n path = \"/plans\"\n data = {\n \"id\"=> @id, \n \"name\"=> @name, \n \"amount\"=> @amount, \n \"currency\"=> @currency, \n \"interval\"=> @interval, \n \"trial_period\"=> @trial_period, \n \"metadata\"=> @metadata, \n \"return_url\"=> @return_url, \n \"cancel_url\"=> @cancel_url\n }\n\n response = Response.new(request.post(path, data, options))\n return_values = Array.new\n \n body = response.body\n body = body[\"plan\"]\n \n \n return_values.push(self.fill_with_data(body))\n \n\n \n return_values[0]\n end", "title": "" }, { "docid": "f38231947293d4d51245bb20b6aeb977", "score": "0.7242891", "text": "def create\n @plan = @group.plans.new(params[:plan])\n\n respond_to do |format|\n if @plan.save\n format.html { redirect_to @plan, notice: 'Plan was successfully created.' }\n format.json { render json: @plan, status: :created, location: @plan }\n else\n format.html { render action: \"new\" }\n format.json { render json: @plan.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8f83547682ce4c592de8ed3bc6bd3440", "score": "0.71716434", "text": "def create\n account_plan = account_plans.create(account_plan_create_params)\n respond_with(account_plan)\n end", "title": "" }, { "docid": "8f83547682ce4c592de8ed3bc6bd3440", "score": "0.71716434", "text": "def create\n account_plan = account_plans.create(account_plan_create_params)\n respond_with(account_plan)\n end", "title": "" }, { "docid": "fc53bd92eff485c0bf58db47a44de94d", "score": "0.7170812", "text": "def plans\n @api.get_plans( :project_id => @id )\n end", "title": "" }, { "docid": "39096c11f4e0baee538a64e3e5e4eb81", "score": "0.71698314", "text": "def create\n @plan = Plan.new(plan_params)\n\n respond_to do |format|\n if @plan.save\n format.html { redirect_to @plan, notice: 'Plan of datum was successfully created.' }\n format.json { render :show, status: :created, location: @plan }\n else\n format.html { render :new }\n format.json { render json: @plan.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "eec5ee96bc015294622d79c16536e97b", "score": "0.715864", "text": "def plan\n unless form.valid?\n render json: { errors: ['invalid data'] }, status: :bad_request\n return\n end\n\n if planning_service.errors?\n render json: { errors: planning_service.errors }, status: :unprocessable_entity\n return\n end\n\n render json: { success: true }\n end", "title": "" }, { "docid": "59f15c2039d2ca559d15717b70ad5a83", "score": "0.71574354", "text": "def create\n @plan = Plan.new(plan_params)\n if @plan.save\n flash[:success] = \"#{@plan.name} was successfully created.\"\n else\n flash[:error] = @plan.errors\n end\n respond_with(@plan)\n end", "title": "" }, { "docid": "5b231aaa064e3d8c5863db7eb11b2e61", "score": "0.71545494", "text": "def index\n @plans = Plan.all\n \n render json: @plans\n end", "title": "" }, { "docid": "87c2fca78f860d94ee1d4190f828b91c", "score": "0.7151089", "text": "def create\n \t @user = current_user\n\t @plan = @user.splans.new(plans_params)\n \n Stripe.api_key = @user.access_code\n \n Stripe::Plan.create(\n :amount => @plan.amount,\n :interval => @plan.interval,\n :name => @plan.name,\n :id => @plan.stripe_id,\n :currency =>@plan.currency\n )\n \n\t @plan.save\n redirect_to root_path\n \t\t\n end", "title": "" }, { "docid": "b1334ad3097db32f84eaff0708f1867e", "score": "0.71305674", "text": "def create\n @plan = @store.plans.new(params[:plan])\n\n respond_to do |format|\n if @plan.save\n format.html { redirect_to store_plan_path(@plan), notice: 'Plan was successfully created.' }\n format.json { render json: @plan, status: :created, location: store_plan(@plan) }\n else\n @plan_types = Plan::PLAN_TYPES.to_a.map(&:reverse)\n @products = [] #it need be changed when products be done\n @frequences = [[\"Monthly\",\"monthly\"],[\"Weekly\",\"weekly\"],[\"Daily\",\"daily\"],[\"Hourly\",\"hourly\"]]\n format.html { render action: \"new\" }\n format.json { render json: @plan.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "20166e2d3fda6bde6458da17806eb198", "score": "0.71143997", "text": "def create\n @plan = current_user.plans.new(plan_params)\n\n respond_to do |format|\n if @plan.save\n Tools.write2log(current_user.id, 'Добавление', 'Планы', 0, plan_params.to_s)\n format.html { redirect_to plans_path, notice: 'План был успешно добавлен.' }\n format.json { render action: 'show', status: :created, location: @plan }\n else\n Tools.write2log(current_user.id, 'Добавление', 'Планы', 1, plan_params.to_s)\n format.html { render action: 'new' }\n format.json { render json: @plan.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "856c23727e9dfaa0c2587670a742a884", "score": "0.7101714", "text": "def create\n @plan = Plan.new(name: params[:name], description: params[:description], creator_id: current_athlete.id, plan_creator: current_athlete.username)\n\n if @plan.save\n @athleteplan = AthletePlan.create(athlete_id: current_athlete.id, plan_id: @plan.id, start_date: params[:start_date], end_date: params[:end_date])\n render 'create.json.jbuilder', status: :created\n else\n render json: { errors: @athlete.errors.full_messages }, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "59b4af74182c4d822507183f5efda103", "score": "0.7097496", "text": "def create\n if @current_user.admin_bizgo?\n @plan = Plan.new(plan_params)\n if @plan.save\n render \"api/v1/plans/show\"\n else\n array_error!(@plan.errors.full_messages, 422)\n end\n else\n error!(\"Sólo administradores pueden crear nuevos planes.\",401)\n end\n end", "title": "" }, { "docid": "6e75eeb27a28fd39d697b540614e8c79", "score": "0.7097345", "text": "def plans_post\n if params[\"new\"] \n redirect_to \"/plans/new\" and return\n else\n redirect_to \"/plans/#{params[\"edit\"]}\" and return\n end\n end", "title": "" }, { "docid": "407ca8928a841c18e11e293988111da6", "score": "0.7094454", "text": "def index\n @plans = Plan.all\n render json:@plans\n end", "title": "" }, { "docid": "46ab2d28b2a859673d437d91196c3cc1", "score": "0.70775616", "text": "def create\n @plan = Plan.new(plan_params)\n respond_to do |format|\n if @plan.save\n plansoption()\n courseplan()\n\n format.html { redirect_to @plan, notice: 'Plan was successfully created.' }\n format.json { render :show, status: :created, location: @plan }\n else\n format.html { render :new }\n format.json { render json: @plan.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3c6d0de4d5260131f83ecf804f2d53d9", "score": "0.70727694", "text": "def index\n @plans = @project.plans\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @plans }\n end\n end", "title": "" }, { "docid": "2a0f0ffb9cc91dd98ace772f2eea98bb", "score": "0.7072084", "text": "def create\n @plan = Plan.new(plan_params)\n\n respond_to do |format|\n if @plan.save\n format.html { redirect_to @plan, notice: 'План успешно создан' }\n format.json { render :show, status: :created, location: @plan }\n else\n format.html { render :new }\n format.json { render json: @plan.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "87797035a3f37ca803030427ce3da242", "score": "0.70409423", "text": "def create\n application_plan = application_plans.create(application_plan_create_params)\n respond_with(application_plan)\n end", "title": "" }, { "docid": "cc7232b48c75ae96bbe5bc25849c0218", "score": "0.70353854", "text": "def create\n @plan = Plan.new(plan_create_params)\n @plan.assign_params_from_controller(plan_create_params)\n\n respond_to do |format|\n if @plan.save\n format.html { redirect_to @plan, notice: 'Plan was successfully created.' }\n format.json { render :show, status: :created, location: @plan }\n else\n format.html { redirect_to @plan, notice: 'ERROR - Stripe ID probably already exists' }\n format.json { render json: @plan.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "715ae99e149d22215637853e2dba1dde", "score": "0.70306593", "text": "def create\n @plan = Plan.new(params[:plan])\n @plan.account = current_user.account\n respond_to do |format|\n if @plan.save\n\n format.html { redirect_to edit_user_registration_path(), notice: 'Plan has been successfully updated' }\n format.json { render json: @plan, status: :created, location: @plan }\n else\n format.html { render action: \"new\" }\n format.json { render json: @plan.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5b85b32d4b10d7edac65922f986b0f53", "score": "0.7011607", "text": "def create\n @saved_plan = SavedPlan.new(params[:saved_plan])\n\n respond_to do |format|\n if @saved_plan.save\n format.html { redirect_to current_user, notice: 'Plan was successfully Saved.' }\n format.json { render json: @saved_plan.plan, status: :created, location: @saved_plan.plan }\n else\n format.html { render action: \"new\" }\n format.json { render json: @saved_plan.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "54ee4423ef6cbc10ceb643e5d17225b9", "score": "0.6980677", "text": "def plan\n return nil if request[\"plan_member\"].nil?\n plan_id = request[\"plan_member\"][\"plan\"][\"id\"]\n res = get(\"plans\", plan_id)\n end", "title": "" }, { "docid": "fab2b6560eaa4b099e470777a7387f29", "score": "0.6977862", "text": "def create\n @plan = @issue.plans.new(params[:plan])\n\n respond_to do |format|\n if @plan.save\n format.html { redirect_to @plan, notice: 'Plan was successfully created.' }\n format.json { render json: @plan, status: :created, location: @plan }\n format.js \n else\n format.html { render action: \"new\" }\n format.json { render json: @plan.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b95a17907d174b3a5bc664fca75c695e", "score": "0.6968175", "text": "def create\n @test_plan = TestPlan.new(test_plan_params)\n\n respond_to do |format|\n if @test_plan.save\n format.html { redirect_to @test_plan, notice: 'Test plan was successfully created.' }\n format.json { render :show, status: :created, location: @test_plan }\n else\n format.html { render :new }\n format.json { render json: @test_plan.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "336fed226c960590c39503a6be9f4d45", "score": "0.6960724", "text": "def create\n @payment_plan = PaymentPlan.new(params[:payment_plan])\n\n respond_to do |format|\n if @payment_plan.save\n format.html { redirect_to payment_plans_url, notice: 'Payment plan was successfully created.' }\n format.json { render json: @payment_plan, status: :created, location: @payment_plan }\n else\n format.html { render action: \"new\" }\n format.json { render json: @payment_plan.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1d3a2320337e867bcb2c92343e1e41f9", "score": "0.6941955", "text": "def create\n service_plan = service_plans.create(service_plan_create_params)\n respond_with(service_plan)\n end", "title": "" }, { "docid": "acf2927824e70ba6db5dab1bb99e366a", "score": "0.6899991", "text": "def create\n @plan = Plan.new(plan_params)\n\n respond_to do |format|\n if @plan.save\n redirect_to recent_path\n format.json { render action: 'show', status: :created, location: @plan }\n else\n format.html { render action: 'new' }\n format.json { render json: @plan.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ade382710eef9b363b371c05a915db31", "score": "0.68966055", "text": "def create\n @payplan = Payplan.new(payplan_params)\n\n respond_to do |format|\n if @payplan.save\n format.html { redirect_to payplans_url, notice: 'Payplan was successfully created.' }\n format.json { render :show, status: :created, location: @payplan }\n else\n format.html { render :new }\n format.json { render json: @payplan.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "97ed83e7e3873d70056a0939a6f50597", "score": "0.68738496", "text": "def create\n @admin_plan = Plan.new(admin_plan_params)\n\n respond_to do |format|\n if @admin_plan.save\n format.html { redirect_to @admin_plans_path, notice: 'Pacote criado com sucesso.' }\n format.json { render action: 'show', status: :created, location: @admin_plan }\n else\n format.html { render action: 'new' }\n format.json { render json: @admin_plan.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6ad6e4249a68753dc68b845cea48d43b", "score": "0.6857941", "text": "def create\n @regular_plan = RegularPlan.new(regular_plan_params)\n\t\t@regular_plan.user = current_user\n\n respond_to do |format|\n if @regular_plan.save\n format.html { redirect_to user_regular_plans_path, notice: 'Regular plan was successfully created.' }\n format.json { render :show, status: :created, location: @regular_plan }\n else\n format.html { render :new }\n format.json { render json: @regular_plan.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "111883650e4d29600a59cf13e7c413d0", "score": "0.6851862", "text": "def create\r\n @testplan = Testplan.new(params[:testplan])\r\n\r\n respond_to do |format|\r\n if @testplan.save\r\n format.html { redirect_to @testplan, notice: 'Testplan was successfully created.' }\r\n format.json { render json: @testplan, status: :created, location: @testplan }\r\n else\r\n format.html { render action: \"new\" }\r\n format.json { render json: @testplan.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "title": "" }, { "docid": "5aab92c2a47ef912bcda6abdf72ce959", "score": "0.6844818", "text": "def create\n @plan = Plan.new(params[:plan])\n\n respond_to do |format|\n if @plan.save\n flash[:notice] = 'Plan was successfully created.'\n format.html { redirect_to(@plan) }\n format.xml { render :xml => @plan, :status => :created, :location => @plan }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @plan.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d972b7dea67efbf08888db8597d933ac", "score": "0.6835583", "text": "def new\n @plan = Plan.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @plan }\n end\n end", "title": "" }, { "docid": "d972b7dea67efbf08888db8597d933ac", "score": "0.6835583", "text": "def new\n @plan = Plan.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @plan }\n end\n end", "title": "" }, { "docid": "d972b7dea67efbf08888db8597d933ac", "score": "0.6835583", "text": "def new\n @plan = Plan.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @plan }\n end\n end", "title": "" }, { "docid": "d972b7dea67efbf08888db8597d933ac", "score": "0.6835583", "text": "def new\n @plan = Plan.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @plan }\n end\n end", "title": "" }, { "docid": "d972b7dea67efbf08888db8597d933ac", "score": "0.6835583", "text": "def new\n @plan = Plan.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @plan }\n end\n end", "title": "" }, { "docid": "d972b7dea67efbf08888db8597d933ac", "score": "0.6835583", "text": "def new\n @plan = Plan.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @plan }\n end\n end", "title": "" }, { "docid": "25bf33b25a1b3495ce89892444e39766", "score": "0.6827478", "text": "def new\n @plan = Plan.new\n @plan.project = @project\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @plan }\n end\n end", "title": "" }, { "docid": "e801c9e4a12c16e2c83b893c4e7a779e", "score": "0.67993206", "text": "def create\n @plan = Plan.new(plan_params)\n authorize @plan\n respond_to do |format|\n if @plan.save\n format.html { redirect_to plans_path, notice: 'Plan was successfully activated.' }\n format.json { render :index, status: :created }\n else\n #TODO: Display the actual error to the end user.\n flash[:danger] = 'There was an issue activating this plan.'\n format.html { redirect_to plans_path }\n format.json { render json: @plan.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "09a4d7e74e68ba1363672152ad588661", "score": "0.67966866", "text": "def new\n @plan = @issue.plans.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @plan }\n format.js\n end\n end", "title": "" }, { "docid": "abca83468acb59e24b73adb933bc22f5", "score": "0.67916673", "text": "def create\n @plan = Plan.new(plan_params)\n\n respond_to do |format|\n if @plan.save\n format.html { redirect_to(@plan, :notice => 'plan was successfully created.') }\n format.xml { render :xml => @plan, :status => :created, :location => @plan }\n else\n format.html { render :action => 'new' }\n format.xml { render :xml => @plan.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2e4c6e9cd676f2fd7b5f09e39e3c84ed", "score": "0.6790724", "text": "def create\n @plan = Plan.new(params[:plan])\n @plan.when_upcoming = Time.now\n \n respond_to do |format|\n if @plan.save\n \n if params[:comment] != \"\"\n @comment = Comment.create(:content => params[:comment], :plan_id => @plan.id)\n end\n \n format.html { redirect_to indexchoice_url, notice: 'Plan was successfully created.' }\n format.json { render json: @plan, status: :created, location: @plan }\n else\n format.html { render action: \"new\" }\n format.json { render json: @plan.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fe9bdca14cecd083df525fbb6e38c680", "score": "0.67873955", "text": "def create\n @page_plan = PagePlan.new(page_plan_params)\n respond_to do |format|\n if @page_plan.save\n format.html { redirect_to @page_plan, notice: 'Page plan was successfully created.' }\n format.json { render :show, status: :created, location: @page_plan }\n else\n format.html { render :new }\n format.json { render json: @page_plan.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "284c7478d602da2e1fa19a7284019f40", "score": "0.6780714", "text": "def create\n @plan_resource = PlanResource.new(params[:plan_resource])\n\n respond_to do |format|\n if @plan_resource.save\n format.html { redirect_to @plan_resource, notice: 'Plan resource was successfully created.' }\n format.json { render json: @plan_resource, status: :created, location: @plan_resource }\n else\n format.html { render action: \"new\" }\n format.json { render json: @plan_resource.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "dcd7ad35022746b7b537c5f86e9498af", "score": "0.6767346", "text": "def create\n @payment_plan = PaymentPlan.new(payment_plan_params)\n\n respond_to do |format|\n if @payment_plan.save\n format.html { redirect_to @payment_plan, notice: 'Payment plan was successfully created.' }\n format.json { render action: 'show', status: :created, location: @payment_plan }\n else\n format.html { render action: 'new' }\n format.json { render json: @payment_plan.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "80334d9c11b8affa147d619f67b92703", "score": "0.6765858", "text": "def index\n @plans = Plan.all.order(:id)\n\n render json: @plans\n end", "title": "" }, { "docid": "1a866cb82955b973271d8f99da644993", "score": "0.6761977", "text": "def create\n @account_plan = AccountPlan.new(params[:account_plan])\n\n respond_to do |format|\n if @account_plan.save\n format.html { redirect_to @account_plan, notice: 'Organization plan was successfully created.' }\n format.json { render json: @account_plan, status: :created, location: @account_plan }\n else\n format.html { render action: \"new\" }\n format.json { render json: @account_plan.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5c43f5acac88255809793a810c029c66", "score": "0.67609614", "text": "def index\n authorize Plan\n\n @plans = Plan.where(active: true)\n\n begin\n @stripe_plans = Stripe::Plan.all().to_hash\n rescue => e\n @stripe_plans = nil\n end\n # @stripe_plans[:data][0][:id]\n if not @stripe_plans.nil?\n @plans.each do |n|\n @stripe_plans[:data].delete_if { |i| i[:id] == n.stripe_plan_id }\n end\n end\n\n @new_plan = Plan.new(active: true)\n end", "title": "" }, { "docid": "ce75b8a7ef1d1de2a8888256ccf8bd3f", "score": "0.67574215", "text": "def create\n @membership_plan = MembershipPlan.new(membership_plan_params)\n\n respond_to do |format|\n if @membership_plan.save\n format.html { redirect_to @membership_plan, notice: 'Membership plan was successfully created.' }\n format.json { render :show, status: :created, location: @membership_plan }\n else\n format.html { render :new }\n format.json { render json: @membership_plan.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "952f1fdc95c63c5a7a226c69a337d73c", "score": "0.6740864", "text": "def create\n @data_plan = DataPlan.new(data_plan_params)\n\n respond_to do |format|\n if @data_plan.save\n format.html { redirect_to @data_plan, notice: 'Data plan was successfully created.' }\n format.json { render :show, status: :created, location: @data_plan }\n else\n format.html { render :new }\n format.json { render json: @data_plan.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0af2af334dae5449faf31885e80b0ee5", "score": "0.6736724", "text": "def created_plans\n raise Pundit::NotAuthorizedError unless Api::V0::StatisticsPolicy.new(@user, :statistics).plans?\n\n scoped = if @user.can_super_admin? && params[:org_id].present?\n Org.find(params[:org_id]).plans\n else\n @user.org.plans\n end\n\n if params[:range_dates].present?\n r = {}\n params[:range_dates].each_pair do |k, v|\n r[k] = scoped.where(created_at: dates_to_range(v)).count\n end\n\n # Reverse hash r, so dates in ascending order\n r = r.to_a.reverse.to_h\n\n respond_to do |format|\n format.json { render(json: r.to_json) }\n format.csv do\n send_data(CSV.generate do |csv|\n csv << [_('Month'), _('No. Plans')]\n total = 0\n r.each_pair do |k, v|\n csv << [k, v]\n total += v\n end\n csv << [_('Total'), total]\n end, filename: \"#{_('plans')}.csv\")\n end\n end\n else\n if params['start_date'].present? || params['end_date'].present?\n scoped = scoped.where(created_at: dates_to_range(params))\n end\n render(json: { completed_plans: scoped.count })\n end\n end", "title": "" }, { "docid": "5b4a7614da4c34a0fb4bc019c3db50fc", "score": "0.67347085", "text": "def plans\r\n PlansController.instance\r\n end", "title": "" }, { "docid": "e040e57762cd427716d4a2ed72ea81b3", "score": "0.672714", "text": "def create\n @shipping_plan = ShippingPlan.new(params[:shipping_plan])\n\n respond_to do |format|\n if @shipping_plan.save\n format.html { redirect_to @shipping_plan, notice: 'Shipping plan was successfully created.' }\n format.json { render json: @shipping_plan, status: :created, location: @shipping_plan }\n else\n format.html { render action: \"new\" }\n format.json { render json: @shipping_plan.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3095af315ab7664330cb47c18f9da970", "score": "0.6723032", "text": "def create\n plan_params.permit!\n params[:plan][:study_year_ids] ||= []\n @plan = Plan.new(plan_params)\n\n respond_to do |format|\n if @plan.save\n format.html { redirect_to plans_path, notice: 'План успешно создан.' }\n format.json { render action: 'show', status: :created, location: @plan }\n else\n format.html { render action: 'new' }\n format.json { render json: @plan.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a8698a88e0a41f27ff449146d7c83f10", "score": "0.6722501", "text": "def create\n\n plan_params[:plan_type] = plan_params[:plan_type].to_i\n plan_params[:payor_type] = plan_params[:payor_type].to_i\n plan_params[:print_sort_code] = plan_params[:print_sort_code].to_i\n plan_params[:copay_type] = plan_params[:copay_type].to_i\n plan_params[:support_split_billing] = plan_params[:support_split_billing].to_i\n\n @plan = Plan.new(plan_params)\n\n respond_to do |format|\n if @plan.save\n format.html { redirect_to @plan, notice: 'Plan was successfully created.' }\n format.json { render :show, status: :created, location: @plan }\n else\n format.html { render :new }\n format.json { render json: @plan.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "80ee44a656e85fe66769129a722586c4", "score": "0.6712233", "text": "def create\n @plan = Plan.new\n\n @plan.user_id = params[:user_id]\n @plan.schedule_id = params[:schedule_id]\n @course_name = Schedule.find(@plan.schedule_id).course.course_name\n\n if params[:bid].empty?\n @plan.bid = 1\n else\n @plan.bid = params[:bid]\n end\n\n save_status = @plan.save\n\n if save_status == true\n respond_to do |format|\n format.html {redirect_to :back, :notice => \"Your planned bid was saved!\"}\n format.js # directs to /views/plans/create.js.erb\n end\n else\n redirect_to(:back, :alert => \"Sorry! There was an issue.\")\n end\n end", "title": "" }, { "docid": "414ac7dd8c77d0cabec83cf445a7a809", "score": "0.670705", "text": "def create\n @plan = Plan.new(params.require(:plan).permit(:title))\n\n # First saving and then updating is needed because of a bug, that doesn't\n # allow saving a model with nested, new created attributes.\n @plan.save\n @plan.update(plan_params) and return redirect_to admin_plan_path(@plan)\n render :new\n end", "title": "" }, { "docid": "c649567913ee15cf8184ecc65a8be2f2", "score": "0.66865766", "text": "def create\n @plan = Plan.new(plan_params)\n respond_to do |format|\n if @plan.save\n params.each do |name, value|\n if /unit_(.+)$/.match(name)\n Rate.create(:plan_id => @plan.id, :unit_id => $1, :rate => value)\n end\n end\n format.html { redirect_to plans_path(:building_id => @plan.building_id), notice: 'پلان هزینه با موفقیت ایجاد شد.' }\n format.json { render action: 'show', status: :created, location: @plan }\n format.js\n else\n format.html { render action: 'new' }\n format.json { render json: @plan.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e065b1acfc7525c8dc3d8f83319758e1", "score": "0.6683905", "text": "def index\n @plans = current_user.plans\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @plans }\n end\n end", "title": "" }, { "docid": "dde66977dc26b3875f171c925f04d820", "score": "0.6678798", "text": "def create\n @round_plan = RoundPlan.new(round_plan_params)\n\n respond_to do |format|\n if @round_plan.save\n format.html { redirect_to @round_plan, notice: 'Round plan was successfully created.' }\n format.json { render :show, status: :created, location: @round_plan }\n else\n format.html { render :new }\n format.json { render json: @round_plan.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3849569ffd437b08785d4f04ef56e8d1", "score": "0.6671717", "text": "def create\n @plan = Plan.new(params[:plan])\n @plan.creator_id = current_user.id\n\n respond_to do |format|\n if @plan.save\n format.html { redirect_to(@plan, :notice => 'Successfully created plan') }\n format.xml { render :xml => @plan, :status => :created, :location => @plan }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @plan.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ea0a34ab6a3e8ef5f637e01a0b4cbd89", "score": "0.66693455", "text": "def create\n @basico_plan = Basico::Plan.new(basico_plan_params)\n\n respond_to do |format|\n if @basico_plan.save\n format.html { redirect_to @basico_plan, notice: 'Plan was successfully created.' }\n format.json { render :show, status: :created, location: @basico_plan }\n else\n format.html { render :new }\n format.json { render json: @basico_plan.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5af854daeacd3316017b7a1d3cc72f84", "score": "0.66668713", "text": "def new\n @plan_resource = PlanResource.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @plan_resource }\n end\n end", "title": "" }, { "docid": "3b11bfe2492e76c6697757691eb861ad", "score": "0.6656002", "text": "def create\n @assessment_plan = AssessmentPlan.new(assessment_plan_params)\n\n respond_to do |format|\n if @assessment_plan.save\n format.html { redirect_to @assessment_plan, notice: 'Assessment plan was successfully created.' }\n format.json { render :show, status: :created, location: @assessment_plan }\n else\n format.html { render :new }\n format.json { render json: @assessment_plan.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "05c9c40b66b32cda36b20fd17b3e64fe", "score": "0.66405064", "text": "def create_plan\n \tplanAttributes = {\n \"name\" => \"POC Subscription C4\",\n \"description\" => \"Premium Subscription\",\n \"type\" => \"INFINITE\",\n \"payment_definitions\" => [\n {\n \"name\" => \"Monthly Premium Subscription\",\n \"type\" => \"REGULAR\",\n \"frequency\" => \"MONTH\",\n \"frequency_interval\" => \"1\",\n \"amount\" => {\n \"value\" => \"30\",\n \"currency\" => \"USD\"\n },\n \"cycles\" => \"0\" \n }\n ],\n \"merchant_preferences\" => {\n \"return_url\" => \"http://localhost:3000/subscription/return\",\n \"cancel_url\" => \"http://localhost:3000/subscription/cancel\",\n \"auto_bill_amount\" => \"YES\",\n \"initial_fail_amount_action\" => \"CONTINUE\",\n \"max_fail_attempts\" => \"2\"\n }\n \t}\n \tplan = Plan.new(PlanAttributes)\n plan.create #returns true\n\n logger.info \"Plan: #{plan.id}\"\n patch = Patch.new\n patch.op = \"replace\"\n patch.path = \"/\";\n patch.value = { :state => \"ACTIVE\" }\n plan.update( patch )\n end", "title": "" }, { "docid": "efdfdf1dca08c22891657de82564495a", "score": "0.6632445", "text": "def create\n @tipo_plan = TipoPlan.new(params[:tipo_plan])\n\n respond_to do |format|\n if @tipo_plan.save\n format.html { redirect_to tipo_plan_index_path, notice: 'Plan creado.' }\n format.json { render json: @tipo_plan, status: :created, location: @tipo_plan }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tipo_plan.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5eff7add131ab301fe177ec411dc7c31", "score": "0.6619306", "text": "def create\n @crawler_plan = Crawler::Plan.new(crawler_plan_params)\n\n respond_to do |format|\n if @crawler_plan.save\n format.html { redirect_to @crawler_plan, notice: 'Plan was successfully created.' }\n format.json { render :show, status: :created, location: @crawler_plan }\n else\n format.html { render :new }\n format.json { render json: @crawler_plan.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d79f3da893b1609a9458358f8146244c", "score": "0.6616075", "text": "def create\n @plan = Plan.new(plan_params)\n @plan.user_id = current_user.id\n\n respond_to do |format|\n if @plan.save\n current_user.update_attribute(:selected_plan, @plan.id)\n format.html {redirect_to plans_swotedit_path, notice: \"Plano criado com sucesso\"}\n else\n format.html {render :new}\n format.json {render json: @plan.errors, status: :unprocessable_entity}\n end\n end\n end", "title": "" }, { "docid": "d79f3da893b1609a9458358f8146244c", "score": "0.6616075", "text": "def create\n @plan = Plan.new(plan_params)\n @plan.user_id = current_user.id\n\n respond_to do |format|\n if @plan.save\n current_user.update_attribute(:selected_plan, @plan.id)\n format.html {redirect_to plans_swotedit_path, notice: \"Plano criado com sucesso\"}\n else\n format.html {render :new}\n format.json {render json: @plan.errors, status: :unprocessable_entity}\n end\n end\n end", "title": "" }, { "docid": "6e602531b8556f70cfabec71c4f47528", "score": "0.66111684", "text": "def create\n @planitem = Planitem.new(params[:planitem])\n\n respond_to do |format|\n if @planitem.save\n format.html { redirect_to @planitem, notice: 'Planitem was successfully created.' }\n format.json { render json: @planitem, status: :created, location: @planitem }\n else\n format.html { render action: \"new\" }\n format.json { render json: @planitem.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1be7714822f1ec450d6459f6df480f7b", "score": "0.66083074", "text": "def index\n @plans = Plan.all\n end", "title": "" }, { "docid": "1be7714822f1ec450d6459f6df480f7b", "score": "0.66083074", "text": "def index\n @plans = Plan.all\n end", "title": "" }, { "docid": "1be7714822f1ec450d6459f6df480f7b", "score": "0.66083074", "text": "def index\n @plans = Plan.all\n end", "title": "" }, { "docid": "1be7714822f1ec450d6459f6df480f7b", "score": "0.66083074", "text": "def index\n @plans = Plan.all\n end", "title": "" }, { "docid": "1be7714822f1ec450d6459f6df480f7b", "score": "0.66083074", "text": "def index\n @plans = Plan.all\n end", "title": "" }, { "docid": "1be7714822f1ec450d6459f6df480f7b", "score": "0.66083074", "text": "def index\n @plans = Plan.all\n end", "title": "" }, { "docid": "1be7714822f1ec450d6459f6df480f7b", "score": "0.66083074", "text": "def index\n @plans = Plan.all\n end", "title": "" }, { "docid": "1be7714822f1ec450d6459f6df480f7b", "score": "0.66083074", "text": "def index\n @plans = Plan.all\n end", "title": "" }, { "docid": "1be7714822f1ec450d6459f6df480f7b", "score": "0.66083074", "text": "def index\n @plans = Plan.all\n end", "title": "" } ]
718829dcfd723058de4555b441a1b3a9
UpdateItemModifierLists Updates the [CatalogModifierList](typecatalogmodifierlist) objects that apply to the targeted [CatalogItem](typecatalogitem) without having to perform an upsert on the entire item.
[ { "docid": "54c7e54246f76f208bfcd2cbadb61676", "score": "0.8257509", "text": "def update_item_modifier_lists(body, opts = {})\n data, _status_code, _headers = update_item_modifier_lists_with_http_info(body, opts)\n return data\n end", "title": "" } ]
[ { "docid": "500978e99f15f01401227274ea970500", "score": "0.67542267", "text": "def update_item_modifier_lists_with_http_info(body, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: CatalogApi.update_item_modifier_lists ...\"\n end\n # verify the required parameter 'body' is set\n fail ArgumentError, \"Missing the required parameter 'body' when calling CatalogApi.update_item_modifier_lists\" if body.nil?\n # resource path\n local_var_path = \"/v2/catalog/update-item-modifier-lists\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n \n header_params['Square-Version'] = \"2018-07-12\"\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(body)\n auth_names = ['oauth2']\n data, status_code, headers = @api_client.call_api(:POST, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'UpdateItemModifierListsResponse')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CatalogApi#update_item_modifier_lists\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "344c7821816cac283cbf8487d1d2b07c", "score": "0.6390544", "text": "def apply_modifier_list(location_id, modifier_list_id, item_id, opts = {})\n data, _status_code, _headers = apply_modifier_list_with_http_info(location_id, modifier_list_id, item_id, opts)\n return data\n end", "title": "" }, { "docid": "2a4077089b61f5f86be63bef61c73281", "score": "0.6061526", "text": "def update_modifier_list(location_id, modifier_list_id, body, opts = {})\n data, _status_code, _headers = update_modifier_list_with_http_info(location_id, modifier_list_id, body, opts)\n return data\n end", "title": "" }, { "docid": "8006fd1cdf4d2256377bf4512bab07c2", "score": "0.5576472", "text": "def apply_modifier_list_with_http_info(location_id, modifier_list_id, item_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: V1ItemsApi.apply_modifier_list ...\"\n end\n # verify the required parameter 'location_id' is set\n fail ArgumentError, \"Missing the required parameter 'location_id' when calling V1ItemsApi.apply_modifier_list\" if location_id.nil?\n # verify the required parameter 'modifier_list_id' is set\n fail ArgumentError, \"Missing the required parameter 'modifier_list_id' when calling V1ItemsApi.apply_modifier_list\" if modifier_list_id.nil?\n # verify the required parameter 'item_id' is set\n fail ArgumentError, \"Missing the required parameter 'item_id' when calling V1ItemsApi.apply_modifier_list\" if item_id.nil?\n # resource path\n local_var_path = \"/v1/{location_id}/items/{item_id}/modifier-lists/{modifier_list_id}\".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s).sub('{' + 'modifier_list_id' + '}', modifier_list_id.to_s).sub('{' + 'item_id' + '}', item_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n \n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['oauth2']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'V1Item')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: V1ItemsApi#apply_modifier_list\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "cda7b4a23cbcd1c583de40595cacb980", "score": "0.55565184", "text": "def update_modifier_list_with_http_info(location_id, modifier_list_id, body, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: V1ItemsApi.update_modifier_list ...\"\n end\n # verify the required parameter 'location_id' is set\n fail ArgumentError, \"Missing the required parameter 'location_id' when calling V1ItemsApi.update_modifier_list\" if location_id.nil?\n # verify the required parameter 'modifier_list_id' is set\n fail ArgumentError, \"Missing the required parameter 'modifier_list_id' when calling V1ItemsApi.update_modifier_list\" if modifier_list_id.nil?\n # verify the required parameter 'body' is set\n fail ArgumentError, \"Missing the required parameter 'body' when calling V1ItemsApi.update_modifier_list\" if body.nil?\n # resource path\n local_var_path = \"/v1/{location_id}/modifier-lists/{modifier_list_id}\".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s).sub('{' + 'modifier_list_id' + '}', modifier_list_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n \n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(body)\n auth_names = ['oauth2']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'V1ModifierList')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: V1ItemsApi#update_modifier_list\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "5d16b24f571b8f8501c1f754ec895d40", "score": "0.52360785", "text": "def update!(**args)\n @list_items = args[:list_items] if args.key?(:list_items)\n end", "title": "" }, { "docid": "7e7bcc9a80f92bbd99ef306a30ce8e98", "score": "0.52320105", "text": "def update(item_attrs = {})\n body = { update: item_attrs }\n Iterable.request(conf, base_path).patch(body)\n end", "title": "" }, { "docid": "f87df27c67b01b1e7429750367c5d84c", "score": "0.5186988", "text": "def update\n response = success_update_response\n ActiveRecord::Base.transaction do\n @item.roles = []\n unless @item.update_attributes(allowed_params)\n response = fail_update_response @item\n end\n end\n render json: response\n end", "title": "" }, { "docid": "92b9fd9bf1b02954bebfd104454a257b", "score": "0.51194847", "text": "def add_or_update_item(list,new_items)\n list.merge!(new_items)\nend", "title": "" }, { "docid": "a184ac60f0d038aff90c50b2981bab5b", "score": "0.50951517", "text": "def update!(**args)\n @items = args[:items] if args.key?(:items)\n end", "title": "" }, { "docid": "a184ac60f0d038aff90c50b2981bab5b", "score": "0.50951517", "text": "def update!(**args)\n @items = args[:items] if args.key?(:items)\n end", "title": "" }, { "docid": "a184ac60f0d038aff90c50b2981bab5b", "score": "0.50951517", "text": "def update!(**args)\n @items = args[:items] if args.key?(:items)\n end", "title": "" }, { "docid": "a184ac60f0d038aff90c50b2981bab5b", "score": "0.50951517", "text": "def update!(**args)\n @items = args[:items] if args.key?(:items)\n end", "title": "" }, { "docid": "a184ac60f0d038aff90c50b2981bab5b", "score": "0.50951517", "text": "def update!(**args)\n @items = args[:items] if args.key?(:items)\n end", "title": "" }, { "docid": "a184ac60f0d038aff90c50b2981bab5b", "score": "0.50951517", "text": "def update!(**args)\n @items = args[:items] if args.key?(:items)\n end", "title": "" }, { "docid": "a184ac60f0d038aff90c50b2981bab5b", "score": "0.50951517", "text": "def update!(**args)\n @items = args[:items] if args.key?(:items)\n end", "title": "" }, { "docid": "a184ac60f0d038aff90c50b2981bab5b", "score": "0.50951517", "text": "def update!(**args)\n @items = args[:items] if args.key?(:items)\n end", "title": "" }, { "docid": "a184ac60f0d038aff90c50b2981bab5b", "score": "0.50951517", "text": "def update!(**args)\n @items = args[:items] if args.key?(:items)\n end", "title": "" }, { "docid": "3341d1e46ad2726197473a67e1c91b79", "score": "0.5028706", "text": "def update_order_of_items_bulk\n @catalog = Catalog.find(params[:id])\n result = @catalog.do_update_order_of_items_bulk(params[:item_change][:moved_items], params[:item_change][:before_item]);\n \n # return a success message, wouldn't make sense to call this API method as html, but for debugging\n # just return json anyway\n respond_to do |format|\n format.html { render json: result}\n format.json { render json: result}\n end\n end", "title": "" }, { "docid": "607e14659a809c8c67ea5bf62b6aa053", "score": "0.49836084", "text": "def update\n @list = List.find(params[:id])\n\n nested = params[:list].delete( :list_items_attributes )\n\n new_items = []\n\n if nested then\n nested.each do |i, r|\n\n if !r.key?( \"id\" )\n\n new_items << ListItem.new( { \"list\" => @list }.merge( r ) ) if !item_blank?( r )\n\n nested.delete( i )\n\n else\n\n r[ \"_destroy\" ] = \"true\" if item_blank?( r )\n\n end\n\n end\n end\n\n respond_to do |format|\n if @list.update_attributes( params[ :list ] ) && \n @list.update_attributes( list_items_attributes: (nested || {}) ) &&\n new_items.map( &:save ).all? then\n\n format.html { redirect_to @list, notice: 'List was successfully updated.' }\n format.json { head :no_content }\n\n else\n\n format.html { render action: \"edit\" }\n format.json { render json: @list.errors, status: :unprocessable_entity }\n\n end\n end\n end", "title": "" }, { "docid": "59099549dba176e851042d594859d5e6", "score": "0.49756807", "text": "def update\n @item = Item.find(params[:id])\n\n respond_to do |format|\n if @item.update_attributes(params[:item])\n format.html { redirect_to lists_path, :notice => 'Item was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @item.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1dc1787baf895feecbb0aedc6fca8dc0", "score": "0.496774", "text": "def update(list, item, qty)\n add_item(list, item, qty)\nend", "title": "" }, { "docid": "06057e2e70098ce26a22888b293c2a62", "score": "0.49567753", "text": "def update_item_quantity(list, updateitem, new_qty, print=true)\n\t# input: list, item name (string), new quantity (int or string)\n\t# output: updated list\n\n\tmatch_index = find_item(list, updateitem)\n\tif not match_index\n\t\t# alert if not found\n\t\tmsg = \"\\n\\n** WARNING update_item_quantity failure: item \"\n\t\tmsg += \"\\\"#{removeitem}\\\" not found in list. List unchanged. **\"\n\t\treturn list\n\telse\t\t\t\n\t\t# update list\n\t\tlist.delete_at(match_index)\n\t\tlist.insert(match_index, [updateitem.strip.capitalize, new_qty.to_s])\n\t\t# print success message\n\t\tmsg = \"\\n\\nList updated: item '#{updateitem}' quantity \"\n\t\tmsg += \"updated to '#{new_qty}'.\\n\"\n\t\tputs msg\n\t\t# print updated list\n\t\tprint_list(list) if print\n\t\treturn list\n\tend\nend", "title": "" }, { "docid": "2f02b634dffd4efda23f55733a4f7a6d", "score": "0.495529", "text": "def update\n @item.update_attributes(item_params)\n @items = List.find(item_params[:list_id]).items.order(\"id ASC\")\n @list_id = @item.list.id\n end", "title": "" }, { "docid": "cfc45ed7fbd2893ad01844cc148abc46", "score": "0.49422902", "text": "def update!(**args)\n @_context = args[:_context] if args.key?(:_context)\n @_type = args[:_type] if args.key?(:_type)\n @item_list_element = args[:item_list_element] if args.key?(:item_list_element)\n end", "title": "" }, { "docid": "2e430ad20d485e8efbc2d0c7a50d247b", "score": "0.49030173", "text": "def update_item(list, item, new_quantity)\n\tlist[item] = new_quantity\n\tlist\nend", "title": "" }, { "docid": "9133b610543770e77070ea7bb4ae3952", "score": "0.49006352", "text": "def update_list(item_name, item_list, quantity)\n add_list(item_name, item_list, quantity)\nend", "title": "" }, { "docid": "5485561a890b30a4d84c0cb6d665216b", "score": "0.4891593", "text": "def update_items\n @existing_items = []\n @order.items.each { |i| @existing_items << i.id }\n\n # detail and reproduction_pages will come in as attributes of items, but they actually belong to the item_order\n # so look for those, then add them to the correct record in @item_orders\n\n @item_orders.each do |item_order|\n # add item to order\n if !@existing_items.include?(item_order['item_id'].to_i)\n item_order_record = @order.item_orders.create!(item_id: item_order['item_id'], archivesspace_uri: item_order['archivesspace_uri'], user_id: current_user.id, active: true)\n else\n item_order_record = @order.item_orders.where(item_id: item_order['item_id']).first\n item_order_record.update_attributes(archivesspace_uri: item_order['archivesspace_uri'])\n @order.reload\n # delete id from @existing_items array to track associations to be deleted\n @existing_items.delete(item_order['item_id'])\n end\n\n if item_order['reproduction_spec']\n create_or_update_reproduction_spec(item_order_record.id, item_order['reproduction_spec'])\n end\n\n # handle fees\n if @order_sub_type_name == 'reproduction_fee'\n if item_order['order_fee']\n create_or_update_order_fee(item_order_record.id, 'ItemOrder', item_order['order_fee'])\n end\n else\n # delete any existing fee for this item_order if it exists\n OrderFee.where(record_id: item_order_record.id,\n record_type: 'ItemOrder').each { |f| f.destroy! }\n end\n end\n\n @existing_items.each do |item_id|\n @order.item_orders.where(item_id: item_id).each { |io| io.destroy! }\n end\n end", "title": "" }, { "docid": "34a2c9b7ac86e1c2e1b56371aa3717bf", "score": "0.4876064", "text": "def update_many(filter, update, options = nil)\n result = native.update_many(filter, update, options || {})\n update_result(result)\n end", "title": "" }, { "docid": "8c8d9c21e4c061f2c39611bfb6e48213", "score": "0.48706606", "text": "def update\n @part_types = Constants::PART_TYPES\n respond_to do |format|\n if @item.update(item_params)\n format.html { redirect_to @item, notice: \"Item was successfully updated.\" }\n format.json { render :show, status: :ok, location: @item }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "748fcd395e6b78bf231babaaffd325ca", "score": "0.4850172", "text": "def update\n @list.append_items!(params.dig(:list, :items), current_user)\n redirect_to [@project, @randomization_scheme], notice: \"Items successfully added.\"\n end", "title": "" }, { "docid": "734d40d42e2935f6ffb13dd252e2f551", "score": "0.4839766", "text": "def update_item(index, attrs)\n new_items = items\n new_items[index] = new_items[index].merge(attrs)\n item = item_from_attributes(new_items[index])\n raise ActiveRecord::RecordInvalid, item unless item && item_is_valid?(item)\n update_attribute :items, new_items\n item\n end", "title": "" }, { "docid": "815ce1c3035f537dc94d3abee22eda8e", "score": "0.48379996", "text": "def update\n @item = @user.items.find(params[:id])\n\n @item.update(:type_list => \"\", :tag_list => \"\")\n respond_to do |format|\n if @item.update(item_params)\n format.html { redirect_to [@user, @item], notice: 'item was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n\n\n end", "title": "" }, { "docid": "008a9647ab85ecd6d1c0dc769c90a5ab", "score": "0.481145", "text": "def update(items)\n # clear!\n self.items.each do |i|\n number = items[i.id].blank? ? 1 : items[i.id].to_i <= 0 ? 1 : items[i.id]\n number.to_i < 99 ? i.quantity = number.to_i : i.quantity=99\n end\n # items.each { |id, quantity| add_items(id, quantity) }\n end", "title": "" }, { "docid": "c37a0a07fd54cdad25920d472545b4bb", "score": "0.48109514", "text": "def update\n \t@list = current_user.lists.find params[:list_id]\n @item = @list.items.find(params[:id])\n respond_to do |format|\n if @item.update(item_params)\n format.html { redirect_to list_items_path(@list), notice: 'Item was successfully updated.' }\n #format.json { render :show, status: :ok, location: @item }\n else\n format.html { render :edit }\n #format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "39e921c1b94968f3ceac4723831b5f12", "score": "0.47897217", "text": "def update\n @admin_item = Admin::Item.find(params[:id])\n fields = params[:item][:field]\n\n respond_to do |format|\n if @admin_item.update_attributes(params[:admin_item])\n \n fields.each do |key, value|\n Admin::FieldValue.create(:item_id => @admin_item.id, :field_id => key, :value => value)\n end\n \n format.html { redirect_to @admin_item, notice: 'Item was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @admin_item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0ac92e6927940676452ae7020f54b5f2", "score": "0.47883525", "text": "def update!(**args)\n @column_items = args[:column_items] if args.key?(:column_items)\n end", "title": "" }, { "docid": "29cd6b7402c20077fd3c0d4c861a50c1", "score": "0.4763813", "text": "def change_multiple_items\n @items = params[:items]\n\n @items.each do |item|\n @current_item = Item.find(item[:id])\n @current_item.update(quantity: item[:quantity])\n end\n\n render :json => @items.to_json\n end", "title": "" }, { "docid": "624fad6051cd72e652845c00fd3fe755", "score": "0.47569934", "text": "def update\n respond_to do |format|\n if @item_list.update(item_list_params)\n format.html { redirect_to @item_list, notice: 'Item list was successfully updated.' }\n format.json { render :show, status: :ok, location: @item_list }\n else\n format.html { render :edit }\n format.json { render json: @item_list.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "47129d9188f47ad80a5a4bb928f815b4", "score": "0.47468117", "text": "def update \n respond_to do |wants|\n if @item.update_attributes(params[:item])\n flash[:notice] = 'Item was successfully updated.'\n wants.html { redirect_to(admin_items_path) }\n wants.xml { head :ok }\n else\n \n wants.html { render :action => \"edit\" }\n wants.xml { render :xml => @item.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c35d476a7f4990ccc97862360a7419d9", "score": "0.47343338", "text": "def update\n @list_item = @list.list_items.find(params[:id])\n return error_status(true, :cannot_edit_listitem) unless (@list_item.can_be_edited_by(@logged_user))\n \n @list_item.updated_by = @logged_user\n\n respond_to do |format|\n if @list_item.update_attributes(params[:list_item])\n flash[:notice] = 'ListItem was successfully updated.'\n format.html { redirect_to(@list_item) }\n format.js\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.js\n format.xml { render :xml => @list_item.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f8d4252d254a151ee9cd22a5c8d84729", "score": "0.47092536", "text": "def bulk_update_associated_items\n return unless @image_ids.present?\n @image_ids.each_with_index { |image_id, position| update_position_or_create_item(image_id, position) }\n delete_removed_items\n end", "title": "" }, { "docid": "915a55864e1edf11be7679783852bf21", "score": "0.47081298", "text": "def update( mods )\n\t\tself.log.debug \" entry already exists: updating...\"\n\t\tself.before_update( mods ) or\n\t\t\traise Treequel::BeforeHookFailed, :update\n\t\tself.modify( mods )\n\t\tself.after_update( mods )\n\tend", "title": "" }, { "docid": "e1b822624f9e691a77f5e4521ab82be9", "score": "0.4705612", "text": "def remove_modifier_list_with_http_info(location_id, modifier_list_id, item_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: V1ItemsApi.remove_modifier_list ...\"\n end\n # verify the required parameter 'location_id' is set\n fail ArgumentError, \"Missing the required parameter 'location_id' when calling V1ItemsApi.remove_modifier_list\" if location_id.nil?\n # verify the required parameter 'modifier_list_id' is set\n fail ArgumentError, \"Missing the required parameter 'modifier_list_id' when calling V1ItemsApi.remove_modifier_list\" if modifier_list_id.nil?\n # verify the required parameter 'item_id' is set\n fail ArgumentError, \"Missing the required parameter 'item_id' when calling V1ItemsApi.remove_modifier_list\" if item_id.nil?\n # resource path\n local_var_path = \"/v1/{location_id}/items/{item_id}/modifier-lists/{modifier_list_id}\".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s).sub('{' + 'modifier_list_id' + '}', modifier_list_id.to_s).sub('{' + 'item_id' + '}', item_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n \n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['oauth2']\n data, status_code, headers = @api_client.call_api(:DELETE, 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 => 'V1Item')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: V1ItemsApi#remove_modifier_list\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "fb1bbe15351f47c97ad43f1a143c6697", "score": "0.47036025", "text": "def update\n @item.update!(item_params)\n end", "title": "" }, { "docid": "faec94dc00a616df650dc8372c8efdc5", "score": "0.46659338", "text": "def update_catalog(item, *)\n\t\t\t# get catalog\n\t\t\titem_cat = item.model.catalog\n\t\t\t# set total items\n\t\t\titem_cat.total_items = item_cat.items.count\n\t\t\t# set total and average costs\n\t\t\tcost = 0.0\n\t\t\titem_cat.items.each do |i|\n\t\t\t\tcost += i.price\n\t\t\tend\n\t\t\titem_cat.total_cost = cost\n\t\t\titem_cat.avg_cost = cost/item_cat.items.count\n\t\t\titem_cat.save\n\t\tend", "title": "" }, { "docid": "199347cc0da3f73381dc1a210b5f41c2", "score": "0.4663313", "text": "def update_roles(roles)\n self.roles |= roles\n self.save!\n end", "title": "" }, { "docid": "a3d242ac98ed173c287ac0ea0948bb1e", "score": "0.46590132", "text": "def update_line_item_price_lists!\n line_items.where('price_list_id != ?', price_list_id).each do |line_item|\n update_line_item_price!(line_item)\n end\n end", "title": "" }, { "docid": "c8468c4b172720c7f686ab0d1f2b8996", "score": "0.4658394", "text": "def batch_update(updates,commit=true)\n params=\"[{\\\"id\\\":\\\"#{id}\\\",\"\n updates.each do |update|\n params+=\"\\\"#{update[:field]}\\\":\"\n if update[:operation] == 'add'\n params+=\"{\\\"add\\\":\\\"#{update[:new_values].gsub('\"','\\\"')}\\\"}\"\n elsif update[:operation] == 'remove'\n params+=\"{\\\"set\\\":null}\"\n else\n update[:new_values]=self.class.to_array(update[:new_values])\n new_values = update[:new_values].map {|s| s.to_s.gsub(\"\\\\\",\"\\\\\\\\\\\\\").gsub('\"','\\\"').strip} # strip leading/trailing spaces and escape quotes for each value\n params+=\"{\\\"set\\\":[\\\"#{new_values.join('\",\"')}\\\"]}\"\n end\n params+=\",\"\n end\n params.chomp!(\",\")\n params+=\"}]\"\n post_to_solr(params,commit)\n end", "title": "" }, { "docid": "3cb3e80598b7cec924ef5ee044132630", "score": "0.4652522", "text": "def update\n item = @list.list_items.find(params[:id])\n\n if item.update_attributes(params[:list_item])\n render json: item\n else\n error(t('messages.list_item.errors.update'))\n end\n end", "title": "" }, { "docid": "f77b9d15dadaa29452e53537da9f8a42", "score": "0.46410576", "text": "def update\n @item = Item.find(params[:id])\n @statuses = ItemStatus.all\n @tags= Item.all_tags\n \n delete_images \n\n respond_to do |format|\n if @item.update_attributes(params[:item])\n if current_user and current_user.role_id == 1\n Notifier.item_updated(@item).deliver\n format.html { redirect_to(manage_items_url, :notice => 'Item was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { redirect_to(@item, :notice => 'Item was successfully updated.') }\n format.xml { head :ok }\n end\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @item.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "db91424f993ec10291a7d045e8ee8568", "score": "0.46366766", "text": "def update\n @admin_item = Admin::Item.find(params[:id])\n\n respond_to do |format|\n if @admin_item.update_attributes(params[:admin_item])\n format.html { redirect_to @admin_item, notice: 'Item was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @admin_item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "441798e5dcc0a29147b90416e0fd55d5", "score": "0.4632227", "text": "def update\n @list = List.find(params[:list_id])\n @list_item = @list.list_items.find(params[:id])\n\n if @list_item.update_attributes(params[:list_item])\n flash[:success] = \"List item was successfully updated.\"\n redirect_to list_path(@list) \n else\n flash[:errror] = \"Unable to update item.\"\n redirect_to edit_list_list_item_path(@list, @list_item)\n end\n end", "title": "" }, { "docid": "57c04bc3b74e349ebc0b0aab571a8526", "score": "0.46254542", "text": "def updated(item)\n end", "title": "" }, { "docid": "94d5e4d9ab2fd4bb2cd99ed6f8224e40", "score": "0.46253753", "text": "def update_quantity(list, item, quantity)\n\tadd_to_list(list, item, quantity)\nend", "title": "" }, { "docid": "eae5cdbbee5fdcaa0bb0f26649e3f1c1", "score": "0.4624311", "text": "def update\n puts \"update\"\n h = item_params\n unless current_user.admin?\n puts \"Item params before: \" + item_params.inspect\n h = item_params.slice(:observations, :status)\n end\n\n puts \"========================================\"\n puts h.inspect\n puts \"========================================\"\n if\n respond_to do |format|\n if @item.update(h)\n format.html { redirect_to @item, notice: 'Item was successfully updated.' }\n format.json { render :show, status: :ok, location: @item }\n else\n format.html { render :edit }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end\n end", "title": "" }, { "docid": "b0b836cddbd05102d2db2b8514f96038", "score": "0.46062616", "text": "def update_list(update)\n change_detail_update = ChangeDetail.new(update)\n \n # Update the editable fields and save\n self.name = change_detail_update.name\n self.active = change_detail_update.active\n self.definition = change_detail_update.definition\n self.save\n \n if self.errors.empty?\n change_details = self.change_item.change_details.find(:all)\n index = change_details.index(self)\n change_details[index].insert_at(update[:position].to_i)\n end\n end", "title": "" }, { "docid": "a0d20147163cdb9264fa47bb9a302c1a", "score": "0.46043748", "text": "def update\n \n respond_to do |format|\n if @item.update_attributes(params[:item])\n format.html { redirect_to @item, :notice => 'Item was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @item.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d04155f9c75cb06c7adb3b0862e25b40", "score": "0.4593988", "text": "def update\n\n @item = Item.find(params[:id])\n @item.update(item_params)\n\n redirect_to user_list_path(@item.list.user, @item.list)\n end", "title": "" }, { "docid": "7e33c35cbb1e0fb861eea74d418bd6f3", "score": "0.45817876", "text": "def update!(**args)\n @item = args[:item] if args.key?(:item)\n @location = args[:location] if args.key?(:location)\n @update_mask = args[:update_mask] if args.key?(:update_mask)\n end", "title": "" }, { "docid": "bdb9ad57310b1463ab448e47f4817e3c", "score": "0.457559", "text": "def update\n respond_to do |format|\n if @list_item.update(list_item_params)\n format.html { redirect_to @list_item, notice: 'List item was successfully updated.' }\n format.json { render json: @list_item, status: :ok }\n else\n format.html { render :edit }\n format.json { render json: @list_item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4e11b189b0dc1d52971770a61ae687af", "score": "0.45635453", "text": "def update_multiple_orders_and_indents(items)\n tuples = {}\n items.each do |item|\n tuples[item.id] = [item.item_order, item.indent]\n end\n args = {ids_to_orders_indents: tuples.to_json}\n return @client.api_helper.command(args, \"item_update_orders_indents\")\n end", "title": "" }, { "docid": "acde4d0bfa43d4b9aa6fa80073c4088e", "score": "0.45620295", "text": "def updating_item(list,item,quantity)\r\n\r\n adding_item(list,item, quantity)\r\n\r\nend", "title": "" }, { "docid": "5a915ce5c7eb3e4cb4b8a8792eeeb42f", "score": "0.45534205", "text": "def update\n if @item.update(item_params)\n flash[:success] = \"Updated item\"\n redirect_to item_path(@item)\n else\n render 'items/edit'\n end\n end", "title": "" }, { "docid": "0a9c129d75827c2bac8c435c1af8e249", "score": "0.45511454", "text": "def increment_positions_on_all_items\n # acts_as_list_class.update_all(\"#{position_column} = (#{position_column} + 1)\", \"#{scope_condition}\")\n acts_as_list_class.with_acts_as_list_scope(scope_condition) do \n update_all(\"#{position_column} = (#{position_column} + 1)\")\n end \n end", "title": "" }, { "docid": "08e91632a59c3bbfca73c3aa98bb4dd0", "score": "0.45450133", "text": "def update!(**args)\n @item_id = args[:item_id] if args.key?(:item_id)\n @list_id = args[:list_id] if args.key?(:list_id)\n end", "title": "" }, { "docid": "6fa451f0d4f28bb118c521a19c531178", "score": "0.4538731", "text": "def update\n @rentable_item.update(rentable_item_params)\n end", "title": "" }, { "docid": "f2a4a259f5c7710576f35259e621f913", "score": "0.45335853", "text": "def update_amounts\n @items = @items.each do |item|\n item[:good_tax] = set_tax(item[:good], item[:total], @good_tax_rate)\n item[:import_tax] = set_tax(item[:import], item[:total], @import_tax_rate)\n item[:sales_tax] = add_taxes(item[:sales_tax], item[:good_tax], item[:import_tax])\n item[:total] = add_taxes(item[:total], item[:good_tax], item[:import_tax])\n end\n end", "title": "" }, { "docid": "4d50bb958ed9534b65c528bfa9d12214", "score": "0.4528765", "text": "def update(args)\n return @client.api_helper.command(args, \"item_update\")\n end", "title": "" }, { "docid": "da24d9dbbec78ed2745009628618699c", "score": "0.45257708", "text": "def update_quality(items)\n items.each do |item|\n if is_special_item?(item)\n special_item(item)\n else\n item.sell_in > 0 ? decrement_normal_item(item, 1) : decrement_normal_item(item, 2)\n end\n\n item.sell_in -= 1\n end\nend", "title": "" }, { "docid": "0de697b96b1dc861e41a20716384f5b8", "score": "0.45244616", "text": "def modify_guild_role_positions(guild_id, positions, reason: nil)\n response = request(\n :guilds_gid_roles, guild_id,\n :patch,\n \"guilds/#{guild_id}/roles\",\n positions,\n 'X-Audit-Log-Reason': reason,\n )\n\n Rapture::Role.from_json_array(response.body)\n end", "title": "" }, { "docid": "6b8e9a94d71f37ced383f422360a41c8", "score": "0.45231268", "text": "def update\n @item_catalog = ItemCatalog.find(params[:id])\n\n respond_to do |format|\n if @item_catalog.update_attributes(params[:item_catalog])\n format.html { redirect_to @item_catalog, notice: 'Item catalog was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @item_catalog.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7a3c130b33363a58b4110bab7d11252d", "score": "0.45222047", "text": "def update\n @item = Item.find(params[:id])\n\n params[:item_locales].each do |loc, values|\n locale = Locale.find(values[:id])\n locale.name = values[:name]\n locale.description = values[:description]\n locale.locale = values[:locale]\n locale.save\n end\n\n respond_to do |format|\n if @item.update_attributes(params[:item])\n format.html { redirect_to @item, notice: 'Item was successfully updated.' }\n format.json { head :ok }\n format.xml { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n format.xml { render xml: @item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bad9bf24b8d431c32a1c5f32740b2005", "score": "0.451494", "text": "def update\n \t\t@item = Item.find(params[:id])\n \t\tif @item.update_attributes(item_params)\n \t\t\t flash[:success] = \"Item updated successfully.\"\n \t\t\tredirect_to items_path\n \t\telse\n \t\t\trender('edit')\n \t\tend\n \tend", "title": "" }, { "docid": "48128830c39f0cb23e3e5b193b3c45ac", "score": "0.45106664", "text": "def update(item, quantity, list)\n\t# steps: if the item is in the list\n\tif list.include? item.to_sym\n\t\t# update the quantity\n\t\tlist[item.to_sym] = quantity\n\telse \n\t\tadd_item(item, quantity, list)\n\tend\n\t# output: return the updated list\n\tlist\nend", "title": "" }, { "docid": "e2ea20c330b6c25e01fe5e6aa3522ba7", "score": "0.45086062", "text": "def update\n respond_to do |format|\n if @item.update(item_params)\n format.html { redirect_to items_path, notice: 'Item was updated successfully' }\n format.json { render :show, status: :ok, location: items_path }\n else\n format.html { render :edit }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "59bf034c512960d00e2ef4815552b65a", "score": "0.45079523", "text": "def onUpdated(item)\n @object.updated(import(item))\n end", "title": "" }, { "docid": "b2dd1d81aecc499396faeb261cdbf91b", "score": "0.4507537", "text": "def items\n if params[:update] == \"true\"\n ## Invariant: we are about to update all of the items in the library.\n logger.debug(\"Updating Items.\")\n Product.find(:all).each do |product|\n @name_call = product.id.to_s + \".name\"\n product.update_name(params[@name_call])\n @price_call = product.id.to_s + \".price\"\n product.update_price(params[@price_call])\n @inventory_call = product.id.to_s + \".inventory\"\n product.update_inventory(params[@inventory_call])\n @description_call = product.id.to_s + \".description\"\n product.update_description(params[@description_call])\n end\n ## Now we have to add any new items that were written in.\n if params[:added] != 0\n for i in 1..params[:added].to_i\n @n = \"name.new.\" + i.to_s\n @p = \"price.new.\" + i.to_s\n @inv = \"inventory.new.\" + i.to_s\n @des = \"description.new.\" + i.to_s\n if params[@n] && params[@p] && params[@inv] && params[@des]\n Product.create(:name => params[@n].to_s, :price => params[@p].to_f, :inventory => params[@inv].to_i, :description => params[@des].to_s)\n end\n end\n end\n end\n end", "title": "" }, { "docid": "d1e8ed5cb184b63499e4815bc5db70b2", "score": "0.45053032", "text": "def update\n respond_to do |format|\n if @item.update(item_params)\n format.html { redirect_to items_path, success: \"Customer record updated\"}\n else\n format.html { render :edit }\n end\n end\n end", "title": "" }, { "docid": "188fb806a9bee883894e6a9ba1a6811e", "score": "0.45004478", "text": "def update!(**args)\n @column_items = args[:column_items] if args.key?(:column_items)\n @wrap_style = args[:wrap_style] if args.key?(:wrap_style)\n end", "title": "" }, { "docid": "97eeaf655c39e4842ffafcc2654583e9", "score": "0.44991535", "text": "def update\n respond_to do |format|\n if @item.update(item_params)\n format.html { redirect_to items_url, notice: 'Item was successfully updated.' }\n format.json { render :show, status: :ok }\n else\n format.html { render :edit }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1c6e15b42958685ac82d4243b987b039", "score": "0.44872457", "text": "def update_item_button_list\n @item_button_list.item_list = @item_list\n @item_button_list.index = @index\n end", "title": "" }, { "docid": "0560b2ae878149f3b68b8af73c1a5eb7", "score": "0.44836423", "text": "def update_list(list, update_key, update_value)\r\n add_to_list(list, update_key, update_value)\r\n list\r\nend", "title": "" }, { "docid": "00220631c0081c97ea4c5988d06a91f1", "score": "0.44826633", "text": "def update_quantity(item, list, quantity)\n add_item(item, list, quantity)\nend", "title": "" }, { "docid": "0e3c191436e2fc47d0f2094efa20df1c", "score": "0.4480831", "text": "def update\n @modifier = Modifier.find(params[:id])\n\n respond_to do |format|\n if @modifier.update_attributes(params[:modifier])\n format.html { redirect_to @modifier, notice: 'Modifier was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @modifier.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d42f1895467ca5940c0987e90c3efe0f", "score": "0.44781572", "text": "def update\n respond_to do |format|\n if @item.update(item_params)\n format.html { redirect_to '/items', notice: 'Item was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9dd05e52270ed36f4f22e944aa6453c2", "score": "0.44769254", "text": "def update_item(list, item_name, new_qty)\n if list.has_key?(item_name)\n list[item_name] = new_qty\n else\n list = add_method(list, item_name, new_qty)\n end\n list\nend", "title": "" }, { "docid": "6abde3da0793807627a3a548a55dadf8", "score": "0.44750726", "text": "def batch_update\n authorize BonusElementMonthAmount\n if BonusElementMonthAmount.batch_update(bonus_element_month_amount_batch_update_params[:updates])\n render json: { success: true }, status: :ok\n else\n render json: { error: 'update failed' }, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "ab71039aaec6e9cc4d9dd8695ab690d2", "score": "0.4472137", "text": "def update_modifier_option_with_http_info(location_id, modifier_list_id, modifier_option_id, body, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: V1ItemsApi.update_modifier_option ...\"\n end\n # verify the required parameter 'location_id' is set\n fail ArgumentError, \"Missing the required parameter 'location_id' when calling V1ItemsApi.update_modifier_option\" if location_id.nil?\n # verify the required parameter 'modifier_list_id' is set\n fail ArgumentError, \"Missing the required parameter 'modifier_list_id' when calling V1ItemsApi.update_modifier_option\" if modifier_list_id.nil?\n # verify the required parameter 'modifier_option_id' is set\n fail ArgumentError, \"Missing the required parameter 'modifier_option_id' when calling V1ItemsApi.update_modifier_option\" if modifier_option_id.nil?\n # verify the required parameter 'body' is set\n fail ArgumentError, \"Missing the required parameter 'body' when calling V1ItemsApi.update_modifier_option\" if body.nil?\n # resource path\n local_var_path = \"/v1/{location_id}/modifier-lists/{modifier_list_id}/modifier-options/{modifier_option_id}\".sub('{format}','json').sub('{' + 'location_id' + '}', location_id.to_s).sub('{' + 'modifier_list_id' + '}', modifier_list_id.to_s).sub('{' + 'modifier_option_id' + '}', modifier_option_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n \n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(body)\n auth_names = ['oauth2']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'V1ModifierOption')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: V1ItemsApi#update_modifier_option\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "121c9b30588cea59369f32fc4acd89b7", "score": "0.4470815", "text": "def update\n respond_to do |format|\n if @list_item.update(list_item_params)\n format.html { redirect_to list_path(@list), notice: 'List item was successfully updated.' }\n format.json { render :show, status: :ok, location: @list_item }\n else\n format.html { render :edit }\n format.json { render json: @list_item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c381266a36a3ae167a604627abf67a3d", "score": "0.44703755", "text": "def update\n if @item.update(item_params)\n redirect_to items_path, notice: 'Item was successfully updated.'\n else\n render :edit, notice: 'Something went wrong try again.'\n end\n end", "title": "" }, { "docid": "6220df500ce7cc81536fcc89669ed053", "score": "0.44692433", "text": "def update_list(new_list,item,new_qty)\n new_list[item]=new_qty\n return new_list\nend", "title": "" }, { "docid": "d49835008e505c095eee6df709359ab1", "score": "0.44662276", "text": "def update_amount(list, item, amount)\n\n\tlist.each do |iterator|\n\t\tif iterator[:item] == item\n\t\t\titerator.replace({item: item, qty: amount}) \n\t\tend\n\tend\n\tlist\nend", "title": "" }, { "docid": "239b2e1ff0feff23751666862a145a4a", "score": "0.4463293", "text": "def item_update(item)\n debug \"item update\"\n row = @contacts_rows[item.jid]\n unless row\n add_item_to_roster(item)\n row = @contacts_rows[item.jid]\n end\n fill_model_values_for_item item, row\n end", "title": "" }, { "docid": "b19b7bf03013e8d588130ff685480ac6", "score": "0.446039", "text": "def update\n respond_to do |format|\n if @list_item.update(list_item_params)\n format.html { redirect_to @list_item, notice: 'List item was successfully updated.' }\n format.json { render :show, status: :ok, location: @list_item }\n else\n format.html { render :edit }\n format.json { render json: @list_item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "63e755dc1c24a359e03e60651a8e578c", "score": "0.44565898", "text": "def update_for\n update_for_items.collect(&:package)\n end", "title": "" }, { "docid": "f31805f9dc6b1692e52937a9b79d255c", "score": "0.44543475", "text": "def update\n respond_to do |format|\n if @item.update(item_params)\n format.html { redirect_to items_path, notice: 'Item ' + @item.name + ' was successfully updated.' }\n format.json { render :show, status: :ok, location: @item }\n else\n format.html { render :edit }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6469761bbbc69e508599240db828ddf0", "score": "0.4454001", "text": "def update\n authorize! :edit, @item\n if @item.update(item_params)\n redirect_to @item\n else\n render 'edit'\n end\n\n end", "title": "" }, { "docid": "da54f0086d35933838c9e7ba0d406869", "score": "0.44522354", "text": "def update!(**args)\n @create_item = args[:create_item] if args.key?(:create_item)\n @delete_item = args[:delete_item] if args.key?(:delete_item)\n @move_item = args[:move_item] if args.key?(:move_item)\n @update_form_info = args[:update_form_info] if args.key?(:update_form_info)\n @update_item = args[:update_item] if args.key?(:update_item)\n @update_settings = args[:update_settings] if args.key?(:update_settings)\n end", "title": "" }, { "docid": "b277aa09e6dfa47af805c90bd79786ca", "score": "0.44456935", "text": "def update\n respond_to do |format|\n if @material_item.update(material_item_params)\n format.html { redirect_to @material_item, notice: 'Material item was successfully updated.' }\n format.json { render :show, status: :ok, location: @material_item }\n else\n format.html { render :edit }\n format.json { render json: @material_item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "10acf767211b20ad40a58680a5c36dee", "score": "0.0", "text": "def set_team\n @team = Team.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60339177", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.60135007", "text": "def on_setup_callbacks; end", "title": "" }, { "docid": "311e95e92009c313c8afd74317018994", "score": "0.59219855", "text": "def setup_actions\n domain = @apps.domain\n path_user = '/a/feeds/'+domain+'/user/2.0'\n path_nickname = '/a/feeds/'+domain+'/nickname/2.0'\n path_email_list = '/a/feeds/'+domain+'/emailList/2.0'\n path_group = '/a/feeds/group/2.0/'+domain\n\n @apps.register_action(:domain_login, {:method => 'POST', :path => '/accounts/ClientLogin' })\n @apps.register_action(:user_create, { :method => 'POST', :path => path_user })\n @apps.register_action(:user_retrieve, { :method => 'GET', :path => path_user+'/' })\n @apps.register_action(:user_retrieve_all, { :method => 'GET', :path => path_user })\n @apps.register_action(:user_update, { :method => 'PUT', :path => path_user +'/' })\n @apps.register_action(:user_delete, { :method => 'DELETE', :path => path_user +'/' })\n @apps.register_action(:nickname_create, { :method => 'POST', :path =>path_nickname })\n @apps.register_action(:nickname_retrieve, { :method => 'GET', :path =>path_nickname+'/' })\n @apps.register_action(:nickname_retrieve_all_for_user, { :method => 'GET', :path =>path_nickname+'?username=' })\n @apps.register_action(:nickname_retrieve_all_in_domain, { :method => 'GET', :path =>path_nickname })\n @apps.register_action(:nickname_delete, { :method => 'DELETE', :path =>path_nickname+'/' })\n @apps.register_action(:group_create, { :method => 'POST', :path => path_group })\n @apps.register_action(:group_update, { :method => 'PUT', :path => path_group })\n @apps.register_action(:group_retrieve, { :method => 'GET', :path => path_group })\n @apps.register_action(:group_delete, { :method => 'DELETE', :path => path_group })\n\n # special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n @apps.register_action(:next, {:method => 'GET', :path =>'' })\n end", "title": "" }, { "docid": "8315debee821f8bfc9718d31b654d2de", "score": "0.5913137", "text": "def initialize(*args)\n super\n @action = :setup\nend", "title": "" }, { "docid": "8315debee821f8bfc9718d31b654d2de", "score": "0.5913137", "text": "def initialize(*args)\n super\n @action = :setup\nend", "title": "" }, { "docid": "bfea4d21895187a799525503ef403d16", "score": "0.589884", "text": "def define_action_helpers\n super\n define_validation_hook if runs_validations_on_action?\n end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.5890051", "text": "def actions; end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.5890051", "text": "def actions; end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.5890051", "text": "def actions; end", "title": "" }, { "docid": "352de4abc4d2d9a1df203735ef5f0b86", "score": "0.5889191", "text": "def required_action\n # TODO: implement\n end", "title": "" }, { "docid": "8713cb2364ff3f2018b0d52ab32dbf37", "score": "0.58780754", "text": "def define_action_helpers\n if action == :save\n if super(:create_or_update)\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n else\n super\n end\n end", "title": "" }, { "docid": "a80b33627067efa06c6204bee0f5890e", "score": "0.5863248", "text": "def actions\n\n end", "title": "" }, { "docid": "930a930e57ae15f432a627a277647f2e", "score": "0.58094144", "text": "def setup_actions\n domain = @apps.domain\n path_base = '/a/feeds/emailsettings/2.0/'+domain+'/'\n\n @apps.register_action(:create_label, {:method => 'POST', :path => path_base })\n @apps.register_action(:create_filter, { :method => 'POST', :path => path_base })\n @apps.register_action(:create_send_as, { :method => 'POST', :path => path_base })\n @apps.register_action(:update_webclip, { :method => 'PUT', :path => path_base })\n @apps.register_action(:update_forward, { :method => 'PUT', :path => path_base })\n @apps.register_action(:set_pop, { :method => 'PUT', :path => path_base })\n @apps.register_action(:set_imap, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_vacation, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_signature, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_language, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_general, { :method => 'PUT', :path =>path_base })\n\n # special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n @apps.register_action(:next, {:method => 'GET', :path =>nil })\n end", "title": "" }, { "docid": "33ff963edc7c4c98d1b90e341e7c5d61", "score": "0.57375425", "text": "def setup\n common_setup\n end", "title": "" }, { "docid": "a5ca4679d7b3eab70d3386a5dbaf27e1", "score": "0.57285565", "text": "def perform_setup\n end", "title": "" }, { "docid": "ec7554018a9b404d942fc0a910ed95d9", "score": "0.57149214", "text": "def before_setup(&block)\n pre_setup_actions.unshift block\n end", "title": "" }, { "docid": "9c186951c13b270d232086de9c19c45b", "score": "0.5703237", "text": "def callbacks; end", "title": "" }, { "docid": "c85b0efcd2c46a181a229078d8efb4de", "score": "0.56900954", "text": "def custom_setup\n\n end", "title": "" }, { "docid": "100180fa74cf156333d506496717f587", "score": "0.56665677", "text": "def do_setup\n\t\tget_validation\n\t\tprocess_options\n\tend", "title": "" }, { "docid": "2198a9876a6ec535e7dcf0fd476b092f", "score": "0.5651118", "text": "def initial_action; end", "title": "" }, { "docid": "b9b75a9e2eab9d7629c38782c0f3b40b", "score": "0.5648135", "text": "def setup_intent; end", "title": "" }, { "docid": "471d64903a08e207b57689c9fbae0cf9", "score": "0.56357735", "text": "def setup_controllers &proc\n @global_setup = proc\n self\n end", "title": "" }, { "docid": "468d85305e6de5748477545f889925a7", "score": "0.5627078", "text": "def inner_action; end", "title": "" }, { "docid": "bb445e7cc46faa4197184b08218d1c6d", "score": "0.5608873", "text": "def pre_action\n # Override this if necessary.\n end", "title": "" }, { "docid": "432f1678bb85edabcf1f6d7150009703", "score": "0.5598699", "text": "def target_callbacks() = commands", "title": "" }, { "docid": "48804b0fa534b64e7885b90cf11bff31", "score": "0.5598419", "text": "def execute_callbacks; end", "title": "" }, { "docid": "5aab98e3f069a87e5ebe77b170eab5b9", "score": "0.5589822", "text": "def api_action!(*args)\n type = self.class.name.split(\"::\").last.downcase\n run_callbacks_for([\"before_#{type}\", :before], *args)\n result = nil\n begin\n result = yield if block_given?\n run_callbacks_for([\"after_#{type}\", :after], *args)\n result\n rescue => err\n run_callbacks_for([\"failed_#{type}\", :failed], *(args + [err]))\n raise\n end\n end", "title": "" }, { "docid": "9efbca664902d80a451ef6cff0334fe2", "score": "0.5558845", "text": "def global_callbacks; end", "title": "" }, { "docid": "9efbca664902d80a451ef6cff0334fe2", "score": "0.5558845", "text": "def global_callbacks; end", "title": "" }, { "docid": "482481e8cf2720193f1cdcf32ad1c31c", "score": "0.55084664", "text": "def required_keys(action)\n\n end", "title": "" }, { "docid": "353fd7d7cf28caafe16d2234bfbd3d16", "score": "0.5504379", "text": "def assign_default_callbacks(action_name, is_member=false)\n if ResourceController::DEFAULT_ACTIONS.include?(action_name)\n DefaultActions.send(action_name, self)\n elsif is_member\n send(action_name).build { load_object }\n send(action_name).wants.html\n send(action_name).wants.xml { render :xml => object }\n send(action_name).failure.flash \"Request failed\"\n send(action_name).failure.wants.html\n send(action_name).failure.wants.xml { render :xml => object.errors }\n else\n send(action_name).build { load_collection }\n send(action_name).wants.html\n send(action_name).wants.xml { render :xml => collection }\n send(action_name).failure.flash \"Request failed\"\n send(action_name).failure.wants.html\n send(action_name).failure.wants.xml { head 500 }\n end\n end", "title": "" }, { "docid": "dcf95c552669536111d95309d8f4aafd", "score": "0.5465574", "text": "def layout_actions\n \n end", "title": "" }, { "docid": "2f6ef0a1ebe74f4d79ef0fb81af59d40", "score": "0.5464707", "text": "def on_setup(&block); end", "title": "" }, { "docid": "8ab2a5ea108f779c746016b6f4a7c4a8", "score": "0.54471064", "text": "def testCase_001\n test_case_title # fw3_actions.rb\n setup # fw3_global_methods.rb\n \n get_page_url # fw3_actions.rb\n validate_page_title # fw3_actions.rb\n validate_page_link_set # fw3_actions.rb\n \n teardown # fw3_global_methods.rb\nend", "title": "" }, { "docid": "e3aadf41537d03bd18cf63a3653e05aa", "score": "0.54455084", "text": "def before(action)\n invoke_callbacks *options_for(action).before\n end", "title": "" }, { "docid": "6bd37bc223849096c6ea81aeb34c207e", "score": "0.5437386", "text": "def post_setup\n end", "title": "" }, { "docid": "07fd9aded4aa07cbbba2a60fda726efe", "score": "0.54160327", "text": "def testCase_001\n testTitle # fw2_actions.rb\n setup # fw2_global_methods.rb\n get_page_url # fw2_actions.rb\n validate_title # fw2_actions.rb\n teardown # fw2_global_methods.rb\nend", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.5411113", "text": "def action_methods; end", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.5411113", "text": "def action_methods; end", "title": "" }, { "docid": "9358208395c0869021020ae39071eccd", "score": "0.5397424", "text": "def post_setup; end", "title": "" }, { "docid": "cb5bad618fb39e01c8ba64257531d610", "score": "0.5392518", "text": "def define_model_action(methods,action,default_options={:validate => true})\n default_options.merge!(methods.extract_options!)\n actions = [action,\"#{action}!\".to_sym]\n actions.each do |a|\n define_method(a) do |opts = {}|\n rslt = nil\n options = default_options.merge(opts)\n options[:raise_exception] = a.to_s.match(/\\!$/)\n run_callbacks(action) do\n rslt = run_model_action(methods,options)\n end\n run_after_any\n rslt\n end\n end\n end", "title": "" }, { "docid": "c5904f93614d08afa38cc3f05f0d2365", "score": "0.5391541", "text": "def before_setup; end", "title": "" }, { "docid": "c5904f93614d08afa38cc3f05f0d2365", "score": "0.5391541", "text": "def before_setup; end", "title": "" }, { "docid": "a468b256a999961df3957e843fd9bdf4", "score": "0.5385411", "text": "def _setup\n setup_notification_categories\n setup_intelligent_segments\n end", "title": "" }, { "docid": "f099a8475f369ce73a38d665b6ee6877", "score": "0.53794575", "text": "def action_run\n end", "title": "" }, { "docid": "2c4e5a90aa8efaaa3ed953818a9b30d2", "score": "0.5357573", "text": "def execute(setup)\n @action.call(setup)\n end", "title": "" }, { "docid": "118932433a8cfef23bb8a921745d6d37", "score": "0.53487605", "text": "def register_action(action); end", "title": "" }, { "docid": "725216eb875e8fa116cd55eac7917421", "score": "0.5346655", "text": "def setup\n @controller.setup\n end", "title": "" }, { "docid": "39c39d6fe940796aadbeaef0ce1c360b", "score": "0.53448105", "text": "def setup_phase; end", "title": "" }, { "docid": "bd03e961c8be41f20d057972c496018c", "score": "0.5342072", "text": "def post_setup\n controller.each do |name,ctrl|\n ctrl.post_setup\n end\n end", "title": "" }, { "docid": "c6352e6eaf17cda8c9d2763f0fbfd99d", "score": "0.5341318", "text": "def initial_action=(_arg0); end", "title": "" }, { "docid": "207a668c9bce9906f5ec79b75b4d8ad7", "score": "0.53243506", "text": "def before_setup\n\n end", "title": "" }, { "docid": "669ee5153c4dc8ee81ff32c4cefdd088", "score": "0.53025913", "text": "def ensure_before_and_after; end", "title": "" }, { "docid": "c77ece7b01773fb7f9f9c0f1e8c70332", "score": "0.5283114", "text": "def setup!\n adding_handlers do\n check_arity\n apply_casting\n check_validation\n end\n end", "title": "" }, { "docid": "1e1e48767a7ac23eb33df770784fec61", "score": "0.5282289", "text": "def set_minimum_up_member_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end", "title": "" }, { "docid": "4ad1208a9b6d80ab0dd5dccf8157af63", "score": "0.52585614", "text": "def rails_controller_callbacks(&block)\n rails_controller_instance.run_callbacks(:process_action, &block)\n end", "title": "" }, { "docid": "63a9fc1fb0dc1a7d76ebb63a61ed24d7", "score": "0.52571374", "text": "def define_callbacks(*args)\n if abstract_class\n all_shards.each do |model|\n model.define_callbacks(*args)\n end\n end\n\n super\n end", "title": "" }, { "docid": "fc88422a7a885bac1df28883547362a7", "score": "0.52483684", "text": "def pre_setup_actions\n @@pre_setup_actions ||= []\n end", "title": "" }, { "docid": "8945e9135e140a6ae6db8d7c3490a645", "score": "0.5244467", "text": "def action_awareness\n if action_aware?\n if !@options.key?(:allow_nil)\n if @required\n @allow_nil = false\n else\n @allow_nil = true\n end\n end\n if as_action != \"create\"\n @required = false\n end\n end\n end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.52385926", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.52385926", "text": "def action; end", "title": "" }, { "docid": "7b3954deb2995cf68646c7333c15087b", "score": "0.5236853", "text": "def after_setup\n end", "title": "" }, { "docid": "1dddf3ac307b09142d0ad9ebc9c4dba9", "score": "0.52330637", "text": "def external_action\n raise NotImplementedError\n end", "title": "" }, { "docid": "5772d1543808c2752c186db7ce2c2ad5", "score": "0.52300817", "text": "def actions(state:)\n raise NotImplementedError\n end", "title": "" }, { "docid": "64a6d16e05dd7087024d5170f58dfeae", "score": "0.522413", "text": "def setup_actions(domain)\n\t\t\tpath_user = '/a/feeds/'+domain+'/user/2.0'\n\t\t\tpath_nickname = '/a/feeds/'+domain+'/nickname/2.0'\n\t\t\tpath_group = '/a/feeds/group/2.0/'+domain # path for Google groups\n\n\t\t\taction = Hash.new\n\t\t\taction[:domain_login] = {:method => 'POST', :path => '/accounts/ClientLogin' }\n\t\t\taction[:user_create] = { :method => 'POST', :path => path_user }\n\t\t\taction[:user_retrieve] = { :method => 'GET', :path => path_user+'/' }\n\t\t\taction[:user_retrieve_all] = { :method => 'GET', :path => path_user } \n\t\t\taction[:user_update] = { :method => 'PUT', :path => path_user +'/' }\n\t\t\taction[:user_rename] = { :method => 'PUT', :path => path_user +'/' }\n\t\t\taction[:user_delete] = { :method => 'DELETE', :path => path_user +'/' }\n\t\t\taction[:nickname_create] = { :method => 'POST', :path =>path_nickname }\n\t\t\taction[:nickname_retrieve] = { :method => 'GET', :path =>path_nickname+'/' }\n\t\t\taction[:nickname_retrieve_all_for_user] = { :method => 'GET', :path =>path_nickname+'?username=' }\n\t\t\taction[:nickname_retrieve_all_in_domain] = { :method => 'GET', :path =>path_nickname }\n\t\t\taction[:nickname_delete] = { :method => 'DELETE', :path =>path_nickname+'/' }\n\t\t\taction[:group_create] = { :method => 'POST', :path =>path_group }\n\t\t\taction[:group_update] = { :method => 'PUT', :path =>path_group+'/' }\n\t\t\taction[:group_delete] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:groups_retrieve] = { :method => 'GET', :path =>path_group+'?member=' }\n\t\t\taction[:all_groups_retrieve] = { :method => 'GET', :path =>path_group }\n\t\t\taction[:membership_add] = { :method => 'POST', :path =>path_group+'/' }\n\t\t\taction[:membership_remove] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:membership_confirm] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:all_members_retrieve] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:ownership_add] = { :method => 'POST', :path =>path_group+'/' }\n\t\t\taction[:ownership_remove] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:ownership_confirm] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:all_owners_retrieve] = { :method => 'GET', :path =>path_group+'/' }\n\t\n\t\t\t# special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n\t\t\taction[:next] = {:method => 'GET', :path =>nil }\n\t\t\treturn action \t\n\t\tend", "title": "" }, { "docid": "6350959a62aa797b89a21eacb3200e75", "score": "0.52226824", "text": "def before(action)\n invoke_callbacks *self.class.send(action).before\n end", "title": "" }, { "docid": "db0cb7d7727f626ba2dca5bc72cea5a6", "score": "0.521999", "text": "def process_params\n set_params_authable if process_params_authable?\n set_params_ownerable if process_params_ownerable?\n set_params_sub_action\n end", "title": "" }, { "docid": "8d7ed2ff3920c2016c75f4f9d8b5a870", "score": "0.5215832", "text": "def pick_action; end", "title": "" }, { "docid": "7bbfb366d2ee170c855b1d0141bfc2a3", "score": "0.5213786", "text": "def proceed_with(action, *arguments)\n self.class.decouplings.each do |decoupler|\n decoupler.run_on(self, action, *arguments)\n end\n end", "title": "" }, { "docid": "78ecc6a2dfbf08166a7a1360bc9c35ef", "score": "0.52100146", "text": "def define_action_helpers\n if action_hook\n @action_hook_defined = true\n define_action_hook\n end\n end", "title": "" }, { "docid": "2aba2d3187e01346918a6557230603c7", "score": "0.52085197", "text": "def ac_action(&blk)\n @action = blk\n end", "title": "" }, { "docid": "4c23552739b40c7886414af61210d31c", "score": "0.5203262", "text": "def execute_pre_setup_actions(test_instance,runner=nil)\n self.class.pre_setup_actions.each do |action|\n action.call test_instance\n end\n end", "title": "" }, { "docid": "691d5a5bcefbef8c08db61094691627c", "score": "0.5202406", "text": "def performed(action)\n end", "title": "" }, { "docid": "6a98e12d6f15af80f63556fcdd01e472", "score": "0.520174", "text": "def perform_setup\n ## Run global setup before example\n Alfred.configuration.setup.each do |setup|\n @request.perform_setup(&setup)\n end\n\n ## Run setup blocks for scenario\n setups.each { |setup| @request.perform_setup(&setup) }\n end", "title": "" }, { "docid": "d56f4ec734e3f3bc1ad913b36ff86130", "score": "0.5201504", "text": "def create_setup\n \n end", "title": "" }, { "docid": "ad33138fb4bd42d9785a8f84821bfd88", "score": "0.51963276", "text": "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "title": "" }, { "docid": "ad33138fb4bd42d9785a8f84821bfd88", "score": "0.51963276", "text": "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "title": "" }, { "docid": "7fca702f2da4dbdc9b39e5107a2ab87d", "score": "0.5191404", "text": "def add_transition_callbacks\n %w(before after).each {|type| owner_class.define_callbacks(\"#{type}_transition_#{attribute}\") }\n end", "title": "" }, { "docid": "063b82c93b47d702ef6bddadb6f0c76e", "score": "0.5178325", "text": "def setup(instance)\n action(:setup, instance)\n end", "title": "" }, { "docid": "9f1f73ee40d23f6b808bb3fbbf6af931", "score": "0.51765746", "text": "def setup( *args )\n\t\t\tself.class.setupMethods.each {|sblock|\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\tend", "title": "" }, { "docid": "b4f4e1d4dfd31919ab39aecccb9db1d0", "score": "0.51710224", "text": "def setup(resources) ; end", "title": "" }, { "docid": "b4f4e1d4dfd31919ab39aecccb9db1d0", "score": "0.51710224", "text": "def setup(resources) ; end", "title": "" }, { "docid": "b4f4e1d4dfd31919ab39aecccb9db1d0", "score": "0.51710224", "text": "def setup(resources) ; end", "title": "" }, { "docid": "7a0c9d839516dc9d0014e160b6e625a8", "score": "0.5162045", "text": "def setup(request)\n end", "title": "" }, { "docid": "e441ee807f2820bf3655ff2b7cf397fc", "score": "0.5150735", "text": "def after_setup; end", "title": "" }, { "docid": "1d375c9be726f822b2eb9e2a652f91f6", "score": "0.5143402", "text": "def before *actions, &proc\n actions = ['*'] if actions.size == 0\n actions.each { |a| @callbacks[:a][a] = proc }\n end", "title": "" }, { "docid": "c594a0d7b6ae00511d223b0533636c9c", "score": "0.51415485", "text": "def code_action_provider; end", "title": "" }, { "docid": "faddd70d9fef5c9cd1f0d4e673e408b9", "score": "0.51398855", "text": "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end", "title": "" }, { "docid": "2fcff037e3c18a5eb8d964f8f0a62ebe", "score": "0.51376045", "text": "def setup(params)\n end", "title": "" }, { "docid": "111fd47abd953b35a427ff0b098a800a", "score": "0.51318985", "text": "def setup\n make_notification_owner\n load_superusers\n admin_sets.each do |as|\n @logger.debug \"Attempting to make admin set for #{as}\"\n make_admin_set_from_config(as)\n end\n load_workflows\n everyone_can_deposit_everywhere\n give_superusers_superpowers\n end", "title": "" }, { "docid": "f2ac709e70364fce188bb24e414340ea", "score": "0.5115387", "text": "def setup_defaults\n add_help\n @handler = Cliqr::Util.forward_to_help_handler if @handler.nil? && help? && actions?\n @actions.each(&:setup_defaults)\n end", "title": "" }, { "docid": "3b4fb29fa45f95d436fd3a8987f12de7", "score": "0.5111866", "text": "def setup\n transition_to(:setup)\n end", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.5110294", "text": "def action\n end", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.5110294", "text": "def action\n end", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.5110294", "text": "def action\n end", "title": "" }, { "docid": "4c7a1503a86fb26f1e4b4111925949a2", "score": "0.5109771", "text": "def scaffold_setup_helper\n include ScaffoldingExtensions::Helper\n include ScaffoldingExtensions::MerbControllerHelper\n include ScaffoldingExtensions::PrototypeHelper\n include ScaffoldingExtensions::Controller\n include ScaffoldingExtensions::MerbController\n before :scaffold_check_nonidempotent_requests\n end", "title": "" }, { "docid": "63849e121dcfb8a1b963f040d0fe3c28", "score": "0.5107364", "text": "def perform_action(action, item)\n if action == :approve\n approve(item.fullid)\n elsif action == :remove\n remove(item.fullid)\n elsif action == :alert\n #perform_alert() check condition alert params and proceed\n else\n #something isn't cool, pass or error \n end\nend", "title": "" }, { "docid": "f04fd745d027fc758dac7a4ca6440871", "score": "0.5106081", "text": "def block_actions options ; end", "title": "" }, { "docid": "0d1c87e5cf08313c959963934383f5ae", "score": "0.51001656", "text": "def on_action(action)\n @action = action\n self\n end", "title": "" }, { "docid": "916d3c71d3a5db831a5910448835ad82", "score": "0.50964546", "text": "def do_action(action)\n case action\n when \"a\"\n @user_manager.create_user\n when \"b\"\n @user_manager.delete_user\n when \"c\"\n @user_manager.get_info\n when \"d\"\n @user_manager.list_all_users\n when \"quit\", \"exit\"\n bail\n end\n end", "title": "" }, { "docid": "076c761e1e84b581a65903c7c253aa62", "score": "0.5093199", "text": "def add_callbacks(base); end", "title": "" } ]
84ab34899611f54f0d5d37d6adae6f04
Some actions need this variable in the view
[ { "docid": "b35bf2de13bf72953cdb91174bb38a71", "score": "0.0", "text": "def load_user\n @user = current_user\n end", "title": "" } ]
[ { "docid": "c5d23a1d8161e7d7adcc240789013bd6", "score": "0.6784486", "text": "def view_context; end", "title": "" }, { "docid": "b8f955b5cceda4a0dbcfb22aaa2863fb", "score": "0.65569633", "text": "def view_assigns; end", "title": "" }, { "docid": "628f8b9b755e0677baad9c0eaad52eae", "score": "0.65330684", "text": "def show\n # Instance variable defined in before_action\n end", "title": "" }, { "docid": "79ff49abc83a32c352ca114630928ab0", "score": "0.6425331", "text": "def extra_view_variables\n {}\n end", "title": "" }, { "docid": "0f9897ee0de631b1f348b71485f5fdf8", "score": "0.6237595", "text": "def before_render; end", "title": "" }, { "docid": "38354c0dd0c314483e4c023b64e49f68", "score": "0.6107195", "text": "def view; end", "title": "" }, { "docid": "38354c0dd0c314483e4c023b64e49f68", "score": "0.6107195", "text": "def view; end", "title": "" }, { "docid": "7f35dbaefc46a2e5bd4ff62483edef9c", "score": "0.6063647", "text": "def view\n\t\t\n\tend", "title": "" }, { "docid": "7f35dbaefc46a2e5bd4ff62483edef9c", "score": "0.6063471", "text": "def view\n\t\t\n\tend", "title": "" }, { "docid": "1b880504a9f6f02961cf05e5a5254cba", "score": "0.60259926", "text": "def view_assigns\n {}\n end", "title": "" }, { "docid": "1ac88d90c89fdac1991028947dd90d8d", "score": "0.59901386", "text": "def view_context\n self\n end", "title": "" }, { "docid": "6802414ceab75f739bc981fe99a29ec5", "score": "0.59647685", "text": "def view\n return @view\n end", "title": "" }, { "docid": "954206898305c61ca938dca26dc586d8", "score": "0.5950313", "text": "def edit\n # Instance variable defined in before_action\n end", "title": "" }, { "docid": "70f30d5f7b2fd99aba0fb3039bcb5463", "score": "0.59239906", "text": "def view_context_class; end", "title": "" }, { "docid": "713996e91aba164eef856ba0d17484cf", "score": "0.5897632", "text": "def view\n end", "title": "" }, { "docid": "c93326b850b6982d9c9b86373906daec", "score": "0.5832668", "text": "def view\n \n end", "title": "" }, { "docid": "f07edd49431e0e3b7d674607a25a2b18", "score": "0.5830611", "text": "def view\n\tend", "title": "" }, { "docid": "aa681542e9303ec09e74e248b3c63489", "score": "0.58269477", "text": "def index\n # Instance variables are automatically copied to all views loaded in the same method.\n @username = \"Ramaze\"\n end", "title": "" }, { "docid": "d7928de735a1b403672761ce53e1f21f", "score": "0.5822966", "text": "def view_context_before_render(context)\n end", "title": "" }, { "docid": "d7928de735a1b403672761ce53e1f21f", "score": "0.5822966", "text": "def view_context_before_render(context)\n end", "title": "" }, { "docid": "54d4317523769f3315b8336670966fa2", "score": "0.58208585", "text": "def view_param\n params[:view]\n end", "title": "" }, { "docid": "f2c9b0b27c98d9dabf456f9915374899", "score": "0.58151424", "text": "def set_view_vars\n if params[:state].blank? or params[:state] == \"all\"\n @state = \"all\"\n @states = Task.active_states\n else\n @state = params[:state]\n @states = [@state]\n end\n\n if params[:select].blank?\n @select = \"0\"\n else\n @select = params[:select]\n end\n end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.5814588", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.5814588", "text": "def action; end", "title": "" }, { "docid": "3e22b8aaa47fb91a5a0d820f6408dfed", "score": "0.58064425", "text": "def view\n end", "title": "" }, { "docid": "18362da27fb3966ac2a80ac45e32ec42", "score": "0.57834375", "text": "def views; end", "title": "" }, { "docid": "18362da27fb3966ac2a80ac45e32ec42", "score": "0.57834375", "text": "def views; end", "title": "" }, { "docid": "c884033b2f1d25993b95ca59b0386d75", "score": "0.57716656", "text": "def view\n { }\n end", "title": "" }, { "docid": "ea188383f7b786c47375f17cddcab068", "score": "0.5742803", "text": "def current=(view_context); end", "title": "" }, { "docid": "a361c47c4d17751bb88faf6972d0292b", "score": "0.5726911", "text": "def action_view\n end", "title": "" }, { "docid": "fca6b161b76cac484c204c6336de4778", "score": "0.57035685", "text": "def view_context\n @view_context ||= super\n end", "title": "" }, { "docid": "c8fd65d50a75b09d8f641d4fa00d0cec", "score": "0.5642038", "text": "def show\n #only knows about the variables that are inside of our URL/Params\n end", "title": "" }, { "docid": "1941b6cef78151ea415104201d8b361b", "score": "0.56176305", "text": "def show\n # marks show action dited by suresh\n #dvmcvxcnvicxnvicxivncixvni\n end", "title": "" }, { "docid": "5ffc364e77a0582adfed9fa385eed534", "score": "0.56095386", "text": "def show\n @user=\"Wait for Admin approval\"\n end", "title": "" }, { "docid": "a6161ce75606dcc50d62cee587b79b77", "score": "0.56079566", "text": "def process_view_action\n view_type, view_ids = get_auth_params_view_model_type_and_ids\n access_denied(current_record, \"Action view params[:auth][:view_type] is blank.\") if view_type.blank?\n access_denied(current_record, \"Action view params[:auth][:view_ids] are blank.\") if view_ids.blank?\n view_type_class = get_model_type_class(view_type)\n access_denied(current_record, \"Action view params[:auth][view_type: #{view_type.inspect} cannot be constantized.\") if view_type_class.blank?\n access_denied(\"Invalid view action class #{view_type_class.name}.\") unless valid_ownerable_class?(view_type_class)\n @params_view_ids = [view_ids].flatten.compact\n @params_view_class = view_type_class\n @params_view_class_name = view_type_class.name # convience for where(ownerable_type: params_view_class_name)\n debug_message('*params_view_class', \"set to class [#{params_view_class.name}].\") if debug?\n debug_message('*params_view_ids', \"set to ids #{params_view_ids}.\") if debug?\n end", "title": "" }, { "docid": "0f83806aef25c3ad1bcf97582e2389aa", "score": "0.56050533", "text": "def view_variables\n { model: model,\n parent: parent,\n controllers_name: controllers_name,\n controllers_path: controllers_path,\n grand_parent: grand_parent,\n forward: forward,\n link_set_args_proc: link_set_args_proc }\n end", "title": "" }, { "docid": "c90c3951b4f9775e74183b32eb3edfaa", "score": "0.5603656", "text": "def display_action\n self[:action_type] ||= DISPLAY_ACTION\n end", "title": "" }, { "docid": "28ee61cf62f55ffa66b4b7c078e9427e", "score": "0.55870897", "text": "def prepare_views var_in_view\n assign(view_name, var_in_view)\n render\n end", "title": "" }, { "docid": "d00e3cda7966e7bd5c333019a71a1df5", "score": "0.5583141", "text": "def view_name\n unless @view_name\n action_name = controller.action_name\n @view_name = VIEW_PLACEHOLDERS[action_name] || action_name\n end\n @view_name\n end", "title": "" }, { "docid": "53902f9fa0740a15a364550ff3ac5c7d", "score": "0.55807436", "text": "def show\n @test = 'test'\n end", "title": "" }, { "docid": "7da1fa005d987ef79f041a26aa4a23a8", "score": "0.55722314", "text": "def view_context\n @_view_context ||= ActionView::Base.for_controller(self)\n end", "title": "" }, { "docid": "5a319529c4a5fc797e8cd06b519d8b98", "score": "0.55712837", "text": "def settings\n # render view\n end", "title": "" }, { "docid": "5c5f770f162b6256f8d793ec82f9f440", "score": "0.55710036", "text": "def view_props\n {}\n end", "title": "" }, { "docid": "3261013ec0cddb42aa7b0c511a57e7af", "score": "0.55677813", "text": "def tacos\n @my_tacos = 'carnitas'\n render 'tacos.html.erb'\nend", "title": "" }, { "docid": "be1a43745d0d82296b3fbdbd59a13fbd", "score": "0.5557196", "text": "def show\n #not in use\n end", "title": "" }, { "docid": "be1a43745d0d82296b3fbdbd59a13fbd", "score": "0.5557196", "text": "def show\n #not in use\n end", "title": "" }, { "docid": "55c7f1a6afe540e42873f7703903d32f", "score": "0.55468214", "text": "def view_title(pref, action_name=\"\")\n action_name = params[:action] if action_name.empty?\n @view_title = t(\"#{pref}.#{action_name}\") \n end", "title": "" }, { "docid": "d3d4d20b08883eabf7b48b89b79f02cc", "score": "0.5533473", "text": "def change_view\n $view_field = params[:view]\n redirect_to root_path\n end", "title": "" }, { "docid": "bb445e7cc46faa4197184b08218d1c6d", "score": "0.5525508", "text": "def pre_action\n # Override this if necessary.\n end", "title": "" }, { "docid": "6b05204286f48c275c852a06325ffe3e", "score": "0.55077875", "text": "def view_assigns\n @_view_assigns ||= {}\n end", "title": "" }, { "docid": "fed1fa3791c3121f845fd1f6f30bc755", "score": "0.5502402", "text": "def prepare_view\n #find in helpers/grants_helper.rb\n f = false\n url = \"/404\"\n case action_name\n when \"index\"\n @title = @header = \"Список пользователей\" \n f = could_see_users_list? && is_control?\n when \"show\"\n @title = @header = is_admin? && current_user != @user ? \"Личный кабинет пользователя #{@user.email}\" : \"Личный кабинет\" \n f = could_see_user?\n when \"new\", \"create\"\n @title = @header = \"Регистрация на сайте\" \n f = could_add_user? \n url = my_path \n @show_passwords = @show_email = @show_secondary = true\n @show_control_password = false \n when \"destroy\"\n @title = @header = \"Удаление пользователя\"\n f = could_destroy_user? \n when \"edit\", \"update\"\n f = could_modify_user?\n @update_type = params[:user].nil? ? params[:update_type] : params[:user][:update_type]\n @show_passwords = @update_type == \"password\"\n @show_email = @update_type == \"email\"\n @show_control_password = @show_email || @show_passwords\n @show_secondary = !@show_control_password\n if @show_passwords\n @title = @header = \"Изменение пароля\"\n @notice_text = \"Пароль успешно обновлён\" \n elsif @show_email\n @title = @header = \"Изменение контактного email адреса\" \n @notice_text = \"Email успешно обновлён\" \n else\n @title = @header = \"Изменение общей информации\" \n @notice_text = \"Информация успешно обновлена\" \n end\n when \"check\"\n f = (!params[:key].nil? && !params[:email].nil?)\n end\n redirect_to url and return if !f \n end", "title": "" }, { "docid": "d305f33239c69bed1a68b26adba6976c", "score": "0.5501875", "text": "def action_name; end", "title": "" }, { "docid": "b370b36a814780cc30165c0067984353", "score": "0.550111", "text": "def render; end", "title": "" }, { "docid": "b370b36a814780cc30165c0067984353", "score": "0.550111", "text": "def render; end", "title": "" }, { "docid": "b370b36a814780cc30165c0067984353", "score": "0.550111", "text": "def render; end", "title": "" }, { "docid": "b370b36a814780cc30165c0067984353", "score": "0.550111", "text": "def render; end", "title": "" }, { "docid": "b370b36a814780cc30165c0067984353", "score": "0.550111", "text": "def render; end", "title": "" }, { "docid": "b370b36a814780cc30165c0067984353", "score": "0.550111", "text": "def render; end", "title": "" }, { "docid": "56af1132e1cc8cf3119c8585434e6512", "score": "0.5500525", "text": "def view_with_check_option_support\n :local\n end", "title": "" }, { "docid": "928512e34ca1d76a28b3e5a1c18a9f87", "score": "0.54971594", "text": "def requestor; end", "title": "" }, { "docid": "2dd79bf5204ab22c940e4d6b548faf5d", "score": "0.54832697", "text": "def field_of_view\n end", "title": "" }, { "docid": "ec877aed96c0f2d4fe1885688026ff72", "score": "0.5483002", "text": "def artist_show_variables\n @user = current_user\n @artist = Artist.find_by(slug: params[:id])\n @date = params[:date] ? Date.parse(params[:date]) : Date.today\n @count = @artist.upcoming_count\n @cal_selection = params[:cal]\n end", "title": "" }, { "docid": "06ad98ee4d4a7c6f8d73fe6611899ab4", "score": "0.54824215", "text": "def request; @controller.request; end", "title": "" }, { "docid": "acb3c91f075c764adb2008b9e9129d51", "score": "0.5477744", "text": "def set_view_vars\n\n # Check to see if we got an asset group to sub select on. This occurs when the user\n # selects an asset group from the menu selector\n if params[:asset_group].nil? or params[:asset_group] == '0'\n @asset_group = ''\n else\n @asset_group = params[:asset_group]\n end\n\n # Check to see if we got an asset type to sub select on. This occurs when the user\n # selects an asset type from the drop down\n if params[:asset_type].nil?\n @asset_type = 0\n else\n @asset_type = params[:asset_type].to_i\n end\n\n # Check to see if we got an asset subtype to sub select on. This will happen if an asset type is selected\n # already and the user selected a subtype from the dropdown.\n if params[:asset_subtype].nil?\n @asset_subtype = 0\n else\n @asset_subtype = params[:asset_subtype].to_i\n end\n\n # Check to see if we got an organization to sub select on.\n if params[:org_id].nil?\n @org_id = 0\n else\n @org_id = params[:org_id].to_i\n end\n\n # Check to see if we got a manufacturer to sub select on.\n if params[:manufacturer_id].nil?\n @manufacturer_id = 0\n else\n @manufacturer_id = params[:manufacturer_id].to_i\n end\n\n # Check to see if we got a service status to sub select on.\n if params[:service_status].nil?\n @service_status = 0\n else\n @service_status = params[:service_status].to_i\n end\n\n # Check to see if we got a search text and search param to filter on\n if params[:search_text].nil?\n # See if one is stored in the session\n @search_text = session[:search_text].blank? ? nil : session[:search_text]\n @search_param = session[:search_param].blank? ? nil : session[:search_param]\n else\n @search_text = params[:search_text]\n @search_param = params[:search_param]\n end\n\n # Check to see if we got list of assets to filter on\n if params[:ids]\n #Checks to see if the id list is already an array. Converts a string to\n # an array if necessary.\n if params[:ids].is_a?(Array)\n @id_filter_list = params[:ids]\n else\n @id_filter_list = params[:ids].split(\"|\")\n end\n\n else\n @id_filter_list = []\n end\n\n # Check to see if we got spatial filter. This session variable is managed\n # by the spatial_filter method\n @spatial_filter = session[:spatial_filter]\n\n # Check to see if we got a different format to render\n if params[:format]\n @fmt = params[:format]\n else\n @fmt = 'html'\n end\n\n # Check to see if search for early disposition proposed assets only\n if params[:early_disposition] == '1'\n @early_disposition = true\n end\n if params[:transferred_assets] == '1'\n @transferred_assets = true\n end\n\n # If the asset type is not set we default to the asset base class\n if @id_filter_list.present? or (@asset_type == 0)\n # THIS WILL NO LONGER WORK\n # asset base class name should really be seed to pull typed asset class\n # base class here is just Asset or the new TransamAsset\n @asset_class_name = 'TransamAsset'\n elsif @asset_subtype > 0\n # we have an asset subtype so get it and get the asset type from it. We also set the filter form\n # to the name of the selected subtype\n subtype = AssetSubtype.find(@asset_subtype)\n @asset_type = subtype.asset_type.id\n @asset_class_name = subtype.asset_type.class_name\n @filter = subtype.name\n else\n asset_type = AssetType.find(@asset_type)\n @asset_class_name = asset_type.class_name\n end\n @view = \"#{@asset_class_name.underscore}_index\"\n\n Rails.logger.debug \"@fmt = #{@fmt}\"\n Rails.logger.debug \"@asset_type = #{@asset_type}\"\n Rails.logger.debug \"@asset_subtype = #{@asset_subtype}\"\n Rails.logger.debug \"@asset_class_name = #{@asset_class_name}\"\n Rails.logger.debug \"@view = #{@view}\"\n Rails.logger.debug \"@view = #{@fta_asset_class_id}\"\n\n end", "title": "" }, { "docid": "d5845adada1bbc93068ca6a8363cee6e", "score": "0.5477663", "text": "def user_view\n\n end", "title": "" }, { "docid": "7df64036030476279c31c1d6a9f8b02c", "score": "0.5476948", "text": "def init_pairing_view_variables\n otp_confirm_view_variables\n end", "title": "" }, { "docid": "32bd1e6cbb450f47f5af51e39a509427", "score": "0.5473761", "text": "def viewing_hint; end", "title": "" }, { "docid": "b693a92292cc2506791c76596b1fe7c4", "score": "0.54734087", "text": "def static_view \n \n @assignment = OiAssignment.find(params[:id])\n @section = @assignment.oi_instruction.oi_category_section\n @design = @assignment.oi_instruction.design\n @comments = @assignment.oi_assignment_comments\n \n render(:layout => false)\n \n end", "title": "" }, { "docid": "7e289d648dafe1f08d32ce6840958c6e", "score": "0.5461064", "text": "def view\n @user = current_user\n @todo = Todo.find(params[:id])\n unless @todo.user == current_user || admin?\n render :action => \"noperms\"\n return\n end\n @title = \"LifeHelpr - #{@todo.name}\"\n end", "title": "" }, { "docid": "ead8dfdfbbde4e566ea4f4efd439139f", "score": "0.54587805", "text": "def done_uploading_teaser\n \trender :layout => false\n \t#These objects are not being used.\n \t#if !@params['article_id'].nil?\n \t#\t@obj = Article.find(@params['article_id'])\n \t#end\n \t#if !@params['show_id'].nil?\n \t#\t@obj = Show.find(@params['show_id'])\n \t#end\n end", "title": "" }, { "docid": "37cd029d843c7ef2fcde49f1712dd75e", "score": "0.5457259", "text": "def action args = {}\n\t\tend", "title": "" }, { "docid": "f0c8ac564bd793c6ba6219a20414b367", "score": "0.5450174", "text": "def show\n # see before action filter\n end", "title": "" }, { "docid": "b4067de2266830a768c9b9d88745874b", "score": "0.54495174", "text": "def v\n view_context\n end", "title": "" }, { "docid": "c66b24c6de0bb6f951b2167b1e658941", "score": "0.544343", "text": "def action_run\n # This space left intentionally blank.\n end", "title": "" }, { "docid": "02fec93e944274a6fdb13cc88b9852ee", "score": "0.5436558", "text": "def oprah_view_context\n view_context\n end", "title": "" }, { "docid": "9cfdec68842e7833bd917a18f24f0ae8", "score": "0.543453", "text": "def rendered\n end", "title": "" }, { "docid": "7f3be1d19f86258ed444fa05027526ba", "score": "0.54326475", "text": "def cool_view_count\n view_count\n end", "title": "" }, { "docid": "7578252ddc2279d0bbd57712d71bf1dd", "score": "0.542986", "text": "def current_view\n raise 'define in child classes'\n end", "title": "" }, { "docid": "468d85305e6de5748477545f889925a7", "score": "0.5425449", "text": "def inner_action; end", "title": "" }, { "docid": "5e8ca59c44ee648be5f83cb52a5e4643", "score": "0.5423908", "text": "def help\n # tbd: somehow @current_user is available in all other controllers.\n @current_user = current_user\n end", "title": "" }, { "docid": "4c678b54229f67e7bf1181cefd563164", "score": "0.54228413", "text": "def initialize_view\n end", "title": "" }, { "docid": "1c4226617c462ebe7a16b89ceefe47ec", "score": "0.5418154", "text": "def view\n if @title == 'Action Items'\n ActionItems\n else\n Report\n end\n end", "title": "" }, { "docid": "5d1d2544786e3d20ed6ea249746e45bf", "score": "0.5405112", "text": "def show #just for admin view\n end", "title": "" }, { "docid": "ad97737456405029d682fcbb218f11bb", "score": "0.539703", "text": "def atenciones_no_brindadas\n @title = \"Atenciones no brindadas al público\"\n @action = \"show_atenciones_no_brindadas\"\n end", "title": "" }, { "docid": "1b736aff4a0ee82fe1e6ba1b935b1dae", "score": "0.53956497", "text": "def additional_show_actions\n\t\t\tnil\n\t\tend", "title": "" }, { "docid": "2436b0f846a45b23362eafcc3b822359", "score": "0.5389771", "text": "def set_scrapbook_vars #**** should be moved to application_controller\n @user = User.find(params[:id])\n @time = request.path.split(\"/\")[4] \n @nav_menu = @user.nav_menu\n \n end", "title": "" }, { "docid": "9ab9ef49679ddccfc3ece37de95aab25", "score": "0.53869736", "text": "def action\n action_property ? action_property.ruby_value : nil\n end", "title": "" }, { "docid": "ed4618b71e9405af6f910d3b4333e610", "score": "0.5360043", "text": "def _action_view\n @_action_view ||= begin\n av = super\n av.helpers.send(:include, master_helper_module)\n av\n end\n end", "title": "" }, { "docid": "c6f3428cc156c42e7beecb995ef1a3e6", "score": "0.5359982", "text": "def after_find\n create_accessor('view')\n end", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.5358488", "text": "def action\n end", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.5358488", "text": "def action\n end", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.5358488", "text": "def action\n end", "title": "" }, { "docid": "457028a619e01aaf47e4a9d2a0c8f062", "score": "0.53578174", "text": "def show\n #En este caso puedo acceder a @articulo porque está disponible por el before_Action :set:articulo\n @page_title = @articulo.titulo\n #sobreescribiendo la variable @seo_keywords por defecto creada por mi para los tags (se crea concerns)\n @seo_keywords = @articulo.cuerpo\n end", "title": "" }, { "docid": "954c5828178f6e4a659c40ef92736547", "score": "0.53544295", "text": "def helpful!\n\n\t\tend", "title": "" }, { "docid": "076426321423ca5a3e51819724cb7cfd", "score": "0.53532505", "text": "def load_view\n\n render params[:view]\n\n end", "title": "" }, { "docid": "9618edf1b572ce7731369298d2e5c280", "score": "0.53489935", "text": "def view_processor_comments\n \n @board_design_entry = BoardDesignEntry.find(params[:id])\n @user_action = params[:user_action]\n\n end", "title": "" }, { "docid": "cfd78d155a355642bc7b1799f4c478ff", "score": "0.53477794", "text": "def view\n if @title == 'Action Items'\n if @text or Minutes.started\n ActionItems\n else\n SelectActions\n end\n elsif @title == 'Roll Call' and User.role == :secretary\n RollCall\n elsif @title == 'Adjournment' and User.role == :secretary\n Adjournment\n else\n Report\n end\n end", "title": "" }, { "docid": "2528fad8aa06f01957da0f0215ad4e52", "score": "0.5347528", "text": "def before_render\n # Only have the view context available here\n @summary_error_list = view_context.content_for(:summary_error_list)\n end", "title": "" }, { "docid": "1424a5b5c72cddb153b61c12a6edba01", "score": "0.5346832", "text": "def title\n @title\nend", "title": "" }, { "docid": "1424a5b5c72cddb153b61c12a6edba01", "score": "0.5346832", "text": "def title\n @title\nend", "title": "" }, { "docid": "1424a5b5c72cddb153b61c12a6edba01", "score": "0.5346832", "text": "def title\n @title\nend", "title": "" } ]
fbd0da5d25bbbc6b96ff4b142187f9ca
Get the OSW path
[ { "docid": "490ba37337838fea441ba8aada3536c9", "score": "0.88284445", "text": "def osw_path\n @osw_abs_path\n end", "title": "" } ]
[ { "docid": "b3a921e41f3270f03960e36c90830f8d", "score": "0.8149696", "text": "def osw_dir\n File.dirname(@osw_abs_path)\n end", "title": "" }, { "docid": "b3a921e41f3270f03960e36c90830f8d", "score": "0.8149696", "text": "def osw_dir\n File.dirname(@osw_abs_path)\n end", "title": "" }, { "docid": "b1a35789919b13dc011855a9a1c13be7", "score": "0.7600476", "text": "def oswDir\n OpenStudio.toPath(@osw_dir)\n end", "title": "" }, { "docid": "19b312300a2ffc457d4281c8639fe292", "score": "0.6873853", "text": "def path\n driver.getOperaPath()\n end", "title": "" }, { "docid": "1108f9a8e7180b04c13f0affee152acc", "score": "0.67688143", "text": "def pathSourceHyper\n\t\"../../HyperOpen/\"\nend", "title": "" }, { "docid": "f4b52e7ab2aea9d921e912dd0e75af5d", "score": "0.6753669", "text": "def wc_path\n ::File.expand_path(@wc_path)\n end", "title": "" }, { "docid": "8adadc0861285ecc8f962069a9fe52d4", "score": "0.6679755", "text": "def get_path (fei_or_wfid)\n\n \"#{@workdir}/#{extract_wfid(fei_or_wfid, true)}.ejournal\"\n end", "title": "" }, { "docid": "b40768c60b383e1c246b043fe8c3787a", "score": "0.6592523", "text": "def wms_path\n url = Array.wrap(resource_decorator.wms_url)\n return url.first if url.try(:first).present?\n return unless generate_wms_path?\n \"#{path}/#{@config[visibility][:workspace]}/wms\"\n end", "title": "" }, { "docid": "f05cf6583946536a86fa5eb4f3923793", "score": "0.6578406", "text": "def path\r\n @pathname.to_s\r\n end", "title": "" }, { "docid": "493dd7333fc2a86d1c0b3f76ed98aac5", "score": "0.6549883", "text": "def path\n native.path\n end", "title": "" }, { "docid": "b37424cb12e8cf0f9a6a493ed76fc005", "score": "0.65396553", "text": "def wfs_path\n url = Array.wrap(resource_decorator.wfs_url)\n return url.first if url.try(:first).present?\n return unless @config && visibility && file_set && vector_file_set?\n \"#{path}/#{@config[visibility][:workspace]}/wfs\"\n end", "title": "" }, { "docid": "8fdded58dbb13d56e3f13e17205b7282", "score": "0.6515802", "text": "def path\n if location =~ /^\\/dev/\n \"dev:#{location}\"\n elsif location =~ /iso$/\n \"iso:#{location}\"\n elsif location.is_a?(Integer)\n \"disc:#{location}\"\n elsif location =~ /^disc/\n location\n else\n raise RuntimeError\n end\n end", "title": "" }, { "docid": "8fdded58dbb13d56e3f13e17205b7282", "score": "0.6515802", "text": "def path\n if location =~ /^\\/dev/\n \"dev:#{location}\"\n elsif location =~ /iso$/\n \"iso:#{location}\"\n elsif location.is_a?(Integer)\n \"disc:#{location}\"\n elsif location =~ /^disc/\n location\n else\n raise RuntimeError\n end\n end", "title": "" }, { "docid": "8c74c75b5c3a0e6685783e57ed5f339c", "score": "0.6499215", "text": "def path\n @pathname.to_s\n end", "title": "" }, { "docid": "110973ce16251dc4715d79843a9be367", "score": "0.64835167", "text": "def path\n Rails.root.join(ROOT, type, name, executable).to_s\n end", "title": "" }, { "docid": "98db204d75229a6b9ab7812041e45eaa", "score": "0.6468194", "text": "def path\n io.path\n end", "title": "" }, { "docid": "60403f260be52ef4203e066be699a3e1", "score": "0.6464594", "text": "def get_opera_path\n @driver.getOperaPath()\n end", "title": "" }, { "docid": "f5a9f960966a9187ec0c6a8533f69d69", "score": "0.6442519", "text": "def path()\n return ::File.join(@root, @name)\n end", "title": "" }, { "docid": "49731df67c50c56a7fafbccc9b537b89", "score": "0.6426859", "text": "def path\n return ENV['ORBIT_FILE'] if ENV.include? 'ORBIT_FILE'\n\n [ENV.fetch('ORBIT_HOME'), 'config', 'orbit.json'].join(SEP)\n rescue KeyError\n raise 'env ORBIT_HOME not set'\n end", "title": "" }, { "docid": "33d32ec7db9449eb5ae192f8e78876a0", "score": "0.64217377", "text": "def to_www\n @path \n end", "title": "" }, { "docid": "e3908f7f783f0fd95e5b3a5da79cffb7", "score": "0.6411699", "text": "def path\n @path ||= best_qmake\n end", "title": "" }, { "docid": "5b290d61f3293fdbf727c4765278800e", "score": "0.638636", "text": "def path\n return @path\n end", "title": "" }, { "docid": "5b290d61f3293fdbf727c4765278800e", "score": "0.638636", "text": "def path\n return @path\n end", "title": "" }, { "docid": "5b290d61f3293fdbf727c4765278800e", "score": "0.638636", "text": "def path\n return @path\n end", "title": "" }, { "docid": "4894d0cc3d5b5daa99a1d499b12e7ed3", "score": "0.6371243", "text": "def path\n return @path\n end", "title": "" }, { "docid": "c7cb0f33242ecfe9a2fcb764b856eb28", "score": "0.6370151", "text": "def path\n File.join(@base, @name)\n end", "title": "" }, { "docid": "398fb7809b9439849140d689ea3c45b6", "score": "0.63627714", "text": "def path() end", "title": "" }, { "docid": "398fb7809b9439849140d689ea3c45b6", "score": "0.63627714", "text": "def path() end", "title": "" }, { "docid": "398fb7809b9439849140d689ea3c45b6", "score": "0.63627714", "text": "def path() end", "title": "" }, { "docid": "db060b3c213aba061cab1682eaf41036", "score": "0.63417363", "text": "def path_from_hoard\n Pathname(path).relative_path_from(Pathname(hoard_path)).to_s\n end", "title": "" }, { "docid": "558572463f23ed19c463092a6f0b9e82", "score": "0.63276327", "text": "def wfs_path\n return unless @config && visibility && geo_file_set? && file_set_format?\n \"#{path}/#{@config[:workspace]}/wfs\"\n end", "title": "" }, { "docid": "e958110b77371017fc9aada981b87a0e", "score": "0.63147295", "text": "def wms_path\n return unless @config && visibility && geo_file_set? && file_set_format?\n \"#{path}/#{@config[:workspace]}/wms\"\n end", "title": "" }, { "docid": "1813480f690caeea67ca9c34994204f2", "score": "0.630051", "text": "def path\n @backend.lib_dir + name_on_disk\n end", "title": "" }, { "docid": "e8df0a5c5267e1ef1ccd65ea66bd50a1", "score": "0.6295161", "text": "def get_epw_file_path\n return @epw_file_path\n end", "title": "" }, { "docid": "eaf3b5b8182b8813e6904f2a5d295405", "score": "0.6288748", "text": "def path\n File.join(RH_CONFIG[\"location\"], self.parent.pid.gsub(/:/,\"_\"), \"data\", self.name.first) unless self.parent.nil? or self.name.empty?\n end", "title": "" }, { "docid": "678af283e279e253a133157c82dac292", "score": "0.62778443", "text": "def path\n File.join(@base, @name)\n end", "title": "" }, { "docid": "4743a2bebd16aeadb744cbda9a7240fb", "score": "0.6264476", "text": "def wcs_path\n return unless @config && visibility && file_set && raster_file_set?\n \"#{path}/#{@config[visibility][:workspace]}/wcs\"\n end", "title": "" }, { "docid": "af255f42105f8ea17a73c9d8816dbf99", "score": "0.6247784", "text": "def full_path\n File.join(@path, @name)\n end", "title": "" }, { "docid": "ee8fb21eb24e2507c892ebba7cfc3a1b", "score": "0.62477326", "text": "def path\n real_path = Pathname.new(root).realpath.to_s\n full_path.sub(%r{^#{real_path}/}, '')\n end", "title": "" }, { "docid": "f51bc2bf8ed9be176b75106f983ec0aa", "score": "0.6223267", "text": "def path\n @path ||= make_path(@module.to_a.concat(outter_class.to_a).push(filename))\n end", "title": "" }, { "docid": "7cf2dd78220cd1994f3086f7fd494055", "score": "0.6222811", "text": "def path\n @path\n end", "title": "" }, { "docid": "7cf2dd78220cd1994f3086f7fd494055", "score": "0.6222811", "text": "def path\n @path\n end", "title": "" }, { "docid": "7cf2dd78220cd1994f3086f7fd494055", "score": "0.6222811", "text": "def path\n @path\n end", "title": "" }, { "docid": "7cf2dd78220cd1994f3086f7fd494055", "score": "0.6222811", "text": "def path\n @path\n end", "title": "" }, { "docid": "91c36ce3e0a0521ccc3b70616fd3da62", "score": "0.6220909", "text": "def out_path\n @out_path ||= File.join out_base, node.file_name\n end", "title": "" }, { "docid": "e31ff0c9c6d791f0ea3154b0d9cbabc6", "score": "0.6214894", "text": "def path\n name + extension\n end", "title": "" }, { "docid": "3d9c7bc7fdcdc90013a438d03a5ad8c6", "score": "0.6212998", "text": "def stow_buildout_path\n \"#{node['stow']['path']}/stow#{pkg_delim}#{node['stow']['version']}\"\n end", "title": "" }, { "docid": "940478ec061bf26fd950cb7fa1ae548a", "score": "0.6204846", "text": "def path\n http_url @store.rdoc.generator.file_dir\n end", "title": "" }, { "docid": "7a2882abd5fa7b1170fc9a6086901f78", "score": "0.61897105", "text": "def path\n @path ||= File.join(folder,\".xHF#{name}\")\n end", "title": "" }, { "docid": "72084562f23c4695ae988048d90a3ff5", "score": "0.61855125", "text": "def path\n location.path\n end", "title": "" }, { "docid": "eedef77e0e57dbed8507118ee6298496", "score": "0.618467", "text": "def path\n @path\n end", "title": "" }, { "docid": "eedef77e0e57dbed8507118ee6298496", "score": "0.618467", "text": "def path\n @path\n end", "title": "" }, { "docid": "eedef77e0e57dbed8507118ee6298496", "score": "0.618467", "text": "def path\n @path\n end", "title": "" }, { "docid": "eedef77e0e57dbed8507118ee6298496", "score": "0.618467", "text": "def path\n @path\n end", "title": "" }, { "docid": "e9d6ead79ada4063dfb0eff4c113a445", "score": "0.61735713", "text": "def path\n '/' + path_states.map(&:name)[1..-1].join('/')\n end", "title": "" }, { "docid": "4bdb5f840e1dacda8e651e1e8d17733f", "score": "0.6173298", "text": "def admin_basica_path(o)\n n = self.nombreobj_admin(o, !o.id) + \"_path\"\n return send(n.to_sym, o)\n end", "title": "" }, { "docid": "c70e496f96dc167797ab717a2a46edc2", "score": "0.61706585", "text": "def path\n end", "title": "" }, { "docid": "5db237b7ee5f148e8c6bf54c3fece578", "score": "0.61566", "text": "def build_path\n end", "title": "" }, { "docid": "338fca73964ba73048fb6e4394358b7b", "score": "0.6143177", "text": "def path_of(path)\n File.join(self.path, path)\n end", "title": "" }, { "docid": "4e5495e541ade4f5b6deb8ed603f0923", "score": "0.61173254", "text": "def path\n @location.path\n end", "title": "" }, { "docid": "44480cc45f4c81da0e9d8bbe11b7007b", "score": "0.61150503", "text": "def path\n s = ''\n s << '/' if @absolute\n s << @path.join('/')\n s << '/' if @trail\n s << '.' if s.empty?\n s\n end", "title": "" }, { "docid": "2f97c17320f7732a2bb6f3ba53216206", "score": "0.61087954", "text": "def to_s\n path\n end", "title": "" }, { "docid": "40fc54254ea76a747b906604f2a2d580", "score": "0.61040866", "text": "def path\n File.expand_path File.join(songs.first.path, '..').gsub(' ','\\ ')\n end", "title": "" }, { "docid": "034075d1ce78bd4380a01b2b7fc41bc5", "score": "0.6101027", "text": "def path\n out_buffer = FFI::MemoryPointer.new(:uchar, 2048)\n io_size = FFI::MemoryPointer.new(:uint32)\n io_size.put_uint32(0, out_buffer.size)\n\n status = Sec.SecKeychainGetPath(self,io_size, out_buffer)\n Sec.check_osstatus(status)\n\n out_buffer.read_string(io_size.get_uint32(0)).force_encoding(Encoding::UTF_8)\n end", "title": "" }, { "docid": "aff10aa48ffed62fa7fab236e8113563", "score": "0.6099302", "text": "def path\n return @path.sub(/^\\//,'').sub(/^%2F/,'/')\n end", "title": "" }, { "docid": "8dc7b3b9aa3375b5fd935cbca8ffe570", "score": "0.60930437", "text": "def as_path()\n @hops.map { |hop| hop.asn }\n end", "title": "" }, { "docid": "f844b54bf35c4e68714d0cadc8d2d4b5", "score": "0.60926473", "text": "def path\n location.nil? ? nil : location.path\n end", "title": "" }, { "docid": "ddd284a1db2979eb05d0c8a03d2e821f", "score": "0.60889965", "text": "def path\n @path ||=\n if user_configuration.has_key?('solr')\n \"#{user_configuration['solr']['path'] || '/solr'}\"\n end\n end", "title": "" }, { "docid": "f71dd38b97bdf685c2cbce9b15cbed01", "score": "0.6074803", "text": "def path\n @game_info['path']\n end", "title": "" }, { "docid": "e7f589f2ba830c7693900226b974c176", "score": "0.6071202", "text": "def path\n File.join Dubya.root_path, 'vendor/wiki'\n end", "title": "" }, { "docid": "8795e7dff13196696be71deef7d614c6", "score": "0.6070226", "text": "def path\n driver.getPath\n end", "title": "" }, { "docid": "ebe1a9ab16a436ca4f3288d247f31cce", "score": "0.6066109", "text": "def path\n # if an api_version is specified and the path does not already contain\n # one, prepend it to the path\n api_version = raw_options[:api_version] || Blupee.config.api_version\n \"/#{api_version}/#{raw_path}\"\n end", "title": "" }, { "docid": "ea54b428ddc1e728dd94b3efd1314302", "score": "0.60657793", "text": "def path\n `window.location.pathname`\n end", "title": "" }, { "docid": "04925655fe6aac5d8d6d4d7af102bcb4", "score": "0.606156", "text": "def path\n @base\n end", "title": "" }, { "docid": "4a2fd245a967d181797a9ff50c767281", "score": "0.6050479", "text": "def path\n @data[\"path\"].to_s\n end", "title": "" }, { "docid": "ff0841eb53eba2f5f96efba91da19e7e", "score": "0.6047744", "text": "def full_path\n path\n end", "title": "" }, { "docid": "6335478410cd3588585ac3dba8e64b47", "score": "0.6037675", "text": "def _path(action=nil)\n # Use the absolute path if present, otherwise get the relative path\n pre_action_paths =\n if defined?(self.class::ABSOLUTE_PATH)\n [self.class::ABSOLUTE_PATH]\n else\n _path_array\n end\n # Join it with the action\n paths = pre_action_paths + [action]\n # Strip out empty elements\n paths = paths.map(&:to_s).reject(&:empty?)\n \"/#{paths.join('/')}\"\n end", "title": "" }, { "docid": "fc68198e713127472152701efece577a", "score": "0.6036873", "text": "def path\n application? ? application_path : local_path\n end", "title": "" }, { "docid": "71bbbd9ea82a667a048fb47f385f50e5", "score": "0.60362315", "text": "def full_path\n container.root.join(path)\n end", "title": "" }, { "docid": "71bbbd9ea82a667a048fb47f385f50e5", "score": "0.60362315", "text": "def full_path\n container.root.join(path)\n end", "title": "" }, { "docid": "99f74decfaa878e3d7f046aa73cf4d50", "score": "0.60334706", "text": "def path\n File.join(@base, @target)\n end", "title": "" }, { "docid": "96cd7cb81b460fdce36674bc81363316", "score": "0.6026796", "text": "def path\n File.join(self.drive.path, self.relative_path)\n end", "title": "" }, { "docid": "ccb227319f87c34a5d5badd68ea58ad4", "score": "0.6022253", "text": "def to_s\n @path\n end", "title": "" }, { "docid": "3b9e3de2c9f293e9a5edad9cf2ddc3f1", "score": "0.6016846", "text": "def uri_path\n __getobj__.uri.path\n end", "title": "" }, { "docid": "e73e2728dceb0e5feca6b1c5c970a207", "score": "0.60139686", "text": "def path(ident=:default)\n tail = identifying_path_part(ident)\n if tail.empty?\n base_path\n else\n File.join base_path, tail\n end\n end", "title": "" }, { "docid": "0144e42fa2a01a25cc0863d9ca4098a8", "score": "0.60108525", "text": "def path\n @path ||= begin\n dir = File.join Dir.home, \".relaton\", \"iec\"\n FileUtils.mkdir_p dir\n File.join dir, \"index.yaml\"\n end\n end", "title": "" }, { "docid": "66e1e33ffa0dd8bc6ee2771a4306418d", "score": "0.59997183", "text": "def local_path\n @io.local_path\n end", "title": "" }, { "docid": "509b09952e8afc12f834950f5c969262", "score": "0.5993903", "text": "def save_path_with_own_path\n File.join(save_path, path)\n end", "title": "" }, { "docid": "d7b980fa6abe06943d766f294458eb0f", "score": "0.599209", "text": "def full_path; end", "title": "" }, { "docid": "5073c0eddddfe2cf078c55bff640f881", "score": "0.59911686", "text": "def object_dir\n ::File.join(new_resource.config_home, type_from_name) + 's'\n end", "title": "" }, { "docid": "7ffd5cbe1ca61bc0856017c666c6f620", "score": "0.5990996", "text": "def path\n \"/\" + @prefix.join(\"/\")\n end", "title": "" }, { "docid": "266642016d31661a3e046f8ea177de7c", "score": "0.5989546", "text": "def path\n\t\t\t@path_elements.join(\"/\")\n\t\tend", "title": "" }, { "docid": "64d2313157916bcf41098f17a76b5afe", "score": "0.5987744", "text": "def to_s\n @path\n end", "title": "" }, { "docid": "8e0d49dc3d5cef3384fa4787c1b36f57", "score": "0.59838754", "text": "def make_path inOut, name=''\r\n return @options[inOut] + '/' + name\r\n end", "title": "" }, { "docid": "e2a3b9d0968f8fb8f8dd4ecb9807cf2b", "score": "0.59828424", "text": "def where_to_save\n output_dir = @template_options[OUTPUT_DIR]\n # assume absolute\n full_path = output_dir\n if (Pathname.new(output_dir)).relative?\n full_path = File.expand_path(output_dir, Dir.pwd)\n end\n return full_path\n end", "title": "" }, { "docid": "087275e0748de05556655d2c63da70b5", "score": "0.5982072", "text": "def path\n '/c/document_library/get_file?folderId=%i&name=%s' % [self.folderid, self.name]\n end", "title": "" }, { "docid": "670816e28aa2c0fcc725897a7e12ffff", "score": "0.59816134", "text": "def to_s\n path\n end", "title": "" }, { "docid": "6cb810a8ea314a36581ee7a791e2a907", "score": "0.59746075", "text": "def to_s\n @path\n end", "title": "" }, { "docid": "26db972c9635a8ae98a2e765d7423953", "score": "0.59702224", "text": "def path\n ensure_valid\n @path\n end", "title": "" } ]
af207246b2665ebdd74ed39c9225c2cb
check if a user is active
[ { "docid": "4cb1fb21c3b626d6668cb70f91df3fb6", "score": "0.0", "text": "def active_for_authentication?\n super && active?\n end", "title": "" } ]
[ { "docid": "d15915e312a9f7ab2065d8e7a0c3521d", "score": "0.8354176", "text": "def user_status_active?\n return self.status==\"Active\" ? true : false\n end", "title": "" }, { "docid": "ad199a8e674bd89827a4cdae60557690", "score": "0.83374625", "text": "def active?\n # active\n if self.active != User::ACTIVE.to_i\n \treturn false\n else \n true\n end\n end", "title": "" }, { "docid": "d5fa03875155bab3cd2753c2071e4d24", "score": "0.83367646", "text": "def active?\n # active\n if self.active != User::ACTIVE.to_i\n \treturn false\n else\n true\n end\n end", "title": "" }, { "docid": "2f2744255988614c3343ef2667603f8b", "score": "0.832709", "text": "def active?\n (status == ConfigCenter::User::ACTIVE)\n end", "title": "" }, { "docid": "a67cda065025a5cd67bf175a4562b25b", "score": "0.8180023", "text": "def is_active_user?\n self.verified? && !self.marked_for_deletion && !self.suspended?\n end", "title": "" }, { "docid": "a67cda065025a5cd67bf175a4562b25b", "score": "0.8180023", "text": "def is_active_user?\n self.verified? && !self.marked_for_deletion && !self.suspended?\n end", "title": "" }, { "docid": "b3d79f108a5be1384bbbfcdf7aa0e05a", "score": "0.8098461", "text": "def active?\n type.include?(AIC.ActiveUser)\n end", "title": "" }, { "docid": "ac4f499cecddd3971e281f1cd5a71de6", "score": "0.7977079", "text": "def registered_user?\n active?\n end", "title": "" }, { "docid": "f9de0c1585c5eb20469dde5f8608f368", "score": "0.7965001", "text": "def active_user?\n !@user.nil?\n end", "title": "" }, { "docid": "7c4af83de2d6e21e6fadb72045c34ff2", "score": "0.7925479", "text": "def user_activated?(current_user)\n current_user.activated\n end", "title": "" }, { "docid": "def7469836c9b3bb398df868dfb9fde6", "score": "0.78696007", "text": "def activated?\n @user = User.find(id)\n @user.activated\n end", "title": "" }, { "docid": "82877c1d8fdc63b97669ef2536cc1e60", "score": "0.7831252", "text": "def active()\n if session[:user_id]\n @active = User.find(session[:user_id])\n else session = nil \n end\n end", "title": "" }, { "docid": "ec91e2214024011bc6e8cd7fb1b6f138", "score": "0.77251303", "text": "def is_active?\n !!(self.account_status == 'active')\n end", "title": "" }, { "docid": "a1710803bd4dfd3ac497aebc88f36ced", "score": "0.76838404", "text": "def account_active?\n if self.is_super_admin?\n activation_code.nil? && user_status_active?\n else\n activation_code.nil? && user_status_active? && user_department_active?\n end\n end", "title": "" }, { "docid": "5b9dd894f198565d40e0551e79fc3556", "score": "0.76177895", "text": "def is_active\n membership = MembershipService.new(current_domain, object)\n membership.active?\n end", "title": "" }, { "docid": "69cbd6c5ff66505144f6835890559694", "score": "0.75803393", "text": "def is_active?\n self.status == ACTIVE\n end", "title": "" }, { "docid": "569e70a23401208bcd99c700e783a2bc", "score": "0.75575024", "text": "def inactive?\n (status == ConfigCenter::User::INACTIVE)\n end", "title": "" }, { "docid": "f8f5a596681575d064cb9dbc790cf5b9", "score": "0.7551014", "text": "def active_for_authentication?\n self.account.active && self.active\n end", "title": "" }, { "docid": "1eb74f213e5ba9d23e9354937def3878", "score": "0.7542875", "text": "def status_ok?\n current_user.status if current_user\n end", "title": "" }, { "docid": "891b773219694a714c6442ba9653cf5b", "score": "0.7542023", "text": "def active_for_authentication?\n super && self.status == USER_STATUS_ACTIVE\n end", "title": "" }, { "docid": "f73c41f46d79387dabf7fdcc7021a36d", "score": "0.75342846", "text": "def is_active\n @status == STATUS[:active]\n end", "title": "" }, { "docid": "59056035e70460e7859758e6394f2c96", "score": "0.7532204", "text": "def active_user\n User.find_by(activated: true)\n end", "title": "" }, { "docid": "ec79cdba407f0d894a0fb82f1e6e63be", "score": "0.7528603", "text": "def active_for_authentication?\n self && !inactive?\n end", "title": "" }, { "docid": "06465b02cc50192fc5d6e1abe7438e7e", "score": "0.75129867", "text": "def active?\n if is_active\n return true\n else\n return false\n end\n end", "title": "" }, { "docid": "645b5be9fd22302a28e8e64a0ac2e825", "score": "0.74759215", "text": "def user_active!\n \t\tif current_user && current_user.active == false\n \t\t\tsign_out current_user\n \t\t\tredirect_to new_user_session_path, notice:\"You don't have permissions.\"\n \t\tend\n end", "title": "" }, { "docid": "3cdc9e93b92548378875b98f93d1ccb3", "score": "0.74755466", "text": "def user_active\n @user_active ||= User.find_by(id: session[:user_id])\n end", "title": "" }, { "docid": "796e139ca7345e5afbc1525bad169831", "score": "0.74627984", "text": "def active?\n membership && membership.active\n end", "title": "" }, { "docid": "9108b23d4fd1911a1597443b47fb33ba", "score": "0.74391305", "text": "def active_user\n if session[:user_id]\n @active == @user || @active.role == \"admin\"\n else session = nil \n end \n end", "title": "" }, { "docid": "39e928906fa4da23969b5abe56dad81b", "score": "0.7438531", "text": "def is_active?\n return @active\n end", "title": "" }, { "docid": "6aad98d4be7ae3e92fd5bf0f997fe5f4", "score": "0.742587", "text": "def is_active?\r\n self.active\r\n end", "title": "" }, { "docid": "08d4c92eb1252c64b40c3b029737d352", "score": "0.7424162", "text": "def is_active?\n \tis_active\n end", "title": "" }, { "docid": "43e260f8e23b17f4253a9a9bc5fc0d5f", "score": "0.7423619", "text": "def check_access usr\n access?(usr) ? UserType.active : UserType.unhidden\n end", "title": "" }, { "docid": "cd3f2bd932fce85550cbcfffdc2c167c", "score": "0.74230003", "text": "def is_active?\n active\n end", "title": "" }, { "docid": "6d8b979ee0afdb7e7749d9438e56b424", "score": "0.7412212", "text": "def membership_active?\n true unless active_at?(Time.now).nil?\n end", "title": "" }, { "docid": "6c70f5afe06ad69d3e0f591cb3716a8f", "score": "0.74060166", "text": "def has_active_user?(user)\r\n conversation_members.where(\r\n :user_id => user.id,\r\n :parted => true\r\n ).any?\r\n end", "title": "" }, { "docid": "2d06ed7cb1cda65cb06ddd0a4f8e39fe", "score": "0.73892105", "text": "def logged_in?\n !current_user.nil? && current_user.activated?\n end", "title": "" }, { "docid": "045c584eba1183bd0d0ab4082aeb10e7", "score": "0.73824906", "text": "def active?\r\n status == 'active'\r\n end", "title": "" }, { "docid": "41f7003f416f427f30925c5292afc8b4", "score": "0.73810947", "text": "def is_active?\n @active\n end", "title": "" }, { "docid": "9eb28d08ef46e7be4afe69b74777bde9", "score": "0.7366218", "text": "def is_active\n active?\n end", "title": "" }, { "docid": "08ca768a7d904789b78c3668c7a856fc", "score": "0.735446", "text": "def is_active?\n self.active\n end", "title": "" }, { "docid": "08ca768a7d904789b78c3668c7a856fc", "score": "0.735446", "text": "def is_active?\n self.active\n end", "title": "" }, { "docid": "6f9ee6e0f2808af258130fca8e600e48", "score": "0.7351501", "text": "def active_for_authentication?\n # Log it\n unless self.active\n Rails.logger.info \"Attempted access to in-active account for user with email #{email} at #{Time.now}\"\n end\n\n super && self.active\n end", "title": "" }, { "docid": "282ccb70ed00f74eeb29197e0bc5e2b5", "score": "0.7349468", "text": "def is_active?\n status == \"Active\"\n end", "title": "" }, { "docid": "9c0e9dfc8ee5d94a22df3a7801318a00", "score": "0.7348695", "text": "def active?\n return self.status == STATUSES[:active] ? true : false\n end", "title": "" }, { "docid": "3358dbb79d12ce419cce46fb44e3c17a", "score": "0.73391134", "text": "def active?\n status == 'active'\n end", "title": "" }, { "docid": "3358dbb79d12ce419cce46fb44e3c17a", "score": "0.73391134", "text": "def active?\n status == 'active'\n end", "title": "" }, { "docid": "3358dbb79d12ce419cce46fb44e3c17a", "score": "0.73391134", "text": "def active?\n status == 'active'\n end", "title": "" }, { "docid": "3358dbb79d12ce419cce46fb44e3c17a", "score": "0.73391134", "text": "def active?\n status == 'active'\n end", "title": "" }, { "docid": "b3d640939a7cc09363fd87b02c542405", "score": "0.7329443", "text": "def activate? #activates the users account once they have registered\n update_attributes(:activated => true)\n if self.activated\n return true\n else\n return false\n end\n end", "title": "" }, { "docid": "a2f890e2afa2df99d6f3b17b32f3dc94", "score": "0.73070574", "text": "def active?\n (status == ACTIVE)\n end", "title": "" }, { "docid": "a2f890e2afa2df99d6f3b17b32f3dc94", "score": "0.73070574", "text": "def active?\n (status == ACTIVE)\n end", "title": "" }, { "docid": "a2f890e2afa2df99d6f3b17b32f3dc94", "score": "0.73070574", "text": "def active?\n (status == ACTIVE)\n end", "title": "" }, { "docid": "a2f890e2afa2df99d6f3b17b32f3dc94", "score": "0.73070574", "text": "def active?\n (status == ACTIVE)\n end", "title": "" }, { "docid": "6b01572513ea9f65d0da1873bb3aa77d", "score": "0.7293133", "text": "def active?\n status == 1\n end", "title": "" }, { "docid": "72062f51c1b8417ec8ba3fb2cb5f34bb", "score": "0.7290171", "text": "def is_active\n true\n end", "title": "" }, { "docid": "d4731b45cd772a6c1c8b7e1cf23599b3", "score": "0.72871494", "text": "def session_active\n session_model = Session.find_by user_id: session[:user_id]\n if session_model == nil\n return false\n else\n session_model.active_check()\n end\n end", "title": "" }, { "docid": "69023874e665e26ff55b46311b59a0e0", "score": "0.7285668", "text": "def is_active\n end", "title": "" }, { "docid": "819de59ba5e30ae7a0370de1888861a7", "score": "0.72782665", "text": "def active?\r\n @activated\r\n end", "title": "" }, { "docid": "256ba4dc9a4c139d55cb86bc20e3a866", "score": "0.72763455", "text": "def active?\n (status == \"active\")\n end", "title": "" }, { "docid": "f2f7938018de9ee4168415cfc2f196fe", "score": "0.72641873", "text": "def account_active?\n self.state==='deactivated'|| !self.confirmed? ? false : true\n end", "title": "" }, { "docid": "0fbb647440114d32d9f098edd5e58017", "score": "0.72497797", "text": "def active?\n\t\tstatus == 'active'\n\tend", "title": "" }, { "docid": "c977f18ed9c9568e3cb30d64e82bf639", "score": "0.7249693", "text": "def is_active?\n return self.active\n end", "title": "" }, { "docid": "c977f18ed9c9568e3cb30d64e82bf639", "score": "0.7249693", "text": "def is_active?\n return self.active\n end", "title": "" }, { "docid": "c977f18ed9c9568e3cb30d64e82bf639", "score": "0.7249693", "text": "def is_active?\n return self.active\n end", "title": "" }, { "docid": "0ecf1e08ba93f3d6b19d93230173a292", "score": "0.72244275", "text": "def active_for_authentication?\n\t\t#remember to call the super\n\t\t#then put our own check to determine \"active\" state using \n\t\t#our own \"is_active\" column\n\t\tsuper and self.is_active?\n\tend", "title": "" }, { "docid": "4b1b494b2a0417d36fe2250f059f2d18", "score": "0.72135824", "text": "def active?\r\n @active == true\r\n end", "title": "" }, { "docid": "0c65e444d19956ef7f31852bcace2b4c", "score": "0.7207853", "text": "def active!\n self.update_attribute(:status, ConfigCenter::User::ACTIVE)\n end", "title": "" }, { "docid": "c79b993f0bad2fa5fd7306ff4f96fe7c", "score": "0.7204699", "text": "def active?\n status == :active\n end", "title": "" }, { "docid": "c79b993f0bad2fa5fd7306ff4f96fe7c", "score": "0.7204699", "text": "def active?\n status == :active\n end", "title": "" }, { "docid": "20b15f41cc8d1b40fd5ddca3788b9ff1", "score": "0.7183944", "text": "def toggle_activation?\n user.present? && user.admin? && (user != record)\n end", "title": "" }, { "docid": "1f02d612637ab1edda106a10bc094fbd", "score": "0.71826893", "text": "def can_be_activated?\n !PointsService.where.not(id: self.id).exists?(user: user, status: Service.statuses['in_progress'])\n end", "title": "" }, { "docid": "028b6ab558bf54a0969030373045e56f", "score": "0.71629864", "text": "def account_active?\n !blocked\n end", "title": "" }, { "docid": "66edfe2144b4ed10f903fd8cbf7e2a45", "score": "0.7150195", "text": "def active_for_authentication?\n super && account_active?\n end", "title": "" }, { "docid": "82bd6ab931e59d5e2c1a577d2097ea89", "score": "0.7141337", "text": "def active_for_authentication?\n %w[active suspended].include?(state)\n end", "title": "" }, { "docid": "f4be24dfafc54fb9d1b9506466a6cbe9", "score": "0.7136045", "text": "def active?\n\t\tif(active)\n\t\t\treturn true\n\t\telse\n\t\t\treturn false\n\t\tend\n\tend", "title": "" }, { "docid": "5513ea9ceb6d0cfea355a531fe94fc80", "score": "0.7102644", "text": "def active?\n end", "title": "" }, { "docid": "ec37f2fd55d5a27c4eb0924e0a92a76a", "score": "0.7100769", "text": "def is_active?(time=Time.now)\n return (\n (self.activated < time) &&\n (\n (self.deactivated.blank?) ||\n (self.deactivated > time)\n )\n )\n end", "title": "" }, { "docid": "8b07acebc2f0b7713b8e604ee5ef6187", "score": "0.7096311", "text": "def active?\n true\n end", "title": "" }, { "docid": "75e666ccd1de1cf3aaa3c13487ca24e0", "score": "0.7083545", "text": "def active?\n (self.status == 'active' || !self.status)\n end", "title": "" }, { "docid": "1f8169767224d3d93d613867dd3c36e8", "score": "0.7082469", "text": "def active?\n\n end", "title": "" }, { "docid": "dfae8038bb6860b52b808dc398a4dd5e", "score": "0.7081875", "text": "def is_active?(dept)\n self.departments_users[0].active\n end", "title": "" }, { "docid": "fc077891fee2329e432e6315453838e7", "score": "0.70791405", "text": "def is_active()\n return self.active\n end", "title": "" }, { "docid": "5cd5749c2c3367ede5043c0c4c661e2d", "score": "0.70779175", "text": "def is_active_step_user?(user)\n individual_steps.non_pending.exists?(user: user)\n end", "title": "" }, { "docid": "5cd5749c2c3367ede5043c0c4c661e2d", "score": "0.70779175", "text": "def is_active_step_user?(user)\n individual_steps.non_pending.exists?(user: user)\n end", "title": "" }, { "docid": "2b41b90ff2c083ea899630352547ae08", "score": "0.7075254", "text": "def active?\r\n @active\r\n end", "title": "" }, { "docid": "7fd59c0f7e3d1d329d07d54fd6871641", "score": "0.7066553", "text": "def active?\n activated\n end", "title": "" }, { "docid": "07604d7c271bd0734aa7dea4c6749530", "score": "0.7065179", "text": "def active?\n status.downcase == 'active'\n end", "title": "" }, { "docid": "10a927a44940d504c6f17ce1dfa86ed8", "score": "0.7060287", "text": "def active_for_authentication?\n super && account_active?\n end", "title": "" }, { "docid": "6744af54ce99e1105d67c416ef1f0fef", "score": "0.70560515", "text": "def status\n @session_status = 'active'\n @user = current_user\n end", "title": "" }, { "docid": "3e3a33b79a1a862290c432b34ca74c23", "score": "0.70516306", "text": "def is_active\n return @is_active\n end", "title": "" }, { "docid": "3e3a33b79a1a862290c432b34ca74c23", "score": "0.70516306", "text": "def is_active\n return @is_active\n end", "title": "" }, { "docid": "3e3a33b79a1a862290c432b34ca74c23", "score": "0.70516306", "text": "def is_active\n return @is_active\n end", "title": "" }, { "docid": "3e3a33b79a1a862290c432b34ca74c23", "score": "0.70516306", "text": "def is_active\n return @is_active\n end", "title": "" }, { "docid": "c83972e31789e11385ac4c9dd350f886", "score": "0.7042441", "text": "def active?\n @active == true\n end", "title": "" }, { "docid": "b5b3c77837214ec2b80e26671e095ad1", "score": "0.70417917", "text": "def active_for_authentication?\n\t\tself.active\n\tend", "title": "" }, { "docid": "3908ad1103fbc84a0fcdbb12caadfb18", "score": "0.7039879", "text": "def is_active?(dept)\n if DepartmentsUser.where(user_id: self, department_id: dept, active: true).first\n true\n else\n false\n end\n end", "title": "" }, { "docid": "4be8cae7679d7180b50fc130ada287c5", "score": "0.70380974", "text": "def active_for_authentication?\n #remember to call the super\n #then put our own check to determine \"active\" state using\n #our own \"is_active\" column\n super and self.is_active?\n end", "title": "" }, { "docid": "3d88be02c3cd10cacb18546df1f2342b", "score": "0.7035197", "text": "def active_for_authentication?\n super && !inactive\n end", "title": "" }, { "docid": "66ae428172065885cf726168c8c71882", "score": "0.7032011", "text": "def active?\n state == \"ACTIVE\"\n end", "title": "" }, { "docid": "0d2ce3afcf7a231bc00328d3dff2a464", "score": "0.70254225", "text": "def active\n\t\tusers.where(activationqueue_id: nil).present?\n\tend", "title": "" }, { "docid": "58419fbce69b61d84fdd534de7f5a203", "score": "0.70231164", "text": "def active?\n @active\n end", "title": "" } ]
19b91323bce5b771e74704d578b6b7e2
returns the last nonempty column in a sheet
[ { "docid": "629a8e170777734178ffa28acedd25ca", "score": "0.78729254", "text": "def last_column(sheet=nil)\n sheet = @default_sheet unless sheet\n unless @last_column[sheet]\n sheet_no = sheets.index(sheet) + 1\n @first_row[sheet], @last_row[sheet], @first_column[sheet], @last_column[sheet] = @gs.oben_unten_links_rechts(sheet_no)\n end\n return @last_column[sheet]\n end", "title": "" } ]
[ { "docid": "5384eb2b26d04ec2f1ecf55f06ee32fc", "score": "0.85415244", "text": "def last_column(sheet = nil)\n sheet_for(sheet).last_column\n end", "title": "" }, { "docid": "38b8dabba3b3530fade0da7f49d51b33", "score": "0.8461398", "text": "def last_column(sheet=nil)\n sheet = @default_sheet unless sheet\n return @last_column[sheet] if @last_column[sheet]\n fr, lr, fc, lc = get_firsts_lasts(sheet)\n lc\n end", "title": "" }, { "docid": "85de02722220408e6a029279cfe770d5", "score": "0.8206359", "text": "def last_column(sheet=nil)\n sheet = @default_sheet unless sheet\n read_cells(sheet) unless @cells_read[sheet]\n if @last_column[sheet]\n return @last_column[sheet]\n end\n impossible_value = 0\n result = impossible_value\n @cell[sheet].each_pair {|key,value|\n y,x = key # _to_string(key).split(',')\n x = x.to_i\n result = [result, x].max if value\n } if @cell[sheet]\n result = nil if result == impossible_value\n @last_column[sheet] = result\n result\n end", "title": "" }, { "docid": "fe383462e0e355c3454646c85761e014", "score": "0.7765748", "text": "def last_column(sheet=nil)\r\n sheet ||= @default_sheet\r\n unless @last_column[sheet]\r\n sheet_no = sheets.index(sheet) + 1\r\n @first_row[sheet], @last_row[sheet], @first_column[sheet], @last_column[sheet] =\r\n oben_unten_links_rechts(sheet_no)\r\n end\r\n return @last_column[sheet]\r\n end", "title": "" }, { "docid": "4f400ea986bea27851a622d3cba1a6fe", "score": "0.7623083", "text": "def first_column(sheet = nil)\n sheet_for(sheet).first_column\n end", "title": "" }, { "docid": "fac2efaeac9ffe2c42e0a3d37782f926", "score": "0.736339", "text": "def last_column; end", "title": "" }, { "docid": "fac2efaeac9ffe2c42e0a3d37782f926", "score": "0.736339", "text": "def last_column; end", "title": "" }, { "docid": "c5f7214aff32489917f72cef92ab7371", "score": "0.7341164", "text": "def first_column(sheet=nil)\n sheet = @default_sheet unless sheet\n return @first_column[sheet] if @first_column[sheet]\n fr, lr, fc, lc = get_firsts_lasts(sheet)\n fc\n end", "title": "" }, { "docid": "7d909a499207565a2bc7577f134aae36", "score": "0.7177337", "text": "def first_column(sheet=nil)\n if sheet == nil\n sheet = @default_sheet\n end\n read_cells(sheet) unless @cells_read[sheet]\n if @first_column[sheet]\n return @first_column[sheet]\n end\n impossible_value = 999_999 # more than a spreadsheet can hold\n result = impossible_value\n @cell[sheet].each_pair {|key,value|\n y,x = key # _to_string(key).split(',')\n x = x # .to_i\n result = [result, x].min if value\n } if @cell[sheet]\n result = nil if result == impossible_value\n @first_column[sheet] = result\n result\n end", "title": "" }, { "docid": "98756da16c66d8567b8d77e3b8d3eed9", "score": "0.7059352", "text": "def _firstEmptyRowOfColumn(col)\n revVal = @board.reverse.find_index {|i| i[col] == 0}\n if revVal == nil\n return nil\n end\n return @board.length - 1 - revVal\n end", "title": "" }, { "docid": "1f4bd7c08357ad4473e32ff0a06c2732", "score": "0.6954841", "text": "def bottom(column)\n index = column.last(12).index(0)\n if index == 0\n return nil\n end\n return index\n end", "title": "" }, { "docid": "633611e74d1e69c1bf71dcef6b149a50", "score": "0.6937747", "text": "def get_last_empty_row(col_num)\n # each row reverse\n @grid.reverse.each_with_index do |row, idx|\n return (5 - idx) if row[col_num].nil?\n end\n end", "title": "" }, { "docid": "ef4f69fcdd64af839ff3f3d466315170", "score": "0.6877246", "text": "def last\n last_cell.value\n end", "title": "" }, { "docid": "b4d15bf74666e945c0a876a2e1b4bb6b", "score": "0.6811683", "text": "def first_column(sheet=nil)\n sheet = @default_sheet unless sheet\n unless @first_column[sheet]\n sheet_no = sheets.index(sheet) + 1\n @first_row[sheet], @last_row[sheet], @first_column[sheet], @last_column[sheet] = @gs.oben_unten_links_rechts(sheet_no)\n end\n return @first_column[sheet]\n end", "title": "" }, { "docid": "1ea1c1a88f2474f59b278d326031d60e", "score": "0.68035346", "text": "def last_column(str)\n column_of(str, str.length)\n end", "title": "" }, { "docid": "7242a50aa6952b1d66246a561e6e78ca", "score": "0.6724935", "text": "def last_column_as_letter(sheet = default_sheet)\n ::Roo::Utils.number_to_letter(last_column(sheet))\n end", "title": "" }, { "docid": "19dd48f394295b872ee2d9933fd78f34", "score": "0.67065346", "text": "def first_column(sheet=nil)\r\n sheet ||= @default_sheet\r\n unless @first_column[sheet]\r\n sheet_no = sheets.index(sheet) + 1\r\n @first_row[sheet], @last_row[sheet], @first_column[sheet], @last_column[sheet] =\r\n oben_unten_links_rechts(sheet_no)\r\n end\r\n return @first_column[sheet]\r\n end", "title": "" }, { "docid": "f815c1133b23ff6ee4fc9e7a689f9cfa", "score": "0.66869855", "text": "def last_column_as_letter(sheet=nil)\n GenericSpreadsheet.number_to_letter(last_column(sheet))\n end", "title": "" }, { "docid": "9ba578ef4603cb9304aaf3e8b8c149c3", "score": "0.66273457", "text": "def last_row(sheet=nil)\n sheet = @default_sheet unless sheet\n return @last_row[sheet] if @last_row[sheet]\n fr, lr, fc, lc = get_firsts_lasts(sheet)\n lr\n end", "title": "" }, { "docid": "5db6cb4ef683d363d9a1cea21d1bb748", "score": "0.66139597", "text": "def last_row(sheet=nil)\n sheet = @default_sheet unless sheet\n read_cells(sheet) unless @cells_read[sheet]\n if @last_row[sheet]\n return @last_row[sheet]\n end\n impossible_value = 0\n result = impossible_value\n @cell[sheet].each_pair {|key,value|\n y,x = key # _to_string(key).split(',')\n y = y.to_i\n result = [result, y].max if value\n } if @cell[sheet]\n result = nil if result == impossible_value\n @last_row[sheet] = result\n result\n end", "title": "" }, { "docid": "e57e48bb29e9730a1072ccfdbaa4b5d3", "score": "0.66101545", "text": "def first_last_row_col_for_sheet(sheet)\n @first_last_row_cols ||= {}\n @first_last_row_cols[sheet] ||= begin\n result = collect_last_row_col_for_sheet(sheet)\n {\n first_row: result[:first_row] == MAX_ROW_COL ? nil : result[:first_row],\n first_column: result[:first_column] == MAX_ROW_COL ? nil : result[:first_column],\n last_row: result[:last_row] == MIN_ROW_COL ? nil : result[:last_row],\n last_column: result[:last_column] == MIN_ROW_COL ? nil : result[:last_column]\n }\n end\n end", "title": "" }, { "docid": "952a4ce943cccd56d1856e94b4e71374", "score": "0.6591012", "text": "def last_column\n @expression.last_column\n end", "title": "" }, { "docid": "1842078e40510953dd996bd12e0eaf28", "score": "0.6558481", "text": "def check_columns\n\t\tcolumn = 0\n\t\twhile (column < @grid.length)\n\t\t\trow = 0\n\t\t\tcolumn_values = []\n\t\t\twhile (row < @grid.length)\n\t\t\t\tcolumn_values << @grid[row][column]\n\t\t\t\trow += 1\n\t\t\tend\n\t\t\tunless (column_values.include?(nil))\n\t\t\t\tif(column_values.uniq.length == 1)\n\t\t\t\t\treturn column_values.uniq.first\n\t\t\t\tend\t\t\t\t\n\t\t\tend\n\t\t\tcolumn += 1\n\t\tend\n\t\treturn nil\n\tend", "title": "" }, { "docid": "3e8201b64d56ddbb3af388eb492ee00a", "score": "0.65282714", "text": "def longest_sheet\n sheet(@workbook.worksheets.inject {|m,o| o.row_count > m.row_count ? o : m}.name)\n end", "title": "" }, { "docid": "8321d9ed24a76dedfa6bb8969af04919", "score": "0.649007", "text": "def column_full?(column)\n unless column(column.to_i)[@rows - 1].nil?\n return true\n end\n return false\n end", "title": "" }, { "docid": "e89f1d4c1493b27e141dfd91320a88ce", "score": "0.6480714", "text": "def column(n)\n columns[n]&.rtrim!\n end", "title": "" }, { "docid": "bd54eb34a077d9b401dd2048525323c3", "score": "0.6442154", "text": "def col_max; 1; end", "title": "" }, { "docid": "bd54eb34a077d9b401dd2048525323c3", "score": "0.6442154", "text": "def col_max; 1; end", "title": "" }, { "docid": "bd54eb34a077d9b401dd2048525323c3", "score": "0.6442154", "text": "def col_max; 1; end", "title": "" }, { "docid": "674470a4a365b038b39e9668a2fc6637", "score": "0.6410681", "text": "def last_cell_label(xsheet)\n dimension = xsheet.at_xpath('/worksheet/dimension')\n if dimension\n col = dimension.attributes['ref'].value.match(/:([A-Z]+[0-9]+)/)\n col ? col.captures.first : 'A1'\n else\n last = xsheet.at_xpath(\"/worksheet/sheetData/row[last()]/c[last()]\")\n last ? last.attributes['r'].value.match(/([A-Z]+[0-9]+)/).captures.first : 'A1'\n end\n end", "title": "" }, { "docid": "7e0cab9a0f1febb4f4add13b0b57028e", "score": "0.6400255", "text": "def last_row_index\n [dimensions[1] - 1, 0].max\n end", "title": "" }, { "docid": "f4468794adbb6ec85bf970e18a50e034", "score": "0.6393247", "text": "def columnFull(index)\n return _firstEmptyRowOfColumn(index) ? true : false\n end", "title": "" }, { "docid": "e64d9cd33b25101eb241289b630d2a45", "score": "0.6379615", "text": "def col_max; 0; end", "title": "" }, { "docid": "9255979193558c46092b230d02799ceb", "score": "0.636315", "text": "def col_max\n return COLUMNS\n end", "title": "" }, { "docid": "949c33b8f1d354a5032c20f312968125", "score": "0.63477355", "text": "def collect_last_row_col_for_sheet(sheet)\n first_row = first_column = MAX_ROW_COL\n last_row = last_column = MIN_ROW_COL\n @cell[sheet].each_pair do |key, value|\n next unless value\n first_row = [first_row, key.first.to_i].min\n last_row = [last_row, key.first.to_i].max\n first_column = [first_column, key.last.to_i].min\n last_column = [last_column, key.last.to_i].max\n end if @cell[sheet]\n { first_row: first_row, first_column: first_column, last_row: last_row, last_column: last_column }\n end", "title": "" }, { "docid": "888bceb3f488ccbea712fdbf7d5567d1", "score": "0.62905407", "text": "def total_columns\n @sheet.row(0).length\n end", "title": "" }, { "docid": "14b5f7d8f79af7783aaa78f71a99f0e1", "score": "0.62815744", "text": "def last_timesheet\n sheets = Timesheet.find_by_sql [\"select * from timesheets where contract_id = ? order by id desc LIMIT 1;\", self.id]\n if sheets.length > 0\n return sheets[0]\n else\n return nil\n end\n end", "title": "" }, { "docid": "7de200b8379ae6dd85f6bac076129771", "score": "0.6274251", "text": "def col\n @col-1\n end", "title": "" }, { "docid": "96d44b8cf8fbef313975cb10ad606a66", "score": "0.62734956", "text": "def last_in_column(column_index)\n token_row_coordinate = nil\n @board.each_with_index do |row, index|\n if !row[column_index].occupied?\n token_row_coordinate = index\n end\n end\n token_row_coordinate\n # since column index is given, returns only the row index of\n # where the token 'drops' for the column\n end", "title": "" }, { "docid": "31ea14d81184b19e5c7fd7fe28dfe54e", "score": "0.6248924", "text": "def col_max\n return 1\n end", "title": "" }, { "docid": "eb92b1b1b2bedf5101f530b43e6b15dd", "score": "0.61870587", "text": "def last_row(sheet = nil)\n sheet_for(sheet).last_row\n end", "title": "" }, { "docid": "bb919b48ff11145d08677a004b28e938", "score": "0.61778545", "text": "def longest_sheet\n sheet(worksheets.inject do |m, o|\n o.row_count > m.row_count ? o : m\n end.name)\n end", "title": "" }, { "docid": "25f0223f1976650ba26d5ae99c5a943d", "score": "0.61652136", "text": "def get_email_column (ws)\n email_user_column = 1\n (2..ws.num_cols).each do |col|\n if ws[1,col].include? \"Please write your email\"\n email_user_column = col\n break\n end\n end\n email_user_column\n end", "title": "" }, { "docid": "c2a1c226305ece18c66ce464b1e1122b", "score": "0.6161764", "text": "def column_full?(column)\n @board[column + 34]\n end", "title": "" }, { "docid": "b4b255c15b9947318190a2a7d1c4d403", "score": "0.6156783", "text": "def last_nil_row(column_index)\n column = board.index_arr('column', column_index)\n\n # final row location of piece\n board.height - column_reversed_first_nil_row(column) - 1\n end", "title": "" }, { "docid": "717fd5163549094666b8173cc7ceac1e", "score": "0.61465234", "text": "def previous_column\n return false if column == Board::COLUMNS.first\n index = Board::COLUMNS.index(column)\n Board::COLUMNS.at(index - 1)\n end", "title": "" }, { "docid": "a5722ea58486cef9436abb11966d93e9", "score": "0.61351657", "text": "def last_cell_reference\n dimension_reference(worksheet.rows.last.last, Dimension.default_last)\n end", "title": "" }, { "docid": "13465354af139af26acc7b0f631e7556", "score": "0.6117396", "text": "def col_max\n 1\n end", "title": "" }, { "docid": "13465354af139af26acc7b0f631e7556", "score": "0.6117396", "text": "def col_max\n 1\n end", "title": "" }, { "docid": "13465354af139af26acc7b0f631e7556", "score": "0.6117396", "text": "def col_max\n 1\n end", "title": "" }, { "docid": "13465354af139af26acc7b0f631e7556", "score": "0.6117396", "text": "def col_max\n 1\n end", "title": "" }, { "docid": "13465354af139af26acc7b0f631e7556", "score": "0.6117396", "text": "def col_max\n 1\n end", "title": "" }, { "docid": "13465354af139af26acc7b0f631e7556", "score": "0.6117396", "text": "def col_max\n 1\n end", "title": "" }, { "docid": "63ba64f74b745ebcbe5160368ae818d7", "score": "0.61150604", "text": "def realLast\n\t\tdc = (@first.col - @last.col).abs\n\t\tdr = (@first.row - @last.row).abs\n\n\t\tif dc < dr # then the selection vertical\n\t\t\treturn @cells[@last.row][@first.col]\n\t\telse # the selection is horizontal\n\t\t\treturn @cells[@first.row][@last.col]\n\t\tend\n\tend", "title": "" }, { "docid": "e94374098d47e13b101e289e1ed89f43", "score": "0.61111915", "text": "def endCol; @col + @width - 1; end", "title": "" }, { "docid": "c649b5c922d784512cec25810b421cb0", "score": "0.61046505", "text": "def col_max\r\n return 3\r\n end", "title": "" }, { "docid": "282235028b8d68a1be05728c283b66aa", "score": "0.60946405", "text": "def last_cell_reference; end", "title": "" }, { "docid": "2ccb40c9e11468853f829b4d8e07ff10", "score": "0.60939354", "text": "def last_position(list_name = nil)\n item = last_item(list_name)\n item.nil? ? 0 : item.send(evaluate_sortable_options(list_name)[:column])\n end", "title": "" }, { "docid": "7fedad8fb9718528035cebb2cc739274", "score": "0.6078127", "text": "def empty_columns\n index = 0\n index += 1 while @grid.all? { |row| row.nil? || row[index].nil? }\n index\n end", "title": "" }, { "docid": "ba57dc9cf039a6c6495586851db440db", "score": "0.6040655", "text": "def col_max\n return 2\n end", "title": "" }, { "docid": "ba57dc9cf039a6c6495586851db440db", "score": "0.6040655", "text": "def col_max\n return 2\n end", "title": "" }, { "docid": "ba57dc9cf039a6c6495586851db440db", "score": "0.6040655", "text": "def col_max\n return 2\n end", "title": "" }, { "docid": "ba57dc9cf039a6c6495586851db440db", "score": "0.6040655", "text": "def col_max\n return 2\n end", "title": "" }, { "docid": "3658f94cfb8546b8dd65007f4c16f290", "score": "0.6029557", "text": "def num_cols\n reload() if !@cells\n return @cells.keys.map(){ |_, c| c }.max || 0\n end", "title": "" }, { "docid": "46af3a8d9b3e4d79aea53a45fa6007ea", "score": "0.6026526", "text": "def col_max;\n 1;\n end", "title": "" }, { "docid": "bd9f2671bfb8337a1ba34d5c0477cf18", "score": "0.6025673", "text": "def col_length\n self[0].length\n end", "title": "" }, { "docid": "c54d31bfe9a81190768e237047e75bde", "score": "0.6023939", "text": "def get_col(c)\n\t\tif c.between?(0,@board_width-1)\n\t\t\tarr = Array.new(@board_height)\n\t\t\tfor i in 0..@board_width-1\n\t\t\t\tarr[i] = @arr_board[i][c]\n\t\t\tend\n\t\t\treturn arr\n\t\telse\n\t\t\treturn nil\n\t\tend\n\tend", "title": "" }, { "docid": "6727902f9da96ae5faf5370b4da9c3ea", "score": "0.602381", "text": "def find_empty_cell()\n\t$value_grid.each_with_index do |row, index_r|\n\t\trow.each_with_index do |col, index_c|\n\t\t\tif col.to_i == 0\n\t\t\t\treturn [index_r,index_c]\n\t\t\tend\n\t\tend\n\tend\n\treturn [$N,$N]\nend", "title": "" }, { "docid": "6727902f9da96ae5faf5370b4da9c3ea", "score": "0.602381", "text": "def find_empty_cell()\n\t$value_grid.each_with_index do |row, index_r|\n\t\trow.each_with_index do |col, index_c|\n\t\t\tif col.to_i == 0\n\t\t\t\treturn [index_r,index_c]\n\t\t\tend\n\t\tend\n\tend\n\treturn [$N,$N]\nend", "title": "" }, { "docid": "c75fe1d316d6eff3cc05f87e4ec3cea2", "score": "0.602112", "text": "def num_cols\n reload() if !@cells\n return @cells.keys.map(){ |r, c| c }.max || 0\n end", "title": "" }, { "docid": "8123b2c38ba75ddb2287c7a112a06e7c", "score": "0.60142535", "text": "def last_cell\n Cell.new( sheet, each_address.to_a.last )\n end", "title": "" }, { "docid": "c5a671c8325b8138eeebf820a0f9f98f", "score": "0.60100085", "text": "def column_full?(column, board_arr)\n if board_arr[column -1].length == 6\n disp_msg('column_full')\n true \n else\n false\n end\n end", "title": "" }, { "docid": "314ba89c2ae3ca743d0f95ab90f6cb96", "score": "0.5995831", "text": "def rightmost?\n @column == @master_cell.column + @master_cell.colspan - 1\n end", "title": "" }, { "docid": "6727399fce21ced3d5d819a380fc3cef", "score": "0.59903586", "text": "def get_last_sheet\n accessor_method = :get_last_sheet\n Quip::Sheet.new(\n accessor_method: :get_last_sheet, \n quip_sheet: get_container(\"table\", -1), \n thread_id: thread_id, \n client: client\n )\n end", "title": "" }, { "docid": "c3345cb8dbfcf73ca9ce530e24eae83b", "score": "0.5950081", "text": "def get_column column\n cell_list = []\n @board.each do |(coordinate, cell)|\n if coordinate[1] == column\n cell_list.append(cell)\n end\n end\n cell_list.reverse!\n end", "title": "" }, { "docid": "c2354e12bd6eae302354c741b170178f", "score": "0.5949259", "text": "def max_cols\n reload() if !@cells\n return @max_cols\n end", "title": "" }, { "docid": "8cb3fb72756563236e49f86db8e1ca6b", "score": "0.5937221", "text": "def cell_last\n return Cell.new(row_last,col_last)\n end", "title": "" }, { "docid": "52a06856c4380f75a71baaf4066b86d6", "score": "0.5918666", "text": "def last_row(sheet=nil)\n sheet = @default_sheet unless sheet\n unless @last_row[sheet]\n sheet_no = sheets.index(sheet) + 1\n @first_row[sheet], @last_row[sheet], @first_column[sheet], @last_column[sheet] = @gs.oben_unten_links_rechts(sheet_no)\n end\n return @last_row[sheet]\n end", "title": "" }, { "docid": "fdbf296046b580b00a32b5fa049cc499", "score": "0.5905772", "text": "def get_firsts_lasts(sheet=nil)\n \n # 2008-09-14 BEGINf\n fr=lr=fc=lc=nil\n sheet = @default_sheet unless sheet\n if ! @cells_read[sheet]\n read_cells(sheet)\n end\n if @cell[sheet] # nur wenn ueberhaupt Zellen belegt sind\n @cell[sheet].each {|cellitem|\n key = cellitem.first\n y,x = key\n\n if cellitem[1].class != String or\n (cellitem[1].class == String and cellitem[1] != \"\")\n fr = y unless fr\n fr = y if y < fr \n \n lr = y unless lr\n lr = y if y > lr \n \n fc = x unless fc\n fc = x if x < fc\n \n lc = x unless lc\n lc = x if x > lc \n end\n }\n end\n @first_row[sheet] = fr\n @last_row[sheet] = lr\n @first_column[sheet] = fc\n @last_column[sheet] = lc\n return fr, lr, fc, lc\n end", "title": "" }, { "docid": "c574d66f1b538f6ef1d240d3d6d59715", "score": "0.58986264", "text": "def col_max\n return 11\n end", "title": "" }, { "docid": "2251965e128e302b9c3d47affb3e1149", "score": "0.58928686", "text": "def testFirstEmpty\n assert_equal(@ySize-1, @board._firstEmptyRowOfColumn(0), 'wrong index returned for bottom of column')\n end", "title": "" }, { "docid": "e9044a7cac0b6cad71ff700498dc2132", "score": "0.58855456", "text": "def columns_delete_last()\n @columns.delete(@columns.last)\n return @columns\n end", "title": "" }, { "docid": "74906b2648f0a97af8384ce30e08e1e4", "score": "0.58755517", "text": "def column_names sheet\n \n names = []\n \n titles = sheet.column_titles\n \n sheet.each_cell_definition do |column, i|\n \n if titles[i]\n\n names << titles[i]\n \n elsif column.respond_to?(:value_name)\n \n names << column.value_name\n \n else\n \n names << nil\n \n end\n \n end\n \n names\n \n end", "title": "" }, { "docid": "b4a9d68d09e572964bf6dad9bfce14ee", "score": "0.5871458", "text": "def col_max\n 2;\n end", "title": "" }, { "docid": "09db565158e353484c07ca2eb90d6071", "score": "0.5866792", "text": "def last\n @data[-1][-1]\n end", "title": "" }, { "docid": "d6e5fd9840774ebeb525ec880134b9c2", "score": "0.5858713", "text": "def full?(col)\n @board[col].last != \" \"\n end", "title": "" }, { "docid": "ad5cefc1cf768a9d8bdfb00e639d6bbb", "score": "0.5856013", "text": "def last_entry(db, table, col)\n\t\tlast_entry = db.execute(\"SELECT MAX(#{col}) FROM #{table}\")[0][\"MAX(#{col})\"]\n\tend", "title": "" }, { "docid": "c64bb0102eed457e16edb2970c977995", "score": "0.58554965", "text": "def get_col(col)\n raise ArgumentError.new(\"You put in a negative column\") if col < 0\n result= []\n $boggle_board.each_index {|x| result << $boggle_board[x][col]}\n result\nend", "title": "" }, { "docid": "da54c359aac4f16b1d6a00dbf6564ee0", "score": "0.58530325", "text": "def get_col(board, col)\n\tunless col <= board.length && col >= 0\n\t\traise ArgumentError.new('Column number is not within accepted range') \n\tend\t\n\n\treturn board.map {|row| row[col]}\nend", "title": "" }, { "docid": "9b9c4a00fa68a1b619a830c075187eb0", "score": "0.58528227", "text": "def num_cols( colmax ) \nif colmax <= 1\n return 1;\nelse\n return colmax + 1;\nend\nend", "title": "" }, { "docid": "18d9729b30220f5c7046b87677711420", "score": "0.58435005", "text": "def column\n \"\"\n end", "title": "" }, { "docid": "5a3cd327895e9d3c4dfade0cd86bd792", "score": "0.5823776", "text": "def seach_column_index(field)\n i = 0\n while i < @sheet.column_size\n break if @sheet[0, i].value == field\n i += 1\n end\n i\n end", "title": "" }, { "docid": "d720bb7575404f05ee2f47e80f49b1af", "score": "0.5819959", "text": "def full\n return !(0..@board[0].length-1).any? {|i| _firstEmptyRowOfColumn(i) != nil}\n end", "title": "" }, { "docid": "440280a1437d7e0df472cbe0941158e6", "score": "0.5815054", "text": "def winning_col\n (0..MAX_INDEX).each do |col|\n symbol = @board[0][col]\n next if symbol == EMPTY\n (1..MAX_INDEX).each do |row|\n break unless symbol == @board[row][col]\n return symbol if row == MAX_INDEX\n end\n end\n nil\n end", "title": "" }, { "docid": "5f907b17016460bed96f37206a806c6f", "score": "0.5809811", "text": "def last_row(sheet=nil)\r\n sheet ||= @default_sheet\r\n unless @last_row[sheet]\r\n sheet_no = sheets.index(sheet) + 1\r\n @first_row[sheet], @last_row[sheet], @first_column[sheet], @last_column[sheet] =\r\n oben_unten_links_rechts(sheet_no)\r\n end\r\n return @last_row[sheet]\r\n end", "title": "" }, { "docid": "d905b0f3041c1295a168c5f76aa2e8bf", "score": "0.5805251", "text": "def get_column(column_index); end", "title": "" }, { "docid": "0c6ce4d2ab0e1fd381d437b4989a9247", "score": "0.58050334", "text": "def get_cols\n if cols > 0\n cols\n else\n c = Array.new\n pages.each do |p|\n if p.page_number != 'i'\n rowcol = p.page_number.split('')\n if !c.include?(rowcol[1])\n c.push(rowcol[1])\n end\n end\n end\n c.size\n end\n end", "title": "" }, { "docid": "952478f5466865dada172991feaa07e7", "score": "0.57869285", "text": "def last_row\n special_last_row = @ole_worksheet.UsedRange.SpecialCells(RobustExcelOle::XlLastCell).Row\n used_last_row = @ole_worksheet.UsedRange.Rows.Count\n [special_last_row, used_last_row].max\n end", "title": "" }, { "docid": "7b780e2f0bb17c900a91fe9f9f5123fe", "score": "0.5785772", "text": "def get_col(board, col)\n\tcolumns = board.transpose\n\treturn columns[col]\nend", "title": "" }, { "docid": "1c98e08cfea93df5d0e838feb7cfdbc8", "score": "0.57741594", "text": "def column(columnnumber, sheet=nil)\n if columnnumber.class == String\n columnnumber = GenericSpreadsheet.letter_to_number(columnnumber)\n end\n sheet = @default_sheet unless sheet\n read_cells(sheet) unless @cells_read[sheet]\n result = []\n first_row(sheet).upto(last_row(sheet)) do |row|\n result << cell(row,columnnumber,sheet)\n end\n result\n end", "title": "" } ]
38312c09364ab3f3aad3a4fd38dc6574
GET /stats GET /stats.json
[ { "docid": "aa217487bd0b8768202c4786a1110510", "score": "0.7096539", "text": "def index\n @stats = Stat.all\n end", "title": "" } ]
[ { "docid": "4522cf8448c0d86dd1697fdbb6d7ec22", "score": "0.8496457", "text": "def stats\n request :get, \"_stats\"\n end", "title": "" }, { "docid": "4522cf8448c0d86dd1697fdbb6d7ec22", "score": "0.8496457", "text": "def stats\n request :get, \"_stats\"\n end", "title": "" }, { "docid": "26a4dc29a68fdc616edfb3490f41f4aa", "score": "0.8385577", "text": "def stats\n Client.current.get(\"#{resource_url}/stats\")\n end", "title": "" }, { "docid": "26bfaaaeacb1b1c622397672b58e4e41", "score": "0.7971654", "text": "def stats\n _get(\"/system/stats\") { |json| json }\n end", "title": "" }, { "docid": "fe3bf327ed1825413f1586be67eca765", "score": "0.76488227", "text": "def stats\n response[\"stats\"]\n end", "title": "" }, { "docid": "dea5e5623f3684c075aaebf39ae45890", "score": "0.7374003", "text": "def stats\n @stats = time_data Gig.all\n\n respond_to do |format|\n format.html # stats.html.erb\n format.json { render json: time_data(Gig.all, :hash), callback: params[:callback] }\n format.xml { render xml: time_data(Gig.all, :hash) }\n end\n end", "title": "" }, { "docid": "a97cc8130b764e33c8140a00e6db54f4", "score": "0.7276539", "text": "def stats\n @server.make_json_request('show.stats', tvdbid: @tvdbid)['data']\n end", "title": "" }, { "docid": "ab16740a42d3447b4249a1552fd49adc", "score": "0.72763014", "text": "def index\n @stats = Stat.all\n\n render json: {data:\n @stats.map {|stat|\n days = range_to_days(stat)\n {\n total_seconds: stat.total_seconds,\n human_readable_total: humanize(stat.total_seconds),\n daily_average: stat.daily_average,\n human_readable_daily_average: humanize(stat.daily_average),\n range: stat.range,\n holidays: stat.holidays,\n days_including_holidays: days,\n days_minus_holidays: days - stat.holidays,\n status: stat.status,\n is_already_updating: stat.is_already_updating,\n is_stuck: stat.is_stuck,\n is_up_to_date: stat.is_up_to_date,\n timeout: stat.timeout,\n editors: stat.editors.map {|e|\n {\n name: e.name,\n total_seconds: e.total_seconds,\n percent: e.percent\n }\n }\n }\n }}\n end", "title": "" }, { "docid": "f96893dcb16db323d58d8fbcae754238", "score": "0.72340065", "text": "def stats\n @stats = time_data SolarReading.all\n\n respond_to do |format|\n format.html # stats.html.erb\n format.json { render json: time_data(SolarReading.all, :hash), callback: params[:callback] }\n format.xml { render xml: time_data(SolarReading.all, :hash) }\n end\n end", "title": "" }, { "docid": "4f8c5a842f0422e78e5f90e371a4bee8", "score": "0.7221926", "text": "def statistics\n JSON.parse @gapi.statistics.to_json\n end", "title": "" }, { "docid": "086eb31418e72209b32e4c109ee6a9da", "score": "0.71899736", "text": "def stats\n @stats = {\n total_distance: CyclingEvent.sum(:distance),\n total_time: CyclingEvent.sum(:finish_time),\n average_speed: CyclingEvent.sum(:distance).to_f / CyclingEvent.sum(:finish_time).to_f\n }\n\n respond_to do |format|\n format.html # stats.html.erb\n format.json { render json: @stats, callback: params[:callback] }\n format.xml { render xml: @stats }\n end\n end", "title": "" }, { "docid": "9fcb57d7200a6ac66660050a9b3303fb", "score": "0.71400106", "text": "def raw_stats\n url = URI.parse(stats_url)\n Net::HTTP.start(url.host, url.port) {|http|\n http.request(Net::HTTP::Get.new(url.path))\n }.body\nend", "title": "" }, { "docid": "3663d35680da51754bd947783f7e61cb", "score": "0.7122524", "text": "def stats\n repo = Repo.find(params[:id])\n\n render(:json => CodeburnerUtil.get_repo_stats(repo.id))\n rescue ActiveRecord::RecordNotFound\n render(:json => {error: \"Service or findings not found}\"}, :status => 404)\n end", "title": "" }, { "docid": "e92329dcde3a62105a6b205a07587cce", "score": "0.71210396", "text": "def stats\n @stats = {}\n @stats[\"online\"] = \"Of course. That's how the internet works.\"\n @stats[\"requested_at\"] = Time.now\n @stats[\"total_tweets\"] = ActiveRecord::Base.connection.execute(\"explain select count(id) from tweets\").all_hashes.first[\"rows\"]\n @stats[\"total_users\"] = ActiveRecord::Base.connection.execute(\"explain select count(id) from users\").all_hashes.first[\"rows\"]\n @stats[\"number_collections\"] = ActiveRecord::Base.connection.execute(\"select count(id) from collections\").fetch_row.first\n @stats[\"researchers_active\"] = ActiveRecord::Base.connection.execute(\"select count(id) from researchers\").fetch_row.first\n @stats[\"scrape_count\"] = ActiveRecord::Base.connection.execute(\"select count(id) from scrapes\").fetch_row.first\n @stats[\"datasets_count\"] = ActiveRecord::Base.connection.execute(\"select count(id) from collections where single_dataset = 1\").fetch_row.first\n @stats[\"analysis_jobs_completed\"] = ActiveRecord::Base.connection.execute(\"select count(id) from analysis_metadatas\").fetch_row.first\n @stats[\"total_graphs\"] = ActiveRecord::Base.connection.execute(\"select count(id) from graphs\").all_hashes.first[\"rows\"]\n @stats[\"total_graph_points\"] = ActiveRecord::Base.connection.execute(\"select count(id) from graph_points\").all_hashes.first[\"rows\"]\n @stats[\"total_edges\"] = ActiveRecord::Base.connection.execute(\"select count(id) from edges\").fetch_row.first\n respond_to do |format|\n format.xml { render :xml => @stats.to_xml }\n format.json { render :json => @stats.to_json }\n end\n end", "title": "" }, { "docid": "d00a01102186f632fc134de514d86bd2", "score": "0.7081768", "text": "def stats\n @stats = time_data MonzoTransaction.all\n\n respond_to do |format|\n format.html # stats.html.erb\n format.json { render json: time_data(MonzoTransaction.all, :hash), callback: params[:callback] }\n format.xml { render xml: time_data(MonzoTransaction.all, :hash) }\n end\n end", "title": "" }, { "docid": "e196dafca6ab5cc87e1d0ddced8b7afb", "score": "0.7077504", "text": "def stats_find(opts = {})\n if Configuration.debugging\n Configuration.logger.debug \"Calling API: StatsApi#stats_find ...\"\n end\n \n # resource path\n path = \"/stats\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n _header_accept = ['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript']\n _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result\n\n # HTTP header 'Content-Type'\n _header_content_type = ['application/json', 'application/x-www-form-urlencoded']\n header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n\n auth_names = []\n result = @api_client.call_api(:GET, path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Array<Stats>')\n if Configuration.debugging\n Configuration.logger.debug \"API called: StatsApi#stats_find. Result: #{result.inspect}\"\n end\n return result\n end", "title": "" }, { "docid": "0940f1908eb2ef925a1172ebe7665c74", "score": "0.7060773", "text": "def stats\n year = Analytic.where(\"created_at > ?\", Time.now - 1.year)\n @stats = time_data year\n\n respond_to do |format|\n format.html # stats.html.erb\n format.json { render json: time_data(year, :hash), callback: params[:callback] }\n format.xml { render xml: time_data(year, :hash) }\n end\n end", "title": "" }, { "docid": "8ae75026d0ee5a6ec8fcf5e744bd6d93", "score": "0.7056477", "text": "def stats(url, options={})\n query = {:url => url}\n query.merge!(options)\n response = handle_response(self.class.get(\"/stats.json\", :query => query))\n Topsy::Stats.new(response)\n end", "title": "" }, { "docid": "eacff25575e42af1a9ef7bcd0c36c0b6", "score": "0.7028605", "text": "def stats\n ## TODO:\n end", "title": "" }, { "docid": "571f5321ec8ce318b2c4a1f4920cc630", "score": "0.6976703", "text": "def index\n @stats = Stat.all\n end", "title": "" }, { "docid": "b47a841d7b42b6c9e24b14fd99998f25", "score": "0.6953858", "text": "def stats\n @stats = time_data Episode.all\n @cloud = word_cloud Episode.pluck(:title)\n\n respond_to do |format|\n format.html # stats.html.erb\n format.json { render json: time_data(Episode.all, :hash), callback: params[:callback] }\n format.xml { render xml: time_data(Episode.all, :hash) }\n end\n end", "title": "" }, { "docid": "cf67ca8e63b689bc69cc6d2a9bf6d87c", "score": "0.6942611", "text": "def stats\n StatsManager::StatsD.time(Settings::StatsConstants.api['user']['stats']) do\n if params[:id] == current_user.id.to_s\n # A regular user can only view his/her own stats\n @user = current_user\n elsif current_user.is_admin\n # admin users can view anyone's stats\n unless @user = User.where(:id => params[:id]).first\n return render_error(404, \"could not find that user\")\n end\n else\n return render_error(401, \"unauthorized\")\n end\n\n @status = 200\n num_recent_frames = params[:num_frames] ? params[:num_frames].to_i : Settings::UserStats.num_recent_frames\n @stats = GT::UserStatsManager.get_dot_tv_stats_for_recent_frames(@user, num_recent_frames)\n @stats.each {|s| s.frame.creator[:shelby_user_image] = s.frame.creator.avatar_url}\n end\n end", "title": "" }, { "docid": "b15e649732e2b8fa7ec88cef4eb5bbbd", "score": "0.6927768", "text": "def index\n @group_stats = GroupStat.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @group_stats }\n end\n end", "title": "" }, { "docid": "9cae492c24d10bb8fd8d911018eac055", "score": "0.6923968", "text": "def show\n render json: @stat\n end", "title": "" }, { "docid": "075b0361f4c36f71a3747b9d99073056", "score": "0.6921274", "text": "def get_json_stats_from(ip, port)\n Net::HTTP.start(ip, port) {|http| http.get('/stats.json') }.body rescue \"{}\"\nend", "title": "" }, { "docid": "54a41341bff9b5673a9045120ea1497c", "score": "0.6916078", "text": "def get_team_stats()\n query_params = { }\n headers = {}\n body = nil\n\n path = \"/team/stats\"\n\n @client.request(\n method: :get,\n path: path,\n query: query_params,\n headers: headers,\n body: body)\n end", "title": "" }, { "docid": "340b0ac39ae4d68e3edbafb67a6e7941", "score": "0.69134456", "text": "def index\n @stats = Stat.all\n @stat = Stat.new\n render html: @stats, json: @stats\n # respond_to do |format|\n # format.html\n # format.json\n # end\n end", "title": "" }, { "docid": "deab2d67d9b313a06057d2e1b448001a", "score": "0.6904705", "text": "def stats\n @client.stats\n end", "title": "" }, { "docid": "4b49e5731e53108de3847e94af079591", "score": "0.6895912", "text": "def index\n @backend_stats = Backend::Stat.order('created_at ASC')\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @backend_stats }\n end\n end", "title": "" }, { "docid": "f42acf8983b63fcd56e134f98e4be159", "score": "0.6876614", "text": "def stats\n return self.endpoint.stats(self.id)\n end", "title": "" }, { "docid": "530214f15216e3804b85960df8c0fc34", "score": "0.68358344", "text": "def stats(id)\n request(:get, \"/users/#{id}/vm_stats.json\")\n end", "title": "" }, { "docid": "68db9189bf32b1363d2f18457999c5ef", "score": "0.6834292", "text": "def stats\n @stats = time_data Track.all\n @cloud = word_cloud Track.pluck(:artist), split: false, limit: 60\n\n respond_to do |format|\n format.html # stats.html.erb\n format.json { render json: time_data(Track.all, :hash), callback: params[:callback] }\n format.xml { render xml: time_data(Track.all, :hash) }\n end\n end", "title": "" }, { "docid": "4b5294b5732a6d54eacbfe431e2c29ce", "score": "0.68313205", "text": "def admin_stats\n logger.debug('Getting admin statistics') if @debug\n get('/api/admin/stats')\n end", "title": "" }, { "docid": "757aa6b238cfa964a26c72ba4124bb4b", "score": "0.68110555", "text": "def stats\n JSON.parse TCPSocket.new(@options[:stats_uri].host,@options[:stats_uri].port).read rescue {}\n end", "title": "" }, { "docid": "14d9cfe86a7f471f1163774b53fced7d", "score": "0.6786562", "text": "def activity_statistics\n get(\"/user/#{@user_id}/activities.json\")\n end", "title": "" }, { "docid": "14d9cfe86a7f471f1163774b53fced7d", "score": "0.6786562", "text": "def activity_statistics\n get(\"/user/#{@user_id}/activities.json\")\n end", "title": "" }, { "docid": "2122bcde8a5df1642c267496cb91d55a", "score": "0.6754817", "text": "def user_stats\n @user = User.find(params[:id])\n @stats = time_data @user.episodes\n @cloud = word_cloud @user.episodes.pluck(:title)\n\n respond_to do |format|\n format.html { render 'stats' }\n format.json { render json: time_data(@user.episodes, :hash), callback: params[:callback] }\n format.xml { render xml: time_data(@user.episodes, :hash) }\n end\n end", "title": "" }, { "docid": "1ee614245a16e030bab6858824030ff9", "score": "0.6705891", "text": "def index\r\n @stats = Stat.all\r\n @statsu = Stat.where(calculation_id: params[:id])\r\n\r\n respond_to do |format|\r\n format.html # index.html.erb\r\n format.json { render json: @stats }\r\n end\r\n end", "title": "" }, { "docid": "db0919554441d9041d7b514deff33c88", "score": "0.668794", "text": "def get_stats_headers(options={format: \"json\"})\n Rails.cache.fetch([\"/game/stats\", { query: options }], :expires => 1.hour) do\n self.class.get(\"/game/stats\", { query: options })\n end\n end", "title": "" }, { "docid": "d8736569c84cd43e69309992d1b84756", "score": "0.6660662", "text": "def stats(params = {})\n response = client.get \"/_cluster/stats\", params.merge(action: \"cluster.stats\", rest_api: \"cluster.stats\")\n response.body\n end", "title": "" }, { "docid": "6f95a4997d0239ae095a65ff8636e664", "score": "0.6642226", "text": "def stats\n Project.hit 15\n Project.hit 32\n @stats = time_data TextMessage.all\n @cloud = word_cloud TextMessage.pluck(:text)\n\n respond_to do |format|\n format.html # stats.html.erb\n format.json { render json: time_data(TextMessage.all, :hash), callback: params[:callback] }\n format.xml { render xml: time_data(TextMessage.all, :hash) }\n end\n end", "title": "" }, { "docid": "f9deebc2a719a2e0db07e5fc7b0434d9", "score": "0.66336524", "text": "def stats(options={})\n Resources::Stats.new(self, options)\n end", "title": "" }, { "docid": "f14acf887f4d9f2e607d9bd8f9860197", "score": "0.6624457", "text": "def index\n @player_statistics = PlayerStatistic.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @player_statistics }\n end\n end", "title": "" }, { "docid": "b7d43dde9687d0b2f6b2d5eb95d1b36a", "score": "0.66098124", "text": "def show\n @stat = Stat.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @stat }\n end\n end", "title": "" }, { "docid": "2baeebacddf4b1327fdba4c5b391743c", "score": "0.66065425", "text": "def stats\n end", "title": "" }, { "docid": "2baeebacddf4b1327fdba4c5b391743c", "score": "0.66065425", "text": "def stats\n end", "title": "" }, { "docid": "be1a490d2dc5288ea7e9d2668f156d0a", "score": "0.6605892", "text": "def stats\n stats_cache.stats\n end", "title": "" }, { "docid": "2b88f123cb0cc3c8a3e4cf061f3cd128", "score": "0.65826875", "text": "def venue_stats(id, options = {})\n get(\"venues/#{id}/stats\", options)\n end", "title": "" }, { "docid": "5eb7d3cf42d49ee4a520f0ade06a8605", "score": "0.65503925", "text": "def index\n respond_to do |format|\n format.html { render 'application/cube_trainer' }\n format.json do\n stats = @mode.stats.map(&:to_simple)\n render json: stats, status: :ok\n end\n end\n end", "title": "" }, { "docid": "7169bdb7cd2f01fa555459ea94df23d1", "score": "0.65480936", "text": "def show\n @stat = Stat.find(params[:id])\n\n respond_to do |format|\n format.html { render \"show\" }\n format.json { render json: @stat }\n end\n end", "title": "" }, { "docid": "e2169f62e3d9978c5f2fa0175f607059", "score": "0.65294164", "text": "def index\n @users = User.all(include: :stats)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "a9f21b52f607a84e0604549ce845d746", "score": "0.652378", "text": "def get_statistics\n response = get_siteinfo('statistics')\n ret = {}\n response['query']['statistics'].each { |k, v| ret[k] = v }\n ret\n end", "title": "" }, { "docid": "60b312cfa867026dbaf6d58c1db43b34", "score": "0.6507259", "text": "def stats(&blk)\n if block_given?\n websocket.subscribe :stats, &blk\n else\n http.get :stats\n end\n end", "title": "" }, { "docid": "7f5cde8d821b3a9cae009775ead51949", "score": "0.65021366", "text": "def stats(opts)\n if opts[:aggregate] && (opts[:field] || opts[:service])\n fail Error, \"You can't specify a field or a service for an aggregate request\"\n end\n\n url = '/stats'\n\n url += '/aggregate' if opts.delete(:aggregate)\n\n if service = opts.delete(:service)\n url += \"/service/#{service}\"\n end\n\n if field = opts.delete(:field)\n url += \"/field/#{field}\"\n end\n\n client.get_stats(url, opts)\n end", "title": "" }, { "docid": "be238084c05487a474c3dc225939d2ab", "score": "0.64997643", "text": "def stats\n \n end", "title": "" }, { "docid": "9d78b2512b2345eb7f8e9d3972fcf223", "score": "0.64912415", "text": "def index\n @tw_stats = TwStat.all\n end", "title": "" }, { "docid": "41c295be494bccd613d0d75b03725ca3", "score": "0.649082", "text": "def stats\n get_charts\n end", "title": "" }, { "docid": "191026433d37d753d9b4d162b281d717", "score": "0.64698803", "text": "def stats\n @stats ||= query\n end", "title": "" }, { "docid": "191026433d37d753d9b4d162b281d717", "score": "0.64698803", "text": "def stats\n @stats ||= query\n end", "title": "" }, { "docid": "88e640f77b0968841faa0c5b58d7b4df", "score": "0.6463592", "text": "def index\n @usages = get_usages\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @usages }\n end\n end", "title": "" }, { "docid": "16a591b9783030049e51efb2002c53e2", "score": "0.64607984", "text": "def get_event_stats ( event_key )\n get_api_resource \"#{@@api_base_url}event/#{event_key}/stats\"\n end", "title": "" }, { "docid": "5413c474154cd20a97915e4c1e03adb3", "score": "0.6424613", "text": "def stats\n self[:stats]\n end", "title": "" }, { "docid": "d01beea0b19e884d23c1e810d7714114", "score": "0.6424181", "text": "def index\n @stats = Stat.where(:match_id => params[:match_id])\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @stats }\n end\n end", "title": "" }, { "docid": "e2f40dab588dde2c20676ba7ccdcdfbd", "score": "0.6410841", "text": "def index\n respond_to do |format|\n format.html {\n render :file => \"public/#{ENV['PROJECT_ID']}/admin.html\"\n }\n format.json {\n @stats = [\n {label: \"User Registration Stats\", data: User.getStatsByDay},\n {label: \"Transcript Edit Stats\", data: TranscriptEdit.getStatsByDay}\n ]\n }\n end\n end", "title": "" }, { "docid": "03ee6cef05793a473bf1ddb2269a1084", "score": "0.6399289", "text": "def stats\n # lookup user + stats via api\n if user_signed_in? and request.headers['HTTP_COOKIE'] and @user = Shelby::API.get_user(params['user_id'])\n @frames = Shelby::API.get_user_stats(params['user_id'], req0uest.headers['HTTP_COOKIE'])\n end\n end", "title": "" }, { "docid": "cae220edb0cb916fea26e3bb6bc872c4", "score": "0.6359059", "text": "def call_rest_getlbvstats\n print \"get lb vserver stats\\n\"\n @uri.path = \"/nitro/v1/config/lbvserver/\"\n @request = Net::HTTP::Get.new(@uri)\n @request.basic_auth \"#{@username}\", \"#{@password}\"\n @request.add_field('Content-Type', 'application/vnd.com.citrix.netscaler.lbvserver+json')\n\n Net::HTTP.start(@uri.host, @uri.port) { |http|\n response = http.request(@request)\n\n if response.code == \"200\"\n result = JSON.parse(response.body)\n File.open(\"lbvserver-stats.json\", \"w\") do |file|\n file.write(JSON.pretty_generate(result))\n end\n end\n }\n\n end", "title": "" }, { "docid": "ec4ae97c1e87b3811dc7101a47d07034", "score": "0.63548154", "text": "def request_stats\n @all = current_user.trip_requests.requests.count\n @completed = current_user.trip_requests.completed.requests.count\n @cancelled = current_user.trip_requests.cancelled.requests.count\n @active = current_user.trip_requests.active.requests.count\n @stats = current_user.trip_requests.requests.group_by_month(:created_at, format: \"%b\", reverse:true).count\n @response = { all: @all, completed: @completed, cancelled: @cancelled, active: @active, requests: @stats }\n json_response(@response)\n end", "title": "" }, { "docid": "52f6d29056a878f3eea4c132db17bd80", "score": "0.6339554", "text": "def show\n @game_stat = GameStat.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @game_stat }\n end\n end", "title": "" }, { "docid": "f36915dc085e33e33b5fde6dc6cd5aff", "score": "0.6332908", "text": "def list_stats\r\n puts \"#{@name} Stats:\"\r\n puts \"Total HP: #{@hp}\"\r\n puts \"Class: #{@job}\"\r\n puts \"Total Strength: #{@strength}\"\r\n puts \"Total Speed: #{@speed}\"\r\n end", "title": "" }, { "docid": "704432185397ea24847490705dbad1b0", "score": "0.63254637", "text": "def stats\n expose Metadata.stats(@oauth_token)\n end", "title": "" }, { "docid": "93bb425e55f296374124bfd2a2d38745", "score": "0.6317051", "text": "def index\n @statistics = Statistic.all\n end", "title": "" }, { "docid": "93bb425e55f296374124bfd2a2d38745", "score": "0.6317051", "text": "def index\n @statistics = Statistic.all\n end", "title": "" }, { "docid": "93bb425e55f296374124bfd2a2d38745", "score": "0.6317051", "text": "def index\n @statistics = Statistic.all\n end", "title": "" }, { "docid": "8cd1baedddf4cef5d544e5fd0fade780", "score": "0.63150233", "text": "def getStats (player)\n if player == \"me\"\n my_hits = self.my_hits\n my_misses = self.my_misses\n my_sunk_ships = sunkShips(\"me\")\n finished = self.finished\n stats = {my_hits: my_hits,\n my_misses: my_misses,\n my_sunk_ships: my_sunk_ships,\n finished: finished}\n statsRet = stats.to_json\n return statsRet\n\n else # player == \"enemy\"\n enemy_hits = self.enemy_hits\n enemy_misses = self.enemy_misses\n enemy_sunk_ships = sunkShips(\"enemy\")\n finished = self.finished\n stats = {enemy_hits: enemy_hits,\n enemy_misses: enemy_misses,\n enemy_sunk_ships: enemy_sunk_ships,\n finished: finished}\n statsRet = stats.to_json\n return statsRet\n end\n end", "title": "" }, { "docid": "2b43b5222aaa31e268c7e04786ef6065", "score": "0.6314612", "text": "def index\n @visit_stats = VisitStat.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @visit_stats }\n end\n end", "title": "" }, { "docid": "d9090211c3a7c1578f993f3fa3170fe9", "score": "0.6307654", "text": "def stats!\n stats = send_recv( KJess::Request::Stats.new )\n raise KJess::Error, \"Problem receiving stats: #{stats.inspect}\" unless KJess::Response::Stats === stats\n\n h = stats.data\n dump_stats = send_recv( KJess::Request::DumpStats.new )\n h['queues'] = Hash.new\n if KJess::Response::DumpedStats === dump_stats then\n h['queues'].merge!( dump_stats.data )\n end\n return h\n end", "title": "" }, { "docid": "839ee73567b8a34f43b0f87bdb867745", "score": "0.63055", "text": "def stats\n adapter.stats\n end", "title": "" }, { "docid": "f5db8f030a63cc4ce4b8cd5178197963", "score": "0.6262696", "text": "def show\n @town = Town.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @town } # hash returned get_stats does not serialize to_xml\n format.json { render :json => @town.to_json({ :methods => [:current_stats, :url, :public_url]}) }\n end\n end", "title": "" }, { "docid": "1a0980ae07ebeffd06ff0854498a5ad9", "score": "0.6257581", "text": "def stats(id)\n response = request(:get, \"/users/#{id}/vm_stats.json\")\n response.first['vm_stats']\n end", "title": "" }, { "docid": "72c0e4ab1c7273b1ec754738fb5eb3b4", "score": "0.6257329", "text": "def show\r\n @stats = Stat.all\r\n @statsu = Stat.where(calculation_id: params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @stat }\r\n end\r\n end", "title": "" }, { "docid": "fcd5c8d3ef79ef9a73dd0d21a0605c62", "score": "0.62524235", "text": "def stats(contents={}, &callback)\n send_request Request::Stats.new(contents) do |result|\n callback.call result\n\n if result[:status] == Errors::NO_ERROR && result[:key] != ''\n :proceed\n end\n end\n end", "title": "" }, { "docid": "8ea926906fe061ab29394e4c67b43816", "score": "0.6245524", "text": "def statistics\n cached = Rails.cache.read(\"stats\")\n return cached unless cached.nil?\n\n stats = {\n user_count: User.select(:id).count,\n completed_plan_count: Plan.select(:id).count,\n institution_count: Org.participating.select(:id).count\n }\n cache_content(\"stats\", stats)\n stats\n end", "title": "" }, { "docid": "68da02c2bf3979ebb3f99492f251c844", "score": "0.6242198", "text": "def show\n @daily_statistic = DailyStatistic.find(params[:id])\n\n render json: @daily_statistic\n end", "title": "" }, { "docid": "cd99a7e632cbdcabe2c1157d569fcaaa", "score": "0.62413365", "text": "def stats\n result = UserReservation.stats params[:id_list]\n render json: {revenue:result[:totalRevenue]}\n end", "title": "" }, { "docid": "a02997ec1fa21a57b80389fae2b70712", "score": "0.62389934", "text": "def stats\n @data.info\n end", "title": "" }, { "docid": "f00cecb7a0912370e095cae5dbe26ad3", "score": "0.62359774", "text": "def get_stats_json(secret)\n if !valid_secret?(secret)\n return BAD_SECRET_MSG\n end\n\n return JSON.dump(@all_stats)\n end", "title": "" }, { "docid": "5cf5fe042a75868a0b2015727a13ae5c", "score": "0.6232316", "text": "def track\n url = Rails.env.development? ? \"http://localhost:8000/stat\" : \"http://stats.universit.as/stat\"\n RestClient.get(url, :params => {\n :ip => request.remote_ip,\n :title => request.referrer\n })\n render :js => ''\n end", "title": "" }, { "docid": "7b7e50d0bd003fedcfbb55ebe6e54830", "score": "0.6231264", "text": "def index_tape_stats_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapesApi.index_tape_stats ...'\n end\n # resource path\n local_var_path = '/tape_stats'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?\n query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'TapeStatCollection' \n\n # auth_names\n auth_names = opts[:auth_names] || ['BasicAuth', 'BearerAuth']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TapesApi#index_tape_stats\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "c6826be170adbc9bb65a5fd560654d5a", "score": "0.62289464", "text": "def statistics \n channel = Channel.find_by!(id: params[:id])\n joinedChannels = ChannelJoined.where(channel_id: params[:id])\n messages = Message.where(channel_id: params[:id])\n json_response({\n users: joinedChannels.length,\n messages: messages.length,\n })\n end", "title": "" }, { "docid": "cf7a3be725851d503a446002aa016693", "score": "0.61998826", "text": "def stats\n {:money => @money , :life => @life, :fights => @fights, :respect => @respect, :state => @state.id, :substate => @state.state.id}\n end", "title": "" }, { "docid": "f77a114dbff1aa55adc2d19ea5e9df5f", "score": "0.6188911", "text": "def index\n @system_stats = SystemStat.all\n end", "title": "" }, { "docid": "172a3a8d27f5dbe311ab7ad89bf20c65", "score": "0.6185031", "text": "def view_stats\n @company = Company.find(params[:id])\n data = {\n :name => \"Student Views\",\n :pointInterval => 1.day * 1000,\n :pointStart => 1.weeks.ago.at_midnight.to_i * 1000,\n :data => (1.weeks.ago.to_date..Date.today).map{ |date|\n @company.impressions.where(\n \"created_at > ? AND created_at < ?\",\n date.at_beginning_of_day,\n date.tomorrow.at_beginning_of_day\n ).select{ |impression| impression.action_name == \"stat_show\"}.count\n }\n }\n respond_with data\n end", "title": "" }, { "docid": "c84b50833360c02d08f71025007d6b4b", "score": "0.61839026", "text": "def statistics\n ratings = Restaurant.within(params[:latitude],\n params[:longitude],\n params[:radius]).pluck(:rating)\n render json: {\n count: ratings.length,\n avg: ratings.mean,\n std: ratings.standard_deviation\n }\n end", "title": "" }, { "docid": "a074ca41bef885c41b0b16a080ee10a1", "score": "0.61824614", "text": "def show\n url = Url.find(params[:id].to_i)\n @stats = {\n shortened_url: \"#{request.base_url}/#{url.shortened_url}\",\n original_url: url.original_url,\n usage_count: url.count,\n created_at: url.created_at,\n most_recent_use: url.updated_at\n }\n end", "title": "" }, { "docid": "64d8a09395c345dd7d7277cd443498e1", "score": "0.61747265", "text": "def stats\n\t\t@counts\n\tend", "title": "" }, { "docid": "9c96c5404a7c333d8f6176cf03ae8bcf", "score": "0.6160279", "text": "def show\n @backend_stat = Backend::Stat.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @backend_stat }\n end\n end", "title": "" }, { "docid": "fb9a6611889f91c65c50847282036a8a", "score": "0.61581606", "text": "def stats\n # find project\n @project = Project.find(params[:id])\n # check user is manager of project\n if (!@superuser_is_superadmin && !(superuser_is_part_of_project? @project))\n flash[:warning] = \"You can't see stats for this project\"\n redirect_to lato_core.root_path and return false\n end\n # find datas\n @tasks = Task.where(project_id: @project.id).order('end_date ASC')\n @wait_tasks = @tasks.where(status: 'wait')\n @develop_tasks = @tasks.where(status: 'develop')\n @test_tasks = @tasks.where(status: 'test')\n @completed_tasks = @tasks.where(status: 'completed')\n @collaborators = @project.collaborators\n end", "title": "" }, { "docid": "600745f81af1ce78324dbbc73f8ab19b", "score": "0.6157004", "text": "def stats; end", "title": "" } ]
f36a3f5b893d89778b7a63e759b95029
Administrator change User from buyer to seller A corriger
[ { "docid": "de19f2b524d2fdf8f30da428239dcc38", "score": "0.7181489", "text": "def user_to_seller\n @user = User.find(params[:id])\n if @user.client?\n @user.seller!\n end\n redirect_to :admindashboard if @user.save\nend", "title": "" } ]
[ { "docid": "f20c80eb7216bc32297b01870fa13c42", "score": "0.7005963", "text": "def set_user\n @seller = User.find(params[:id])\n end", "title": "" }, { "docid": "1c9dbed821a0d8b067046754f27152e2", "score": "0.6984504", "text": "def set_admin_user\n #@user = User.find(params[:id])\n @vendor = Vendor.find(params[:id])\n end", "title": "" }, { "docid": "8c9bee5ec940175320fc4698c017afbb", "score": "0.6841495", "text": "def assign_user_to_admin(brand)\n\t\tself.user_brands.find_by(brand_id: brand.id).update(permission: 1)\n\tend", "title": "" }, { "docid": "3a694d76ec524a14468adb240ab1eadf", "score": "0.68016136", "text": "def change_existing_user\n mem = @data.mem\n creator = mem.creator\n email = creator.contact.con_email\n need_email = email && !email.empty?\n\n @session.push(self.class, :continue_to_renew)\n @session.dispatch(Login,\n :handle_update_details_for_third_party, \n [ creator, need_email ])\n end", "title": "" }, { "docid": "d6d0cf791aa004586f31c949d7b6c120", "score": "0.6746606", "text": "def upgrade_user\n set_role_to_premium\n end", "title": "" }, { "docid": "1cc73f80b5e7223c0981bec93b023107", "score": "0.672965", "text": "def set_user\n if @user\n \t\t edit()\n end\n \tend", "title": "" }, { "docid": "0965ca6cfbe6ef336f05b7e5ef887bdd", "score": "0.67264915", "text": "def set_admin_user\n params = {:schema => self.schema, :email => 'admin@mybus.vn'}\n self.set_admin(params)\n end", "title": "" }, { "docid": "58db2837495b6d21119a85cb622dd3d6", "score": "0.6696072", "text": "def correct_user\n @user = User.find(current_user)\n redirect_to(\"/dashboard\",:notice => 'You cannot access this page') unless current_user == @user && current_user.role?(:productmanager)\n end", "title": "" }, { "docid": "0916093ecbba1cbb19a9e7802b90327a", "score": "0.66744846", "text": "def upgrade_to_main_user\n self.is_main_user = true \n self.save \n\n admin_role = Role.find_by_name(USER_ROLE[:admin]) \n self.add_role_if_not_exists(admin_role ) \n end", "title": "" }, { "docid": "5cb44d5870e7fd027b71d12b57f2bc17", "score": "0.6627694", "text": "def buyer_user\n redirect_to(root_url) unless current_user.buyer?\n end", "title": "" }, { "docid": "a7f4dd9b74fe3378e10de45975f8d85d", "score": "0.66046256", "text": "def update\n\n @user = User.find(params[:id])\n # Check if user has permission to update this seller\n if @usertype != \"Guest\" and @usertype != \"Seller\"\n if @usertype == \"Admin\"\n @ownerPrivileges = true\n elsif !@CurrentUser.nil?\n if @CurrentUser.id == @user.id\n @ownerPrivileges = true\n end\n else\n @ownerPrivileges = false\n end\n else\n @ownerPrivileges = false\n end\n\n if @ownerPrivileges\n if updateHelper(@user, user_params)\n respond_to do |formating|\n formating.html { redirect_to @user, greenNotice: \"User updated\"}\n end\n end\n end\n end", "title": "" }, { "docid": "4cd16c2135e24785910eaeb265319e48", "score": "0.66012573", "text": "def admin_user\n\t\t\t#redirect_to(root_url) unless current_user.cadmin?\n\t\t\tunless current_user.admin?\n\t\t\t\tstore_location\n\t\t\t\tflash[:danger] = \"You don't have previlege to create a company. Please update your role.\"\n\t\t\t\tredirect_to current_user\n\t\t\tend\n\t\tend", "title": "" }, { "docid": "20f3597c70294b79858e761966f120e8", "score": "0.6581887", "text": "def assign_protected_stuff(account, user, params)\n if all_ids_look_ok(account, user, params)\n if user.administrator?\n self.salesman_id = params[:salesman_id] if params.key?(:salesman_id)\n else\n # If this guy is not an admin he can only assign offers to himself.\n self.salesman = user\n end\n self.customer_id = params[:customer_id] if params.key?(:customer_id)\n self.status_id = params[:status_id] if params.key?(:status_id)\n end\n end", "title": "" }, { "docid": "eae2199123b5470504d3960d4a1db701", "score": "0.657849", "text": "def set_seller(user = User.current)\n self.seller ||= user\n self.owner ||= self.seller\n end", "title": "" }, { "docid": "cb31325d7a930a5e36d9aaf7ab757d62", "score": "0.6558679", "text": "def set_user\n end", "title": "" }, { "docid": "fd2061b9258e897a9347aa9d85654a8f", "score": "0.6534092", "text": "def change_service_offerer(service_id,user_id)\n service = Service.find(service_id)\n service.user_id = user_id\n service.save\n unless current_user.blank? \n service.activate! \n send_new_service_message(service)\n end\n session[:service_id] = nil\n end", "title": "" }, { "docid": "0640e111fb5649cc052995123ee0c200", "score": "0.6513125", "text": "def correct_user\n redirect_to(root_url) unless current_user.type == \"Manager\" || current_user.admin?\n end", "title": "" }, { "docid": "cf87ceaf2da0185ffdf4d4c42c7ed0ea", "score": "0.6505908", "text": "def update\n @user = User.find(params[:id])\n redirect_to :action => \"index\" and return if current_admin.limited_sales_rep && !current_admin.users.include?(@user)\n @user.write_attributes(params[:user])\n mass_assign_protected_attributes\n @user.updated_by = current_admin.email\n @user.email.downcase!\n respond_to do |format|\n if @user.save\n format.html { redirect_to(admin_users_url, :notice => 'User was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "17b1888801692c2d4aa4ad089a3236e2", "score": "0.650304", "text": "def correct_user\n @user = Order.find(params[:id]).user\n redirect_to(root_url) unless (current_user?(@user) || current_user.admin?)\n end", "title": "" }, { "docid": "39ca94581ce17f420d8be732f65edf28", "score": "0.64963484", "text": "def upgrade_user\n # TODO\n # pass user references to current_user\n # delete guest_user\n end", "title": "" }, { "docid": "e34bb20620e0d8a3c4afa64914676789", "score": "0.64943695", "text": "def user_only\n if current_user != @product.user\n redirect_to root_url, alert: \"I'm sorry. You can only edit products for which you are the seller.\"\n end\n end", "title": "" }, { "docid": "7fbb6beceddfb66fff555c76c3cca4af", "score": "0.64712477", "text": "def sell_restaurant(restaurant, buyer)\n restaurant.owner = buyer\n end", "title": "" }, { "docid": "990dcf61b44a4f4d8d340633ed34cf35", "score": "0.64640045", "text": "def set_user\r\n @user = User.find(current_user.id)\r\n if admin and params[:id]\r\n @user = User.find(params[:id])\r\n end\r\n end", "title": "" }, { "docid": "a0325cf55dbe2c40c25f7cb8aa279c45", "score": "0.6408226", "text": "def make_admin(user)\n user.admin = true\n user.role_name = 'super_user'\n user.save!\n end", "title": "" }, { "docid": "5ea7eeace96c120e0cd86868900fbde8", "score": "0.6399624", "text": "def correct_user\n redirect_to(root_url) unless (current_user.id == params[:id].try(:to_i) || is_manager?)\n @user = User.find_by(id: params[:id])\n # redirect_to(root_url) unless current_user.admin?\n end", "title": "" }, { "docid": "11816b9c6e7d4b51b1e0f1396a9b581e", "score": "0.6373916", "text": "def correct_or_admin_user\n @user = @temp_order_item.temp_order.user\n unless current_user?(@user) || admin_user?\n flash[:danger] = \"Uncorrect user.\"\n redirect_to(root_url) \n end\n end", "title": "" }, { "docid": "3ac4a8e340310c6e67ae39a3d1301aef", "score": "0.6369945", "text": "def set_user\n @user = User.find(params[:id])\n if (!current_user.nil?) and (@user != current_user)\n redirect_to users_path, alert: 'No tiene permiso para acceder'\n end\n end", "title": "" }, { "docid": "abb7003843440660d460041e36d6b0d0", "score": "0.63697815", "text": "def correct_user\n @item = current_user.items.find_by_id(params[:id])\n @item = Item.find(params[:id]) if current_user.admin == true\n redirect_to root_url if @item.nil?\n end", "title": "" }, { "docid": "ff1b10c43f3e3d8b73977f644d1e70cb", "score": "0.6367098", "text": "def set_user\n @admin_user = User.find(params[:id])\n end", "title": "" }, { "docid": "a00cd32d15ec1a27d3861a44bbdd08cb", "score": "0.6351945", "text": "def change_user_authority\n \t\t@user = User.find(params[:id])\n \t\tif @user.admin == true\n \t\t\t@user.admin = false\n \t\telse\n \t\t\t@user.admin = true\n \t\tend\n \t\t@user.save\n \t\tredirect_to settings_path\n \tend", "title": "" }, { "docid": "80943657420ba6d6cd5154b3fc019c7c", "score": "0.6350659", "text": "def change_lead_owner\n lead = Lead.where(id: params[:lead_id]).last\n if lead.present? && lead.user_id == current_user.id && current_user.is_manager?\n lead.update_attributes(user_id: params[:user_id])\n end \n redirect_to leads_path\n end", "title": "" }, { "docid": "97df7f04bce03b515e7809fa46b05a6f", "score": "0.63386875", "text": "def set_user_as_virtual_buyer!\n user.roles << Role.find_or_create(\"virtual_buyer\") if virtual? && user.has_role?(\"virtual_buyer\")\n end", "title": "" }, { "docid": "6c5827835343fca03b4b5ef795a8ae25", "score": "0.6319694", "text": "def set_user\n @user = User.find_by_id(params[:id])\n redirect_to admin_users_path if @user.nil?\n end", "title": "" }, { "docid": "da5b46a7a144d5925229aeda616c97b4", "score": "0.63185877", "text": "def make_admin!\n @user = User.find(:id)\n @user.make_admin!\n @user.update\n end", "title": "" }, { "docid": "21952c35f5849d7fd81cb5e91de3cce4", "score": "0.6317383", "text": "def become_user(merchant)\n merchant.becomes!(User) if !merchant.valid_merchant\n end", "title": "" }, { "docid": "4ac58c425f5cc70d286275b2d77cc15b", "score": "0.631366", "text": "def assign_administrator(user_id)\n add_user(user_id, true, true)\n end", "title": "" }, { "docid": "ae23210c7fbd5cc93413365695fc9f03", "score": "0.63084435", "text": "def resell_to_user\n @reservation.update_by_admin = true\n create_reservation_owner\n\n if @reservation.resell_to_user(@owner)\n SegmentAnalytics.sold_resell_booking(@reservation, current_user || current_admin)\n ActivityLog.record_log(:reservation_updated, current_admin.company.id, current_admin, @reservation)\n head :ok\n else\n render json: { errors: { '0' => @reservation.errors.full_messages } }, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "49acdb2637d9f0fa9b2bc1507ff28cfb", "score": "0.63012224", "text": "def switch_admin\n @requester = User.find(session[:user_id])\n @society = Society.find(params[:society_id])\n \n if !@society.has_admin(@requester.id)\n return\n else\n @user = User.find(params[:user_id])\n if @society.has_admin(@user.id)\n @society.delete_admin(@user.id) \n else \n @society.add_admin(@user.id)\n end\n end\n \n end", "title": "" }, { "docid": "5bfb99725c98abf3606f17408cfdb8a0", "score": "0.62936383", "text": "def set_selleradmin\n @selleradmin = Selleradmin.find(params[:id])\n end", "title": "" }, { "docid": "04ce96bbb332110da2dde009d05a28e6", "score": "0.6288698", "text": "def set_admin_user\n @user = User.find(params[:id])\n end", "title": "" }, { "docid": "04ce96bbb332110da2dde009d05a28e6", "score": "0.6288698", "text": "def set_admin_user\n @user = User.find(params[:id])\n end", "title": "" }, { "docid": "04ce96bbb332110da2dde009d05a28e6", "score": "0.6288698", "text": "def set_admin_user\n @user = User.find(params[:id])\n end", "title": "" }, { "docid": "96a7062cd4698d7dc33f6942ea3042fc", "score": "0.6279024", "text": "def set_user\n @user = current_user\n # User.find(params[:picked_bill][:user_id])\n end", "title": "" }, { "docid": "a760d274933db6c523338a917edeb023", "score": "0.62782806", "text": "def correct_user\n\t\tif current_user.allowed?('user') || current_user.allowed?('customer')\n @user = User.find(params[:id])\n if current_user != @user\n\t\t\t\tflash[:alert] = I18n.t(:not_allowed)\n \tredirect_to root_path\n end\n\t\tend\n\tend", "title": "" }, { "docid": "e109c19d1d85f2b92581224e6b64e269", "score": "0.62637466", "text": "def resell_to_user(new_owner)\n return false unless reselling? && recurring? && new_owner.is_a?(User) && new_owner != user\n\n update_attributes(booking_type: 0,\n reselling: false,\n user: new_owner,\n initial_membership_id: membership.id)\n end", "title": "" }, { "docid": "0bce2e4256b358e64334e11c469d727c", "score": "0.6263723", "text": "def cadmin_user\n\t\t\t#redirect_to(root_url) unless current_user.cadmin?\n\t\t\tunless current_user.cadmin?\n\t\t\t\tstore_location\n\t\t\t\tflash[:danger] = \"You don't have previlege to create a company. Please update your role.\"\n\t\t\t\tredirect_to current_user\n\t\t\tend\n\t\tend", "title": "" }, { "docid": "89fa3983ce2aadddbf00292a6bdcf2a3", "score": "0.62585056", "text": "def set_update_user\n logger.info(\"Setting update user.\")\n update_user = current_user\n @claim.update_user = update_user.email\n end", "title": "" }, { "docid": "2bd173f86e62ae73f08fb94f30441bdd", "score": "0.6246232", "text": "def set_admin\n @user = User.find(current_user.id)\n @user.admin=true\n @user.lecturer=false\n @user.save\n redirect_to \"/\", notice: \"You have been updated to an admin\"\n end", "title": "" }, { "docid": "9fa1a68f196b88afcf56bfec0185ce29", "score": "0.62153065", "text": "def switch_to_user\n if current_user != @user\n old_user = current_user\n bypass_sign_in(@user)\n session[:original_admin_user_id] = old_user.id\n end\n redirect_to agents_path\n end", "title": "" }, { "docid": "e2b67834b2960342653c72cb11a55672", "score": "0.62131065", "text": "def seller\n seller = User.find(self.listing.user_id)\n end", "title": "" }, { "docid": "635220bb059160752032725179fad0ac", "score": "0.62040323", "text": "def set_administrator\n @administrator = User.find(params[:id])\n end", "title": "" }, { "docid": "d3b91e3f48b69cf7fa58f3fbab78ac77", "score": "0.6203053", "text": "def set_user\n current_user\n end", "title": "" }, { "docid": "2eaa08809e488755a8fbbcb35ed4127d", "score": "0.6202508", "text": "def correct_user\n set_event\n unless @event.user == current_user || is_admin?\n redirect_to root_path\n end\n end", "title": "" }, { "docid": "0a8e0e8b380174c2b10478a2fd194a30", "score": "0.619967", "text": "def user_seller\n redirect_to root_url unless current_user.seller?\n end", "title": "" }, { "docid": "2fdb377abcfb4c5b27667b19f047c937", "score": "0.6197948", "text": "def grant_manager(user)\n @user = user\n mail(to: @user.email, subject: 'Your have been promoted as Project Manager')\n end", "title": "" }, { "docid": "47f3513764bc8f55099913746043050e", "score": "0.61970484", "text": "def set_user\n @user = Admin.find(params[:id])\n end", "title": "" }, { "docid": "5a0f59a3dc706df0069631f9af17c8a5", "score": "0.61936235", "text": "def set_user\n @user = current_user.empresa.users.find(params[:id])\n end", "title": "" }, { "docid": "df2a3aec069397738b85096395ea28b1", "score": "0.6178538", "text": "def set_user\n if user = current_user\n if user.id != params[:id].to_i && !user.access_for_level?(User.al_admin)\n redirect_to utu_path, alert: 'Nemáte práva měnit data jiných uživatelů'\n end\n end\n\n @user = User.find(params[:id])\n end", "title": "" }, { "docid": "ab7d0a7a40815f6d1ec495d59aeb77be", "score": "0.6175352", "text": "def set_admin_user\n @user = User.find(params[:id])\n end", "title": "" }, { "docid": "ee1bb38e4edd5bd0db651c44c5a76852", "score": "0.6175276", "text": "def set_user\n @user = current_user # only allow current user\n end", "title": "" }, { "docid": "89b35d6e29365d7196e096cdcc9de7da", "score": "0.6170925", "text": "def correct_admin_user\n user = User.find(params[:id])\n admin_user = User.find(1)\n if (current_user != user) and (current_user != admin_user)\n redirect_to users_path\n end\n\n end", "title": "" }, { "docid": "5cb4c807e56db9efca661f2d96deb74d", "score": "0.61677337", "text": "def admin_user\n\t\t\tredirect_to('/kuniri') unless current_user.admin?\n\t\tend", "title": "" }, { "docid": "f89c6922718b96a37b6da0ed839a134f", "score": "0.61638457", "text": "def set_first_user_to_admin\n user = User.first\n if !user.nil?\n if user.id == 1 \n user.update!(roles: \"admin\")\n end\n end\n end", "title": "" }, { "docid": "c3a0ab5169c99796a84705595644eb9d", "score": "0.6160038", "text": "def set_user\n\t @usuario = AdminUser.find(params[:id])\n\t end", "title": "" }, { "docid": "47ce9f01c7fcbbe002b6cb36c83de354", "score": "0.6156621", "text": "def set_user\n @user = current_user.company.users.find(params[:id])\n end", "title": "" }, { "docid": "915ab73e9fe6acc74145bfc5c4348a25", "score": "0.61546564", "text": "def correct_user_or_manager_user\n @user = User.find(params[:id])\n if (current_user && current_user?(@user))\n # Do Nothing\n elsif (current_user && current_user.manager?)\n # Do Nothing\n else\n redirect_to(root_url)\n end\n end", "title": "" }, { "docid": "c8c4255365fe2da7470d1740ed93e956", "score": "0.6153962", "text": "def set_user\n @seminar = User.find(params[:id])\n end", "title": "" }, { "docid": "9a010bf525ac4540af4df805bbc3c03d", "score": "0.6153539", "text": "def updateuser\n # Find a user by their ID number\n @user = User.find(params[:user][:id])\n # Case statement considering the text on the submit button\n case params[:commit]\n # If it reads \"Add Admin\" or \"Remove Admin\"\n when \"Add Admin\", \"Remove Admin\"\n # Togge the boolean value of the admin field\n @user.toggle!(:admin)\n end\n \n # Redirecct the browser to the users page in Housekeepingf\n redirect_to \"/hk/users/#{@user.name}\"\n # End method execution\n return\n end", "title": "" }, { "docid": "cf23bfc39f91f536603cf7eb6c475fa2", "score": "0.6150165", "text": "def advertiser\n\t@ad=User.find(params[:id])\n\tif @ad.update_attributes(@ad.role = \"advertiser\")\n\tflash[:alert]=\"Your account has been upgraded to advertiser account!..\"\n\tredirect_to home_advertiserhome_path\n\tend\n end", "title": "" }, { "docid": "2f1ab5179a7a3f906009a156bea34132", "score": "0.6148766", "text": "def updater\n Ecore::User.first(@updated_by) || Ecore::User.nobody\n end", "title": "" }, { "docid": "53fd32cf490cfd3b09b33376bfd5a19b", "score": "0.61382973", "text": "def set_user\n UserInfo.current_user = current_user\n end", "title": "" }, { "docid": "2b27572d2fbefbe0b6640be7aaed6001", "score": "0.6137206", "text": "def correct_user\n \t\t@user = User.find(params[:id])\n redirect_to(current_user) unless current_user?(@user) || current_user.admin?\n \tend", "title": "" }, { "docid": "2f006f815b371de027c2230c7515e1d6", "score": "0.6127146", "text": "def changeAdmin\n @page_id = \"supramap\"\n @page_title = \"Change Admin\"\n\n if request.post?\n user = User.find(params[:id])\n user.admin = !(user.admin)\n user.save!\n end\n \n redirect_to :action => \"list_users\"\n end", "title": "" }, { "docid": "1850a262689bc81231012555d730c05e", "score": "0.6126276", "text": "def set_user\n @user = current_company.users.find(params[:id])\n rescue ActiveRecord::RecordNotFound\n redirect_to admin_users_path, flash: { error: I18n.t('controllers.not_found', model_name: User.model_name.human) }\n end", "title": "" }, { "docid": "ccc8547c19c8997f956f9dd4799fdb3e", "score": "0.61261296", "text": "def swapUser\n\t\t@iden_user = User.find(session[:id])\n\t\t@user_find = User.find(params[:id])\n\t\tif @iden_user.id != @user_find.id\n\t\t\tredirect_to \"/\"\n\t\t\tflash[:denied] = \"Access denied, I see what you are doing!\"\n\t\telsif @user_find.update(user_change)\n\t\t\tredirect_to \"/land\"\n\t\telse\n\t\t\tredirect_to \"/user/#{@iden_user.id}/edit\"\n\t\t\tflash[:taken_email] = \"Use a different email\"\n\t\tend\n\tend", "title": "" }, { "docid": "973704acc4657c2bfe9199af059ba47d", "score": "0.61183935", "text": "def check_user\n if current_user.type != \"Buyer\"\n redirect_to root_url, :alert => \"Please create a buyer account to view this page\"\n end\n end", "title": "" }, { "docid": "4e225f78e423055ac7cd3e038f16337d", "score": "0.6118125", "text": "def promote\n user = User.find(params[:id])\n user.role = 'admin'\n if user.save!\n redirect_to users_url, notice: 'User was successfully updated.' \n else\n render action: \"index\"\n end\n end", "title": "" }, { "docid": "3c2d1bc39b9b2c1c1a1a3165ccc6978a", "score": "0.61181045", "text": "def setStoreAdmin\n if current_user.admin == Const::MANAGER[:supper_manager]\n @user = User.find(params[:user_id])\n @notice = @user.bindingStoreAdmin(params[:store_id])\n else\n @notice = \"越权操作!\"\n end\n render json:{notice: @notice}\n end", "title": "" }, { "docid": "0f0601c3526af001d9f34578c34a53e3", "score": "0.6112837", "text": "def set_user\n @user = User.find(params[:id])\n add_breadcrumb @user.name, admin_user_path(@user)\n end", "title": "" }, { "docid": "c1425b75f06ca6245ac134da52d8ea96", "score": "0.61096203", "text": "def set_superadmin_user\n @user = User.find(params[:id])\n end", "title": "" }, { "docid": "328ecf61eb35c3643d1c21510b920caa", "score": "0.61062604", "text": "def correct_user\n @user = User.find(params[:id])\n redirect_to(root_path) unless current_user?(@user) or current_user.administrator?\n end", "title": "" }, { "docid": "751d8127ba55f8ec171eee27b7ebcd1c", "score": "0.6106228", "text": "def set_user\n @user = User.find(params[:id])\n unless @logged_in.admin?\n @user.readonly!\n end\n end", "title": "" }, { "docid": "ff22fca330a8cb0f726264d665bda3ca", "score": "0.61058784", "text": "def admin_user\n if current_user.user_type != \"user\"\n redirect_to(root_url)\n end\n end", "title": "" }, { "docid": "ff22fca330a8cb0f726264d665bda3ca", "score": "0.61058784", "text": "def admin_user\n if current_user.user_type != \"user\"\n redirect_to(root_url)\n end\n end", "title": "" }, { "docid": "b46fa4a9b813a1c56570ce0379090ff1", "score": "0.6103314", "text": "def admin_user\n\t\t\tredirect_to current_user unless current_user.admin?\n\t\tend", "title": "" }, { "docid": "6e7bf857dbc75c7f61ed395ff689ebfd", "score": "0.60963535", "text": "def set_user\n @user = current_company.users.find(params[:id])\n end", "title": "" }, { "docid": "6b575726f6dfccda8c8c7bee2d72e1b6", "score": "0.6092501", "text": "def set_user\n @user = current_user.decorate\n end", "title": "" }, { "docid": "96b4c8b2a907d1181f4bc2a6d0a2a295", "score": "0.6086305", "text": "def become_user\n user = User.find_by_id(params[:user_id])\n if user\n logger.info(\"#{current_user.email} is now becoming user: #{user.email}\")\n sign_in(:user, user)\n session[:admin] = true\n end\n redirect_to :action => :users\n end", "title": "" }, { "docid": "6f081f54690152c86111df6234d35654", "score": "0.60836697", "text": "def notice_admins_update\n if !current_user.admin?\n AdminMailer.with(subject: 'Reserva de turno', text: \"#{@reserva.user.nombre_completo} ha actualizado su reserva del Club.\", link: reserva_url(@reserva)).email_notificacion.deliver_later\n elsif @por_aprobar && @reserva.aprobado\n AdminMailer.with(to: @reserva.user.email, subject: 'Turno aprobado', text: \"#{current_user.nombre_completo} ha aprobado tu reserva en el Club.\", link: reserva_url(@reserva)).email_notificacion.deliver_later\n end\n end", "title": "" }, { "docid": "25aaf12119a0784f7512bc1bb232f62d", "score": "0.60787976", "text": "def block_user\n\n user = User.find(params[:id]) rescue nil\n\n if !user.nil?\n role = User.current.user_role.role.role.strip rescue nil\n if ((role.downcase.match(/Administrator/i) rescue false) ? true : false)\n user.update_attributes(active: false,\n :un_or_block_reason => params[:reason])\n end\n end\n\n redirect_to \"/view_users\" and return\n\n end", "title": "" }, { "docid": "d648f1345f017a7625864e1482e0d24f", "score": "0.60779095", "text": "def assign_role_to_user\n self.users.first.make_account_holder(false)\n end", "title": "" }, { "docid": "059c375591253545a0e86196078453f5", "score": "0.6068128", "text": "def correct_user\n @member = User.find(current_user.id)\n redirect_to(root_url) unless current_user?(@member) || current_user.type == 'Manager'\n end", "title": "" }, { "docid": "5e2877b9d4079da263f67646ff68099d", "score": "0.6063624", "text": "def set_user\r\n @user = current_user\r\n end", "title": "" }, { "docid": "b732934ac38756300c9b371985aaaeea", "score": "0.6060794", "text": "def change_admin\n if params[:old_admin] && params[:user_id]\n unless params[:old_admin] == params[:user_id]\n #delete old admin\n old_admin = User.find(params[:old_admin])\n old_admin.update_attribute(:admin, false)\n\n #create new admin\n new_admin = User.find(params[:user_id])\n new_admin.update_attribute(:admin, true)\n\n flash[:notice] = \"Your admin priviliges has been changed. You can access your account as a normal user\"\n redirect_to root_path\n else\n flash[:error] = \"You are already an Admin. Choose another user\"\n redirect_to users_path\n end \n end\n end", "title": "" }, { "docid": "bcf57cf506c5f79685fbe6a1e0cf4f2d", "score": "0.60598975", "text": "def correct_user\n @user = Author.find(params[:id])\n unless is_admin?\n redirect_to(root_url) unless current_user?(@user)\n end\n end", "title": "" }, { "docid": "b9c9739ef9f0786938bf417e56aa12d2", "score": "0.60572153", "text": "def set_user\n\t @user = Admin::User.find(params[:id])\n\t end", "title": "" }, { "docid": "a04ac9ec85cb743e93f04a9ac6534aae", "score": "0.6055711", "text": "def set_admin\n \t\tif(current_user.admin)\n\t\t\t@user = User.find(params[:id]) #.update(params[:profile.first_name => \"ADMIN HAHA\"])\n\t\t\tif(@user.admin)\n\t\t\t\t@user.update_attributes(admin: false)\n\t\t\t\tflash[:error] = \"User Set As Non-Admin.\"\n\t\t\telse\n\t\t\t\t@user.update_attributes(admin: true)\n\t\t\t\tflash[:error] = \"User Set As Admin.\"\n\t\t\tend\n\t\t\t#@user.profile.first_name = \"ADMIN\"\n\t\t\n\t\t\t\n\t \tredirect_to users_url\n\t else\n\t \tif(current_user)\n\t\t\t\tredirect_to \"/dashboard\"\n\t\t\telse\n\t\t\t\tredirect_to \"/home\"\n\t\t\tend\n\t\tend\n\n\tend", "title": "" }, { "docid": "8a1aa10b347f320cfab16ec588462427", "score": "0.6055331", "text": "def set_user\n @user = current_user\n end", "title": "" }, { "docid": "041c181cba49207df4e3154d3a561dcf", "score": "0.60545", "text": "def correct_user\n\t\tunless current_user == @univers.user\n\t\t\tflash[:danger] = \"You have no power there\"\n\t\t\tredirect_to universes_path\n end\n end", "title": "" }, { "docid": "041c181cba49207df4e3154d3a561dcf", "score": "0.60545", "text": "def correct_user\n\t\tunless current_user == @univers.user\n\t\t\tflash[:danger] = \"You have no power there\"\n\t\t\tredirect_to universes_path\n end\n end", "title": "" } ]
3ce35a22fbd9401d268a5d08c2c8d1a7
PUT /historial_odcs/1 PUT /historial_odcs/1.json
[ { "docid": "5fd47626cab4dac5d1f311f2752aa464", "score": "0.7588087", "text": "def update\n @historial_odc = HistorialOdc.find(params[:id])\n\n respond_to do |format|\n if @historial_odc.update_attributes(params[:historial_odc])\n format.html { redirect_to @historial_odc, notice: 'Historial odc was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @historial_odc.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
[ { "docid": "7ecfb6a10cb05cdbce35618bca165a94", "score": "0.6763134", "text": "def update\n @historial_oct = HistorialOct.find(params[:id])\n\n respond_to do |format|\n if @historial_oct.update_attributes(params[:historial_oct])\n format.html { redirect_to @historial_oct, notice: 'Historial oct was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @historial_oct.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "35d5ba0d576a263c242d3cd212900c7a", "score": "0.6605144", "text": "def create\n @historial_odc = HistorialOdc.new(params[:historial_odc])\n\n respond_to do |format|\n if @historial_odc.save\n format.html { redirect_to @historial_odc, notice: 'Historial odc was successfully created.' }\n format.json { render json: @historial_odc, status: :created, location: @historial_odc }\n else\n format.html { render action: \"new\" }\n format.json { render json: @historial_odc.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "584a16de2a88ceb483c06c389833be60", "score": "0.65047765", "text": "def update\n @observacao_historico = ObservacaoHistorico.find(params[:id])\n\n respond_to do |format|\n if @observacao_historico.update_attributes(params[:observacao_historico])\n flash[:notice] = 'ObservacaoHistorico was successfully updated.'\n format.html { redirect_to(@observacao_historico) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @observacao_historico.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "226252c61d1d3b737f6e08de7fee222d", "score": "0.6486571", "text": "def update\n respond_to do |format|\n if @historial_estado_dc.update(historial_estado_dc_params)\n format.html { redirect_to @historial_estado_dc, notice: 'Historial estado dc was successfully updated.' }\n format.json { render :show, status: :ok, location: @historial_estado_dc }\n else\n format.html { render :edit }\n format.json { render json: @historial_estado_dc.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a9c703c56b31f282d29375485f0af786", "score": "0.642751", "text": "def update\n @cotizacione = Cotizacione.find(params[:id])\n \n \n \n respond_to do |format|\n if @cotizacione.update_attributes(params[:cotizacione])\n \n \n #Actualizar historial\n h = Historial.new\n h.usuario = current_user.nombre.to_s\n h.observacion = \"Ha Actualizado la Cotización - \" + @cotizacione.obsedit\n @cotizacione.obsedit = \"\"\n @cotizacione.historials << h\n @cotizacione.save\n \n format.html { redirect_to(@cotizacione, :notice => 'La Cotización ha sido actualizada correctamente.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @cotizacione.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "704388e99e38a11bc686553443278d84", "score": "0.62903917", "text": "def update\n respond_to do |format|\n if @historial_estado_pedido.update(historial_estado_pedido_params)\n format.html { redirect_to @historial_estado_pedido, notice: 'Historial estado pedido was successfully updated.' }\n format.json { render :show, status: :ok, location: @historial_estado_pedido }\n else\n format.html { render :edit }\n format.json { render json: @historial_estado_pedido.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a16ffa4a46950e906a26d7921fbd3c19", "score": "0.6285704", "text": "def destroy\n @historial_odc = HistorialOdc.find(params[:id])\n @historial_odc.destroy\n\n respond_to do |format|\n format.html { redirect_to historial_odcs_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7d54da82ee7bd901b45d82a160fb4fdb", "score": "0.62846833", "text": "def update\n respond_to do |format|\n if @oc.update(oc_params)\n format.html { redirect_to @oc, notice: 'Oc was successfully updated.' }\n format.json { render :show, status: :ok, location: @oc }\n else\n format.html { render :edit }\n format.json { render json: @oc.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0e8e9b9da29f194eaef134f9d46cc9c2", "score": "0.62823194", "text": "def update\n respond_to do |format|\n if @historico.update(historico_params)\n format.html { redirect_to @historico, notice: 'Historico was successfully updated.' }\n format.json { render :show, status: :ok, location: @historico }\n else\n format.html { render :edit }\n format.json { render json: @historico.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "18068f8b3c4126aea74b9e86c9843d3f", "score": "0.62503576", "text": "def update\n respond_to do |format|\n if @historium.update(historium_params)\n format.html { redirect_to @historium, notice: 'Historia fue actualizada satisfactoriamente.' }\n format.json { render :show, status: :ok, location: @historium }\n else\n format.html { render :edit }\n format.json { render json: @historium.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bd47178075c50bd22ca7eeab72b99b80", "score": "0.6249864", "text": "def update(id, name)\n params = {:id => id, :name => name}\n requires params\n DataSift.request(:POST, 'historics/update', @config, params)\n end", "title": "" }, { "docid": "3d63f93c2fac346c0bb26fbddf5ee982", "score": "0.6234808", "text": "def update\n # respond_to do |format|\n # if @historial.update(historial_params)\n # format.html { redirect_to @historial, notice: 'Historial was successfully updated.' }\n # format.json { render :show, status: :ok, location: @historial }\n # else\n # format.html { render :edit }\n # format.json { render json: @historial.errors, status: :unprocessable_entity }\n # end\n # end\n end", "title": "" }, { "docid": "602a93af5f26c8bd89c020e0f7b65850", "score": "0.62235725", "text": "def update\n respond_to do |format|\n if @historico_laboral.update(historico_laboral_params)\n format.html { redirect_to historico_laborals_url, notice: 'Histórico laboral foi atualizado com sucesso!' }\n format.json { render :show, status: :ok, location: @historico_laboral }\n else\n format.html { render :edit }\n format.json { render json: @historico_laboral.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "96d644b7d80b969fa59d924dd4161367", "score": "0.61769", "text": "def update\n respond_to do |format|\n if @historial_clinico.update(historial_clinico_params)\n format.html { redirect_to @historial_clinico, notice: 'Historial clinico was successfully updated.' }\n format.json { render :show, status: :ok, location: @historial_clinico }\n else\n format.html { render :edit }\n format.json { render json: @historial_clinico.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "359c6d532357378cc48ecba874a9b554", "score": "0.6156677", "text": "def update\n @valor_historico = ValorHistorico.new(valor: @criptomoneda[\"valor_actual\"], token_criptomoneda: @criptomoneda[\"token_criptomoneda\"])\n @valor_historico.save\n respond_to do |format|\n if @criptomoneda.update(criptomoneda_params)\n format.html { redirect_to @criptomoneda, notice: \"Criptomoneda was successfully updated.\" }\n format.json { render :show, status: :ok, location: @criptomoneda }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @criptomoneda.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "882c8317370987b86425c0adbf5bfe8c", "score": "0.6143781", "text": "def update_aos_version(args = {}) \n put(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend", "title": "" }, { "docid": "5adfab8b284d5fbe4bcdc307687d2aa3", "score": "0.61388814", "text": "def update\n @opcion = Opcion.find(params[:id])\n\n if @opcion.update(params[:opcion])\n head :no_content\n else\n render json: @opcion.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "83ec2a2b382e0d0b9bd2997dd38a1c98", "score": "0.61061674", "text": "def update\n respond_to do |format|\n if @historium.update(historium_params)\n format.html { redirect_to formulario_path, notice: 'Historium was successfully updated.' }\n format.json { render :index, status: :ok, location: formulario_path }\n else\n format.html { render :edit }\n format.json { render json: @historium.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1e6da0dba3604a6ec7654c4b73c8fd47", "score": "0.6090715", "text": "def update\n @orgao = Orgao.find(params[:id])\n\n if @orgao.update(orgao_params)\n head :no_content\n else\n render json: @orgao.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "1c4bc8bc4401c76787638bf5d3a9f122", "score": "0.60884774", "text": "def update\n respond_to do |format|\n if @historial_de_compra.update(historial_de_compra_params)\n format.html { redirect_to @historial_de_compra, notice: 'Historial de compra was successfully updated.' }\n format.json { render :show, status: :ok, location: @historial_de_compra }\n else\n format.html { render :edit }\n format.json { render json: @historial_de_compra.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "13b4ececb3bd2ec4670dffd292022e48", "score": "0.6075161", "text": "def update\n respond_to do |format|\n if @climatizador.update(climatizador_params)\n\n @data = Time.at(@climatizador[:updated_at]).to_datetime\n @data_str = \"\\\"data\\\":\" << \"\\\"\" << @data.utc.strftime('%m/%d/%Y %H:%M %p') << \"\\\"\"\n @temperatura_str = \"\\\"temperatura\\\":\" << @climatizador[:temperatura].to_s\n @novo_registro = \"{\" << @data_str << \",\" << @temperatura_str << \"}\"\n\n @historico = @climatizador[:historico]\n @historico = @historico + \",\" + @novo_registro\n \n @climatizador.update_attribute(:historico , @historico)\n\n format.html { redirect_to @climatizador, notice: 'Climatizador was successfully updated.' }\n format.json { render :show, status: :ok, location: @climatizador }\n else\n format.html { render :edit }\n format.json { render json: @climatizador.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "500ecb17098f1e51c15a4b7e2564a85d", "score": "0.6050501", "text": "def update\n respond_to do |format|\n if @company_historic_dividend.update(company_historic_dividend_params)\n format.html { redirect_to @company_historic_dividend.company, notice: 'Company historic dividend was successfully updated.' }\n format.json { render :show, status: :ok, location: @company_historic_dividend }\n else\n format.html { render :edit }\n format.json { render json: @company_historic_dividend.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d949899c291bbe0e53d789ec54cd0573", "score": "0.605018", "text": "def update\n respond_to do |format|\n if @historium.update(historium_params)\n format.html { redirect_to @historium, notice: 'Historium was successfully updated.' }\n format.json { render :show, status: :ok, location: @historium }\n else\n format.html { render :edit }\n format.json { render json: @historium.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "74cac5adda93c6ee84f96bcb708ba322", "score": "0.6045054", "text": "def update\n @historial = Historial.find(params[:id])\n\n respond_to do |format|\n if @historial.update_attributes(params[:historial])\n format.html { redirect_to(@historial, :notice => 'Historial was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @historial.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1da87df3360d2b76697f1399cc56dc93", "score": "0.60427344", "text": "def update\n respond_to do |format|\n if @historia.update(historia_params)\n format.html { redirect_to @historia, notice: 'Historium was successfully updated.' }\n format.json { render :show, status: :ok, location: @historia }\n else\n format.html { render :edit }\n format.json { render json: @historia.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "db84a00efac3ce9cbdc2b41e1810cc15", "score": "0.60261494", "text": "def update\n @observation = Observation.find(params[:id])\n @observation.date = nil\n respond_to do |format|\n if @observation.update_attributes(params[:observation])\n session.delete(:head_of_department_id)\n session.delete(:parallel_id)\n session.delete(:course_id)\n session.delete(:path)\n format.html { redirect_to @observation, notice: 'Hospitace byla úspěšně upravená.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @observation.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2beca73de7eae34b0e4ed805984fbe59", "score": "0.6024448", "text": "def update\n respond_to do |format|\n if @oid.update(oid_params)\n format.html { redirect_to @oid, notice: 'Oid was successfully updated.' }\n format.json { render :show, status: :ok, location: @oid }\n else\n format.html { render :edit }\n format.json { render json: @oid.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b93f522945632fc83ba5b16c56d063f9", "score": "0.6023177", "text": "def update\n @proyecto = Proyecto.find(params[:id])\n @action = \"update\"\n #Actualizar historial\n h = Historia.new\n h.user = current_user.nombre.to_s\n h.action = \"Ha actualizado el Proyecto\"\n @proyecto.historias << h\n \n respond_to do |format|\n if @proyecto.update_attributes(params[:proyecto])\n format.html { redirect_to(@proyecto, :notice => 'Proyecto fue actualizado correctamente.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @proyecto.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "44b3ee34ac480199ee10b92607686f15", "score": "0.6021025", "text": "def update\n @historico = Historico.find(params[:id])\n\n respond_to do |format|\n if @historico.update_attributes(params[:historico])\n format.html { redirect_to(@historico, :notice => t('historicoactualizado')) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @historico.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "29b4261a9fac0fede52b912ea0a85134", "score": "0.6012507", "text": "def update\n respond_to do |format|\n if @oid.update(oid_params)\n format.html { redirect_to @oid, notice: 'Oid was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @oid.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0f7b182154dabf278e40660977861fa7", "score": "0.60072327", "text": "def new\n @historial_odc = HistorialOdc.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @historial_odc }\n end\n end", "title": "" }, { "docid": "0a56e68d60dadafa7373ed43562f3e36", "score": "0.5994381", "text": "def update\n respond_to do |format|\n if @table_ocassion.update(table_ocassion_params)\n format.html { redirect_to @table_ocassion, notice: 'Table ocassion was successfully updated.' }\n format.json { render :show, status: :ok, location: @table_ocassion }\n else\n format.html { render :edit }\n format.json { render json: @table_ocassion.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e521944e2c7cb9f420cf5c1a51b70a68", "score": "0.5989413", "text": "def update\n @pur_hist = PurHist.find(params[:id])\n\n respond_to do |format|\n if @pur_hist.update_attributes(params[:pur_hist])\n format.html { redirect_to @pur_hist, notice: 'Pur hist was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @pur_hist.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0424a648e67bda018066f240fb146cba", "score": "0.59817356", "text": "def update\n respond_to do |format|\n if @observation.update(observation_params)\n format.html { redirect_to outing_path(:id => observation_params[:outing_id]), notice: 'Observation was successfully updated.' }\n format.json { render :show, status: :ok, location: @observation }\n else\n @catalogs = Catalog.order(:catalog).select(:catalog).uniq.map(&:catalog)\n @outing = Outing.find(observation_params[:outing_id])\n format.html { render :edit }\n format.json { render json: @observation.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7bbf735a797eb26fde10790120e00f25", "score": "0.59782743", "text": "def update\n @historial_peso = HistorialPeso.find(params[:id])\n\n respond_to do |format|\n if @historial_peso.update_attributes(params[:historial_peso])\n format.html { redirect_to(@historial_peso, :notice => 'Historial peso was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @historial_peso.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "51b54951653cc1b1d0ff202bd5355f6d", "score": "0.596393", "text": "def update\n respond_to do |format|\n if @occaision.update(occaision_params)\n format.html { redirect_to @occaision, notice: 'Occaision was successfully updated.' }\n format.json { render :show, status: :ok, location: @occaision }\n else\n format.html { render :edit }\n format.json { render json: @occaision.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ce13de0dfab70b1759321b7929cfc496", "score": "0.59621674", "text": "def update\n update_params = params.permit! # FIX-ME: This is highly unsafe\n\n observation = Observation.find(params[:id])\n if observation.update(update_params)\n render json: observation, status: :created\n else\n render json: observation.errors, status: :bad_request\n end\n end", "title": "" }, { "docid": "ce13de0dfab70b1759321b7929cfc496", "score": "0.59621674", "text": "def update\n update_params = params.permit! # FIX-ME: This is highly unsafe\n\n observation = Observation.find(params[:id])\n if observation.update(update_params)\n render json: observation, status: :created\n else\n render json: observation.errors, status: :bad_request\n end\n end", "title": "" }, { "docid": "4e50f0152763c68b31752e86f07e6ee6", "score": "0.5929184", "text": "def update\n @occasion = Occasion.find(params[:id])\n\n respond_to do |format|\n if @occasion.update_attributes(params[:occasion])\n format.html { redirect_to @occasion, notice: 'Occasion was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @occasion.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a162194b7e7e431a6b113067dfcb60e3", "score": "0.59180504", "text": "def update\n @histoire = Histoire.find(params[:id])\n\n respond_to do |format|\n if @histoire.update_attributes(params[:histoire])\n format.html { redirect_to(@histoire, :notice => 'Histoire was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @histoire.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ac7c3712d4f581d4f9203a60fdbdd8f9", "score": "0.59178996", "text": "def show\n @historial_odc = HistorialOdc.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @historial_odc }\n end\n end", "title": "" }, { "docid": "64044564f6689e5fd0674e0df838ffa2", "score": "0.5908233", "text": "def update\n respond_to do |format|\n if @historique.update(historique_params)\n format.html { redirect_to @historique, notice: 'Historique was successfully updated.' }\n format.json { render :show, status: :ok, location: @historique }\n else\n format.html { render :edit }\n format.json { render json: @historique.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1ce1a9f01e720ff73bd692c9a100d273", "score": "0.5872788", "text": "def update\n @lop_mon_hoc = LopMonHoc.find(params[:id])\n\n respond_to do |format|\n if @lop_mon_hoc.update_attributes(params[:lop_mon_hoc]) \n format.json { head :no_content }\n else \n format.json { render json: @lop_mon_hoc.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1f957e8396714ab340b20ef5268dceb0", "score": "0.5872624", "text": "def update\n @diocese = Diocese.find(params[:id])\n\n if @diocese.update(diocese_params)\n head :no_content\n else\n render json: @diocese.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "e88836b4fb75c15707e5a48dc6f5d96c", "score": "0.58694357", "text": "def update\n respond_to do |format|\n if @umidificador.update(umidificador_params)\n\n @data = Time.at(@umidificador[:updated_at]).to_datetime\n @data_str = \"\\\"data\\\":\" << \"\\\"\" << @data.utc.strftime('%m/%d/%Y %H:%M %p') << \"\\\"\"\n @umidate_str = \"\\\"umidade\\\":\" << @umidificador[:umidade].to_s\n @novo_registro = \"{\" << @data_str << \",\" << @umidate_str << \"}\"\n\n @historico = @umidificador[:historico]\n @historico = @historico + \",\" + @novo_registro\n\n @umidificador.update_attribute(:historico , @historico)\n\n format.html { redirect_to @umidificador, notice: 'Umidificador was successfully updated.' }\n format.json { render :show, status: :ok, location: @umidificador }\n else\n format.html { render :edit }\n format.json { render json: @umidificador.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4ff8f71b4f183ac305270d3860dda27f", "score": "0.58533454", "text": "def update\n respond_to do |format|\n if @observation.update(observation_params)\n format.html { redirect_to @observation, notice: 'Observation for the LO was successfully updated.' }\n format.json { render :show, status: :ok, location: @observation }\n else\n format.html { render :edit }\n format.json { render json: @observation.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fa5b5ccccfc0c9e4dee51c2d7e0bff9d", "score": "0.58458257", "text": "def update\n @lop_mon_hoc_sinh_vien = LopMonHocSinhVien.find(params[:id])\n\n respond_to do |format|\n if @lop_mon_hoc_sinh_vien.update_attributes(params[:lop_mon_hoc_sinh_vien]) \n format.json { head :no_content }\n else \n format.json { render json: @lop_mon_hoc_sinh_vien.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9855501eea14ff86cfff2ee1caca1250", "score": "0.58419013", "text": "def create(oc)\r\n header = {\"Content-Type\" => \"application/json\"}\r\n params = {\r\n \"oc\": oc\r\n }\r\n @result = HTTParty.put(PATH, :body => params, :header => header)\r\n case @result.code\r\n when 200\r\n @fact = JSON.parse(@result.response.body)\r\n @fact[\"oc\"] = @fact[\"oc\"][\"_id\"]\r\n @invoice = Invoice.new(@fact)\r\n if @invoice.save then\r\n puts \"Guardada con éxito\"\r\n end\r\n end\r\n #render json: @fact, status: :ok\r\n return @result\r\n end", "title": "" }, { "docid": "6b4f38238523b6b4fafb04e2ab4faab6", "score": "0.5822292", "text": "def update\n respond_to do |format|\n if @historico_equipamento.update(historico_equipamento_params)\n format.html { redirect_to @historico_equipamento, notice: 'Historico equipamento was successfully updated.' }\n format.json { render :show, status: :ok, location: @historico_equipamento }\n else\n format.html { render :edit }\n format.json { render json: @historico_equipamento.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3e6bbcfa145c11de6a1b7a87083f5dd9", "score": "0.58171284", "text": "def update\n respond_to do |format|\n if @odbor.update(odbor_params)\n format.html { redirect_to @odbor, notice: 'Odbor was successfully updated.' }\n format.json { render :show, status: :ok, location: @odbor }\n else\n format.html { render :edit }\n format.json { render json: @odbor.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5639eafb43947b8d3bca07dabd9b8e52", "score": "0.58140457", "text": "def update\n @oferta_periodo = OfertaPeriodo.find(params[:id])\n\n if @oferta_periodo.update(params[:oferta_periodo])\n head :no_content\n else\n render json: @oferta_periodo.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "63a5675b0680149fd76d85ee47d5516a", "score": "0.5799817", "text": "def update\n respond_to do |format|\n if @historia_clinica.update(historia_clinica_params)\n format.html { redirect_to @historia_clinica, notice: 'Historia clinica was successfully updated.' }\n format.json { render :show, status: :ok, location: @historia_clinica }\n else\n format.html { render :edit }\n format.json { render json: @historia_clinica.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ad7d0f7cfc2b85ca3cb32d31e8d3aa90", "score": "0.5794929", "text": "def update\n respond_to do |format|\n if @ocorrencium.update(ocorrencium_params)\n format.html { redirect_to @ocorrencium, notice: 'Ocorrencium was successfully updated.' }\n format.json { render :show, status: :ok, location: @ocorrencium }\n else\n format.html { render :edit }\n format.json { render json: @ocorrencium.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c867af4ca2c09f9990cd96d519ccba2d", "score": "0.57684517", "text": "def update\n @os = Os.find(params[:id])\n\n respond_to do |format|\n if @os.update_attributes(params[:os])\n format.html { redirect_to @os, notice: 'Ordem de Serviço atualizada com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @os.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "acbea3a0a2865f995b012d8d704a2e64", "score": "0.57503283", "text": "def update\n respond_to do |format|\n if @oenologist.update(oenologist_params)\n format.html { redirect_to @oenologist, notice: \"Oenologist was successfully updated.\" }\n format.json { render :show, status: :ok, location: @oenologist }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @oenologist.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "36184abc37b04c199d56c7c8566f3d04", "score": "0.57425493", "text": "def update\n respond_to do |format|\n if @host_historico.update(host_historico_params)\n format.html { redirect_to @host_historico, notice: 'Host historico was successfully updated.' }\n format.json { render :show, status: :ok, location: @host_historico }\n else\n format.html { render :edit }\n format.json { render json: @host_historico.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fb56e9c417cc7a4fc7fe90390b82a503", "score": "0.57425046", "text": "def update\n respond_to do |format|\n if @socio_cnh.update(socio_cnh_params)\n format.html { redirect_to :back }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @socio_cnh.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "81e877652acb294bbb7bc831e88ee9ef", "score": "0.5734187", "text": "def update\n \n @orden_trabajo = OrdenTrabajo.find(params[:id])\n estadoAnterior = @orden_trabajo.estado_odt.Nombre\n respond_to do |format|\n if @orden_trabajo.update_attributes(params[:orden_trabajo])\n\tlog = Log.new(:NombreTable => \"orden_trabajos\", :Fecha => Date.today, :Hora => Time.now, :Usuario => current_user.username, :AccionRealizada => \"Update\")\n\tlog.save\n format.html { redirect_to @orden_trabajo, notice: 'Orden trabajo was successfully updated.' }\n format.json { head :no_content }\n hist = HistorialOdt.new(:orden_trabajo_id => @orden_trabajo.id, :EstadoOdtSiguiente => @orden_trabajo.estado_odt.Nombre, :EstadoOdtAnterior => estadoAnterior, :fecha=> Date.today, :hora => Time.now, :NumRecibo => @orden_trabajo.NumRecibo, :Comentarios => @orden_trabajo.Comentarios)\n hist.save\n else\n format.html { render action: \"edit\" }\n format.json { render json: @orden_trabajo.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "23a83e0b6ece5c42da008b638f8edc47", "score": "0.57187194", "text": "def update\n respond_to do |format|\n if @purchase_historic.update(purchase_historic_params)\n format.html { redirect_to @purchase_historic, notice: 'Venda atualizada com sucesso' }\n format.json { render :show, status: :ok, location: @purchase_historic }\n else\n format.html { render :edit }\n format.json { render json: @purchase_historic.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a48db4f81ff6844fb7dc70fa3b613524", "score": "0.57112354", "text": "def update\n respond_to do |format|\n if @daily_histogram.update(daily_histogram_params)\n format.html { redirect_to @daily_histogram, notice: 'Daily histogram was successfully updated.' }\n format.json { render :show, status: :ok, location: @daily_histogram }\n else\n format.html { render :edit }\n format.json { render json: @daily_histogram.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "16602b92ab43065ba60c5ede0d2b1de6", "score": "0.56894934", "text": "def update\n respond_to do |format|\n if @hourly_histogram.update(hourly_histogram_params)\n format.html { redirect_to @hourly_histogram, notice: 'Hourly histogram was successfully updated.' }\n format.json { render :show, status: :ok, location: @hourly_histogram }\n else\n format.html { render :edit }\n format.json { render json: @hourly_histogram.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "534382439a495f8ef2310392bbfe1ea4", "score": "0.56881464", "text": "def update\n respond_to do |format|\n if @oneroom.update(oneroom_params)\n format.html { redirect_to @oneroom, notice: 'Oneroom was successfully updated.' }\n format.json { render :show, status: :ok, location: @oneroom }\n else\n format.html { render :edit }\n format.json { render json: @oneroom.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "49bbcbf2a8d96b401fc54d5bccc0a206", "score": "0.56860095", "text": "def update\n\t\tauthorize! :update, HistorialEstadoUsuario\n respond_to do |format|\n if @historial_estado_usuario.update(historial_estado_usuario_params)\n\n format.html { redirect_to @historial_estado_usuario, notice: 'Historial estado fue actualizado satisfactoriamente' }\n #format.json { render :show, status: :ok, location: @historial_estado_usuario }\n\n else\n format.html { render :edit }\n format.json { render json: @historial_estado_usuario.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "70cb9aec20c27c7ef59215a53646a5ec", "score": "0.56836677", "text": "def update\n @historia = Historia.find(params[:id])\n\n respond_to do |format|\n if @historia.update_attributes(params[:historia])\n format.html { redirect_to(@historia, :notice => 'Historia was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @historia.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3ab21f932c256a06a51d3d2a6ee6eda5", "score": "0.56809443", "text": "def update\n @periodical = Periodical.find_by_hashed_resource(params[:id])\n\n respond_to do |format|\n if @periodical.update_attributes(params[:periodical])\n format.html { redirect_to @periodical, notice: 'Periodical was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @periodical.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b96f1780e3d6bfcab14727f962d29660", "score": "0.5679369", "text": "def update\n @noc = Noc.find(params[:id])\n\n respond_to do |format|\n if @noc.update_attributes(params[:noc])\n format.html { redirect_to @noc, :notice => 'Noc was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @noc.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d6365a741d5d6dd63fff9b75e214aac1", "score": "0.5678572", "text": "def update\n respond_to do |format|\n if @contatoss.update(contatoss_params)\n format.html { redirect_to @contatoss, notice: 'Contatoss was successfully updated.' }\n format.json { render :show, status: :ok, location: @contatoss }\n else\n format.html { render :edit }\n format.json { render json: @contatoss.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1c35f89f4e93251128bbf53c08021b3d", "score": "0.56731975", "text": "def update\n @company_id = company_params[:company_id]\n @reponse = HTTParty.put(\"https://rails-api-ipo.herokuapp.com/api/v1/companies/#{@company_id}.json\",\n :body => {:company_name => company_params[:company_name]}.to_json,\n :headers => { 'Content-Type' => 'application/json' } )\n respond_to do |format|\n format.html { redirect_to '/companies/'+(@reponse['id'].to_s), notice: 'Company was successfully created.' }\n end\n end", "title": "" }, { "docid": "fdf6ffa51789a3cba415f6d27e8405c3", "score": "0.56664425", "text": "def update\n respond_to do |format|\n if @cycloross.update(cycloross_params)\n format.html { redirect_to admin_cyclorosses_url, notice: 'Cycloross was successfully updated.' }\n format.json { render :show, status: :ok, location: @cycloross }\n else\n format.html { render :edit }\n format.json { render json: @cycloross.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e9f4965bb526d38bb9871572834ae2af", "score": "0.56511766", "text": "def update\n @estado_odt = EstadoOdt.find(params[:id])\n\n respond_to do |format|\n if @estado_odt.update_attributes(params[:estado_odt])\n\tlog = Log.new(:NombreTable => \"estado_odts\", :Fecha => Date.today, :Hora => Time.now, :Usuario => current_user.username, :AccionRealizada => \"Update\")\n\tlog.save\n format.html { redirect_to @estado_odt, notice: 'Estado odt was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @estado_odt.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c37523bf37ba96cdc290143bcb9b9c0a", "score": "0.5648669", "text": "def update\n @condominios = Condominio.find(params[:id])\n\n respond_to do |format|\n if @condominios.update_attributes(params[:condominio])\n format.html { redirect_to @condominios, notice: 'Condominio was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @condominios.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "dbb70a1b371376624dd6d1c4cf0b85f0", "score": "0.5648402", "text": "def update\n respond_to do |format|\n if @ovo.update(ovo_params)\n format.html { redirect_to @ovo, notice: 'Ovo was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @ovo.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e5198e1b9b31fd44e313252ddfcde54c", "score": "0.56426924", "text": "def update\n respond_to do |format|\n if @hod_hod.update(hod_hod_params)\n format.html { redirect_to @hod_hod, notice: 'Hod was successfully updated.' }\n format.json { render :show, status: :ok, location: @hod_hod }\n else\n format.html { render :edit }\n format.json { render json: @hod_hod.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "72316b119cd82d8b4f91d0a15506ea59", "score": "0.5635349", "text": "def update\n respond_to do |format|\n\n unless @company.nil?\n rdf = getJsonld(@company[:content]).to_json\n usdl = getJsonld(@company[:usdl]).to_json\n #puts \"sending to elasticsearch@#{ENV['elastic_search_ip']}\"\n @es_client.index index: 'companies', type: 'rdf', id: @copmany.name, body: rdf\n @es_client.index index: 'companies', type: 'usdl', id: @company.name, body: usdl\n @company.json = rdf\n end\n if @company.update(company_params)\n\n format.html { redirect_to @company, notice: 'Company was successfully updated.' }\n format.json { render :show, status: :ok, location: @company }\n else\n format.html { render :edit }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6fd6cfe2937fec7320dc0d9ea3e06e25", "score": "0.5628335", "text": "def update\n respond_to do |format|\n if @dividend_history.update(dividend_history_params)\n format.html { redirect_to admin_dividend_histories_path, notice: 'Dividend history was successfully updated.' }\n format.json { head :no_content }\n else\n\t format.html { redirect_to admin_dividend_histories_path, flash: { notice: @dividend_history.errors.full_messages } }\n format.json { render json: @dividend_history.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7f635c1899cb622c531ea1e0638c056d", "score": "0.5627925", "text": "def update\n @ot = Ot.find(params[:id])\n\n respond_to do |format|\n if @ot.update_attributes(params[:ot])\n format.html { redirect_to @ot, notice: 'Ot was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @ot.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3874279b24fffb143b547f26f1220495", "score": "0.56193036", "text": "def update\n @ocupacion = Ocupacion.find(params[:id])\n\n respond_to do |format|\n if @ocupacion.update_attributes(params[:ocupacion])\n format.html { redirect_to @ocupacion, notice: 'Ocupacion was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @ocupacion.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "567327a034bb10b006c7a2e0dcaf13e1", "score": "0.5614118", "text": "def update\n respond_to do |format|\n @evento.increment(:version)\n if @evento.update(evento_params)\n format.html { redirect_to @evento, notice: 'El evento se ha actualizado con éxito' }\n format.json { render :show, status: :ok, location: @evento }\n else\n format.html { render :edit }\n format.json { render json: @evento.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4705aa3f7a0a45881e2d19b5a5b233ed", "score": "0.5611089", "text": "def update\n\n respond_to do |format|\n if @observation.update(observation_params)\n format.html { redirect_to @observation, notice: 'Observation was successfully updated.' }\n format.json { render :show, status: :ok, location: @observation }\n else\n format.html { render :edit }\n format.json { render json: @observation.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "696f79bb3e9cb4d016ade4080f8793e9", "score": "0.56089", "text": "def update\n respond_to do |format|\n if @obroty.update(obroty_params)\n format.html { redirect_to @obroty, notice: 'Obroty was successfully updated.' }\n format.json { render :show, status: :ok, location: @obroty }\n else\n format.html { render :edit }\n format.json { render json: @obroty.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f9e3330f700971f0ddd5f30f2bef9683", "score": "0.5603217", "text": "def update\n respond_to do |format|\n if @oui.update(oui_params)\n format.html { redirect_to @oui, notice: 'Oui was successfully updated.' }\n format.json { render :show, status: :ok, location: @oui }\n else\n format.html { render :edit }\n format.json { render json: @oui.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fd8c42e4ee7ed47c28056c94088de014", "score": "0.5599039", "text": "def update\n respond_to do |format|\n if @rh.update(rh_params)\n format.html { redirect_to @rh, notice: 'Rh was successfully updated.' }\n format.json { render :show, status: :ok, location: @rh }\n else\n format.html { render :edit }\n format.json { render json: @rh.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ae352232ff6771879ecf081683b67db9", "score": "0.5598015", "text": "def update\n @soon = Soon.find(params[:id])\n\n respond_to do |format|\n if @soon.update_attributes(params[:soon])\n format.html { redirect_to @soon, notice: 'Soon was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @soon.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1d891e8a336135c42d05ea2a57f69437", "score": "0.5593248", "text": "def update\n @historia = Historia.find(params[:id])\n @historias = Historia.where('meta_id = ?',@historia.meta_id ).paginate(:per_page => 10, :page => params[:page])\n respond_to do |format|\n if @historia.update_attributes(params[:historia])\n format.html { redirect_to @historia, notice: 'La nueva historia ha sido actualizada.' }\n format.js\n else\n format.html { render action: \"edit\" }\n format.js\n end\n end\n end", "title": "" }, { "docid": "9b3105fa4589fa77af9d897358d95e38", "score": "0.55928046", "text": "def update\n @osoba = Osoba.find(params[:id])\n\n respond_to do |format|\n if @osoba.update_attributes(params[:osoba])\n format.html { redirect_to @osoba, notice: t(:updated_notice, :model=>t('activerecord.models.osoba')) }\n #format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n #format.json { render json: @osoba.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9aa6cd805c51a1a6a83ccd241e4fe937", "score": "0.5591743", "text": "def destroy\n @historial_oct = HistorialOct.find(params[:id])\n @historial_oct.destroy\n\n respond_to do |format|\n format.html { redirect_to historial_octs_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "77b8adb360017637deca50c4fd4e9fef", "score": "0.55867124", "text": "def update\n @event = Event.find(params[:id])\n add_terms(params[\"terms-id\"],@event)\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ab19a886f48df238e311b3771917207d", "score": "0.55864143", "text": "def update\n respond_to do |format|\n if @loai_thuoc.update(loai_thuoc_params)\n format.html { redirect_to @loai_thuoc, notice: \"Loai thuoc was successfully updated.\" }\n format.json { render :show, status: :ok, location: @loai_thuoc }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @loai_thuoc.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fd75000e08cff362defb0fc93eff473e", "score": "0.55851895", "text": "def save!\n result = JSON.parse(RestClient.put(uri, raw.to_json))\n \n # update our stats\n raw[\"_id\"] = result[\"id\"]\n raw[\"_rev\"] = result[\"rev\"] \n \n result[\"ok\"]\n end", "title": "" }, { "docid": "bd5be1f14a1f30a5164be95750bbe128", "score": "0.5584659", "text": "def update\n permission_denied and return if current_user.cannot 'update_comision_odt'\n respond_to do |format|\n if @comision_odt.update(comision_odt_params)\n format.html { redirect_to comision_odts_url, success: @comision_odt.table_name_to_show.concat(' fue actualizado satisfactoriamente.') }\n format.json { render :show, status: :ok, location: @comision_odt }\n else\n format.html { render :edit }\n format.json { render json: @comision_odt.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3e03e22e840dc647d640efb8647761d9", "score": "0.558404", "text": "def update\n respond_to do |format|\n if @observation.update(observation_params)\n format.html { redirect_to @observation, notice: 'Observation was successfully updated.' }\n format.json { render :show, status: :ok, location: @observation }\n else\n format.html { render :edit }\n format.json { render json: @observation.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "23cf801fd88d7ddad4de147f3da382dd", "score": "0.5578093", "text": "def update\n @ontology = Ontology.find(params[:id])\n\n respond_to do |format|\n if @ontology.update_attributes(params[:ontology])\n format.html { redirect_to @ontology, notice: 'Ontology was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @ontology.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "add3d5747c86c0b6670c923ca551c50e", "score": "0.5572181", "text": "def update\n\n excursao = Excursao.find params[:id]\n \n if excursao.save excursaos_params\n render status: :no_content, json: {}\n else\n render status: :bad_request, json: excursao.errors.messages\n end\n end", "title": "" }, { "docid": "73cf6f3891b40fbe8b6ce17d7dc85925", "score": "0.5567322", "text": "def create\n @historial_oct = HistorialOct.new(params[:historial_oct])\n\n respond_to do |format|\n if @historial_oct.save\n format.html { redirect_to @historial_oct, notice: 'Historial oct was successfully created.' }\n format.json { render json: @historial_oct, status: :created, location: @historial_oct }\n else\n format.html { render action: \"new\" }\n format.json { render json: @historial_oct.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e0cb0524c563862917c06e36a00e5528", "score": "0.5561328", "text": "def update\n respond_to do |format|\n if @reservation_histroy.update(reservation_histroy_params)\n format.html { redirect_to @reservation_histroy, notice: 'Reservation histroy was successfully updated.' }\n format.json { render :show, status: :ok, location: @reservation_histroy }\n else\n format.html { render :edit }\n format.json { render json: @reservation_histroy.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "060b11249ea8db41b8e7ebae71ce777a", "score": "0.55611324", "text": "def update\n @vehicle_odometer = VehicleOdometer.find(params[:id])\n\n respond_to do |format|\n if @vehicle_odometer.update_attributes(params[:vehicle_odometer])\n format.html { redirect_to @vehicle_odometer, notice: 'Vehicle odometer was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @vehicle_odometer.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ea7bc898cf8e7768954a371ade74d61e", "score": "0.55591017", "text": "def update\n @ontology = Ontology.find(params[:id])\n\n respond_to do |format|\n if @ontology.update_attributes(params[:ontology])\n format.html { redirect_to @ontology, notice: 'Ontology was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :edit }\n format.json { render json: @ontology.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5bf15b9a6482a1a049549c43f8a3af5d", "score": "0.5558849", "text": "def update\n @histogram = Histogram.find(params[:id])\n\n respond_to do |format|\n if @histogram.update_attributes(params[:histogram])\n flash[:notice] = 'Histogram was successfully updated.'\n format.html { redirect_to(@histogram) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @histogram.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9bf2297548ccb97fd9d17c00378ad7ae", "score": "0.5558253", "text": "def update\n @observation = Observation.find(params[:id])\n\n respond_to do |format|\n if @observation.update_attributes(params[:observation])\n format.html { redirect_to(@observation, :notice => 'Observação atualizada com sucesso.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @observation.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "521f16907f78716b42794ddf8ba5707c", "score": "0.5555291", "text": "def update\n respond_to do |format|\n if @observation_detail.update(observation_detail_params)\n format.html { redirect_to @observation_detail, notice: 'Observation detail was successfully updated.' }\n format.json { render :show, status: :ok, location: @observation_detail }\n else\n format.html { render :edit }\n format.json { render json: @observation_detail.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
abf3c7a9952abc180e98145b775586b4
DEPRECATED: this will break if 0 is deleted
[ { "docid": "39c52f7edf410e2521e489176c36f10f", "score": "0.0", "text": "def first? #:nodoc:\r\n\t\tsequence == 1\r\n\tend", "title": "" } ]
[ { "docid": "3b25dc23ee0f403e8c8d2d7ab1aebb54", "score": "0.7308368", "text": "def delete0()\r\n end", "title": "" }, { "docid": "c4bc1f8990a2aad9af3df03ab2ecbad7", "score": "0.6827117", "text": "def delete0()\r\n not_implemented\r\n end", "title": "" }, { "docid": "1ea21c3f5f2bb12dfe4becbbb4e21c8b", "score": "0.6809826", "text": "def delete0()\r\n not_implemented\r\n end", "title": "" }, { "docid": "d7d0310aff15159492558a4da685d5ee", "score": "0.67530835", "text": "def delete0()\r\n # Do nothing.\r\n end", "title": "" }, { "docid": "fc0b8798eef8edb3c5ee4d0d0fb7f827", "score": "0.66932994", "text": "def delete\n 0\n end", "title": "" }, { "docid": "73abea17d5caed114ad2076a0f0804d5", "score": "0.6682817", "text": "def desire()\n\t\treturn 0\n\tend", "title": "" }, { "docid": "a77e6c4af23fd6b3a4a7f5562c0e920d", "score": "0.61565095", "text": "def indel\n 1\n end", "title": "" }, { "docid": "b7af8bdcac40d5bb072bd5528571b783", "score": "0.6114414", "text": "def delete0\r\n abort # :D\r\n end", "title": "" }, { "docid": "bdae7f1451845a364fcb575ce3233cb5", "score": "0.61017066", "text": "def zero?; end", "title": "" }, { "docid": "bdae7f1451845a364fcb575ce3233cb5", "score": "0.61017066", "text": "def zero?; end", "title": "" }, { "docid": "837ab9dc1ce4382da97deb8d18d69687", "score": "0.6094893", "text": "def skip_deletion; end", "title": "" }, { "docid": "b13a5a43975caa4e8c6dfd0755a4f712", "score": "0.60651815", "text": "def delete_count; end", "title": "" }, { "docid": "33132a7eeb29f49226df371b16429bee", "score": "0.6044484", "text": "def leftovers; end", "title": "" }, { "docid": "5ab9e3ba37a69372d93e2a00d9092778", "score": "0.6023853", "text": "def dead\n @removed.size >= 40\n end", "title": "" }, { "docid": "4a1e226a0d3a90e2e5e648065e10cf75", "score": "0.597102", "text": "def deleted; end", "title": "" }, { "docid": "ad8b8cd20e87176d5bb27964fbb6c461", "score": "0.5966332", "text": "def zero?()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "e8dea55334a0b3caee6471a8c8ca1c5f", "score": "0.595663", "text": "def deleted?; end", "title": "" }, { "docid": "e8dea55334a0b3caee6471a8c8ca1c5f", "score": "0.595663", "text": "def deleted?; end", "title": "" }, { "docid": "d7ccfea1325897c2c5697dc7d22c4322", "score": "0.5913658", "text": "def delete\n raise \"bad things\" if @size == 0\n # @storage[@size] = 0\n @size -= 1\n end", "title": "" }, { "docid": "3ed4bc59b2e98a1118a1efa11a660256", "score": "0.5893529", "text": "def delete\n raise \"bad things\" if @size == 0\n # @storage[@size-1] = 0\n @size -= 1\n end", "title": "" }, { "docid": "5f0f3ba694fc274cfbafb2d63c5d750d", "score": "0.58665717", "text": "def -@ int\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "5f0f3ba694fc274cfbafb2d63c5d750d", "score": "0.58665717", "text": "def -@ int\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "c3471cc64c4fe9ce93785d7a63ce4679", "score": "0.58370227", "text": "def deleted?; @deleted end", "title": "" }, { "docid": "456acb6fbbfa8d19490feed3f145af4e", "score": "0.58180606", "text": "def deco_pos; end", "title": "" }, { "docid": "446cc3c5c11d93a85b5592e79f9b9eb4", "score": "0.5783905", "text": "def delete\n # raise some error if @size == 0\n # @storage[@size] = 0 #probs don't need this\n @size -= 1\n end", "title": "" }, { "docid": "c837e5f4a5502105a2e565dcb0c98b32", "score": "0.5778428", "text": "def delete_max\n end", "title": "" }, { "docid": "928d16af40144bee7dda94caf4be3d8d", "score": "0.5735379", "text": "def removed; end", "title": "" }, { "docid": "e7383e5c146a1e11af9f763e97c571a0", "score": "0.5717992", "text": "def removed!; end", "title": "" }, { "docid": "9bd118bea05ff7037768ff8baa9fae05", "score": "0.56919944", "text": "def delete\n raise \"bad things\" if @size == 0\n # @storage[@size] = 0 #don't need this line - it only matters where we think @size is\n #when we add the next number it overrides what we had in the array at that point\n @size -= 1\n end", "title": "" }, { "docid": "1499058ecb492b6e796da52379289125", "score": "0.5681622", "text": "def delete?\n self.balance == 0\n end", "title": "" }, { "docid": "ae22b194002159902a1b5723f92a1810", "score": "0.56549346", "text": "def negative; end", "title": "" }, { "docid": "ae22b194002159902a1b5723f92a1810", "score": "0.56549346", "text": "def negative; end", "title": "" }, { "docid": "ae22b194002159902a1b5723f92a1810", "score": "0.56549346", "text": "def negative; end", "title": "" }, { "docid": "bfcbb63e7203444b9d4cad342d20a6de", "score": "0.56476676", "text": "def delete\n return nil if empty?\n # @storage[@size] = 0\n return @size -= 1\n end", "title": "" }, { "docid": "73068497a6ac43af09c4f919b5de0290", "score": "0.5633495", "text": "def obsolete?; end", "title": "" }, { "docid": "5d3db02d0f7f5a8f9b8280fa76fee674", "score": "0.56265134", "text": "def delete(value)\n return self if value <= 0\n push(Op.new(:delete, value))\n end", "title": "" }, { "docid": "71ea4a4080c37e8c055038712b271e2e", "score": "0.56231093", "text": "def value() 0 end", "title": "" }, { "docid": "2bf4ae38e73bc0a6b38ac81af4220a92", "score": "0.5620509", "text": "def zero?(*) end", "title": "" }, { "docid": "f1bc60dc5f0469dccf129735d7c86be6", "score": "0.56139904", "text": "def delete\n #@storage[@size - 1] = 0 ### THIS IS ACTUALLY OPTIONAL! It won't display and it will overwrite.\n size -= 1\n end", "title": "" }, { "docid": "46ea81effd6198802a65af0de6d93e5a", "score": "0.560898", "text": "def delete=(_arg0); end", "title": "" }, { "docid": "40b0179773adf3d179ab420d95c1cf3c", "score": "0.55974525", "text": "def -@ float\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "7ec562eb35a286836f30786490cc735d", "score": "0.5596704", "text": "def -@ rat\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "4e628b04ffff08e76276cb7115c7e228", "score": "0.5576852", "text": "def delete\n raise \"bad things\" if @size == 0\n # @storage[@size] = 0\n # It doesn't matter what is actually in the array, we care only about the size\n @size -= 1\n end", "title": "" }, { "docid": "38c6d7506922ea7a9dc110a8f91ac9c1", "score": "0.55711126", "text": "def remain; end", "title": "" }, { "docid": "3f3a1f438f7c7344fce1c2d9f2a9f0c3", "score": "0.5568065", "text": "def delete\n # atm we are only deleting last value\n raise \"bad things\" if @size == 0\n # @storage[@size] = 0\n # we don't have to manually reassign the value, it will happen automatically,\n # when we reassign the spont next time we add value\n @size -= 1\n end", "title": "" }, { "docid": "0ef40a9a447167b260db344680984eef", "score": "0.55632895", "text": "def fix_too_many_lonely_zeros_in_rows\n\t\tproblematic_columns = self.get_problematic_columns_per_problematic_row\n\t\tself.zero_fewest_problematic_columns(problematic_columns)\n\tend", "title": "" }, { "docid": "0ef40a9a447167b260db344680984eef", "score": "0.55632895", "text": "def fix_too_many_lonely_zeros_in_rows\n\t\tproblematic_columns = self.get_problematic_columns_per_problematic_row\n\t\tself.zero_fewest_problematic_columns(problematic_columns)\n\tend", "title": "" }, { "docid": "51ab46cd3ed3d2dc6632ac0505166976", "score": "0.55528665", "text": "def delete\n # @storage[@size-1] = 0 # This is not necessary because the size determines which values int he native array mean something\n @size -= 1\n end", "title": "" }, { "docid": "b9a1cd5a3228e8bc02063b710c7c309a", "score": "0.55462843", "text": "def obsolete; end", "title": "" }, { "docid": "0b6aa795232c949a2705c2eb8d16ecca", "score": "0.55455446", "text": "def discard_zeroes_data\n @discard_zeroes_data\n end", "title": "" }, { "docid": "c32fb33c0cae97e56ec4b3ceb70fa7ea", "score": "0.55350363", "text": "def delete(value)\n puts \"not implemented\"\n end", "title": "" }, { "docid": "36aff1d2460a48470942664ba8cf3e09", "score": "0.55345416", "text": "def zero?\n end", "title": "" }, { "docid": "36aff1d2460a48470942664ba8cf3e09", "score": "0.55345416", "text": "def zero?\n end", "title": "" }, { "docid": "296a9145379c7d66638690282c256c86", "score": "0.55293274", "text": "def fix_too_many_lonely_zeros_in_columns\n\t\tproblematic_rows = self.get_problematic_rows_per_problematic_column\n\t\tself.zero_fewest_problematic_rows(problematic_rows)\n\tend", "title": "" }, { "docid": "296a9145379c7d66638690282c256c86", "score": "0.55293274", "text": "def fix_too_many_lonely_zeros_in_columns\n\t\tproblematic_rows = self.get_problematic_rows_per_problematic_column\n\t\tself.zero_fewest_problematic_rows(problematic_rows)\n\tend", "title": "" }, { "docid": "5c9d4ddacd9e8b7704eb537776151aee", "score": "0.5524524", "text": "def deleted?\n false\n end", "title": "" }, { "docid": "6afdccea65606a5378730a1ad58f9298", "score": "0.55170536", "text": "def obsolete=(_arg0); end", "title": "" }, { "docid": "0d3d83d56af5e7a4b49133e92c47d256", "score": "0.55094373", "text": "def delete_backward; end", "title": "" }, { "docid": "5be026ff26b07864c5114307430afb56", "score": "0.55050623", "text": "def zero\n self.current = 0\n end", "title": "" }, { "docid": "285dca64887ee9ea4889776fb285ad4d", "score": "0.55043143", "text": "def none\n 0\n end", "title": "" }, { "docid": "a13bc6244e7d25c942a1edccaf82b62a", "score": "0.54992294", "text": "def delete\n @size -= 1\n # optional to actually zero out this element\n # @delete[@size] = 0\n end", "title": "" }, { "docid": "35b9158a44d50dd895b86e3f02b373dd", "score": "0.54833317", "text": "def deleted_count\n n\n end", "title": "" }, { "docid": "13f9d2086e21357354a49cfffa440ad1", "score": "0.5475466", "text": "def revert_to_free\n end", "title": "" }, { "docid": "4a6bcff2913df1755ac86546fdd160c0", "score": "0.5455798", "text": "def remove_extra_zero(result)\n result.pop if result.last.zero?\n result\n end", "title": "" }, { "docid": "d1b856784af0feb1cac827a81be20c9d", "score": "0.54555345", "text": "def deprecation; end", "title": "" }, { "docid": "7b3a1c0aa81c879518831c23fd95270f", "score": "0.54416275", "text": "def remaining; end", "title": "" }, { "docid": "7b3a1c0aa81c879518831c23fd95270f", "score": "0.54416275", "text": "def remaining; end", "title": "" }, { "docid": "7b3a1c0aa81c879518831c23fd95270f", "score": "0.54416275", "text": "def remaining; end", "title": "" }, { "docid": "7deddc6a39ceb7462e854209c762fbde", "score": "0.5441085", "text": "def delete_at(arg0)\n end", "title": "" }, { "docid": "f9139ad10e0febac9d2bcc6b4c8084bd", "score": "0.54392266", "text": "def unbleed\n @unbleed || 0\n end", "title": "" }, { "docid": "f9139ad10e0febac9d2bcc6b4c8084bd", "score": "0.54392266", "text": "def unbleed\n @unbleed || 0\n end", "title": "" }, { "docid": "1b02cc235ebc141d7492f52a8c0c0324", "score": "0.54383737", "text": "def move_zero(array)\n zero_count = array.count(0)\n array.delete(0)\n zero_count.times do array << 0 end\n print array\nend", "title": "" }, { "docid": "922e93b7a93fcad2c29f565bdce591c1", "score": "0.5426097", "text": "def delete_zeros(array)\n array.delete(0)\n array\nend", "title": "" }, { "docid": "4af44ca7d0e2e7bacc0145d22162a747", "score": "0.54217136", "text": "def deprecated?()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "06e0c6c270120a1ae03e422a88ecad4c", "score": "0.54148114", "text": "def fix_0_issues\n @@conflict_matrix.each do |key,value|\n (6..20).each do |n| \n @@conflict_matrix[key][\"#{n}:30 - #{n+1}:30\"].tr!('0', '') \n end\n end\n end", "title": "" }, { "docid": "7ecd7751086d2e1c9f415b748e318d9b", "score": "0.53991425", "text": "def remove!()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "7ecd7751086d2e1c9f415b748e318d9b", "score": "0.53991425", "text": "def remove!()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "c836f5b81005bb6875f33b05769a6698", "score": "0.53969413", "text": "def negative?()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "c836f5b81005bb6875f33b05769a6698", "score": "0.53969413", "text": "def negative?()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "2b8edda29b7b3177d821dbad7a896abf", "score": "0.53956205", "text": "def delete?; end", "title": "" }, { "docid": "2b8edda29b7b3177d821dbad7a896abf", "score": "0.53956205", "text": "def delete?; end", "title": "" }, { "docid": "2b8edda29b7b3177d821dbad7a896abf", "score": "0.53956205", "text": "def delete?; end", "title": "" }, { "docid": "0c975f570c640be24375f172818745e3", "score": "0.5393463", "text": "def negative?; end", "title": "" }, { "docid": "0c975f570c640be24375f172818745e3", "score": "0.5393463", "text": "def negative?; end", "title": "" }, { "docid": "0c975f570c640be24375f172818745e3", "score": "0.5393463", "text": "def negative?; end", "title": "" }, { "docid": "ebaa4c70fa4cfcc7ed87995eb2a421f3", "score": "0.5387548", "text": "def good_one(idx)\n @bad_nodes.delete idx\n end", "title": "" }, { "docid": "14c1559f3549b0d90e3aa601dedcb72e", "score": "0.53863204", "text": "def mustBeDeleted?()\n return false\n end", "title": "" }, { "docid": "3b17a5b67183ec785f7e001e745ae302", "score": "0.538023", "text": "def deleted\n @deleted ||= false\n end", "title": "" }, { "docid": "1e7443a943ee7a44cb8ee2e385ff0add", "score": "0.53800315", "text": "def on_potential_false_positives; end", "title": "" }, { "docid": "310a00f69888f6ab1a2a7948cdd41f8b", "score": "0.5377266", "text": "def last_deleted; end", "title": "" }, { "docid": "8626976a61dccadffcdbefda3cfabf73", "score": "0.5370936", "text": "def delete_min\n end", "title": "" }, { "docid": "8626976a61dccadffcdbefda3cfabf73", "score": "0.5370936", "text": "def delete_min\n end", "title": "" }, { "docid": "0763a5fc481da9850b7207e5ca8d4ec6", "score": "0.53666955", "text": "def deleted?\n false\n end", "title": "" }, { "docid": "9251e5c708d20fc914073ade29576aef", "score": "0.5362146", "text": "def inverse_updates_counter_cache?; end", "title": "" }, { "docid": "08a7e86eaed55dd87bd3cf0eb5ce27b4", "score": "0.5356839", "text": "def zero!\n set(0, 0)\n self\n end", "title": "" }, { "docid": "7ac7e7f177f8f05df9ab8aabd7cca102", "score": "0.53478193", "text": "def sip \n @size -= 1\n if @size < 0\n @size = 0\n end\n end", "title": "" }, { "docid": "1c869a999c8a54e85672ce0be14833f1", "score": "0.53432333", "text": "def can_be_deleted?\n true\n # removed?\n end", "title": "" }, { "docid": "0de209eaf1738bfeff06bed085854678", "score": "0.5336867", "text": "def old_index; end", "title": "" }, { "docid": "c99decfe5032d9c7ba6e6b1c754c99c6", "score": "0.53282684", "text": "def test_should_consider_negative_number_as_custom\n delete_invoices\n i = Invoice.new(valid_invoice(:unique => -1 ))\n \n assert_equal \"-1\", i.unique\n assert_equal \"name\", i.unique_type \n end", "title": "" }, { "docid": "d9ffd6f41883c8ebfae80dc7587a4562", "score": "0.53251463", "text": "def check_if_deleted\n raise ActiveRecord::ReadOnlyRecord unless deleted?\n end", "title": "" }, { "docid": "f7a3be2a84c712e25b04c8cfbf49cc08", "score": "0.5320045", "text": "def negative=(_arg0); end", "title": "" } ]
e65b92380a9e898ca9c7e148950b66cf
Destroy the descendants of this document
[ { "docid": "d165454fef96516f18d1017689bddada", "score": "0.7586915", "text": "def destroy_descendants\n return if self.descendants.empty?\n tree_search_class.destroy(self.descendants.map(&:_id))\n end", "title": "" } ]
[ { "docid": "79874ec829d3ee50b4dbf20f24326a16", "score": "0.71434736", "text": "def clean_document!\n self.questions.destroy_all\n self.comments.destroy_all\n self.timeline_events().each{|event| event.destroy}\n self.document_items.each{|item| item.timeline_events.destroy_all}\n end", "title": "" }, { "docid": "3ef5ec7ef15be6df13789e444815dcfd", "score": "0.7041271", "text": "def collection_recursive_destroy(c)\n c.children.each do |child_c|\n collection_recursive_destroy(child_c)\n end\n \n #destroy all child documents\n c.documents.each do |d|\n d.destroy\n end\n \n c.destroy\n end", "title": "" }, { "docid": "39bb7e450bf2b98237a892a5a4554a71", "score": "0.6836832", "text": "def destroy_or_remove_from_descendants\n if !!self.tree_destroy_descendants\n destroy_descendants\n else\n remove_from_descendants\n end\n end", "title": "" }, { "docid": "d43e9c26df7f764afcfe194cf8d54d97", "score": "0.6791847", "text": "def remove_from_descendants\n # TODO\n end", "title": "" }, { "docid": "2ea6108afbc8fb3a75a851dacfa06c68", "score": "0.67778254", "text": "def destroy\n super\n\n @children.each do |_child_name, child_group|\n child_group.each(&:destroy)\n end\n\n @children = {}\n end", "title": "" }, { "docid": "ba1ff895dacdb96331fb258e4f84cf2f", "score": "0.67700404", "text": "def recursively_destroy!\n children.each { |c| c.recursively_destroy! }\n destroy\n end", "title": "" }, { "docid": "ad9214de7636cdd2a1a0bee758c16f76", "score": "0.6750451", "text": "def delete_content(nodes)\n nodes.each do |node|\n chapters = node.chapters\n chapters.each do |chapter|\n awsdocuments = chapter.awsdocuments\n awsdocuments.each do |awsdocument|\n awsdocument.destroy\n end\n chapter.destroy\n end\n node.destroy\n end\n end", "title": "" }, { "docid": "5e95e1cd84a896395795523484d9811f", "score": "0.6749605", "text": "def purge!\n Document.delete_all\n end", "title": "" }, { "docid": "1b4a10c8cacd28af1619342a7e41e791", "score": "0.6631516", "text": "def destroy\n @parent = nil\n @root = nil\n end", "title": "" }, { "docid": "ce191d797012de8759615486c259b662", "score": "0.65747523", "text": "def destroy_all\n all.each do |n|\n n.destroy\n end\n end", "title": "" }, { "docid": "be23e1f5fca64fa4af9b6d5764245ff6", "score": "0.64805824", "text": "def destroy_cascade\n self.save\n self.children.each do |child|\n child.destroy_cascade\n end\n self.asset_ws_files.destroy\n self.permissions.destroy\n self.changes.destroy\n self.destroy\n end", "title": "" }, { "docid": "d03f9e169dfefac80d2d14c115c49863", "score": "0.6479857", "text": "def purge\n return nullify unless _association.destructive?\n\n after_remove_error = nil\n criteria.delete_all\n many = _target.clear do |doc|\n execute_callback :before_remove, doc\n unbind_one(doc)\n doc.destroyed = true\n begin\n execute_callback :after_remove, doc\n rescue StandardError => e\n after_remove_error = e\n end\n end\n\n raise after_remove_error if after_remove_error\n\n many\n end", "title": "" }, { "docid": "8d134f925eac964a9235287243bc4f6d", "score": "0.64775777", "text": "def destroy_descendants\n return if right.nil? || left.nil? || skip_before_destroy\n \n if acts_as_nested_set_options[:dependent] == :destroy\n descendants.each do |model|\n model.skip_before_destroy = true\n model.destroy\n end\n else\n base_class.delete_all scoped(left_column_name => { '$gt' => left }, right_column_name => { '$lt' => right })\n end\n \n # update lefts and rights for remaining nodes\n diff = right - left + 1\n base_class.all(scoped(left_column_name => { '$gt' => right })).each do |node|\n node.update_attributes left_column_name => node.left - diff\n end\n base_class.all(scoped(right_column_name => { '$gt' => right })).each do |node|\n node.update_attributes right_column_name => node.right - diff\n end\n \n # Don't allow multiple calls to destroy to corrupt the set\n self.skip_before_destroy = true\n end", "title": "" }, { "docid": "3b42317302ca48461cf225f537a02a36", "score": "0.6330126", "text": "def destroy\n @collection = Collection.find(params[:id])\n \n #destroy all child documents\n @collection.documents.each do |d|\n upload_remove(d) #Removes upload record if file is deleted\n d.destroy\n end\n \n #destroy all child collections\n @collection.collections.each do |c|\n collection_recursive_destroy(c)\n end\n \n @collection.destroy\n\n respond_to do |format|\n format.html { redirect_to collections_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "882e9961b11661c69f5a7c8716cb54b4", "score": "0.63151276", "text": "def remove_all_documents\n\n all_clusters = @cluster_warehouse.all_clusters\n\n all_clusters.each do |cluster|\n cluster.remove_all_documents\n end\n\n @cluster_warehouse.clear_dangling_documnents \n end", "title": "" }, { "docid": "48d601136a676e4c8e0114cc9f7c2531", "score": "0.6311856", "text": "def destroy\n delete_files_and_empty_parent_directories\n end", "title": "" }, { "docid": "c152e1673732decadc5edb2695ba71ec", "score": "0.63117373", "text": "def call\n nodes.each do |node|\n embed = embeds_by_node[node]\n user_has_access = user_access_by_embed[embed]\n\n node.remove unless user_has_access\n end\n\n doc\n end", "title": "" }, { "docid": "befe39077b0947e1ce2fb80fdced2e7f", "score": "0.62807196", "text": "def destroy_with_children\n destroyed_comment_ids = []\n self.descendants.each do |comment|\n comment.destroy\n destroyed_comment_ids << comment.id\n end\n\n self.destroy ? destroyed_comment_ids << self.id : false\n end", "title": "" }, { "docid": "0ad464299ac02282696abadfaec101a2", "score": "0.62662697", "text": "def cleanup\n cleanup_nonces\n cleanup_associations\n end", "title": "" }, { "docid": "8f20ece88a8723dcc996d2600bbc8192", "score": "0.6254979", "text": "def destroy\n @document_part.destroy\n end", "title": "" }, { "docid": "a977d30acba23bef3a26d10bf2b9d497", "score": "0.6254233", "text": "def cascade\n if relation\n if relation.is_a?(Enumerable)\n relation.entries\n relation.each { |doc| doc.destroy }\n else\n relation.destroy\n end\n end\n end", "title": "" }, { "docid": "aeeab0f6d13c8c7a16f29d2393130191", "score": "0.6250081", "text": "def remove\n each { |x| x.parent.children.delete(x) }\n end", "title": "" }, { "docid": "55f32b7138a4d365acb634ddf4ff9616", "score": "0.6246859", "text": "def destroy\n @document.destroy\n end", "title": "" }, { "docid": "1aaae5f1030329229c290ee610f466b0", "score": "0.6242242", "text": "def destroy_scribd_documents\n self.class.scribd_attributes.each do |attribute|\n document = scribd_document_for(self[\"#{attribute}_scribd_id\"])\n\n unless document.nil?\n if document.destroy\n logger.info \"[Scribd_fu] #{Time.now.rfc2822}: Removing Object #{id}##{attribute} successful\"\n else\n logger.info \"[Scribd_fu] #{Time.now.rfc2822}: Removing Object #{id}##{attribute} failed!\"\n end\n end\n end\n end", "title": "" }, { "docid": "83ab0293d9a694d77065f66eb25d608b", "score": "0.62263167", "text": "def destroy_descendants\n return if right.nil? || left.nil? || skip_before_destroy\n\n if acts_as_nested_set_options[:dependent] == :destroy\n descendants.each do |model|\n model.skip_before_destroy = true\n model.destroy\n end\n else\n c = nested_set_scope.where(left_field_name.to_sym.gt => left, right_field_name.to_sym.lt => right)\n scope_class.where(c.selector).delete_all\n end\n\n # update lefts and rights for remaining nodes\n diff = right - left + 1\n\n # scope_class.with(:safe => true).where(\n scope_class.where(\n nested_set_scope.where(left_field_name.to_sym.gt => right).selector\n ).inc(left_field_name => -diff)\n\n # scope_class.with(:safe => true).where(\n scope_class.where(\n nested_set_scope.where(right_field_name.to_sym.gt => right).selector\n ).inc(right_field_name => -diff)\n\n # Don't allow multiple calls to destroy to corrupt the set\n self.skip_before_destroy = true\n end", "title": "" }, { "docid": "98f0268e76f8ea5803574aaf4ff4c4a0", "score": "0.6207164", "text": "def destroy_all\n all.each(&:destroy)\n end", "title": "" }, { "docid": "2bd53222159e582fa07552c873d8d82d", "score": "0.6186811", "text": "def destroy_all\n all.each(&:destroy)\n end", "title": "" }, { "docid": "8bd9c76946cae6b55de60d59f37047d4", "score": "0.61697906", "text": "def destroy\n #primitives in structs are without parent\n parent and parent.children.delete self\n end", "title": "" }, { "docid": "007586da124f84b5eab794d155cc0d96", "score": "0.6166938", "text": "def destroy\n super do\n graph.delete [source.to_term, nil, nil]\n parent.delete [parent, nil, source.to_term]\n end\n end", "title": "" }, { "docid": "3db485c69ce5b50232b11272f359a2cb", "score": "0.6139434", "text": "def delete_all_behaviors!\n @behaviors.each { |beh| beh.parent = nil }\n @behaviors = []\n end", "title": "" }, { "docid": "940353f231fb1717e038433427c81fee", "score": "0.61390257", "text": "def remove_all_documents\n @documents.clear\n\n # setup frequencies\n @frequencies = DocVector.new(@frequencies.length, 0)\n\n # setup occurences\n @occurences = DocVector.new(@occurences.length, 0)\n end", "title": "" }, { "docid": "d928c838200c33a0a0768e945b4a0e07", "score": "0.61339045", "text": "def clear!\n @documents = {}\n @attributes = {}\n @lookup_map = nil\n @all_loaded = false\n @all = []\n end", "title": "" }, { "docid": "7d9bcc983bb25010792f99ca4d9a1877", "score": "0.61136526", "text": "def delete_orphaned_documents\n class_ = name.constantize\n\n # Get the document count.\n relation = search\n count = relation.count\n progress = Progress.new(count)\n index = 0\n num_deleted = 0\n\n relation.each_id_in_batches do |id|\n unless class_.exists?(id: to_model_id(id))\n class_.delete_document(id)\n num_deleted += 1\n end\n index += 1\n progress.report(index, \"Deleting orphaned documents\")\n end\n puts \"\\nDeleted #{num_deleted} documents\"\n end", "title": "" }, { "docid": "41ad96ae0ed1fd9e256f5f51a91c6b1a", "score": "0.6112835", "text": "def destroy\n result = database.delete_doc self\n if result['ok']\n self['_rev'] = nil\n self['_id'] = nil\n end\n result['ok']\n end", "title": "" }, { "docid": "bdbd79e318c5edefb26028fbdc0bdce0", "score": "0.6107019", "text": "def remove_all\n @peer.remove_all\n# @children.each { |child| scene.unindex_prop(child) } if scene\n# @children = []\n end", "title": "" }, { "docid": "d1151ad4da3b0f40ed7df226c9ef6835", "score": "0.61036533", "text": "def clear_children!\n @children.clear\n end", "title": "" }, { "docid": "6a4bb117e53762ae689d02c7e83ebe13", "score": "0.6094886", "text": "def destroy_all\n klass.destroy_all(:conditions => selector)\n end", "title": "" }, { "docid": "b938730eda9da270f4e6fe1ad6e025db", "score": "0.6079136", "text": "def delete_all_child_collections()\r\n all_names = get_all_child_collections_names()\r\n all_names.each do |name|\r\n delete_child_collection(name)\r\n end\r\n end", "title": "" }, { "docid": "5957713cd5c1bc2f8b6b105964e65017", "score": "0.6070387", "text": "def destroy_all\n each(&:destroy_all)\n end", "title": "" }, { "docid": "07b91eea5d7e9f6796e9fc57050b5cb9", "score": "0.6064833", "text": "def clear_relations\n each_event { |ev| ev.clear_relations }\n\t super()\n self\n\tend", "title": "" }, { "docid": "0fe38a126c888bde8dbb36902477a8e9", "score": "0.60613525", "text": "def clean_up\n Discussion.where(category_id: self.id).each do |d|\n Reply.where(discussion_id: d.id).destroy_all\n Revision.where(discussion_id: d.id).destroy_all\n d.destroy\n end\n end", "title": "" }, { "docid": "89cd0e79a57b029367cfd9a3354d41b1", "score": "0.6060309", "text": "def cleanup\n self.objectives.destroy_all\n end", "title": "" }, { "docid": "7422abd0c230e3f020ed3e0bbf01258b", "score": "0.60539836", "text": "def destroy\n @descendant.destroy\n respond_to do |format|\n format.html { redirect_to descendants_url, notice: 'Descendant was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6639fbb28e18f33311763567c3841282", "score": "0.60470426", "text": "def ref_cleanup(xmldoc)\n xmldoc.xpath(\"//p/ref\").each do |r|\n parent = r.parent\n parent.previous = r.remove\n end\n end", "title": "" }, { "docid": "989bff8e4ee655c69fb37d6e467d7a21", "score": "0.6035524", "text": "def delete_all\n target.clear\n end", "title": "" }, { "docid": "ca998c4de7f847af3ab5dfdb2f9d9b09", "score": "0.6032705", "text": "def batch_clear(docs)\n pre_process_batch_remove(docs, :delete)\n unless docs.empty?\n collection.find(selector).update_one(\n positionally(selector, \"$unset\" => { path => true }),\n session: _session\n )\n # This solves the case in which a user sets, clears and resets an\n # embedded document. Previously, since the embedded document was\n # already marked not a \"new_record\", it wouldn't be persisted to\n # the second time. This change fixes that and allows it to be persisted.\n docs.each { |doc| doc.new_record = true }\n post_process_batch_remove(docs, :delete)\n end\n _unscoped.clear\n end", "title": "" }, { "docid": "fc328efa40f80ec0be09b4b8228616b8", "score": "0.6032536", "text": "def delete_content_paths\n\n # Delete all the paths with the ancestor as the current id\n ContentPath.delete_all(:ancestor => self.id)\n\n # Delete all the paths with the descendant as the current id\n ContentPath.delete_all(:descendant => self.id)\n end", "title": "" }, { "docid": "ddf265be88c1108e092898e0ab7ba56c", "score": "0.6015131", "text": "def destroy(document)\n document.destroy\n end", "title": "" }, { "docid": "12afd73bdba69d21b703e56a6ca09200", "score": "0.6009708", "text": "def safe_destroy\n if self.is_root? && self.original_post?\n Comment.transaction do\n self.descendants.each{|c| c.destroy }\n end\n self.destroy\n else\n self.update_attribute('deleted', true)\n end\n end", "title": "" }, { "docid": "2d12607f0059fd4aee914c4b63589706", "score": "0.60024214", "text": "def destroy_ancestors\n parent = self.parent\n self.destroy\n if parent and parent.children.first.blank?\n parent.destroy_ancestors\n end\n end", "title": "" }, { "docid": "6c0e3b007f9bf21ebfe6f91113c187c4", "score": "0.5984165", "text": "def cleanup_relationships\n @involved_relationships = self.relationships\n @iterations = @involved_relationships.length\n @iterations.times do |i|\n @involved_relationships[i].destroy\n end\n end", "title": "" }, { "docid": "6bce0be1a211dd45e1185c7e44a7a7c0", "score": "0.59795696", "text": "def destroy_tree_from_leaves\n self.subdirectories.each do |subdirectory|\n subdirectory.destroy_tree_from_leaves\n end\n self.subdirectories.reload\n self.cfs_files.each do |cfs_file|\n cfs_file.destroy!\n end\n self.cfs_files.reload\n self.destroy!\n end", "title": "" }, { "docid": "2c3d8dacae2c6fc0bb4e63d836b6e8eb", "score": "0.59766567", "text": "def destroy(bulk = false)\n raise ArgumentError, \"doc.database required to destroy\" unless database\n result = database.delete_doc(self, bulk)\n if result['ok']\n self['_rev'] = nil\n self['_id'] = nil\n end\n result['ok']\n end", "title": "" }, { "docid": "a47c704575d2e269ed9582e7415c97c2", "score": "0.5961925", "text": "def destroy(bulk=false)\n caught = catch(:halt) do\n _run_destroy_callbacks do\n result = database.delete_doc(self, bulk)\n if result['ok']\n self.delete('_rev')\n self.delete('_id')\n end\n result['ok']\n end\n end\n end", "title": "" }, { "docid": "41c506eae11e106bbe6d92929e56c0dc", "score": "0.5955861", "text": "def destroy\n @paper.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "a0c8933eaf448536048c086622211fd1", "score": "0.59411126", "text": "def destroy_and_child\n materials.each do |material|\n material.destroy\n end\n measures.each do |measure|\n measure.destroy\n end\n destroy\n end", "title": "" }, { "docid": "f9c3e71bc45952ca19df91b986d51062", "score": "0.59335864", "text": "def delete_all\n self.destroy\n end", "title": "" }, { "docid": "bde0aea5e9a66a9a220a8fe3b71241ce", "score": "0.5930268", "text": "def destroy_associations\n end", "title": "" }, { "docid": "76d83fc9c8d1c5e399dd08d81c58720c", "score": "0.5915719", "text": "def cascade_destroy\n ltree_scope.where(\"#{self.class.table_name}.#{ltree_path_column} <@ ?\", ltree_path_in_database).destroy_all\n end", "title": "" }, { "docid": "db2500a85860b50792a88fcc93a713e6", "score": "0.59135306", "text": "def complete_removal(manual_record)\n document_ids = document_ids_for(manual_record)\n\n document_ids.each do |id|\n SpecialistDocumentEdition.where(document_id: id).map(&:destroy)\n end\n\n manual_record.destroy\n\n log \"Manual destroyed.\"\n log \"--------------------------------------------------------\"\n end", "title": "" }, { "docid": "289e6d2ddb249c0f9a74a908fcfb562e", "score": "0.59128493", "text": "def delete_all(xpath); end", "title": "" }, { "docid": "09dbb8a91e26f3c3b5b9eef8266d68d9", "score": "0.58953136", "text": "def purge\n self.files.each do |f|\n f.destroy\n end\n self.commits.each do |c|\n c.destroy\n end\n end", "title": "" }, { "docid": "4904da4144c7e84774407f503c81bdac", "score": "0.58942413", "text": "def destroy_dependents\n self.clouds.each do |cloud| cloud.destroy end\n self.groups.each do |group| group.destroy end\n self.roles.each do |role| role.destroy end\n self.recipes.each do |recipe| recipe.destroy end\n self.questions.each do |question| question.destroy end\n end", "title": "" }, { "docid": "fbd4af1d59bd203611ee4e0cd9328945", "score": "0.5892673", "text": "def purge_nested_form\n self.target_hostnames.find_all{|r| r.marked_for_destruction?}.each do |c|\n c.delete\n end\n end", "title": "" }, { "docid": "f13bc8f3f0c9b0eb68bece16f52d1d7b", "score": "0.5885351", "text": "def cleanup\n filenames = [\"book.opf\", \"toc.html\"]\n filenames += @chapters\n \n filenames.each do |filename|\n File.delete(filename)\n end\n end", "title": "" }, { "docid": "9080e83a235a6e8572953c9eb073a617", "score": "0.5879714", "text": "def nuke\n self.open_graph_event.destroy unless self.open_graph_event.nil?\n self.teamsheet_entries.destroy_all\n self.messages.destroy_all\n self.activity_items.destroy_all\n self.result.destroy unless self.result.nil?\n self.destroy\n end", "title": "" }, { "docid": "440e4e76784e7c015dde9405a51c8f3f", "score": "0.5876617", "text": "def teardown\n @root.remove!(@left_child1)\n @root.remove!(@right_child1)\n @root = nil\n end", "title": "" }, { "docid": "ced7ef178fd73e9eb151997a70f8b2c2", "score": "0.58710605", "text": "def delete_all_specs_and_notes(obj = nil)\n obj = self if obj.nil?\n obj.delete_all_specs\n obj.delete_all_notes\n obj.delete_all_exhibits\n obj.children.each do |_name, child|\n next unless child.has_specs?\n\n delete_all_specs_and_notes(child)\n end\n end", "title": "" }, { "docid": "565221158151ae0bf9bd94c0a6a5fbc6", "score": "0.5864468", "text": "def delete(model)\n @ancestors.delete(model) if @ancestors\n @descendants.delete(model)\n end", "title": "" }, { "docid": "9de940de1e3f2185d16ff0fa83b93a65", "score": "0.58577144", "text": "def delete_tree\n @root = nil # In ruby it will be taken care by garbage collector\n end", "title": "" }, { "docid": "a885d17c43ee62a422f0289ea229aa72", "score": "0.58538115", "text": "def destroy_relations\n begin\n File.delete FRIENDS_IDS_PATH + self.twitter_id.to_s\n File.delete FOLLOWER_IDS_PATH + self.twitter_ids.to_s\n rescue\n puts \"Didnt find the corresponding files.\"\n end \n end", "title": "" }, { "docid": "4ec1f0e9821bba832ef24bb3a0c55f51", "score": "0.5848681", "text": "def destroy_children()\n # self.children.each do |c|\n # class_const = Service.class_map[c.service_id]\n # raise NoClassError.new(\"Pas de classe rattachée au service=#{c.service_id}\") if class_const.nil?\n # child = class_const[c.id]\n # child.destroy()\n # end\n end", "title": "" }, { "docid": "0ef2a348341832633a6995433c4a981a", "score": "0.5836132", "text": "def clear_garbage\n self.tmp_garbage.each do |relation, record|\n if record.is_a? Array\n record.each { |r| r.destroy }\n else\n record.destroy\n end\n end if self.tmp_garbage.present?\n self.tmp_garbage = {}\n end", "title": "" }, { "docid": "ee586584592f4f6fe38861d0399a63a0", "score": "0.58348393", "text": "def delete\n extract.children.to_a.each(&:extract)\n end", "title": "" }, { "docid": "4c78765038a0a41eb1b73eb5e5c0060d", "score": "0.58343685", "text": "def clear_docs\n result = @client[DOCUMENTS_COLLECTION].delete_many({})\n result.n\n ensure\n @last_result = result\n end", "title": "" }, { "docid": "f85f9ffae521d5222a083b9ebef77232", "score": "0.5828434", "text": "def destroy\n # remove this model from the model tree\n parent.try(:remove_descendant, self)\n mixins.each {|mixin| mixin.remove_descendant(self)}\n \n # destroy model subclasses, and all record instances\n children.each(&:destroy)\n all.each(&:destroy)\n \n # remove the association between the site and this model\n site.model_types.delete(name.underscore.pluralize)\n site.model_plural_names.delete(name)\n site.save\n \n # remove any remaining indexes\n indexes.each do |name|\n RecordIndex.remove_index_for_model(self, name)\n end\n \n record_fields.each do |name, field|\n RecordIndex.remove_index_for_field(self, field) if field.index?\n end\n \n # destroy the model record\n super\n end", "title": "" }, { "docid": "9be028f6cd4ccb386f48a35c0b0af832", "score": "0.5816887", "text": "def _destroy_document(opts = {})\n destroy_document(opts)\n end", "title": "" }, { "docid": "19bd52b9fef0a6d3f5545c5c6bcb3bf1", "score": "0.58074015", "text": "def destroy\n @document_type.destroy\n end", "title": "" }, { "docid": "c8e1a6fddee51b8ca50f2788335404ac", "score": "0.5806972", "text": "def destroy_associated_objects\r\n # KKL Verlauf\r\n verlaeufe = KKLVerlauf.find(:all, :conditions => [\"KtoNr = ?\", self.KtoNr])\r\n verlaeufe.each do |verlauf|\r\n verlauf.destroy()\r\n end\r\n\r\n # EEKonto\r\n eeKonten = EeKonto.find(:all, :conditions => [\"KtoNr = ?\", self.KtoNr])\r\n eeKonten.each do |ee|\r\n ee.destroy()\r\n end\r\n\r\n # ZEKonto\r\n zeKonten = ZeKonto.find(:all, :conditions => [\"KtoNr = ?\", self.KtoNr])\r\n zeKonten.each do |ze|\r\n ze.destroy()\r\n end\r\n\r\n end", "title": "" }, { "docid": "ba519772a1dfc23af68b0fd1e9ecb70a", "score": "0.58025324", "text": "def cleanup\n @models.reverse_each(&:destroy_all)\n end", "title": "" }, { "docid": "eb8414ebbf25985561b08e5da0cf7c58", "score": "0.5802391", "text": "def destroy_orphan_documents(sport_community)\n AdministrativeDocument.includes(:sport_community_membership).find_all {|scm| scm.sport_community_membership.nil? }.each(&:destroy)\n end", "title": "" }, { "docid": "acf4d0f9efbbd02fd422644e78283fed", "score": "0.58011585", "text": "def delete_all\n @objects.each do |o|\n o.delete \n end\n\n @objects.clear\n end", "title": "" }, { "docid": "70d3c0300cd8967549c53bda063e7775", "score": "0.57968307", "text": "def truncate_all\n Content::Version.all.map(&:destroy)\n ContentKey::Version.all.map(&:destroy)\n Content.all.map(&:destroy)\n ContentKey.all.map(&:destroy)\n end", "title": "" }, { "docid": "58cfdffb55f3ca02afa09542a59a259c", "score": "0.57929444", "text": "def destroy\n @documento = Documento.find(params[:id])\n # Eliminar los registros asociativos de las tablas JOIN \n # para las asociaciones HBTM (has_and_belongs_to_many)\n #\n @documento.reconocimientos.destroy_all\n @documento.areas.destroy_all\n\n @documento.destroy\n\n respond_to do |format|\n format.html { redirect_to documentos_url, :notice => \"#{@documento.titulo} eliminado\" }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7b72801e6ce28d79604920552a6a8bc8", "score": "0.57901496", "text": "def destroy\n final_parent.delete(source.statements)\n\n parent.statements.each do |statement|\n parent.delete_statement(statement) if\n statement.subject == source.rdf_subject || \n statement.object == source.rdf_subject\n end\n\n super { source.clear }\n end", "title": "" }, { "docid": "ef4e0b8211287e1e3915867446562622", "score": "0.5784094", "text": "def finalize\n Pez.destroy_all\n Comida.destroy_all\n Tiburon.destroy_all\n end", "title": "" }, { "docid": "a48aded875835905d9ef43066c21dc49", "score": "0.5783851", "text": "def destroy_all(conditions = nil)\n find_all(conditions).each { |object| object.destroy }\n end", "title": "" }, { "docid": "8d7dfc7057dcea2d1df4c1a14d2daed0", "score": "0.578336", "text": "def remove\n \n \n Document.destroy(self.document_id)\n self.destroy\n \n end", "title": "" }, { "docid": "3583b219d1073608a06727dad4d3dfef", "score": "0.5781951", "text": "def destroy_content_objects\n content_objects.map { |x| x.destroy } \n end", "title": "" }, { "docid": "b974679a04e6e05bb8b6cef2b0cca596", "score": "0.57816064", "text": "def erase\n @nodes.erase\n end", "title": "" }, { "docid": "27e1012893b2532ee9e8dd04f4af8d03", "score": "0.5753839", "text": "def cleanup_relationships\n @involved_relationships = Relationship.where(:cause_id => self.id)\n @iterations = @involved_relationships.length\n @iterations.times do |i|\n @involved_relationships[i].destroy\n end\n end", "title": "" }, { "docid": "edc26098f4ee61ade427d36b1f57ad3e", "score": "0.5753502", "text": "def destroy_all\n objs = target\n source.update_attribute(source_attribute, nil)\n objs.each(&:destroy)\n end", "title": "" }, { "docid": "e2d48df1618ed475a1653fa31ec60a2c", "score": "0.57505643", "text": "def discard_doc!\n links # force parsing of page links before we trash the document\n @doc = @body = nil\n end", "title": "" }, { "docid": "851886bc93f2cc0f1ee607493879e433", "score": "0.57454026", "text": "def delete_orphans\n count = 0\n mapper.dataset.each do |content|\n unless valid_path?(content)\n content.destroy\n count += 1\n end\n end\n @dirty ||= (count > 0)\n count\n end", "title": "" }, { "docid": "93fdcbd276908dccf08e80d7b69c3200", "score": "0.572849", "text": "def destroy\n\t\t# destroy all comments\n\t\t@article = Article.find(params[:id])\n\t\t@article.comments.each do |comment|\n\t\t\tcomment.destroy\n\t\tend\n\n\t\t# destroy all tags associated with this article\n\t\t@article.tags.each do |tag|\n\t\t\tif tag.articles.count - 1 == 0\n\t\t\t\ttag.destroy\n\t\t\tend\n\t\tend\n\n\t\t@article.destroy\n\n\t\tflash.notice = \"Article '#{@article.title}' Deleted!\"\n\t\tredirect_to articles_path\n\tend", "title": "" }, { "docid": "f44bd2221867f05923099f8c5df9e0f7", "score": "0.57115203", "text": "def destroy_documents(engine_name, ids)\n delete(\"engines/#{engine_name}/documents\", ids)\n end", "title": "" }, { "docid": "39ce8b5884dd7b246dbef19418810601", "score": "0.5709996", "text": "def delete_all\n Neo.db.execute_query(\"#{initial_match} OPTIONAL MATCH (n0)-[r]-() DELETE n0,r\")\n end", "title": "" }, { "docid": "b277702aaf9515739ba5545a054f41d7", "score": "0.5708362", "text": "def after_destroy\n super\n self.class.call_es { _destroy_document }\n end", "title": "" }, { "docid": "ba9beb14e19c0ab9dad85a7205680322", "score": "0.569915", "text": "def destroy\n self.littles.each do | little|\n little.big_id = nil;\n end\n self.positions.each do | pos |\n pos.dke_info_id = nil;\n end\n return super\n end", "title": "" }, { "docid": "8c6790fabc6e303b8303ddf3a9d18066", "score": "0.5685469", "text": "def clean_up(*args)\n # Remove all orphan Entries and Products\n SemiStatic::Entry.all{|e| e.destroy if e.tag.nil?}\n SemiStatic::Product.all{|p| p.destroy if p.entry.nil?}\n\n # Get rid of newsletter tags where the actual newsletter has been deleted\n SemiStatic::Tag.select{|t| t.newsletter_id.present? && t.newsletter.nil?}.each{|t| t.destroy}\n\n # There was a bug where some Entry.master_entry_id were not reset to nil, fix these\n SemiStatic::Entry.where.not(:master_entry_id => nil).each{|e| e.master_entry_id = nil; e.save;}\n end", "title": "" } ]
9cd7a9daa00ff1f6fc445708f261a312
Workaround: Affecting Ruby 2.2 Fix for 2.2 is at However, this doesn't work with 2.1. The following should work for both:
[ { "docid": "7cf2091e94b32a5ae7520a4d934b1293", "score": "0.0", "text": "def start(&block)\n @shutdown_pipe = IO.pipe\n shutdown_pipe = @shutdown_pipe\n super(&block)\n end", "title": "" } ]
[ { "docid": "a35a3749fdeb2db1a1a68be381549b20", "score": "0.6057062", "text": "def with_repl_like_sigint; end", "title": "" }, { "docid": "ed463e2299a9d20771e81c540c211a04", "score": "0.57946366", "text": "def process_fix\n super\n end", "title": "" }, { "docid": "8262c478a5e304bf2044de184e9332f1", "score": "0.5774201", "text": "def exec_fix\n super\n end", "title": "" }, { "docid": "a69fab675e897ec532399477d457b7af", "score": "0.5743279", "text": "def patch_version; end", "title": "" }, { "docid": "8496a6d3df45715f412f43eec4066e0d", "score": "0.5721741", "text": "def ignore_method_conflicts=(_arg0); end", "title": "" }, { "docid": "3a084de2b0da8b89505a15f49d809acc", "score": "0.5696893", "text": "def bump_patch_version; end", "title": "" }, { "docid": "451169ce5f006ab94adf436429a26054", "score": "0.5643525", "text": "def suggested_strictness; end", "title": "" }, { "docid": "1f271a16bf906de826c7b3159f400eb6", "score": "0.56026566", "text": "def raise_deprecations; end", "title": "" }, { "docid": "f732bbb968ad01b28d0dd5ad8668c517", "score": "0.5553328", "text": "def version_mismatch_detected\n end", "title": "" }, { "docid": "5f1dd6eb680b5d8da73095bd2c23622f", "score": "0.54817927", "text": "def raise_deprecations=(_arg0); end", "title": "" }, { "docid": "65868f3890b7055ca6fbf5f330690d03", "score": "0.54814154", "text": "def method_731(base); end", "title": "" }, { "docid": "323233d632cf96104fa548b4c1fc10f9", "score": "0.54577047", "text": "def ignore_method_conflicts; end", "title": "" }, { "docid": "20d25a0266da25f3b5f929fd37c2e40c", "score": "0.54514325", "text": "def ruby22!\n require_ruby_version \"~> 2.2\"\n end", "title": "" }, { "docid": "983a5b9de63b609981f45a05ecc2741f", "score": "0.53994864", "text": "def fallbacks=(_arg0); end", "title": "" }, { "docid": "be14eb463669f109841186bf6dddafc7", "score": "0.53853726", "text": "def raise_ruby_19_deprecation_warning!\n return unless Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.0')\n\n require 'ddtrace/patcher'\n\n Datadog::Patcher.do_once(:ruby_19_deprecation_warning) do\n Datadog::Tracer.log.warn(RUBY_19_DEPRECATION_WARNING)\n end\n end", "title": "" }, { "docid": "fd04309f1c3915e5a612a1dee00ba5a9", "score": "0.5372956", "text": "def version_helper=(_arg0); end", "title": "" }, { "docid": "fd04309f1c3915e5a612a1dee00ba5a9", "score": "0.5372956", "text": "def version_helper=(_arg0); end", "title": "" }, { "docid": "fd04309f1c3915e5a612a1dee00ba5a9", "score": "0.5372956", "text": "def version_helper=(_arg0); end", "title": "" }, { "docid": "bbfd47753e80e0080e2d5f15b3ef0bda", "score": "0.53705746", "text": "def patch=(_arg0); end", "title": "" }, { "docid": "2be7566ab772a36b10640c8f6bcf44e1", "score": "0.5359804", "text": "def ruby_version; '2.6.3' end", "title": "" }, { "docid": "8af32bf6b695f6c125abf0a016d18e67", "score": "0.5338074", "text": "def bug\n end", "title": "" }, { "docid": "1ca696592324a9f19fe4f574fb676c9d", "score": "0.5333202", "text": "def fixup_args ()\n\n print \"Using Ruby version: #{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}\\n\"\n\n if $my_base_url[-4..-1] != \"/slm\" && $my_base_url[-5..-1] != \"/slm/\"\n print \"Fixup: Modifing URL from <#{$my_base_url}>\"\n if $my_base_url[-1..-1] == \"/\"\n $my_base_url.concat(\"slm\")\n else\n $my_base_url.concat(\"/slm\")\n end\n print \" to <#{$my_base_url}>\\n\"\n end\nend", "title": "" }, { "docid": "e81f75ce662f68b8a437ebf472fc6ae6", "score": "0.5327222", "text": "def ruby21!\n require_ruby_version \"~> 2.1\"\n end", "title": "" }, { "docid": "5956cac4f6023712b02951002f9fe5bb", "score": "0.52549726", "text": "def treat_reserved_as_conflict=(_arg0); end", "title": "" }, { "docid": "5974710c7460684a07cdc98851889f3a", "score": "0.52401656", "text": "def minimum_strictness; end", "title": "" }, { "docid": "636d2f86ccf6c425b09e1dd476e5cf66", "score": "0.520433", "text": "def bump_minor_version; end", "title": "" }, { "docid": "3ce93b57ee4853b3d6d51561b770d0cd", "score": "0.51941097", "text": "def strict; end", "title": "" }, { "docid": "b02b271f6a52b2b46be1f2779467bc7c", "score": "0.51692265", "text": "def ruby23!\n require_ruby_version \"~> 2.3\"\n end", "title": "" }, { "docid": "3d93296ba98b07a1426cf9a167ef69d9", "score": "0.5157505", "text": "def fix!# {{{\n self.checksum!\n end", "title": "" }, { "docid": "aef5b43d5bb705443e902c1f71b1faa7", "score": "0.51532835", "text": "def bump_major_version; end", "title": "" }, { "docid": "bc658f9936671408e02baa884ac86390", "score": "0.5118029", "text": "def anchored; end", "title": "" }, { "docid": "75b5353fde9db5fe703c4a06ace3f3fc", "score": "0.5113938", "text": "def strict?; end", "title": "" }, { "docid": "5c8517dfcdb628d733746ed8383233b9", "score": "0.51138496", "text": "def fixed_version\n return @fixed_version if defined?(@fixed_version)\n\n @fixed_version = nil\n\n @fixed_version = issue.fixed_version if issue\n end", "title": "" }, { "docid": "a6d2e276d02c66970a03a21e13d8cf37", "score": "0.50957054", "text": "def patch; end", "title": "" }, { "docid": "a6d2e276d02c66970a03a21e13d8cf37", "score": "0.50957054", "text": "def patch; end", "title": "" }, { "docid": "50c4a1577fc9bd57be79754c2c3443ce", "score": "0.5094692", "text": "def wrapped_causes; end", "title": "" }, { "docid": "c88668ef65f1f1d114c50c09b32ed596", "score": "0.5091339", "text": "def old_method\n \"old improved method\"\nend", "title": "" }, { "docid": "07684950591166c8d855b94ecc016f0c", "score": "0.5083157", "text": "def big_bad; end", "title": "" }, { "docid": "841941ad67b35eac8b4817ed0e65dc20", "score": "0.5082219", "text": "def dev_minor() end", "title": "" }, { "docid": "609db37645675eb53f19ac4a6d92cf2e", "score": "0.5072652", "text": "def test_standard_to_rubygems_with_patchlevel\n value_ = ::Versionomy.parse('1.2-3')\n value2_ = value_.convert(:rubygems)\n assert_equal([1, 2, 3, 0, 0, 0, 0, 0], value2_.values_array)\n value_ = ::Versionomy.parse('1.2p3')\n value2_ = value_.convert(:rubygems)\n assert_equal([1, 2, 3, 0, 0, 0, 0, 0], value2_.values_array)\n value_ = ::Versionomy.parse('1.2c')\n value2_ = value_.convert(:rubygems)\n assert_equal([1, 2, 3, 0, 0, 0, 0, 0], value2_.values_array)\n end", "title": "" }, { "docid": "28219f4845bdf73765b4b419e6735d2a", "score": "0.5062362", "text": "def treat_reserved_as_conflict; end", "title": "" }, { "docid": "a377dc8615201855ddb31a7e4f248afc", "score": "0.50463974", "text": "def silence_deprecations; end", "title": "" }, { "docid": "d84760315d5b1f76a765ee566c57f452", "score": "0.5032539", "text": "def broken_method\n this method is broken\nend", "title": "" }, { "docid": "7d27b7470670a4e40a28a12122d4d511", "score": "0.50294864", "text": "def patches\n \"https://gist.github.com/fredrikw/5858168/raw\"\n end", "title": "" }, { "docid": "7aa4e18e028beda416672d0ee5337f8b", "score": "0.50235647", "text": "def merge_conflict?; end", "title": "" }, { "docid": "9c91d2c9618cee228f4dee079db0818d", "score": "0.5016388", "text": "def diff2; end", "title": "" }, { "docid": "34f2be6ca5d5325f4afea2ee94aa8132", "score": "0.5010828", "text": "def __apply_Xcode_12_5_M1_post_install_workaround(installer)\n # NOTE: This fix is still required due to RCT-Folly\n # creating a function with a better name but keeping the\n # previous for backward compatibility\n __fix_double_definition_of_clockid_in_folly()\nend", "title": "" }, { "docid": "beb54803868353141d3d8845e221a704", "score": "0.50090677", "text": "def solution(s)\n # write your code in Ruby 2.2\n r = Reformat.new(s)\n r.reformat\nend", "title": "" }, { "docid": "95a2b097c595268088365f851cf47f9d", "score": "0.5003971", "text": "def before_lint; end", "title": "" }, { "docid": "b9bf468d14a56de84cb1ef69e534e451", "score": "0.50010586", "text": "def target_version=(_arg0); end", "title": "" }, { "docid": "efe88c8a15c3fc389b5520a4ce9ae5be", "score": "0.49986005", "text": "def patchlevel_is_significant?\n !jruby? && Gem::Version.new(self.ruby_version) <= Gem::Version.new(\"2.1\")\n end", "title": "" }, { "docid": "40c006b742951d62ee44fce739f90bc6", "score": "0.499476", "text": "def test_change_alias\n value_ = ::Versionomy.create([1, 8, 7, 'a', 2], :rubygems)\n value_ = value_.change(:minor => 9)\n assert_equal([1, 9, 7, 'a', 2, 0, 0, 0], value_.values_array)\n end", "title": "" }, { "docid": "8fe2ec19f782455c407b6b91ec673be9", "score": "0.49611682", "text": "def my955; end", "title": "" }, { "docid": "1e6438e63598f167225db72510753132", "score": "0.4956172", "text": "def warn(*args)\n # eliminate ruby/gem warnings from output\nend", "title": "" }, { "docid": "220bf9a2c5e7c5fd4e2a7b9528d1bfe7", "score": "0.49551463", "text": "def autofinish=(_arg0); end", "title": "" }, { "docid": "3d53f33ffedc873375810567835ffc34", "score": "0.49539346", "text": "def support\n raise \"Not implemented\"\n end", "title": "" }, { "docid": "e554c413ad3b5d2229689d5218c3a813", "score": "0.49469686", "text": "def awaken!\n\t\traise 'Not implemented'\n\tend", "title": "" }, { "docid": "ef1e4c0cc26e4eec8642a7d74e09c9d1", "score": "0.4945537", "text": "def private; end", "title": "" }, { "docid": "902d8f42b3fcc65e3d372e5103392663", "score": "0.4935764", "text": "def test_bump_alias\n value_ = ::Versionomy.create([1, 9, 2, 'a', 2], :rubygems)\n value_ = value_.bump(:minor)\n assert_equal([1, 10, 0, 0, 0, 0, 0, 0], value_.values_array)\n end", "title": "" }, { "docid": "0ae7d90b3097e8e5f786d3512c4e823f", "score": "0.4933075", "text": "def target_ruby; end", "title": "" }, { "docid": "327c340de475ba06c1c5625b6b501783", "score": "0.49313217", "text": "def strict?; @strict; end", "title": "" }, { "docid": "54fc9f66273e1ce847fc0e1c0f407e73", "score": "0.49274653", "text": "def silence_deprecations=(_arg0); end", "title": "" }, { "docid": "659417475c02d825bd11905a8a76d00e", "score": "0.49228987", "text": "def f8(\n this,\n this: # error: Duplicated argument name `this`\n )\nend", "title": "" }, { "docid": "232df8e3651daeb6383036e03e94078d", "score": "0.49220443", "text": "def hook_solution?(a); end", "title": "" }, { "docid": "d3ab6dd90858f388fb5fce262c1d609d", "score": "0.49182358", "text": "def sharp; accidental; end", "title": "" }, { "docid": "4e7f63d2e8327143b97af38c6fce7a24", "score": "0.49179125", "text": "def original; end", "title": "" }, { "docid": "ade4dba611204a3b53eea23c16827ea9", "score": "0.489788", "text": "def coverage_exceeding_source_warn; end", "title": "" }, { "docid": "cda79fb871f031cbad5aaea1161a7d08", "score": "0.4891342", "text": "def br3ak\n raise RuntimeError, \"OMFG!!1!\"\n end", "title": "" }, { "docid": "cff814ce008f9fc03b80a70f6e646fce", "score": "0.4890947", "text": "def autofinish; end", "title": "" }, { "docid": "979b8c2bd77dc42693ba9a6a03001299", "score": "0.4886597", "text": "def fallbacks; end", "title": "" }, { "docid": "979b8c2bd77dc42693ba9a6a03001299", "score": "0.4886597", "text": "def fallbacks; end", "title": "" }, { "docid": "74802c96688db0d0e0815980316c3005", "score": "0.4880263", "text": "def enocompatproto?() ENOCOMPATPROTO == @error_code; end", "title": "" }, { "docid": "1010a8a55c40720e7437d1bcc0d04978", "score": "0.48782325", "text": "def patch_version\n @version_helper.patch\n end", "title": "" }, { "docid": "1010a8a55c40720e7437d1bcc0d04978", "score": "0.48782325", "text": "def patch_version\n @version_helper.patch\n end", "title": "" }, { "docid": "1010a8a55c40720e7437d1bcc0d04978", "score": "0.48782325", "text": "def patch_version\n @version_helper.patch\n end", "title": "" }, { "docid": "1ac6078b6cc786be7b08ed0c4d098b9c", "score": "0.48587412", "text": "def patches\n { :p0 =>\n \"https://trac.macports.org/export/91404/trunk/dports/sysutils/renameutils/files/patch-use_coreutils.diff\"\n }\n end", "title": "" }, { "docid": "14187174b07e4c51e8d38b1dd3593d4a", "score": "0.48508245", "text": "def macro; raise NotImplementedError; end", "title": "" }, { "docid": "14187174b07e4c51e8d38b1dd3593d4a", "score": "0.48508245", "text": "def macro; raise NotImplementedError; end", "title": "" }, { "docid": "14187174b07e4c51e8d38b1dd3593d4a", "score": "0.48508245", "text": "def macro; raise NotImplementedError; end", "title": "" }, { "docid": "f05674e57c92078bff42a73d03c9a8b4", "score": "0.48496008", "text": "def after_lint; end", "title": "" }, { "docid": "88301958cda92aa51af0754f6efa6165", "score": "0.4841663", "text": "def patch_method_safely(method_added=nil)\n return if PATCHED.include?([signature.owner, signature.to_s])\n return if Patcher.no_trace?\n # klass and method is defined. So patch away\n if signature.klass && signature.target.instance_methods.include?(signature.method.intern)\n PATCHED.add([signature.owner, signature.to_s])\n patch_method\n end\n end", "title": "" }, { "docid": "142f14526bd467680f7cd76497c54642", "score": "0.4831668", "text": "def original_error; end", "title": "" }, { "docid": "142f14526bd467680f7cd76497c54642", "score": "0.4831668", "text": "def original_error; end", "title": "" }, { "docid": "0f51f7dd0eb2803c8e026cc4e0f1bcdb", "score": "0.48261055", "text": "def test_rubygems_to_standard_fail\n value_ = ::Versionomy.parse('1.2.b.3.4.5', :rubygems)\n assert_raises(::Versionomy::Errors::ConversionError) do\n value_.convert(:standard)\n end\n value_ = ::Versionomy.parse('1.2.c.3', :rubygems)\n assert_raises(::Versionomy::Errors::ConversionError) do\n value_.convert(:standard)\n end\n end", "title": "" }, { "docid": "1f8d22e711fb1ce2264f1c35c5a90755", "score": "0.48203287", "text": "def minor=(_arg0); end", "title": "" }, { "docid": "7b350854535417ceaaea7fe7686e1941", "score": "0.48181325", "text": "def is_1_9_or_later?\n \"1.9\".respond_to?(:encoding)\n end", "title": "" }, { "docid": "d83b5f23412b2b42b1974bd21030dc7a", "score": "0.48113", "text": "def fix_common_typos!\n # well, I don't know what kind of typos people do!\n @pattern.squish!\n end", "title": "" }, { "docid": "f19d49ce0413494ded23f68e5224665e", "score": "0.4810799", "text": "def target_version; end", "title": "" }, { "docid": "7ed039d20d6149fc204a2d661008cbed", "score": "0.47901732", "text": "def ruby20!\n require_ruby_version \"~> 2.0\"\n end", "title": "" }, { "docid": "a39416e7bb54346922d6c7268e5e3a94", "score": "0.47897452", "text": "def backtrace_cleaner; end", "title": "" }, { "docid": "c469e8b2f2e5f26d83e2780cb8ebb9b1", "score": "0.47892377", "text": "def fix_signs\n self.offset_flags = Support::EncodingUtils.network_to_host_64(self.offset_flags)\n self.parent_one_rev = self.parent_one_rev.to_signed_32\n self.parent_two_rev = self.parent_two_rev.to_signed_32\n \n self\n end", "title": "" }, { "docid": "dddf17020555afa21c96f1796fd65890", "score": "0.4787543", "text": "def ruby_version\n RUBY_VERSION.gsub(/[^0-9]/,'').to_i\nend", "title": "" }, { "docid": "d87ee4f7472b1609a8bdb6ad978c1627", "score": "0.47841433", "text": "def defined_style_conversions=(_arg0); end", "title": "" }, { "docid": "ea0bbcd53d5171a0a1253878b0ef940a", "score": "0.47816876", "text": "def faint; end", "title": "" }, { "docid": "ea0bbcd53d5171a0a1253878b0ef940a", "score": "0.47816876", "text": "def faint; end", "title": "" }, { "docid": "d27d91c2dcdceaea51bf31126346ed72", "score": "0.47810346", "text": "def ensure_deletion_fixes \n # TO DO\n end", "title": "" }, { "docid": "6e2af39fac048756fab56e4a8fc676b7", "score": "0.47739932", "text": "def monkey_patch\n MonkeyPatches.apply\n log(\"Applied monkey patches\")\nrescue => e\n fatal(\"Failed to apply monkey patches: #{e}\")\n exit\nend", "title": "" }, { "docid": "3dcc18e4f5b39cab9ba4dea317e3a1d7", "score": "0.47733605", "text": "def original_method; end", "title": "" }, { "docid": "8828398c5b5475e8d926af0dbbef6d43", "score": "0.47706908", "text": "def target_mysql_version=(_arg0); end", "title": "" }, { "docid": "4ea6f5c11a3bc16e2394d273e748b292", "score": "0.47704905", "text": "def internal?; end", "title": "" }, { "docid": "fdf6d63efe981b1b2afb9719d43aa511", "score": "0.47693712", "text": "def fixed_versions(advisory, package)\n # Gem files only include fixes for one package, so we can just return all.\n return advisory.fix_versions.split(\"\\n\") if advisory.os_family == 'gem'\n\n # Otherwise, find any fixes where the name and arch match the given package.\n fixed = []\n advisory.fix_versions.split(\"\\n\").each do |fixed_package|\n m = /^(.+)-([^-]+)-([^-]+)\\.(\\w+)\\.rpm$/.match(fixed_package)\n next unless m[1] == package.name\n next unless m[4] == package.arch\n fixed.push(m[2] + '-' + m[3])\n end\n\n fixed\n end", "title": "" } ]
e5406b3f9aa70dd04d606822f8a6bd50
Returns framework environment (i.e. "production", or "staging")
[ { "docid": "8311f824e0dd8b8a9794d3f7df2a1df8", "score": "0.8015503", "text": "def framework_env\n @environment['framework_env']\n end", "title": "" } ]
[ { "docid": "fe63c103a33e8538522a319688df7d0d", "score": "0.8624485", "text": "def environment\n return 'Local' if Rails.env.development?\n\n hostname = `hostname -s`\n return 'Development' if hostname =~ /dev$/\n return 'Staging' if hostname =~ /stage$/\n\n # Otherwise returns nil, indicating production environment\n end", "title": "" }, { "docid": "7c4a436ed157b9cd796371319f7b06ac", "score": "0.8473321", "text": "def environment \n if exists?(:stage)\n stage.to_s\n elsif exists?(:rails_env)\n rails_env.to_s\n elsif(ENV['RAILS_ENV'])\n ENV['RAILS_ENV'].to_s\n else\n \"production\" \n end\nend", "title": "" }, { "docid": "2c7b548e3dc040ae137b1b638991a7d6", "score": "0.8464104", "text": "def environment\n if exists?(:stage)\n stage\n elsif exists(:rails_env)\n rails_env\n elsif(ENV['RAILS_ENV'])\n ENV['RAILS_ENV']\n else\n \"production\"\n end\nend", "title": "" }, { "docid": "a9c744e06ba6c2045f639215c1c1e0e0", "score": "0.84521383", "text": "def environment\n if exists?(:stage)\n stage\n elsif exists?(:rails_env)\n rails_env\n elsif(ENV['RAILS_ENV'])\n ENV['RAILS_ENV']\n else\n \"production\"\n end\nend", "title": "" }, { "docid": "a9c744e06ba6c2045f639215c1c1e0e0", "score": "0.84521383", "text": "def environment\n if exists?(:stage)\n stage\n elsif exists?(:rails_env)\n rails_env\n elsif(ENV['RAILS_ENV'])\n ENV['RAILS_ENV']\n else\n \"production\"\n end\nend", "title": "" }, { "docid": "0baea80e75dd975f635a84887b8e28e2", "score": "0.84296465", "text": "def env\n if @production\n :production\n else\n :test\n end\n end", "title": "" }, { "docid": "b0f7f5242bba74e099058540c4323174", "score": "0.83745986", "text": "def env\n if @production\n :production\n else\n :test\n end\n end", "title": "" }, { "docid": "233edcb06799b164ef155b26a73db842", "score": "0.83274525", "text": "def environment\n if exists?(:stage)\n stage\n else\n # We do not want to run into production by mistake\n \"staging\"\n end\nend", "title": "" }, { "docid": "d6f1b50b35f01e30561c93f226c97027", "score": "0.8150195", "text": "def environment\n # Allow override using \"ENVIRONMENT_BANNER\" environment variable.\n env_var = ENV['ENVIRONMENT_BANNER']\n return nil if !env_var.nil? && env_var.downcase == 'production'\n return env_var if !env_var.blank?\n \n return 'Local' if Rails.env.development?\n \n hostname = `hostname -s`\n return 'Development' if hostname =~ /dev$/\n return 'Staging' if hostname =~ /stage$/\n \n # Otherwise return nil, indicating production\n end", "title": "" }, { "docid": "5cc23227195af973d332e177b730c8e8", "score": "0.8068406", "text": "def environment \n #if exists?(:stage)\n # stage\n #elsif exists?(:rails_env)\n if exists?(:rails_env)\n rails_env \n elsif(ENV['RAILS_ENV'])\n ENV['RAILS_ENV']\n else\n \"production\" \n end\nend", "title": "" }, { "docid": "80b869536a88bf5ec35eb7032ed646b3", "score": "0.80093944", "text": "def environment\n Rails.env\n #\"production\" # uncomment for quick testing.\n end", "title": "" }, { "docid": "e8dff3386148cb47ba18f6a5881ac199", "score": "0.7999056", "text": "def environment # rubocop:disable Metrics/CyclomaticComplexity\n # Allow override using \"ENVIRONMENT_BANNER\" environment variable.\n env_var = ENV['ENVIRONMENT_BANNER']\n return nil if !env_var.nil? && env_var.downcase == 'production' # rubocop:disable Performance/Casecmp\n return env_var if env_var.present?\n\n return 'Local' if Rails.env.development?\n\n hostname = `hostname -s`\n return 'Development' if hostname =~ /dev$/\n return 'Staging' if hostname =~ /stage$/\n\n # Otherwise return nil, indicating production\n end", "title": "" }, { "docid": "0bae4d616c0636db361f47947dd0674c", "score": "0.7907849", "text": "def environment\n (config_file && config[\"environment\"]) || \n case system\n when :ff then 'sandbox_ff'\n when :sani then 'sandbox_sani'\n when :staging then 'staging'\n else 'production'\n end \n end", "title": "" }, { "docid": "00698f46216b59c91449f700825159b1", "score": "0.7795547", "text": "def environment\n environment = 'development'\n\n if ARGV.last.match(/(development|production)/)\n environment = ARGV.last\n end\n \n return environment\nend", "title": "" }, { "docid": "00698f46216b59c91449f700825159b1", "score": "0.7795547", "text": "def environment\n environment = 'development'\n\n if ARGV.last.match(/(development|production)/)\n environment = ARGV.last\n end\n \n return environment\nend", "title": "" }, { "docid": "5431fd3f160d141abfc8c66ebcb8ad2b", "score": "0.7786859", "text": "def environment # rubocop:disable Metrics/MethodLength\n if !fetch(:rails_env).nil?\n fetch(:rails_env)\n elsif !fetch(:rack_env).nil?\n fetch(:rack_env)\n elsif !fetch(:stage).nil?\n fetch(:stage)\n else\n info '---------------------------------------------------------------'\n info '- Stage, rack or rails environment isn\\'t set in -'\n info '- :stage, :rails_env or :rack_env, defaulting to \\'production\\' -'\n info '---------------------------------------------------------------'\n 'production'\n end\n end", "title": "" }, { "docid": "9cbc13ec684ee0afac7b137c22c321ad", "score": "0.7761358", "text": "def environment\r\n if @@capistrano_instance.exists?(:rails_env)\r\n @@capistrano_instance.fetch(:rails_env)\r\n elsif @@capistrano_instance.exists?(:rack_env)\r\n @@capistrano_instance.fetch(:rack_env)\r\n elsif @@capistrano_instance.exists?(:stage)\r\n @@capistrano_instance.fetch(:stage)\r\n elsif(ENV['RAILS_ENV'])\r\n ENV['RAILS_ENV']\r\n else\r\n puts \"------------------------------------------------------------------\"\r\n puts \"- Stage, rack or rails environment isn't set in -\"\r\n puts \"- :stage or :rails_env or :rack_env, defaulting to 'production' -\"\r\n puts \"------------------------------------------------------------------\"\r\n \"production\"\r\n end\r\n end", "title": "" }, { "docid": "0b34be96c78814a4a32fc39865f4c330", "score": "0.77156353", "text": "def get_env\n ENV['RAILS_ENV'] || 'development'\n end", "title": "" }, { "docid": "042cdf9ff53a97483c1811ed326993d2", "score": "0.76881284", "text": "def deploy_env\n if exists?(:stage)\n stage\n elsif exists?(:rails_env)\n rails_env\n elsif (ENV['RAILS_ENV'])\n ENV['RAILS_ENV']\n elsif exists?(:rack_env)\n rack_env\n elsif (ENV['RACK_ENV'])\n ENV['RACK_ENV']\n else\n 'production'\n end\n end", "title": "" }, { "docid": "902addfafa3e96bb1d61b75b4bdff8ee", "score": "0.7687451", "text": "def env_name\n return Lacmus::ENV if defined?(Lacmus::ENV)\n return Rails.env if defined?(Rails)\n return 'development'\n end", "title": "" }, { "docid": "6ec063ca055467ca50bf22d66e1dc06e", "score": "0.765041", "text": "def environment\n @environment ||= \"development\" \n @environment ||= ::Rails.env if defined? ::Rails\n @environment\n end", "title": "" }, { "docid": "4d3ed275b3df9676a5039e3374353d56", "score": "0.7494311", "text": "def environment\n self.options[:environment] || self.options[:e] || self.options[:env] || 'development'\n end", "title": "" }, { "docid": "4d3ed275b3df9676a5039e3374353d56", "score": "0.7494311", "text": "def environment\n self.options[:environment] || self.options[:e] || self.options[:env] || 'development'\n end", "title": "" }, { "docid": "42abc043c08588289aa9724b31d32c7d", "score": "0.7485566", "text": "def environment_name\n ENV['RACK_ENV'] || 'development'\n end", "title": "" }, { "docid": "e5b153f9cec6c203987d3c5662f2adca", "score": "0.74793744", "text": "def environment\n @environment ||= :development\n end", "title": "" }, { "docid": "edb610cceb632aab8e4f20453c5b71a7", "score": "0.74477965", "text": "def environment\n if defined?(RAILS_ENV)\n RAILS_ENV # Rails 2\n elsif defined?(Rails) && defined?(Rails.env)\n Rails.env.to_s # Rails 3\n elsif ENV.key?('RACK_ENV')\n ENV['RACK_ENV']\n else\n 'development'\n end\n end", "title": "" }, { "docid": "369238a4f6b1dc01547d20e9a39504e7", "score": "0.74235815", "text": "def detect_stage\n ENV['RACK_ENV'] || ENV['RAILS_ENV'] || Rails.env\n rescue NameError\n nil\n end", "title": "" }, { "docid": "7c01d2c07f6523eac94ce6e1091ec6cc", "score": "0.7423063", "text": "def env\n @env || 'development'\n end", "title": "" }, { "docid": "1404506243b1968f47fd976927114a9d", "score": "0.7387872", "text": "def staging_env?\n Rails.env.staging?\n end", "title": "" }, { "docid": "39e91afab2c2ecd75bf12023411d4b03", "score": "0.73646677", "text": "def prod_environment\n ENV['RAILS_ENV'] == 'production'\n end", "title": "" }, { "docid": "845fbdd47fe9312a253eca34178e7837", "score": "0.7351187", "text": "def environment_descriptor\n if Rails.env.development?\n 'Local'\n elsif Socket.gethostname =~ /(local|dev|stage)\\./\n Regexp.last_match.captures\n .first\n .gsub('dev', 'development')\n .humanize\n end\n end", "title": "" }, { "docid": "f6accc65fb5fe291c9abc09e287975a4", "score": "0.73433286", "text": "def environment\n sandbox? ? :sandbox : :production\n end", "title": "" }, { "docid": "fd8efbaf695c304aa7bb8c3c14ce531e", "score": "0.7325171", "text": "def env_tag\n env = provision_object.get_tags[:environment]\n return env[0, 3] unless env.blank?\n end", "title": "" }, { "docid": "fd8efbaf695c304aa7bb8c3c14ce531e", "score": "0.7325171", "text": "def env_tag\n env = provision_object.get_tags[:environment]\n return env[0, 3] unless env.blank?\n end", "title": "" }, { "docid": "fd8efbaf695c304aa7bb8c3c14ce531e", "score": "0.7325171", "text": "def env_tag\n env = provision_object.get_tags[:environment]\n return env[0, 3] unless env.blank?\n end", "title": "" }, { "docid": "1d062787fad0eff2f37d64faacae6626", "score": "0.73109406", "text": "def preferred_server\n Rails.env.production? ? 'production' : 'test'\n end", "title": "" }, { "docid": "03dcdba79530b254f84d842ad2132ed0", "score": "0.7296891", "text": "def environment\n config[:environment]\n end", "title": "" }, { "docid": "4f79972107482c02241799647fa3ae60", "score": "0.72965693", "text": "def environment\n Rails.env\n end", "title": "" }, { "docid": "96ec3b134d91eb85596899385bc36961", "score": "0.7270028", "text": "def is_production_or_staging?\n ENV['RAILS_ENV'].in?('production', 'staging')\n end", "title": "" }, { "docid": "add01d2eef01850e525aac2fc60ce0c1", "score": "0.72464365", "text": "def stage_or_production\n exists?(:stage) ? stage : \"production\"\n end", "title": "" }, { "docid": "add01d2eef01850e525aac2fc60ce0c1", "score": "0.72464365", "text": "def stage_or_production\n exists?(:stage) ? stage : \"production\"\n end", "title": "" }, { "docid": "c91b573a4aa8d0f02e95ce871e6140df", "score": "0.7234999", "text": "def env\n ENV['RUBY_ENV'] || 'development'\n end", "title": "" }, { "docid": "c7127237a86792643ca8cab8a0d32061", "score": "0.723439", "text": "def env\n @@env ||= (ENV['ENV'].to_sym || :production)\n end", "title": "" }, { "docid": "816116eb31f6250112d59904bf79304a", "score": "0.723209", "text": "def environment\n @environment ||= self.detect_environment\n end", "title": "" }, { "docid": "5382fa64c9f2a4b64e7b54c6cc3f2c65", "score": "0.72193533", "text": "def environment\n global_params[:environment]\n end", "title": "" }, { "docid": "0a2d2b1fbd3514ce0c3b1978e08977bf", "score": "0.72129714", "text": "def env\n @env ||= ActiveSupport::StringInquirer.new(ENV['RAILS_ENV'].presence || 'development')\n end", "title": "" }, { "docid": "e3d5cdff1f994286f06db87fee14eef6", "score": "0.72121274", "text": "def environment\n if env[\"STATSD_ENV\"]\n env[\"STATSD_ENV\"]\n elsif defined?(Rails) && Rails.respond_to?(:env)\n Rails.env.to_s\n else\n env[\"RAILS_ENV\"] || env[\"RACK_ENV\"] || env[\"ENV\"] || \"development\"\n end\n end", "title": "" }, { "docid": "3221482537794c146affc1819c255d92", "score": "0.71854216", "text": "def environment\n @opts[:preserve_environments] ? @opts.fetch(:environment, 'production') : 'production'\n end", "title": "" }, { "docid": "fbbfc853a1aa8498adb1043e14afb88e", "score": "0.7185046", "text": "def env_name\n ENV['ENVIRONMENT_NAME']\n end", "title": "" }, { "docid": "680b3f55ce5e4058ce9a642ef7f93b6a", "score": "0.7179385", "text": "def node_environment(node_config)\n env = node_config[\"environment\"]\n env.nil? || env.empty? ? \"production\" : env\nend", "title": "" }, { "docid": "1e1ecf4a663775a5f46602fecfdace76", "score": "0.7177102", "text": "def get_rails_env(default)\n workspace_tags = get_workspace_tags()\n if workspace_tags.has_key?('RAILS_ENV')\n return workspace_tags['RAILS_ENV']\n else\n return default\n end\n end", "title": "" }, { "docid": "3014a86d274d8593a52846062cf3e9bf", "score": "0.71535385", "text": "def env\n @config[\"env\"][environment]\n end", "title": "" }, { "docid": "2c24b268b2c2ca7531083f68cc3ef36e", "score": "0.71401626", "text": "def environment\n config.environment ||= :development\n end", "title": "" }, { "docid": "db47066076de5f12ad4c62d7c8a4aa2e", "score": "0.7135212", "text": "def env\n Rails.env\n end", "title": "" }, { "docid": "68f66dd81e9a7f9c6ee842a631699738", "score": "0.7131567", "text": "def production_env?() environment == 'production'; end", "title": "" }, { "docid": "42eb950e157cd062e25a53b3c1ff4df0", "score": "0.7108969", "text": "def production?\n Rails.env.production? || Rails.env.staging?\n end", "title": "" }, { "docid": "6037f55d4bc346092dfee55f2724567e", "score": "0.71071696", "text": "def env\n Rails.env\n end", "title": "" }, { "docid": "56499e9295a340ebdacb1e16aa2569ab", "score": "0.70793045", "text": "def environment_for_current_stage\n @stage == 'acceptance' ? acceptance_environment : @stage\n end", "title": "" }, { "docid": "41a1bd0bcf7f4e4fc1437a57098bc199", "score": "0.706794", "text": "def environment\n if OS.mac?\n Mac\n elsif OS.windows?\n Windows\n else\n nil \n end\n end", "title": "" }, { "docid": "396e0507d5b7f91c922573d2a2811d60", "score": "0.70657885", "text": "def environment\n settings[:environment]\n end", "title": "" }, { "docid": "3e978c0b0a4af6579dfb27f8c5abcda2", "score": "0.7058665", "text": "def environment_name\n environment.name\n end", "title": "" }, { "docid": "82828c6729a1b9a4d582119a852b7bf6", "score": "0.70515645", "text": "def environment\n ::RAILS_ENV\n end", "title": "" }, { "docid": "2439db911db8b4e28a1345954d52e26f", "score": "0.70302373", "text": "def env_name\n\t\t\t\treturn Rails.env if defined?(Rails) && Rails.respond_to?(:env)\n return Sinatra::Base.environment.to_s if defined?(Sinatra)\n ENV[\"RACK_ENV\"] || ENV[\"GCLOUDDATASTORE_ENV\"] || raise(Errors::NoEnvironment.new)\n\t\t\tend", "title": "" }, { "docid": "1cee80da9e7e4c32c9918a6d151ab8f3", "score": "0.7023704", "text": "def default_rails_env\n node.chef_environment == '_default' ? 'production' : node.chef_environment\n end", "title": "" }, { "docid": "ac388c664451e1e975aa1acd7021c96c", "score": "0.70146036", "text": "def staging\n environment(:staging)\n end", "title": "" }, { "docid": "ac388c664451e1e975aa1acd7021c96c", "score": "0.70146036", "text": "def staging\n environment(:staging)\n end", "title": "" }, { "docid": "f588d484e0d5188ee94cffa4cf059816", "score": "0.7010777", "text": "def environment(environment = nil)\n @environment = environment if environment\n (@environment || ENV['TBK_COMMERCE_ENVIRONMENT'] || :production).to_sym\n end", "title": "" }, { "docid": "ccb7e0602a1b72507a405936b7619090", "score": "0.7003126", "text": "def production\n environment(:production)\n end", "title": "" }, { "docid": "ccb7e0602a1b72507a405936b7619090", "score": "0.7003126", "text": "def production\n environment(:production)\n end", "title": "" }, { "docid": "343d8e352b92faa26348ca3e693b3421", "score": "0.69970584", "text": "def mode\n ENV[@key] || 'development'\n rescue\n 'development'\n end", "title": "" }, { "docid": "a949ad72917b0e4cd456bcf174868647", "score": "0.69959587", "text": "def staging?\n env == :staging\n end", "title": "" }, { "docid": "50377a7f72b6862121b69642a0fc84dd", "score": "0.69890296", "text": "def rails_env\n return ::Rails.env.to_s if defined?(::Rails.env)\n return RAILS_ENV.to_s if defined?(RAILS_ENV)\n nil\n end", "title": "" }, { "docid": "e82fc395b8b06e6a5b6e41fd5b343b75", "score": "0.69856185", "text": "def application_environment\n ENV['app_env'].nil? ? \"JJ\" : ENV['app_env'].gsub(\" \",\"_\").upcase\n end", "title": "" }, { "docid": "588467eb2851b25df3e21a778f619c09", "score": "0.69788164", "text": "def environment\n @options[:environment]\n end", "title": "" }, { "docid": "588467eb2851b25df3e21a778f619c09", "score": "0.69788164", "text": "def environment\n @options[:environment]\n end", "title": "" }, { "docid": "91fe3f7cc108a98667728319699abac3", "score": "0.696991", "text": "def env_name\n Settings::EnvironmentName.gsub(' ', '_').underscore.downcase\n end", "title": "" }, { "docid": "08031ace69f4f3406235177205d030d0", "score": "0.6958826", "text": "def current_environment; end", "title": "" }, { "docid": "90853dc444a3bd9924a8dc4f98a2e426", "score": "0.694968", "text": "def environment_suffix\n credentials[:forced_environment] || Rails.env[0,3]\n end", "title": "" }, { "docid": "54286e04f2c24e6630e7d570dc3e5adf", "score": "0.694561", "text": "def distillery_environment\n fetch(:distillery_environment).to_s\n end", "title": "" }, { "docid": "56b3da5d4fb01731d9c5e0295f7336ab", "score": "0.69375217", "text": "def environment\n @env ||= AdminModule.configuration.default_environment\n @env\n end", "title": "" }, { "docid": "dfc8ac82231917a4f1fc16f4b64c1725", "score": "0.69294536", "text": "def enviroment_name \n\t(ENV['ENVIROMENT']||= 'qa').downcase.to_sym \nend", "title": "" }, { "docid": "5bf1b261924b2cdc6ac7f6d78918e8c8", "score": "0.69248676", "text": "def environment\n @environment ||= read_environment :instance, \"RAILS_ENV\", \"RACK_ENV\", :default\n end", "title": "" }, { "docid": "eaac8e003bd03d81671283f166b3cbfd", "score": "0.689366", "text": "def current_env\n return @default_environment if @current_env.nil?\n @current_env\n end", "title": "" }, { "docid": "eaac8e003bd03d81671283f166b3cbfd", "score": "0.689366", "text": "def current_env\n return @default_environment if @current_env.nil?\n @current_env\n end", "title": "" }, { "docid": "34938e74055e3ec201f98650f677a17c", "score": "0.6882427", "text": "def development?; environment == :development; end", "title": "" }, { "docid": "34938e74055e3ec201f98650f677a17c", "score": "0.6882427", "text": "def development?; environment == :development; end", "title": "" }, { "docid": "d8f6c0fd83795f888aceb8b791d9517b", "score": "0.6872665", "text": "def env\n @@env ||= [ENV['RACK_ENV'], ENV['RAILS_ENV'], ENV['RUBY_ENV'], 'development'].compact.first\n end", "title": "" }, { "docid": "2310f5e83260404e1ff0d660d6d3248a", "score": "0.6866781", "text": "def environments\n [:production, :local_assets, :development]\n end", "title": "" }, { "docid": "d295b444df98ed48aecd228d23eb5406", "score": "0.6862126", "text": "def env\n @env ||= \"test\"\n end", "title": "" }, { "docid": "b376f91c9c6dc421869379c29a97663b", "score": "0.6851107", "text": "def environment\n ENV['CLOUDENVOY_ENV'] || ENV['RAILS_ENV'] || ENV['RACK_ENV'] || 'development'\n end", "title": "" }, { "docid": "2a72e38dcc506ad4881a8dbde063149f", "score": "0.68452764", "text": "def ambiente_rails\n if Rails.env.development?\n \"Desenvolvimento\"\n elsif Rails.env.production?\n \"Produção\"\n else\n \"Teste\"\n end\n end", "title": "" }, { "docid": "bac062cd93630145f0089f90823164b9", "score": "0.6822325", "text": "def rails_env\n return ::Rails.env.to_s if defined?(::Rails.env)\n return RAILS_ENV.to_s if defined?(RAILS_ENV)\n nil\n end", "title": "" }, { "docid": "8abe7941bc2cc2431df63fbc2f849405", "score": "0.68172973", "text": "def project_environment\n $environment\nend", "title": "" }, { "docid": "badd30d7d658a7ba5bbd484c7029172d", "score": "0.6816656", "text": "def environment\n settings[:environment] ||= settings[:env] || ENV[\"RAILS_ENV\"] || ENV[\"APP_ENV\"] || :development\n end", "title": "" }, { "docid": "d2dd64defdd7dbd2ee0260ddb5c5f36d", "score": "0.6813915", "text": "def staging?\n @is_staging ||= ENV['RACK_ENV'] == 'staging'\nend", "title": "" }, { "docid": "1c1c86d97703704ef4c898dce05753df", "score": "0.68089175", "text": "def development?\n env_is('development')\nend", "title": "" }, { "docid": "1c1c86d97703704ef4c898dce05753df", "score": "0.68089175", "text": "def development?\n env_is('development')\nend", "title": "" }, { "docid": "0aa70956bb623be93b3801a1c722591d", "score": "0.6806379", "text": "def development_env?\n Rails.env.development? || Rails.env.test?\n end", "title": "" }, { "docid": "9793d943d16b146dac61c1a13714bae0", "score": "0.67989814", "text": "def environment\n ENV[\"RACK_ENV\"] || \"development\"\n end", "title": "" }, { "docid": "789ee61f5894a5d9444a23ac777cae3d", "score": "0.67882967", "text": "def default_environment\n super.presence\n end", "title": "" } ]
b32463bbabbc5f8f7d998b88e1ae2620
Recursively counts how many controls are in this form.
[ { "docid": "a24e6248eaa33039cb5e6ff311fd810c", "score": "0.71175057", "text": "def control_counts(control_group = self.data[:controls])\n control_counts = Hash.new(0)\n return control_counts unless control_group\n control_group.each do |control|\n control_counts[control[\"type\"]] += 1\n if control[\"type\"] == \"group\"\n child_control_counts = self.control_counts(control[\"children\"])\n control_counts.merge!(child_control_counts) { |key, count1, count2| count1 + count2 }\n end\n end\n control_counts\n end", "title": "" } ]
[ { "docid": "8bf82fc92332007050bcebceab44da3b", "score": "0.64262116", "text": "def num_fields\n @form_fields.size\n end", "title": "" }, { "docid": "7b2be78ddafc7b72ba27d4a839fe8fd5", "score": "0.6383824", "text": "def count\n @children.count\n end", "title": "" }, { "docid": "15e3ed0d147f8b50a857f91b52db9ff8", "score": "0.63300574", "text": "def countChildren\n\t\t\treturn self.children.length\n\t\tend", "title": "" }, { "docid": "5a5b8401d2273bcec35dbb5f4bb6933b", "score": "0.6312918", "text": "def controls_count\n @controls_count ||= RSpec.configuration.formatters.grep(Inspec::Formatters::Base).first.get_controls_count\n end", "title": "" }, { "docid": "4caed3f4cf091c44085e3df5b80fc4f7", "score": "0.6293751", "text": "def form_count\n respond_to?(:form_count_col) ? form_count_col : forms.count\n end", "title": "" }, { "docid": "d84e0920e24fb0b118400347d23ba9ed", "score": "0.62753576", "text": "def children_count\n i = 0\n children { |c| i+=1}\n return i\n end", "title": "" }, { "docid": "c7c3fb1400c35f43eb8e682f404a641e", "score": "0.6150205", "text": "def count\n @root.count\n end", "title": "" }, { "docid": "6fb5f341084c376c77abd1ca156aaea1", "score": "0.607793", "text": "def _count\n @fields.count\n end", "title": "" }, { "docid": "92a4d7b7f0bbd8ef8f17056250ef1692", "score": "0.6049697", "text": "def number_of_children\n content_children.count\n end", "title": "" }, { "docid": "c5974a94eafe8256ffa259a72bd36fcb", "score": "0.6046093", "text": "def child_count\r\n self.children.reject { |c| c.nil? }.size\r\n end", "title": "" }, { "docid": "c8544c57fb2df6cbb576f345afec62fc", "score": "0.60086226", "text": "def values_text_boxes_count\r\n value_text_box_fields.to_a.count\r\n end", "title": "" }, { "docid": "f47afdcb3ffecfa41df256c727fbf2de", "score": "0.5997254", "text": "def number_of_children\n\t\t\treturn self.children.size\n\tend", "title": "" }, { "docid": "79c52e4f14e0a0686fa31518258fae67", "score": "0.59741455", "text": "def count\n return @element_parent.element_children[@element_tag].size if @element_parent\n return 0\n end", "title": "" }, { "docid": "9e70c85795098d168184374eaa24d09b", "score": "0.5973565", "text": "def field_count\n self.class.instance_variable_get('@binding_data'.to_sym).length\n end", "title": "" }, { "docid": "8477f2ff00422ed1bd033a067b15b796", "score": "0.5958495", "text": "def count\n return @element_parent.element_children[@element_tag].size if @element_parent\n return 0\n end", "title": "" }, { "docid": "13f19c3facf500a8f26b809e586e6e1d", "score": "0.5926071", "text": "def count_list_size\n\n tree_children.size\n end", "title": "" }, { "docid": "a885b52e495164b430b765623fc92d32", "score": "0.5924552", "text": "def option_counts\n submissions = form.submissions\n \n values = Hash.new(0)\n submissions.each do |submission|\n submission.quantitative_values.each do |value|\n \n # Radio buttons only have one choice\n if value.content.is_a?(String)\n values[value.content] += 1\n next\n end\n\n # Checkboxes can have multiple choices\n value.content.each do |choice|\n values[choice] += 1\n end\n end\n end\n \n return values\n end", "title": "" }, { "docid": "9c5639c73f9967cacf234742b3dd0bfd", "score": "0.5897031", "text": "def child_count\r\n @children.size\r\n end", "title": "" }, { "docid": "5b61739d08c7953cc95fd39a72a01e18", "score": "0.589554", "text": "def check_count\n check_count = 0\n self.subsections.each { |subsection| check_count += subsection.check_count}\n check_count\n end", "title": "" }, { "docid": "d8931c5c2eeca3933920bfa3252dcd4b", "score": "0.5877611", "text": "def set_NumChildren(value)\n set_input(\"NumChildren\", value)\n end", "title": "" }, { "docid": "f47c75775ab207c51a19c3c7f4a95175", "score": "0.58663976", "text": "def number_prerequisites\n return recursive_prerequisites.size\n end", "title": "" }, { "docid": "8e5359464b6a6ba657186a0050b2f58d", "score": "0.5840287", "text": "def count\n result = 0\n traverse_preorder do |level, node|\n result += 1\n end\n result\n end", "title": "" }, { "docid": "6c48fda45e27d7bb049f15bff3b49a2e", "score": "0.58233017", "text": "def children_count\n children.count\n end", "title": "" }, { "docid": "ae73a82b352f11f9d48125bce9b2c98a", "score": "0.57831496", "text": "def num_nodes\n node_count = 1\n @children.each {|p, t| node_count += t.num_nodes }\n node_count\n end", "title": "" }, { "docid": "230669c42ae4b2a54d6a63060bab1b1b", "score": "0.57816565", "text": "def count_children\n render :text => @node.children.count\n end", "title": "" }, { "docid": "a22b4a207c294b54ca2b28433c00e64b", "score": "0.5780547", "text": "def size\n\t\t\tretval = 0\n\t\t\t@rules.values.each do |part_forms|\n\t\t\t\tpart_forms.values.each do |form_rules|\n\t\t\t\t\tretval += form_rules.size\n\t\t\t\tend\n\t\t\tend\n\t\t\tretval\n\t\tend", "title": "" }, { "docid": "28cff89ace8f9aca5c6f68a52fccee32", "score": "0.5770293", "text": "def getChildCollectionCount()\n @obj.getChildCollectionCount()\n end", "title": "" }, { "docid": "660a93259caf8efcf4aae3d77de3ea0c", "score": "0.57570475", "text": "def count\n Pathname.new(dir).children.count\n end", "title": "" }, { "docid": "acd9981d1610a9fee2f9f7c7a6d2f228", "score": "0.57547915", "text": "def num_of_direct_children\n @children.size\n end", "title": "" }, { "docid": "2925ef804b559bec72f2c31d9f9b7681", "score": "0.57474416", "text": "def dimensions\n controls[0].size\n end", "title": "" }, { "docid": "8b53a7df1c3ade1f9cadae1a6cbb042f", "score": "0.5744079", "text": "def num_children\n\t\tdrill_inject(0, false){|size,p| size + 1}\n\tend", "title": "" }, { "docid": "f0709ffd2da042d46be9690390cbfba0", "score": "0.57396996", "text": "def process_count\n children.count\n end", "title": "" }, { "docid": "536acdd6dc181677fabe4c533fc97034", "score": "0.5733091", "text": "def count\n\n\t\t@inner.each_value.map { |ar| ar.size}.inject(0, :+)\n\tend", "title": "" }, { "docid": "93389588bf389485ba5cd25d1cd62f06", "score": "0.57319486", "text": "def count\n @calc_field_collection.count\n end", "title": "" }, { "docid": "b413c04f20c80833ab0464008c916835", "score": "0.57287073", "text": "def visible_child_count\n children.select { |c| !c.hidden? }.size\n end", "title": "" }, { "docid": "5dafc5684959a4c64a095a81960284dd", "score": "0.56962955", "text": "def sub_node_count\n sub_nodes.size\n end", "title": "" }, { "docid": "9a62359ebb1a93d75f083f7f321bc76c", "score": "0.5695198", "text": "def count\n return 0 if @head == nil\n count_recursive(@head, 1)\n end", "title": "" }, { "docid": "b35a98a8321c2eb2a0a8084884787139", "score": "0.5693764", "text": "def all_children_count\n size = subsegments.count\n subsegments.each { |v| size += v.all_children_count }\n size\n end", "title": "" }, { "docid": "258fdfd8038ff690557fdfd9ef92ddcf", "score": "0.5692777", "text": "def component_variant_count\n ancestry_setup.values_at(*ancestry_components).inject(1) { |r,f| r*f.size }\n end", "title": "" }, { "docid": "ae536960c3e5b6ff2456b76d42e52755", "score": "0.5681036", "text": "def field_count\n @fields.size\n end", "title": "" }, { "docid": "a5aa40ad503211835157ceef1245e9ad", "score": "0.5662904", "text": "def set_item_counts\n children_item_count = 0\n node.children.categories.each {|child_node| children_item_count += child_node.category.set_item_counts }\n# puts \"#{title} category: items: #{displayed_items.count}, child_categories' items: #{children_item_count}\"\n self.item_count = (displayed_items.count + children_item_count)\n self.save!\n return self.item_count\n end", "title": "" }, { "docid": "1553d0cc26b80a9344b9ef083579f679", "score": "0.5626761", "text": "def field_count\n end", "title": "" }, { "docid": "5f830ca277f20a0a6168de9b5f421ddc", "score": "0.56267315", "text": "def nodes_count\n 1 + children_nodes.map{ |n| n.nodes_count }.sum\n end", "title": "" }, { "docid": "408b956bfb8360faf27d243cbc7537ce", "score": "0.5625855", "text": "def number_of_nodes\n node_count(@root)\n end", "title": "" }, { "docid": "daebb1b811de5f8cf4dce26ea751dcc8", "score": "0.5620246", "text": "def children_count\n self.class.count :conditions => [ \"#{acts_as_materialized_path_options[:path_column]} like ? || id \", self[acts_as_materialized_path_options[:path_column]] + \".\" ]\n end", "title": "" }, { "docid": "4d4c27590f31df9ca9985f69de0ca6f4", "score": "0.56122065", "text": "def cardinality\n children_cardinality = children.reduce(0) do |sum, child|\n sum += child.cardinality\n end\n self_cardinality = @in_action_path ? 0 : 1\n children_cardinality + self_cardinality\n end", "title": "" }, { "docid": "459607b72e6ba108c05281a000d8c6cb", "score": "0.56073785", "text": "def count\n self.class.collection_builder_strategy.count(self)\n end", "title": "" }, { "docid": "f8475e35cc9f7d97ca85310635d8142c", "score": "0.5591692", "text": "def count\n apply_fields_on_current_scope\n @current_scope.count\n end", "title": "" }, { "docid": "98a970dbf382b925e59493399fcb3494", "score": "0.5584913", "text": "def number_of_subitems\n @items.inject(0) { |total, item| total += 1 + item.number_of_subitems }\n end", "title": "" }, { "docid": "fcce07e5d58840c705e33638359a2925", "score": "0.5565172", "text": "def structure_count(node)\n return 0 unless node\n return 1 + structure_count(node.left) + structure_count(node.right)\n end", "title": "" }, { "docid": "e355152195472260122d3020dc3ea69f", "score": "0.5564023", "text": "def count\n # implement in subclasses\n end", "title": "" }, { "docid": "e4a8e04c24957cb7bceec09638a78aca", "score": "0.5562789", "text": "def childrens\n self.descendants.size\n end", "title": "" }, { "docid": "87ec73d6f6c9b93283500d2e5ade6ee8", "score": "0.5550286", "text": "def descendent_count_helper(folder)\n folder.children.inject(folder.children.all.size) do |sum, child|\n descendent_count_helper(child) + sum\n end\n end", "title": "" }, { "docid": "3e60137ecde687a50040219138b59540", "score": "0.553392", "text": "def size\n self.root.all_children.uniq.size + 1\n end", "title": "" }, { "docid": "9dfe180949f73c08fd871c53b1046c7d", "score": "0.5528381", "text": "def count_leafs\n self.keys.inject(0) do |result, element|\n if self[element].kind_of?(Hash)\n result+=self[element].count_leafs\n else\n result+=1\n end\n end\n end", "title": "" }, { "docid": "f5e3fb6da8f41d17263a1c0091dd7c61", "score": "0.55249524", "text": "def size\n children.reduce(1) { |a, e| a + e.size }\n end", "title": "" }, { "docid": "c3ec97ad228bec95bac8022293687edd", "score": "0.5524383", "text": "def length\n childCount\n end", "title": "" }, { "docid": "8a70d5ed0abe324edd2e831b0fa5b8ee", "score": "0.550886", "text": "def deep\n parents.size\n end", "title": "" }, { "docid": "f801f11e02a6cdd2f8e5e5a857b9ed23", "score": "0.5507635", "text": "def count\n each.count\n end", "title": "" }, { "docid": "ac34715f5949a092e52e6983c5a09b6c", "score": "0.55038", "text": "def size\n count = 0\n @element.each {|child| count+=1 if child.kind_of? Element }\n count\n end", "title": "" }, { "docid": "ac34715f5949a092e52e6983c5a09b6c", "score": "0.55038", "text": "def size\n count = 0\n @element.each {|child| count+=1 if child.kind_of? Element }\n count\n end", "title": "" }, { "docid": "c94270006e7d6ce08c19d40aafab343f", "score": "0.5484825", "text": "def descendants_count(options={})\n descendants_call(:descendants_count, :bfs, options)\n end", "title": "" }, { "docid": "2febb0aee1e6aac62e829491d45ca40a", "score": "0.5479269", "text": "def size\n\t\tcounter = 0\n\t\tself.each_node {|n| counter += 1}\n\t\tcounter\n\tend", "title": "" }, { "docid": "7910bda6fe75978089dad2b57e308abc", "score": "0.547151", "text": "def count\n each.size\n end", "title": "" }, { "docid": "81e83ab487d2fe5f40553b73d959e6a9", "score": "0.5468029", "text": "def count\n new.count\n end", "title": "" }, { "docid": "81e83ab487d2fe5f40553b73d959e6a9", "score": "0.5468029", "text": "def count\n new.count\n end", "title": "" }, { "docid": "7c930dec91ba4d518b9e24d6da4d13b2", "score": "0.54605454", "text": "def num_fields\n @acro_fields.getFields.size\n end", "title": "" }, { "docid": "bc197491ba69a1b6930e95cef41646af", "score": "0.54569083", "text": "def size\n @children.sum(&:size)\n end", "title": "" }, { "docid": "145e1a8b030d3675ad5b1c4a2cd7a841", "score": "0.54527664", "text": "def count\n size\n end", "title": "" }, { "docid": "a3d38ad0d6e17ba42d90973acac8e26a", "score": "0.5452481", "text": "def children_size\n size = m_classes.size\n m_classes.each{|m_class|\n m_classes = m_class.m_classes\n if m_classes.present?\n size += m_class.children_size\n end\n }\n return size\n end", "title": "" }, { "docid": "981ae24f46bc1e41e39d29893d4bac89", "score": "0.5446181", "text": "def num_children(tree_node)\n count = 0\n count += 1 if tree_node.right\n count += 1 if tree_node.left\n count\n end", "title": "" }, { "docid": "071a8888f2e2c3d131ea2ce6c1c0e4f3", "score": "0.5445555", "text": "def child_count\n return @child_count\n end", "title": "" }, { "docid": "071a8888f2e2c3d131ea2ce6c1c0e4f3", "score": "0.5445555", "text": "def child_count\n return @child_count\n end", "title": "" }, { "docid": "4f6178f9c657383758a82be2462a7eb6", "score": "0.54427445", "text": "def child_count\n return 0 unless (!new_record? && might_have_children?) # shortcut\n \n @child_count ||= self.class.scoped(scope_hash_for_branch).count\n end", "title": "" }, { "docid": "dc472a79f13118c1f918114d8fc780d2", "score": "0.5431618", "text": "def num_nodes\n tree.length\n end", "title": "" }, { "docid": "1e48810455d06c6b0e81b3a63a414640", "score": "0.5419061", "text": "def tree_width\n num_branches = 0\n ancestry = self.steps.pluck(:ancestry)\n repeat_ancestry = ancestry.group_by {|e| e}.select { |k,v| v.size > 1}.keys\n repeat_ancestry.each do |value|\n num_branches = num_branches + ancestry.grep(value).size\n end\n return num_branches\n end", "title": "" }, { "docid": "f993e268c05d17e00bbb33637e9a41fa", "score": "0.540718", "text": "def count_choices(params)\n params.select {|key| key.match(/\\d/) != nil}.each do |question, answer|\n question = Question.find(question.to_i)\n \n answer.each do |ans|\n choice = question.choices.where(text: ans).first \n new_count = choice.count + 1\n choice.update_attributes(count: new_count)\n end\n question.choices.each {|choice| update_choice_percentage(question, choice)} \n end\n end", "title": "" }, { "docid": "339d152e9f0fdebf4e716143ae66853b", "score": "0.5406997", "text": "def number_of_options\n option_values.compact.count\n end", "title": "" }, { "docid": "259c7458b21db28a43459958deb395c5", "score": "0.54044807", "text": "def count\n return 0 if self.is_empty\n current_node = @head\n total = 1\n while current_node.next\n total += 1\n current_node = current_node.next\n end\n return total\n end", "title": "" }, { "docid": "a16c8ce55727cf56a62b81247c0e84bf", "score": "0.5401078", "text": "def size\n node_number = 0\n current_node = @content\n node_number += 1 unless current_node.nil?\n until current_node.next_node.nil?\n current_node = current_node.next_node\n node_number += 1\n end\n node_number\n end", "title": "" }, { "docid": "1b0945a888728446f921dd8ced566a54", "score": "0.5400725", "text": "def item_count\n @root_box.item_count\n end", "title": "" }, { "docid": "822728d5cbc63ab4fb7851e48db273e7", "score": "0.5400702", "text": "def count\n all.size\n end", "title": "" }, { "docid": "4bcd6bc1d88de4cb3907a9c2eeb68c8d", "score": "0.53859574", "text": "def subtags_count\n to_s.count(HYPHEN) + 1\n end", "title": "" }, { "docid": "fe00aac5b9897e46f205e667d802d588", "score": "0.538372", "text": "def child_size\n self.class.count(:conditions => {:parent_id => id}) + \\\n Page.count(:conditions => {:section_id => id} ) \n end", "title": "" }, { "docid": "f7d62316cd14c882a98eed3491c8f99b", "score": "0.53813297", "text": "def count_subs\n subs.count\n end", "title": "" }, { "docid": "8acee5dfb2de62bed88da6a047d56452", "score": "0.5375202", "text": "def count_orbits\n @children.values.each_with_object({ direct: 1, indirect: @tier }) do |child, sum|\n oc = child.count_orbits\n sum[:direct] += oc[:direct]\n sum[:indirect] += oc[:indirect]\n end\n end", "title": "" }, { "docid": "dfc69d7972d2c7c017dc4e0a8a2a9c7b", "score": "0.5372769", "text": "def count\n\t\treturn self.values.inject( 0 ) {|num, val| num + val.length }\n\tend", "title": "" }, { "docid": "3969197b3e18e08df75b2f9b50456f89", "score": "0.53726923", "text": "def all_members_count\n self.self_and_descendants.sum(:members_count)\n end", "title": "" }, { "docid": "e56c3357b0c3b4ffdca5d586020ad4d0", "score": "0.5369475", "text": "def designer_auditor_check_count\n \n total = 0\n self.subsections.each { |ss| total += ss.designer_auditor_check_count }\n \n total\n \n end", "title": "" }, { "docid": "9d17bdbbe4e72c4d34be14c7b7f9dd5c", "score": "0.5366101", "text": "def count\n @text_blocks.count\n end", "title": "" }, { "docid": "565b94d42d21d06f67feb28340af6ee0", "score": "0.53613794", "text": "def n_pages\n children.length\n end", "title": "" }, { "docid": "0d6d2e1ce19ddba11574793913028dd2", "score": "0.5355128", "text": "def countNodes()\n return countNodesOfBST(@root)\n end", "title": "" }, { "docid": "13c67e7e2def086a718735a6f2ff1ea3", "score": "0.5348307", "text": "def get_submenu_group_count(parent_menu)\n menu_count = 0\n for menu in parent_menu.menus\n menu_count += 1 if get_group_patterns(menu).size > 0\n end\n menu_count\n end", "title": "" }, { "docid": "a11621848da32dfd9e51f7d9f82a4eb3", "score": "0.53463006", "text": "def component_count\n count\n end", "title": "" }, { "docid": "82eaa5af53a00ca2e9d4fad6b0328aa9", "score": "0.534605", "text": "def count\r\n num = @files.count\r\n @folders.each { |f| num += f.count }\r\n num\r\n end", "title": "" }, { "docid": "08f88ed16a6a9e1ed1e485850bfdaa9b", "score": "0.5341001", "text": "def count(status)\n if !@count[status.to_sym]\n self.children.each { |c| @count[c.status.to_sym] = @count[c.status.to_sym].to_i + 1 }\n @count.default = 0\n end\n @count[status.to_sym]\n end", "title": "" }, { "docid": "5383106ae7ec5b9bfcbb4b99919cb220", "score": "0.53405523", "text": "def count\n len = 0\n node = @head\n until node.nil?\n len += 1\n node = node.next\n end\n\n return len\n end", "title": "" }, { "docid": "9eb6d623e3681b4515af3b86719a43af", "score": "0.5338724", "text": "def nb_content\n children.size + pictures.size\n end", "title": "" }, { "docid": "9eb6d623e3681b4515af3b86719a43af", "score": "0.5338724", "text": "def nb_content\n children.size + pictures.size\n end", "title": "" } ]
af630984682f1a0b5a68e6092af0d102
Update properties of this object
[ { "docid": "9816e4e64f868ccdfc4490d572ad9d77", "score": "0.0", "text": "def update!(**args)\n @boolean_rule = args[:boolean_rule] if args.key?(:boolean_rule)\n @gradient_rule = args[:gradient_rule] if args.key?(:gradient_rule)\n @ranges = args[:ranges] if args.key?(:ranges)\n end", "title": "" } ]
[ { "docid": "184b1b1ed771473d3eb9f338c0734c38", "score": "0.73066413", "text": "def update *args\n opts = args.extract_options!\n fill_properties opts\n self.save\n end", "title": "" }, { "docid": "5076c5a88404ae72986f958710f5687a", "score": "0.72631145", "text": "def update(properties)\n @__hash__.update(properties)\n end", "title": "" }, { "docid": "60506d5995c168a570c84bcbafd6d01b", "score": "0.7164913", "text": "def update props\n # not an alias because doc\n put props\n end", "title": "" }, { "docid": "ec25850e7b3d73876b69868b5e566a7a", "score": "0.71243227", "text": "def update_properties(hash)\n hash.each do |key, value|\n self.send(\"#{key}=\", value)\n end\n end", "title": "" }, { "docid": "22938231f10efd60d4530259d1ab7161", "score": "0.7061904", "text": "def update_props(properties)\n fail 'not implemented'\n end", "title": "" }, { "docid": "22938231f10efd60d4530259d1ab7161", "score": "0.7061904", "text": "def update_props(properties)\n fail 'not implemented'\n end", "title": "" }, { "docid": "150fa2bdc1fc43d28ac45e2278a1f797", "score": "0.7012263", "text": "def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end", "title": "" }, { "docid": "b46342a57789464175130c5171865a4f", "score": "0.69842774", "text": "def update_properties(props)\n load_properties(force: true)\n\n deep_merge = proc do |_, old_value, new_value|\n if old_value.is_a?(Hash) && new_value.is_a?(Hash)\n old_value.merge(new_value, &deep_merge)\n else\n new_value\n end\n end\n\n props = properties.merge(props || {}, &deep_merge)\n save_properties(properties.merge(props || {}))\n self\n end", "title": "" }, { "docid": "e72f78e0e269f94de07625d4972f0298", "score": "0.69181895", "text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "title": "" }, { "docid": "e72f78e0e269f94de07625d4972f0298", "score": "0.69181895", "text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "title": "" }, { "docid": "e72f78e0e269f94de07625d4972f0298", "score": "0.69181895", "text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "title": "" }, { "docid": "e72f78e0e269f94de07625d4972f0298", "score": "0.69181895", "text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "title": "" }, { "docid": "e72f78e0e269f94de07625d4972f0298", "score": "0.69181895", "text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "title": "" }, { "docid": "e72f78e0e269f94de07625d4972f0298", "score": "0.69181895", "text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "title": "" }, { "docid": "e72f78e0e269f94de07625d4972f0298", "score": "0.69181895", "text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "title": "" }, { "docid": "e72f78e0e269f94de07625d4972f0298", "score": "0.69181895", "text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "title": "" }, { "docid": "e72f78e0e269f94de07625d4972f0298", "score": "0.69181895", "text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "title": "" }, { "docid": "e72f78e0e269f94de07625d4972f0298", "score": "0.69181895", "text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "title": "" }, { "docid": "e72f78e0e269f94de07625d4972f0298", "score": "0.69181895", "text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "title": "" }, { "docid": "e72f78e0e269f94de07625d4972f0298", "score": "0.69181895", "text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "title": "" }, { "docid": "e72f78e0e269f94de07625d4972f0298", "score": "0.69181895", "text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "title": "" }, { "docid": "e72f78e0e269f94de07625d4972f0298", "score": "0.69181895", "text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "title": "" }, { "docid": "e72f78e0e269f94de07625d4972f0298", "score": "0.69181895", "text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "title": "" }, { "docid": "e72f78e0e269f94de07625d4972f0298", "score": "0.69181895", "text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "title": "" }, { "docid": "4aa62f56c7ec71b9c7d914558501001b", "score": "0.67206186", "text": "def update\n update_obj\n end", "title": "" }, { "docid": "10e41ec39ba2af73495ccece21c2d8a3", "score": "0.6709326", "text": "def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end", "title": "" }, { "docid": "b0508d605628b9b1ec78fe5f0697a746", "score": "0.67057854", "text": "def update_properties(hash)\n hash.each_pair do |k, v|\n self.set_property_value(k.to_s, v)\n end\n end", "title": "" }, { "docid": "092b765ad7cf3ce4b6bf4e7d8a2e6af7", "score": "0.6696149", "text": "def update(attrs)\n super(attrs)\n end", "title": "" }, { "docid": "092b765ad7cf3ce4b6bf4e7d8a2e6af7", "score": "0.6696149", "text": "def update(attrs)\n super(attrs)\n end", "title": "" }, { "docid": "092b765ad7cf3ce4b6bf4e7d8a2e6af7", "score": "0.6696149", "text": "def update(attrs)\n super(attrs)\n end", "title": "" }, { "docid": "092b765ad7cf3ce4b6bf4e7d8a2e6af7", "score": "0.6696149", "text": "def update(attrs)\n super(attrs)\n end", "title": "" }, { "docid": "092b765ad7cf3ce4b6bf4e7d8a2e6af7", "score": "0.6696149", "text": "def update(attrs)\n super(attrs)\n end", "title": "" }, { "docid": "092b765ad7cf3ce4b6bf4e7d8a2e6af7", "score": "0.6696149", "text": "def update(attrs)\n super(attrs)\n end", "title": "" }, { "docid": "092b765ad7cf3ce4b6bf4e7d8a2e6af7", "score": "0.6696149", "text": "def update(attrs)\n super(attrs)\n end", "title": "" }, { "docid": "d9b090f93fdffad34c5489c4c437c6f3", "score": "0.6662612", "text": "def update_properties(properties_element)\n end", "title": "" }, { "docid": "b7ed68c679d7eaccf546a282fab6e985", "score": "0.66259164", "text": "def apply\n update_keys\n update_columns\n update_properties\n end", "title": "" }, { "docid": "769b77b7f7f9f82ae847f5968eb201dc", "score": "0.6571848", "text": "def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end", "title": "" }, { "docid": "769b77b7f7f9f82ae847f5968eb201dc", "score": "0.6571848", "text": "def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end", "title": "" }, { "docid": "137759bf2b87f1ca55eb78e668747d15", "score": "0.6539236", "text": "def update!(**args)\n @property = args[:property] if args.key?(:property)\n end", "title": "" }, { "docid": "137759bf2b87f1ca55eb78e668747d15", "score": "0.6539236", "text": "def update!(**args)\n @property = args[:property] if args.key?(:property)\n end", "title": "" }, { "docid": "137759bf2b87f1ca55eb78e668747d15", "score": "0.6539236", "text": "def update!(**args)\n @property = args[:property] if args.key?(:property)\n end", "title": "" }, { "docid": "137759bf2b87f1ca55eb78e668747d15", "score": "0.6539236", "text": "def update!(**args)\n @property = args[:property] if args.key?(:property)\n end", "title": "" }, { "docid": "137759bf2b87f1ca55eb78e668747d15", "score": "0.6539236", "text": "def update!(**args)\n @property = args[:property] if args.key?(:property)\n end", "title": "" }, { "docid": "137759bf2b87f1ca55eb78e668747d15", "score": "0.6539236", "text": "def update!(**args)\n @property = args[:property] if args.key?(:property)\n end", "title": "" }, { "docid": "862f7aa179e3e1751693f78772c09a99", "score": "0.65159345", "text": "def assign_properties(properties); end", "title": "" }, { "docid": "328c68b6c30673dac05ca930f5da533c", "score": "0.6458067", "text": "def update_attributes(attrs)\n self.update(attrs)\n end", "title": "" }, { "docid": "328c68b6c30673dac05ca930f5da533c", "score": "0.6458067", "text": "def update_attributes(attrs)\n self.update(attrs)\n end", "title": "" }, { "docid": "d8b3bf9ec121e23dad3af2edca6e6094", "score": "0.6421526", "text": "def update(attributes); end", "title": "" }, { "docid": "63cce5e99d8dc677403b00708afc27c9", "score": "0.641709", "text": "def update\n @prop.update_attributes(prop_params)\n respond_with @prop, location: backstage_scene_props_path\n end", "title": "" }, { "docid": "3dc790e8b6e9e65eb288c97798a4c7f2", "score": "0.64154994", "text": "def set_properties inst\n model.properties.find_all { |p| model.updatable?(p.name) }.each do |p|\n inst.send(\"#{p.name}=\".to_sym, params[p.name.to_s]) if params.has_key?(p.name.to_s)\n end\n inst\n end", "title": "" }, { "docid": "9373755ebb61f1f274f6c8504a5acace", "score": "0.64146614", "text": "def reload(props = {})\n reset_changes\n super\n assign_attributes(props)\n self\n end", "title": "" }, { "docid": "fb68247cb1373a6c71a42a2aa69f1dcb", "score": "0.64143723", "text": "def update(attrs)\n @attrs = attrs\n self\n end", "title": "" }, { "docid": "fb68247cb1373a6c71a42a2aa69f1dcb", "score": "0.64143723", "text": "def update(attrs)\n @attrs = attrs\n self\n end", "title": "" }, { "docid": "23eb6f5fbeae4bf9f56ac93a4126b4b5", "score": "0.6389745", "text": "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end", "title": "" }, { "docid": "71d6a0160cffce28db4d0a25d6dbda13", "score": "0.6385747", "text": "def update!(**args)\n @count = args[:count] if args.key?(:count)\n @properties = args[:properties] if args.key?(:properties)\n end", "title": "" }, { "docid": "9b95f8bc66f32e7ebbe7e63224d1ebaf", "score": "0.6364864", "text": "def update(attributes)\n attributes.each do |name, value|\n self[name] = value\n end\n end", "title": "" }, { "docid": "575f3d0c94f466263e302883e13868a6", "score": "0.6330631", "text": "def _update\n update!\n end", "title": "" }, { "docid": "7c6d5966289f9347f75aa7b24903a328", "score": "0.6327251", "text": "def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type]))) unless attribute_get(property).nil?\n end\n end\n @attributes[:original][property] = attribute_get(property)\n @dirty[property] = nil\n @attributes[:copied][property] = NOT_SET\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end", "title": "" }, { "docid": "210886bcfd68fae88847f8b3464d4058", "score": "0.6325362", "text": "def update_properties!(scraper)\n log \"Updating assets for #{self.slug}\"\n# only update active properties\n Property.where(source_id: self.id, status: 1).find_each do |prop|\n begin\n scraper.update_property(prop)\n rescue Exception => e\n log \"there was a connection error #{e.message} - #{e.class}\"\n end\n end\n end", "title": "" }, { "docid": "da63345424fc9aecef032928485bd149", "score": "0.6319025", "text": "def update\n \n end", "title": "" }, { "docid": "749afa4ff068e21c7d78bbad94c19d6c", "score": "0.6313444", "text": "def update!(attributes); end", "title": "" }, { "docid": "e8639be61ed6393bc612a8aef27789d3", "score": "0.6312355", "text": "def update!(**args)\n @border = args[:border] if args.key?(:border)\n @fields = args[:fields] if args.key?(:fields)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n end", "title": "" }, { "docid": "6284f332cbe8c998b16d5e816c5d21ed", "score": "0.6291622", "text": "def update!(**args)\n @display_name = args[:display_name] if args.key?(:display_name)\n @parent = args[:parent] if args.key?(:parent)\n @property = args[:property] if args.key?(:property)\n @property_type = args[:property_type] if args.key?(:property_type)\n end", "title": "" }, { "docid": "6284f332cbe8c998b16d5e816c5d21ed", "score": "0.6291622", "text": "def update!(**args)\n @display_name = args[:display_name] if args.key?(:display_name)\n @parent = args[:parent] if args.key?(:parent)\n @property = args[:property] if args.key?(:property)\n @property_type = args[:property_type] if args.key?(:property_type)\n end", "title": "" }, { "docid": "5a8e82caac01cee661bc875a5b0cf723", "score": "0.6283673", "text": "def refresh\n set_attributes\n end", "title": "" }, { "docid": "9e076ce17f1607b2a6248469b63b9c05", "score": "0.62797445", "text": "def training_updated_properties=(value)\n @training_updated_properties = value\n end", "title": "" }, { "docid": "309d8f89c45737b781ca7c15a61b00a5", "score": "0.6273536", "text": "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @size_bytes = args[:size_bytes] if args.key?(:size_bytes)\n end", "title": "" }, { "docid": "309d8f89c45737b781ca7c15a61b00a5", "score": "0.6273536", "text": "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @size_bytes = args[:size_bytes] if args.key?(:size_bytes)\n end", "title": "" }, { "docid": "60d8c4f58de490a0d7cdd918c16a2cce", "score": "0.6269463", "text": "def update(attrs)\n @attrs.update(attrs)\n self\n end", "title": "" }, { "docid": "60d8c4f58de490a0d7cdd918c16a2cce", "score": "0.6269463", "text": "def update(attrs)\n @attrs.update(attrs)\n self\n end", "title": "" }, { "docid": "60d8c4f58de490a0d7cdd918c16a2cce", "score": "0.6269463", "text": "def update(attrs)\n @attrs.update(attrs)\n self\n end", "title": "" }, { "docid": "60d8c4f58de490a0d7cdd918c16a2cce", "score": "0.6269463", "text": "def update(attrs)\n @attrs.update(attrs)\n self\n end", "title": "" }, { "docid": "7a41bc9d5a07220fb8626d1fa90d2d79", "score": "0.62639254", "text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end", "title": "" }, { "docid": "f88ac8dac0e7b4769636f755e65a14ba", "score": "0.6261997", "text": "def update!(**args)\n @fields = args[:fields] if args.key?(:fields)\n @properties = args[:properties] if args.key?(:properties)\n end", "title": "" }, { "docid": "f88ac8dac0e7b4769636f755e65a14ba", "score": "0.6261997", "text": "def update!(**args)\n @fields = args[:fields] if args.key?(:fields)\n @properties = args[:properties] if args.key?(:properties)\n end", "title": "" }, { "docid": "f88ac8dac0e7b4769636f755e65a14ba", "score": "0.6261997", "text": "def update!(**args)\n @fields = args[:fields] if args.key?(:fields)\n @properties = args[:properties] if args.key?(:properties)\n end", "title": "" }, { "docid": "f88ac8dac0e7b4769636f755e65a14ba", "score": "0.6261997", "text": "def update!(**args)\n @fields = args[:fields] if args.key?(:fields)\n @properties = args[:properties] if args.key?(:properties)\n end", "title": "" }, { "docid": "f88ac8dac0e7b4769636f755e65a14ba", "score": "0.6261997", "text": "def update!(**args)\n @fields = args[:fields] if args.key?(:fields)\n @properties = args[:properties] if args.key?(:properties)\n end", "title": "" }, { "docid": "f88ac8dac0e7b4769636f755e65a14ba", "score": "0.6261997", "text": "def update!(**args)\n @fields = args[:fields] if args.key?(:fields)\n @properties = args[:properties] if args.key?(:properties)\n end", "title": "" }, { "docid": "afd53a32bf51a2ff3c438cbf011b1ee6", "score": "0.6261246", "text": "def update!\n saved = false\n retries = RETRIES\n while !saved\n begin\n res = Persistence::Setup.db.save_doc(@properties)\n @properties = Persistence::Setup.db.get(res['id'])\n saved = true\n rescue Exception => ex\n raise ex if ex.http_code != 409\n if(retries > 0)\n @new_properties = Persistence::Setup.db.get(@properties['_id'])\n @properties.each_pair do |k,v|\n if k != \"_rev\" && k != \"_id\"\n @new_properties[k] = v\n end\n end\n @properties = @new_properties\n else\n raise ex\n end\n end\n end\n :ok\n end", "title": "" }, { "docid": "118090da310d688caa13dea348732f3c", "score": "0.62579167", "text": "def update(attributes={})\n self.class.update(self, attributes)\n end", "title": "" }, { "docid": "91dc386ff8fa066852510a5d62b13078", "score": "0.62170374", "text": "def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end", "title": "" }, { "docid": "91dc386ff8fa066852510a5d62b13078", "score": "0.62170374", "text": "def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end", "title": "" }, { "docid": "6249943d1eeff63f8f611fcf73254058", "score": "0.62152076", "text": "def update\n \n end", "title": "" }, { "docid": "1c12f310aca206a2cefff8c291007668", "score": "0.6210263", "text": "def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end", "title": "" }, { "docid": "3dfb66c3e13f181393bb4510e9fcd51f", "score": "0.62083745", "text": "def set_update(attrs = {})\n @movement.attributes = attrs.slice(*attributes_for_update)\n set_details\n\n @movement.balance = get_updated_balance\n @movement.gross_total = original_total\n @movement.set_state_by_balance!\n @movement.discounted = ( discount > 0 )\n\n @movement.balance_inventory = balance_inventory\n @movement.delivered = @movement.details.all? {|v| v.balance <= 0}\n\n @errors.new(movement).set_errors\n end", "title": "" }, { "docid": "1c0316f22c6db917fa4719767b5326a9", "score": "0.6204041", "text": "def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end", "title": "" }, { "docid": "5d229ea224b1dfa7ac9ce6808ca63fc4", "score": "0.62017816", "text": "def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end", "title": "" }, { "docid": "6992c0833b982296b329ec1d8c7289de", "score": "0.6201711", "text": "def update(attributes = {})\n self.attributes = attributes\n _update\n end", "title": "" }, { "docid": "2beb42793217599eea1dac4b91640e41", "score": "0.6196084", "text": "def update_attributes\n server_update_data.each_pair do |key, value|\n instance_variable_set(\"@#{key}\", value)\n end\n end", "title": "" }, { "docid": "67f76e6622d1021031437ad609613c63", "score": "0.6192824", "text": "def update(obj)\n obj.each_pair do |key, value|\n send(\"#{key}=\", value)\n end\n self\n end", "title": "" }, { "docid": "30aa07725af2114280d6e8f916ab079f", "score": "0.6183338", "text": "def update!\n\t\t\tconstruct!(self, &@update)\n\t\t\t@update = nil\n\t\t\t\n\t\t\treturn self\n\t\tend", "title": "" }, { "docid": "f1f71f298690a3bd1f5832b15038d8bb", "score": "0.6174291", "text": "def updated_properties\n @updated_properties ||= ActiveSupport::HashWithIndifferentAccess.new\n end", "title": "" }, { "docid": "e1f766468b11768b786daa133483b157", "score": "0.61730784", "text": "def update\n raise NotImplementedError\n end", "title": "" }, { "docid": "ed1b58af16fd466e308ffc9229115e36", "score": "0.6145399", "text": "def update_attributes(params)\n raise(RHapi::AttributeError, \"The params must be a hash.\") unless params.is_a?(Hash)\n params.each do |name, value|\n self.properties.send(name.to_s + '=', value)\n end\n save # only call API once rather than repeatedly saving with update_attribute calls\n end", "title": "" }, { "docid": "ed1b58af16fd466e308ffc9229115e36", "score": "0.6145399", "text": "def update_attributes(params)\n raise(RHapi::AttributeError, \"The params must be a hash.\") unless params.is_a?(Hash)\n params.each do |name, value|\n self.properties.send(name.to_s + '=', value)\n end\n save # only call API once rather than repeatedly saving with update_attribute calls\n end", "title": "" }, { "docid": "147d62c4df79ff1ca86cbd477112bf7f", "score": "0.61445665", "text": "def update\n end", "title": "" }, { "docid": "147d62c4df79ff1ca86cbd477112bf7f", "score": "0.61445665", "text": "def update\n end", "title": "" }, { "docid": "147d62c4df79ff1ca86cbd477112bf7f", "score": "0.61445665", "text": "def update\n end", "title": "" }, { "docid": "7f11aed7030229ef429116ccba78c00f", "score": "0.61400205", "text": "def update_properties\n # t_init = 0, t_mod = 0, t_formula = 0, t_formula_mod = 0, t_post_init = 0\n # t_update_properties = Benchmark.measure do\n # Reset values for everything except formulas\n # t_init = Benchmark.measure do\n character_properties.reject { |p| p.is_a?(CharacterFormula) }.each do |p|\n p.init(self)\n end\n # end\n\n # Apply modifiers to attributes, skills and resistances (formulas later)\n mods = []\n # t_mod = Benchmark.measure do\n mods << race.property_modifiers if race\n mods << birthsign.property_modifiers if birthsign\n mods.flatten!\n mods.reject { |m| m.property.is_a?(Formula) }.each(&method(:apply_modifier))\n # end\n\n # Now start to process formulas\n # t_formula = Benchmark.measure do\n character_properties.select { |p| p.is_a?(CharacterFormula) }.each do |f|\n f.init(self)\n end\n # end\n\n # Apply modifiers to formulas\n # t_formula_mod = Benchmark.measure do\n mods.select { |m| m.property.is_a?(Formula) }.each(&method(:apply_modifier))\n # end\n\n # t_post_init = Benchmark.measure do\n character_properties.each do |prop|\n prop.post_init(self)\n end\n # end\n # end\n\n # logger.warn(\"## Init: #{(t_init.real*1000).to_i}ms\")\n # logger.warn(\"## Mofifiers: #{(t_mod.real*1000).to_i}ms\")\n # logger.warn(\"## Formula: #{(t_formula.real*1000).to_i}ms\")\n # logger.warn(\"## Formula Modifiers: #{(t_formula_mod.real*1000).to_i}ms\")\n # logger.warn(\"## Post Init: #{(t_post_init.real*1000).to_i}ms\")\n # logger.warn(\"### Update Properties: #{(t_update_properties.real*1000).to_i}ms\")\n end", "title": "" }, { "docid": "22a21a1959eeb926dfe475d8878239d7", "score": "0.6127356", "text": "def update\n connection.put(singleton_path(prefix_options), encode, self.class.headers).tap do |response|\n load_attributes_from_response(response)\n end\n end", "title": "" } ]
9094411bdb52c7f574811a016deb8c5b
Print all odd numbers from 1 to 99, inclusive. All numbers should be printed on separate lines. Input N/A Output odd numbers 199 on separate lines Data string Algo: > get range 199 > iterate thru range > if num % 2 == 1 > puts num
[ { "docid": "d0a5611f61d01802d48889fd46728137", "score": "0.8342714", "text": "def print_odd\n range = (1..99).to_a\n range.each do |num|\n if num % 2 == 1\n puts num\n end\n end\nend", "title": "" } ]
[ { "docid": "4f233fdc2f201df9b6669a1e05124ea3", "score": "0.7973838", "text": "def print_odd\n (1..99).each do |num|\n if num.odd?\n puts num\n end\n end\nend", "title": "" }, { "docid": "b5df5f74a53918a50b913125edd06421", "score": "0.76553434", "text": "def odd_numbers()\n 1.upto(99) { |number| puts number if number.odd? }\nend", "title": "" }, { "docid": "739f0711c6f3644f11bd8a71f28f7288", "score": "0.7642325", "text": "def odd\n\t(1..99).each { |x| if x % 2 == 1 then puts x end }\nend", "title": "" }, { "docid": "3d8db4e65db3acd91eef24883d6996ac", "score": "0.7516203", "text": "def print_the_numbers(range)\n for number in range\n puts \"An odd number: #{number}\" if number.odd?\n puts \"An even number: #{number}\" if number.even?\n end\nend", "title": "" }, { "docid": "71652124cc9e9a6e50d3672f711d8f82", "score": "0.7459131", "text": "def print_odd_numbers_up_to(n)\n for i in 1..n\n puts i if i % 2 != 0\n end\n end", "title": "" }, { "docid": "f2056aa7b09db258543f6db0ec442e5c", "score": "0.73630345", "text": "def every_other_number\n number = 0\n while number < 100\n if number % 2 != 0\n puts number\n end \n number += 1\n end\nend", "title": "" }, { "docid": "683b992197696d3e019b47d5fc6b4372", "score": "0.7318242", "text": "def print_odd_nums()\n for i in 1..10\n if(i % 2 != 0)\n puts i\n end\n end\nend", "title": "" }, { "docid": "683b992197696d3e019b47d5fc6b4372", "score": "0.7318242", "text": "def print_odd_nums()\n for i in 1..10\n if(i % 2 != 0)\n puts i\n end\n end\nend", "title": "" }, { "docid": "669ca0bd8f55f1f6e0557f4c3f00cfb2", "score": "0.72279406", "text": "def oddNum\n\tfor i in 1..255\n\t\tif i % 2 == 1\n\t\t\tputs i\n\t\tend\n\tend\nend", "title": "" }, { "docid": "6706fbfe4e4e1acb497440382dde7b97", "score": "0.7200097", "text": "def print_odd_integers\n num = 1\n while num <= 255\n if num.odd?\n p num\n end\n num += 1\n end\nend", "title": "" }, { "docid": "987e88f71958a1a5e8ff60336747198d", "score": "0.71805614", "text": "def print_odd\n counter = 1\n until counter > 99\n puts counter\n counter += 2\n end\nend", "title": "" }, { "docid": "55ef4800ce61ddeb0c8c03028386d2fb", "score": "0.71665806", "text": "def print_odd\n (1..255).each do |i|\n puts i if i.odd?\n end\nend", "title": "" }, { "docid": "0a0bca25cff89710d3097e42ba78775c", "score": "0.69495684", "text": "def odd_numbers\n puts (1..255).find_all { |i| i % 2 == 1 }\nend", "title": "" }, { "docid": "8d3d3cff20eea5f23633df30bfbf68dc", "score": "0.6940658", "text": "def print_odd\n for i in 1..255\n puts i if i % 2 != 0\n end\nend", "title": "" }, { "docid": "9cef1f891fd826b5ddf1aaac0db3203d", "score": "0.68327546", "text": "def dos_numeros(a, b)\n (a..b).each { |i| puts i if i.even? }\nend", "title": "" }, { "docid": "33cb65688a0164e171803dcf72160a4c", "score": "0.6814056", "text": "def odd \n\ti = 1\n\twhile i <= 255\n\t\tputs i if i%2!=0\n\t\ti+=1\n\tend\nend", "title": "" }, { "docid": "bbc26b54f4e224c8c5e05919cfedb140", "score": "0.6781721", "text": "def numeros_pares(numero1,numero2)\n\tfor n in numero1..numero2\n\t\tif (n % 2).zero?\n\t\t\tputs n\n\t\telse\n\t\t\tputs \"#{n} no es par\"\n\t\tend\n\tend\nend", "title": "" }, { "docid": "4164805310217204a99dc0d65244b789", "score": "0.6778926", "text": "def print_all_num(num)\n for i in (2...num)\n print i\n end\nend", "title": "" }, { "docid": "39bcf20110e4d9c9af1c28a6e8d2d7ef", "score": "0.6775299", "text": "def print_odds\n\tfor num in 1..255\n\t\tputs num unless num % 2 == 0\n\tend\nend", "title": "" }, { "docid": "8621a88932a517e5a1774665aa968f0f", "score": "0.6747155", "text": "def pares(n1, n2)\n for i in n1.. n2\n puts \"#{i}\" if i.even?\n end\nend", "title": "" }, { "docid": "99005ad04ba4e12bece3d27703562a3b", "score": "0.67381155", "text": "def oddNum\n\t0.upto(255) { |i| puts i unless i.even? }\nend", "title": "" }, { "docid": "e8976e2dc6b712d290473cb3d49d7bde", "score": "0.671463", "text": "def numeros_pares(a, b)\n (a..b).each do |i|\n puts i if i.even?\n end\nend", "title": "" }, { "docid": "8d30955bd8a22c2a239f8e2a388a95cd", "score": "0.6679719", "text": "def print_even_nums()\n for i in 1..10\n if(i % 2 == 0)\n puts i\n end\n end\nend", "title": "" }, { "docid": "8d30955bd8a22c2a239f8e2a388a95cd", "score": "0.6679719", "text": "def print_even_nums()\n for i in 1..10\n if(i % 2 == 0)\n puts i\n end\n end\nend", "title": "" }, { "docid": "c4b2189cf6d774b0328257a184f65326", "score": "0.6640624", "text": "def printOnetoHundred \n\n\n(1..100).each{|number| p number}\n\n\nend", "title": "" }, { "docid": "d9dd914e9c1bf7fad1045b04b6f5068a", "score": "0.66275567", "text": "def printNums()\n\ti = 0\n\twhile i <= 100\n\t\tputs i\n\n\t\ti += 1\n\tend\nend", "title": "" }, { "docid": "55b8c5f9cb8452df008694be7c7ae2e5", "score": "0.6587466", "text": "def odd1_255\n (1..255).each{ |i| puts i if i%2 != 0 }\nend", "title": "" }, { "docid": "fc468cbc696fdbd41fe4e4b24190398d", "score": "0.6575886", "text": "def obtener_pares(num1, num2)\n inicio = num1 < num2 ? num1 : num2\n final = num1 > num2 ? num1 : num2\n inicio.upto(final) do |i|\n puts i if i.even?\n end\nend", "title": "" }, { "docid": "013c2d2b5843c120daaf49f4dda92527", "score": "0.6571041", "text": "def odds\n last = []\n (1..50).each do |i|\n if i % 2 == 1\n puts i\n last.unshift 100 - i\n end\n end\n puts last.join(\"\\n\")\nend", "title": "" }, { "docid": "2a803423fe81f6a147dbaf51830d9127", "score": "0.6565625", "text": "def evenNumbers(number)\n (1..number). each do |x|\n if x.even?\n puts x\n end\n end\nend", "title": "" }, { "docid": "e0b4c219def3ceaa1909cab8001ee1f2", "score": "0.6561863", "text": "def odd_number_generator(start, finish)\n puts \"Printing out odd numbers...\"\n sleep 2\n (start..finish).each do |number|\n next if number % 2 == 0\n puts number\n end\nend", "title": "" }, { "docid": "0838dd7191571c4f4768ceb8752199b4", "score": "0.6524483", "text": "def display_odds(nums)\n for num in nums\n puts num if num.odd?\n end\nend", "title": "" }, { "docid": "1a651f4530f84616b21e75dd981e9aa9", "score": "0.6501996", "text": "def pares(num1, num2)\n num1.upto(num2) do |i|\n puts i if i.even?\n end\n\nend", "title": "" }, { "docid": "eee052f4699a5c3b8de15a6acaecb988", "score": "0.6477857", "text": "def even \n (1..15).each do |i| \n if (i % 2 == 0)\n puts \"#{i} is even\"\n else (i % 2 != 0)\n puts \"#{i} is odd\"\n end \n end\nend", "title": "" }, { "docid": "7b6761ab06e74de7bad90cc889b57d0d", "score": "0.6474168", "text": "def output\n @range.each do |number|\n if even_split?(number, 3)\n puts \"fizz\"\n elsif even_split?(number, 5)\n puts \"buzz\"\n else\n puts number\n end\n end \n end", "title": "" }, { "docid": "7b6761ab06e74de7bad90cc889b57d0d", "score": "0.6474168", "text": "def output\n @range.each do |number|\n if even_split?(number, 3)\n puts \"fizz\"\n elsif even_split?(number, 5)\n puts \"buzz\"\n else\n puts number\n end\n end \n end", "title": "" }, { "docid": "5adc06a9503765ce9e687a89f8bb41e4", "score": "0.6468005", "text": "def output\n @range.each do |number|\n if even_split?(number, 3)\n puts \"fizz\"\n elsif even_split?(number, 5)\n puts \"buzz\"\n else\n puts number\n end\n end\n end", "title": "" }, { "docid": "5adc06a9503765ce9e687a89f8bb41e4", "score": "0.6468005", "text": "def output\n @range.each do |number|\n if even_split?(number, 3)\n puts \"fizz\"\n elsif even_split?(number, 5)\n puts \"buzz\"\n else\n puts number\n end\n end\n end", "title": "" }, { "docid": "5adc06a9503765ce9e687a89f8bb41e4", "score": "0.6468005", "text": "def output\n @range.each do |number|\n if even_split?(number, 3)\n puts \"fizz\"\n elsif even_split?(number, 5)\n puts \"buzz\"\n else\n puts number\n end\n end\n end", "title": "" }, { "docid": "147e83379eaf3d53ed2d03c74cf7e553", "score": "0.6466056", "text": "def print_numbers\n (1..100).each do |n|\n n4 = n % 4 == 0\n n6 = n % 6 == 0\n if n4 || n6\n if n4\n print \"Linked\"\n end\n if n6\n print \"In\"\n end\n print \"\\n\"\n else\n puts n\n end\n end\nend", "title": "" }, { "docid": "ab252131a4245287d81e65c742221bb5", "score": "0.6438557", "text": "def print_evens(number)\n i = 0\n while i <= number\n if i % 2 == 0\n p i\n end\n i += 1\n end\n return \"finished!\"\nend", "title": "" }, { "docid": "880a160df00d3f16dc3c32f618a43b38", "score": "0.6424343", "text": "def print_odd\n puts 1.upto(255).find_all { |i| (i % 3).zero? } #same same\n print (1..255).find_all { |i| (i % 3).zero? } #same same\nend", "title": "" }, { "docid": "476157eb42de026efc1d2c0ec96118f0", "score": "0.6402911", "text": "def even_numbers_less_than num\n\tnum = [0,2,4,6,8, 10, 12]\n\n\tfor num in 10 do\n \tputs num\n\tend\nend", "title": "" }, { "docid": "2b04865b15a9067eebc7d478e187f683", "score": "0.6374813", "text": "def numbers_to_100\n index = 1\n while index < 101\n puts index\n index += 1\n end\nend", "title": "" }, { "docid": "ebe1b43e89dad7def592fed1d200bed2", "score": "0.6340302", "text": "def odd_range(min, max)\n odd_numbers = []\n i = min\n while i <= max\n if i % 2 != 0\n odd_numbers << i\n end\n i += 1\n end\n\n return odd_numbers\nend", "title": "" }, { "docid": "ebe1b43e89dad7def592fed1d200bed2", "score": "0.6340302", "text": "def odd_range(min, max)\n odd_numbers = []\n i = min\n while i <= max\n if i % 2 != 0\n odd_numbers << i\n end\n i += 1\n end\n\n return odd_numbers\nend", "title": "" }, { "docid": "a4e907874c06dabd4a86dc4b62da09fe", "score": "0.63160044", "text": "def odd_range(min, max)\n odds = []\n i = min\n while i <= max\n if i % 2 != 0\n odds << i\n end\n i += 1\n end\n odds\n\nend", "title": "" }, { "docid": "64d133c2dd03718faa4e74ec4da55042", "score": "0.6310743", "text": "def odd_range(min, max)\n nums = []\n i = min\n while i <= max\n if i % 2 != 0\n nums << i\n end\n i+=1\n end\n return nums\nend", "title": "" }, { "docid": "be13d997f8abefd7e865141c92d9f204", "score": "0.63062614", "text": "def odd_numbers(numbers)\n return '' if numbers.length == 0\n\n if numbers[0] % 2 != 0\n \"#{numbers[0]} \" + odd_numbers(numbers[1, numbers.length - 1])\n else\n odd_numbers(numbers[1, numbers.length - 1])\n end\nend", "title": "" }, { "docid": "9e0a29790cab2aa644230f48458a284b", "score": "0.63001126", "text": "def print_odd_indexed_integers(array)\n\n array.each_with_index do |number, idx|\n number if idx % 2 != 0\n end\nend", "title": "" }, { "docid": "59d6215648a62b5c012721b37b1f54a7", "score": "0.6281795", "text": "def odd_range(min, max)\n nums = []\n\n i = min\n while i <= max\n if i % 2 != 0\n nums << i\n end\n i += 1\n end\n\n return nums\nend", "title": "" }, { "docid": "9c360005088a404ba7a14f5abf725589", "score": "0.62698376", "text": "def pares(num1, num2)\n while num1 <= num2\n puts num1 if num1.even?\n num1 += 1\n end\nend", "title": "" }, { "docid": "50e3d089f0c51454b3b68f073058e361", "score": "0.6229698", "text": "def pares(num, sum)\n for i in num..sum do\n puts i if i.even?\n i += 1\n end\nend", "title": "" }, { "docid": "dc41c1fa629e92dcc2f57bc8c11333e1", "score": "0.6220314", "text": "def even_nums(max)\n print (0..max).step(2).to_a\nend", "title": "" }, { "docid": "fbfc86446262fa1afb8ea416a7995b56", "score": "0.61981857", "text": "def odd_num\n\ty = []\n\tfor i in 0..255\n\t\ty.push i if i%2!=0\n\tend\n\tprint y\nend", "title": "" }, { "docid": "3fe81ca8bfc7b8acc6a9a2865db1d5ab", "score": "0.6197452", "text": "def even_numbers(lower, upper)\n if lower <= upper\n puts lower\n even_numbers(lower + 2, upper)\n end\nend", "title": "" }, { "docid": "b0190ba0c8863dab33e4a8b20fc71e8d", "score": "0.61937505", "text": "def oddNums()\n puts \"\\nCreate array called y that has odd numbers. Print the array.\"\n y = []\n for i in 1..255\n if i.odd?\n y.push(i)\n end\n end\n puts \"#{y}\"\nend", "title": "" }, { "docid": "e1fe49cf9cc0b78adfa612122c3db48a", "score": "0.6156558", "text": "def stringy(num)\n arr = (1..num).to_a.map do |element|\n if element.odd?\n element = 1\n else\n element = 0\n end\n end\n p arr.join\nend", "title": "" }, { "docid": "2032111a1b2e8f9368ea06b829a229a1", "score": "0.6156058", "text": "def odd_range(min,max)\n odds = []\n\n i = min\n while i <= max\n if i % 2 == 1\n odds << i\n end\n\n i += 1\n end\n\n return odds\nend", "title": "" }, { "docid": "8994d0f34e27292fe2d26a5cf97f34ac", "score": "0.61347306", "text": "def odd_range(min, max)\n odds = []\n \n i = min\n while i <= max\n if i % 2 != 0\n odds << i\n end\n \n i += 1\n end\n \n return odds\n end", "title": "" }, { "docid": "280b1f8501a5c4bcb4e70b59be42c64d", "score": "0.61272806", "text": "def oddNums\n y = []\n (1..255).step(2){|x| y.push(x)}\n print y\nend", "title": "" }, { "docid": "4b23656cb01304f667f5f90e66739ba0", "score": "0.6124783", "text": "def print_odd_indexed_integers(array)\n odd = []\n array.each_with_index do |number, index|\n if index % 2 == 1\n odd << number\n end\n end\n odd\nend", "title": "" }, { "docid": "83fd0d77fb300e8ca95ed3d44c4f60b2", "score": "0.61214215", "text": "def even_or_odd(num)\n\trem = num % 2\n\n\tstr = rem == 0 ? \"even\" : \"odd\"\n\n\tprintf(\"\\n%d is %s\", num, str)\t\nend", "title": "" }, { "docid": "18c8056b451174f04995db4673778344", "score": "0.60874575", "text": "def even_number_detector(n)\n\tcurrent_number = 0\n\t\n\twhile current_number < n\n\t puts current_number\n\t current_number += 2\n\tend\nend", "title": "" }, { "docid": "37e2e09ae4557f6eaf718e8af5a30f93", "score": "0.6079691", "text": "def print_out_Numbers ()\n (1..100).each do |x|\n if (x %3 === 0 && x %5 === 0);\n puts\"FizzBuzz\"\n elsif ( x %3 === 0);\n puts \"Fizz\"\n elsif (x %5 === 0);\n puts \"Buzz\"\n else\n puts x\n end\n end\nend", "title": "" }, { "docid": "d2528d4178accc0e72b0b7c0aa2dfceb", "score": "0.60742146", "text": "def odd_range(min, max)\n odds = []\n i = min\n\twhile i <= max\n\t if(i % 2 != 0)\n odds << i\n end \n i += 1\n end\n return odds\nend", "title": "" }, { "docid": "f251bab8029c77462206118fb2cfffa3", "score": "0.6053301", "text": "def odd_number_detector(n)\n current_count = 3\n \n while current_count < n\n if current_count.odd?\n puts \"#{current_count}!\"\n end\n current_count += 3\n end\n \nend", "title": "" }, { "docid": "8b1d8334e1ffcae50f68e3268cea3b93", "score": "0.60412496", "text": "def even_numbers_less_than num\n even_numbers = []\n for i in 0...num\n if i % 2 == 0\n even_numbers.push(i)\n end\n end\n even_numbers\nend", "title": "" }, { "docid": "80fff2d69cd3f47323abdac8d272baac", "score": "0.601938", "text": "def fizzbuzz(num_1, num_2, range)\n #for an inclusive range between one and up to and including the range variable...\n (1..range).each do |i|\n # print to console 'fizzbuzz' for each number where i is evenly divisible by\n # num_1 AND num_2 (with no remainders)\n if i % num_1 === 0 && i % num_2 === 0\n puts 'fizzbuzz'\n # print 'fizz' if only divisible by num_1\n elsif i % num_1 === 0\n puts 'fizz'\n # print 'buzz' if only divisible by num_2\n elsif i % num_2 === 0\n puts 'buzz'\n # for all other cases, just print i local variable / the number from our range to console\n else\n puts i\n end\n end\nend", "title": "" }, { "docid": "5321682047163697550501ce5dd93759", "score": "0.6006029", "text": "def odds(max)\n @odd = []\n @arr = (2..max).to_a\n\n # The array odds is created with all the odd numbers in the range as elements\n @arr.each do |var|\n if var % 2 != 0\n @odd << var\n end\n end\n return @odd\n end", "title": "" }, { "docid": "3d73de916bd21202a74c15e9bf70461b", "score": "0.60047734", "text": "def print_odd_indexed_integers(array)\r\n\tarray.each_with_index do |item , index|\r\n\t\tputs item.to_s if index.odd?\r\n\tend\r\nend", "title": "" }, { "docid": "82c82f0856bce0e8cfdbd75f16089638", "score": "0.5993536", "text": "def pares_entre(pmt1, pmt2)\n (pmt1..pmt2).each do |item|\n puts item if item.even?\n end\nend", "title": "" }, { "docid": "1c20b75671ff0f36ca89f41740c9620e", "score": "0.597514", "text": "def even_numbers_less_than num\n even_nums = []\n i = 0\n begin\n even_nums.push(i)\n i+=2\n end until i>num-2\n return even_nums\nend", "title": "" }, { "docid": "6ca3f3fda081b85ef5d1de0cbb23cfd5", "score": "0.5971507", "text": "def fizzbuzz(num_1, num_2, range)\n # iterate over a range of values from 1 to range, using i as the iterator\n (1..range).each do |i|\n # if the modulus of i by both num_1 and num_2 are exactly 0, print 'fizzbuzz' to terminal\n if i % num_1 === 0 && i % num_2 === 0\n puts 'fizzbuzz'\n # else if the modulus of i by num_1 is exactly 0, print 'fizz' to the terminal\n elsif i % num_1 === 0\n puts 'fizz'\n # else if the modulus of i by num_2 is exactly 0, print 'buzz' to the terminal\n elsif i % num_2 === 0\n puts 'buzz'\n # otherwise, print the iterator i to the terminal\n else\n puts i\n end\n end\nend", "title": "" }, { "docid": "a6440d07e012518168f25345614401ab", "score": "0.5965784", "text": "def even_numbers(arr)\n if arr.length == 0\n return \"There are no numbers at all\"\n end\n\n index = 0\n\n while index < arr.length\n if arr[index] % 2 == 0\n puts arr[index]\n end\n\n index += 1\n end\nend", "title": "" }, { "docid": "9e851db452746abb3539b05ac4234de1", "score": "0.5964722", "text": "def num_range(x, y)\n for i in x .. y\n if i % 3 == 0 && i % 5 == 0\n print \"FizzBuzz, \"\n elsif i % 3 == 0\n print \"Fizz, \"\n elsif i % 5 == 0\n print \"Buzz, \"\n else\n print i.to_s + \", \"\n end\n end\nend", "title": "" }, { "docid": "cef3f3dfb0ab598716e3a43c586123df", "score": "0.5964526", "text": "def return_evens(n)\n num = n*2\nfor i in 1..num\n if i % 2 == 0\n puts i\nend\nend\nend", "title": "" }, { "docid": "9a4956be8be11a7252aa916a556d422b", "score": "0.59636813", "text": "def one_liner()\r\n for num in 1..100; if num % 3 == 0 && num % 5 == 0; puts \"Mined Minds\"; elsif num % 3 == 0; puts \"Mined\"; elsif num % 5 == 0; puts \"Minds\"; else puts num; end; end\r\nend", "title": "" }, { "docid": "ee8fc9643892a3434483f63a3b644c86", "score": "0.59507513", "text": "def print_evens(number)\n i = 0\n while i <= number\n p i\n i += 2\n end\nend", "title": "" }, { "docid": "7dec8fc27706d47e80adc3bc0390cba6", "score": "0.5940846", "text": "def print_all_primes(num)\n# for(let i=2;i<=num;i++)\n # for i in (num).downto(2)\n # range operator\n for i in (2..num-1)\n is_status=is_prime(i)\n if(is_status)\n puts i\n end\n end\nend", "title": "" }, { "docid": "b868e01b3ae57b055750da61423b21b2", "score": "0.59375584", "text": "def stringy(num)\n results = []\n \n (num / 2 ).times { results << 1 << 0 }\n results << 1 if num.odd?\n \n results.join\nend", "title": "" }, { "docid": "dace51e79832fe80eefb145062ce9d31", "score": "0.59371114", "text": "def printSixes\n\n\t (1..100).each do |i|\n\t puts i if i % 6 ==0\n end \nend", "title": "" }, { "docid": "eaa648e015e58a771b91439480fea5b9", "score": "0.5935588", "text": "def fizzbuzz(num_1, num_2, range)\n #this uses the each enumerable to reference the third parameter above\n (1..range).each do |i|\n #below, for each integer between one and the range:\n #if the modulo of both num_1 and num_2 is 0, print fizzbuzz\n if i % num_1 === 0 && i % num_2 === 0\n puts 'fizzbuzz'\n #if the modulo of num_1 is 0, print fizz\n elsif i % num_1 === 0\n puts 'fizz'\n #if the modulo of num_2 is 0, print buzz\n elsif i % num_2 === 0\n puts 'buzz'\n #otherwise, print the integer\n else\n puts i\n end\n end\nend", "title": "" }, { "docid": "f99d39a04e713cdfd267be586f716d5d", "score": "0.5935097", "text": "def printNums(min, max)\n\ti = min\n\twhile i <= max\n\t\tputs i\n\n\t\ti += 1\n\tend\nend", "title": "" }, { "docid": "7580384e495eed20b9149c866363592b", "score": "0.5913585", "text": "def parcount(num1, num2)\n i = [num1, num2].min\n e = [num1, num2].max\n\n while i <= e\n print \"#{i} \" if i.even? \n i += 1\n end\nend", "title": "" }, { "docid": "771f0725ab0e1e2eb6b89ebe9c157dfe", "score": "0.5910204", "text": "def odd_range(min, max)\n\todd_numbers = []\n \twhile min <= max\n \tif min % 2 != 0\n \todd_numbers << min\n end\n min += 1\n end\n return odd_numbers\nend", "title": "" }, { "docid": "8f87cc739e3d2b8fb3e3297d4dcec64a", "score": "0.5900413", "text": "def print_evens\n 1.upto(255) { |i| puts i if i % 2 != 0 }\nend", "title": "" }, { "docid": "9921596ad56ec6dc610640239e966c8e", "score": "0.58991885", "text": "def even_number(arr,number)\n puts arr.select{|i| i.even?}.slice(-number, number)\n end", "title": "" }, { "docid": "d2af6e45b736d9415cd20a3da1632f47", "score": "0.5894011", "text": "def print_nums(type, num, limit)\n print \"#{type}: \" if num == 1\n print \"#{num}\"\n print \", \" if num < limit\n print \"\\n\" if num == limit\nend", "title": "" }, { "docid": "cf44984f5177d904da06d20cda1fc2a1", "score": "0.58860135", "text": "def odd_range(min, max)\n (min..max).select { |num| num % 2 != 0 }\nend", "title": "" }, { "docid": "6155b2889414f1b54ccff9707f87dfcf", "score": "0.58743", "text": "def odd_range(min, max)\n\ti = min\n array = []\n while(i <= max)\n \tif(i%2 != 0)\n array << i\n end\n i +=1\n \n end\n return array\nend", "title": "" }, { "docid": "d4babb5d6b3b8bc44aae406e7d816657", "score": "0.58730316", "text": "def one_liner()\n for num in 1..100; if num % 3 == 0 && num % 5 == 0; puts \"Mined Minds\"; elsif num % 3 == 0; puts \"Mined\"; elsif num % 5 == 0; puts \"Minds\"; else puts num; end; end\nend", "title": "" }, { "docid": "dcd9f32ff43121ee658f68caf20a6c07", "score": "0.58673596", "text": "def print_all_primes num\r\n\r\n for i in (2..num).step 2\r\n is_status=is_prime i\r\n if is_status\r\n puts i\r\n end\r\n end\r\n\r\nend", "title": "" }, { "docid": "52a4c170c399517674c926c0cdbfe09f", "score": "0.58583844", "text": "def print_odd_indexed_integers(array)\n array.each_with_index do |value, index|\n puts value if index.even?\n end\nend", "title": "" }, { "docid": "6e458259a643ec502c15430ae2ec9cf5", "score": "0.5853398", "text": "def some_odd(numbers)\n for i in numbers do \n if i % 2 != 0\n return p true\n end\n end\n return p false\n end", "title": "" }, { "docid": "569b286fb63faa941ce603ebd956fe29", "score": "0.58526284", "text": "def fizzbuzz(n1, n2, to)\n (1..to).each do |i|\n flag = 0\n if i != 1 then print \" \" end\n if i % n1 == 0 then print \"F\"; flag = 1 end\n if i % n2 == 0 then print \"B\"; flag = 1 end\n if flag == 0 then print i end\n end\n puts \"\"\nend", "title": "" }, { "docid": "c64311fcb8a9e4950074cfd61482b13b", "score": "0.58461577", "text": "def enteros(a, b)\n (a..b).each { |i| puts i if i.even? }\n (b..a).each { |i| puts i if i.even? }\nend", "title": "" }, { "docid": "e49a81466946abc412c12e3a939fe55a", "score": "0.58414924", "text": "def imprime_pares(num1, num2)\n while num1 <= num2 && num1 > 0 && num2 > 0\n puts num1 if num1 != 0 && num1.even?\n num1 += 1\n end\nend", "title": "" }, { "docid": "7d8b6ad2157f0d20a8e80047ab9adb9a", "score": "0.58406556", "text": "def stringy(num)\n res = ''\n (1..num).each { |current| current.odd? ? res << '1' : res << '0' }\n res\nend", "title": "" }, { "docid": "ffc5e4a5acbd54ae215c4376620280d5", "score": "0.58357936", "text": "def even_odd_func(my_nums)\n even_odd = my_nums.map do |my_num|\n if my_num % 2 == 0\n \"even\"\n else\n \"odd\"\n end\n end\n return even_odd\nend", "title": "" } ]
3858b37b85d4050dd6003acec43953fa
GET /codvendas GET /codvendas.json
[ { "docid": "972737288acadd9346e290cdbad68a33", "score": "0.71261704", "text": "def index\n @codvendas = Codvenda.all\n end", "title": "" } ]
[ { "docid": "077966d3de37664d53058552b7ed102e", "score": "0.66243184", "text": "def index\n @antecedentes = Antecedente.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @antecedentes }\n end\n end", "title": "" }, { "docid": "e655e31720bc3c0ae3ac8e58adab2497", "score": "0.6589143", "text": "def index\n\t\tvendas = Venda.all\n\t\trender json: vendas, status: :ok\n\tend", "title": "" }, { "docid": "312103c05759cb60e8f0a3fdb848cf00", "score": "0.6555826", "text": "def index\n @cadavres = Cadavre.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @cadavres }\n end\n end", "title": "" }, { "docid": "9af5b1061d4491218358eb9be5ea4fa8", "score": "0.6396226", "text": "def index\n @contas = Conta.all\n respond_to do |format|\n format.json { render json: @contas.to_json, status: :ok }\n end\n end", "title": "" }, { "docid": "e8f00442e4aeb2094b6769a4ffe63636", "score": "0.63762766", "text": "def index\n @notadedebito = Notadedebito.find(params[:notadedebito_id])\n @renglon_nddndcs = @notadedebito.renglon_nddndcs\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @renglon_nddndcs }\n end\n end", "title": "" }, { "docid": "7d78d46636cba1a22f0a0d3e3e32b0c4", "score": "0.63566184", "text": "def index\n @dnas = Dna.all\n\n render json: @dnas\n end", "title": "" }, { "docid": "7029444639e147351ea916b858275809", "score": "0.6352316", "text": "def index\n @enderecos = Endereco.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @enderecos }\n end\n end", "title": "" }, { "docid": "9e6198dada45603826f42bb2ba854580", "score": "0.63398254", "text": "def index\n @curriculum_vitaes = findable_curriculum_vitaes.all\n respond_to do |format|\n format.html {}\n format.json { render json: @curriculum_vitaes }\n end\n end", "title": "" }, { "docid": "f230b8aea180ab04c4865c189d78c76b", "score": "0.63136053", "text": "def index\n @vendedor_clientes = VendedorCliente.all\n end", "title": "" }, { "docid": "595cfbf8800f5b7c45afdc0990bd01c7", "score": "0.6312263", "text": "def index\n @dia_eventos = DiaEvento.all\n render json: @dia_eventos\n end", "title": "" }, { "docid": "0304e27d76f34cdab30d139f6f30eb01", "score": "0.6278337", "text": "def index\n @cfos = Cfo.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @cfos }\n end\n end", "title": "" }, { "docid": "8072d610840d0135db1e2a3f2105f248", "score": "0.62635165", "text": "def index\n @dinos = Dino.where(query_params)\n render json: @dinos\n end", "title": "" }, { "docid": "d4f5e3d9580bce75ce5f184c1109dde8", "score": "0.6245439", "text": "def index\n @cooperativas = Cooperativa.where(:status_id => Status.find_by_descricao('Ativo'))\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @cooperativas }\n end\n end", "title": "" }, { "docid": "418dff8aa780b48a5af92c2bec0ccb16", "score": "0.6245368", "text": "def show\n\n @evento = Evento.find(params[:id])\n @comentarios = Comentario.where(:comentavel_id => @evento.id, :comentavel_type => \"Evento\").order('created_at DESC')\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @evento }\n end\n end", "title": "" }, { "docid": "a19c112ab83a509d10e657d00424e869", "score": "0.6234095", "text": "def index\n @tipo_denuncia = TipoDenuncium.all\n\n render json: @tipo_denuncia\n end", "title": "" }, { "docid": "7e05e4eeb47087b0b6e6a3bdbe3bf044", "score": "0.6223336", "text": "def index\n #@vendas = Venda.all\n #@vendas = Venda.venda_diaria\t\n @vendas = Venda.includes(:cliente).where('DATE(created_at) = ?',Date.today)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @vendas }\n end\n end", "title": "" }, { "docid": "7fe4ec2b29b9ad9e4276bd5a9bfb9118", "score": "0.6188266", "text": "def index\n @finalidad_cultivos = FinalidadCultivo.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @finalidad_cultivos }\n end\n end", "title": "" }, { "docid": "9c7b1637f838b049876ad0f02dbc617c", "score": "0.618469", "text": "def index\n @contas = Conta.where(nil) #Inicia Escopo\n @contas = @contas.conta_numero(params[:contaNumero]) if params[:contaNumero].present?\n @contas = @contas.conta_descricao(params[:contaDescricao]) if params[:contaDescricao].present?\n @contas = @contas.agencia_numero(params[:agenciaNumero]) if params[:agenciaNumero].present?\n @contas = @contas.banco_id(params[:bancoId]) if params[:bancoId].present?\n\n @contas = @contas.paginate(:page => params[:page], :per_page => params[:per_page])\n respond_to do |format|\n format.html { render :index }\n format.json { render json: {contas: @contas.as_json(:include => [:banco], methods: [:conta, :agencia, :saldo]), total: @contas.total_entries}}\n end\n end", "title": "" }, { "docid": "d92471083f72a75bb3427968f9bab151", "score": "0.6181641", "text": "def index\n find_dependencias\n respond_to do |format|\n format.html\n format.json { render :json => @dependencias.to_json(:methods => :alias_or_fullname, :only => [:id, :codigo, :nombre])}\n\n end\n end", "title": "" }, { "docid": "79ec36ac425286888bc7ac5ff1ed2bc6", "score": "0.61637723", "text": "def index\n @concursos = Concurso.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @concursos }\n end\n end", "title": "" }, { "docid": "f570165fa426ac3e39408671b3526d68", "score": "0.6131645", "text": "def emergencias_en_curso\n @emergencies = Emergency.where(:estado => 'f')\n render json: @emergencies\n end", "title": "" }, { "docid": "7b9884edd5fe1e37bdeaa60bd9a452c0", "score": "0.6123692", "text": "def index\r\n @classdays = Classday.all\r\n\r\n render json: @classdays\r\n end", "title": "" }, { "docid": "a88c829f4228342e1650f4289aef1a30", "score": "0.60791534", "text": "def index\n @acuerdos = Acuerdo.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @acuerdos }\n end\n end", "title": "" }, { "docid": "d13d390466b4ce4e5fc4c1968597d221", "score": "0.6066193", "text": "def index\n @pedidos = Pedido.find(:all, :conditions => [\"cliente_id=?\", session[:usuario_id]])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pedidos }\n end\n end", "title": "" }, { "docid": "4e0ecde20ae5c5d27065232369039d89", "score": "0.6066107", "text": "def show\n @clientepedido = Clientepedido.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @clientepedido }\n end\n end", "title": "" }, { "docid": "3d67e9867ee49f33bd0ad09bafd3242f", "score": "0.605862", "text": "def index\n @acoes = Acao.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @acoes }\n end\n end", "title": "" }, { "docid": "a4e1612ce2b2ed47b4f4b68813b2fb60", "score": "0.60578686", "text": "def index\n if params[:site_id].nil? or params[:site_id].empty?\n @comentarios = Comentario.all # path: /types\n else\n @comentarios = Site.find(params[:site_id]).comentarios # path: /sites/id/comentarios\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @comentarios }\n end\n end", "title": "" }, { "docid": "4eb78fefcf389f8ec45de494d0351ca4", "score": "0.605759", "text": "def index\n @cgvs = Cgv.order('created_at')\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @cgvs }\n end\n end", "title": "" }, { "docid": "37f5b55b417e9110e51e8b04633a76e3", "score": "0.6053006", "text": "def index\n @ventas = Venta.order(\"fecha desc\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ventas }\n end\n end", "title": "" }, { "docid": "910b6c7846d56a4bb4a77ce764406277", "score": "0.60482186", "text": "def index\n @videoconferencias = Videoconferencium.all\n render json: @videoconferencias\n end", "title": "" }, { "docid": "96cb7f9daf863b87dedeb8c8652c6c85", "score": "0.60479957", "text": "def show\n @cso = Cso.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cso }\n end\n end", "title": "" }, { "docid": "48dce95b67df2b651d466bbe0a1dd349", "score": "0.60430133", "text": "def index\n @departamentos = Departamento.all\n\n render json: @departamentos\n end", "title": "" }, { "docid": "9bd4587e5714d25dadd10ef6a9f92e3a", "score": "0.60306305", "text": "def index\n #@csosns = Csosn.all\n @csosns = Csosn.paginate(:page => params[:page], :per_page => 10)\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @csosns }\n end\n end", "title": "" }, { "docid": "713bf9a6de0a98a9443c3a53ec5cfdfb", "score": "0.6024172", "text": "def index\n @cvis = Cvi.all(:order => \"cvi_number DESC\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @cvis }\n end\n end", "title": "" }, { "docid": "c27fa0288a5d23a490a9cd96266a3660", "score": "0.6012157", "text": "def index\n @colegios = Colegio.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @colegios }\n end\n end", "title": "" }, { "docid": "ad29a188f8faeb241ba49b1ed7caa1ea", "score": "0.6009917", "text": "def index\n @content_condos = ContentCondo.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @content_condos }\n end\n end", "title": "" }, { "docid": "cb7cfae3acb06d99e578a263b8eea117", "score": "0.60062426", "text": "def show\n @observacao_vocacionada = ObservacaoVocacionada.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @observacao_vocacionada }\n end\n end", "title": "" }, { "docid": "966a374d8827e0437fc51ace7d406bd1", "score": "0.60007375", "text": "def index\n @conseilles = Conseille.all\n respond_to do |format|\n format.html\n format.json { render json: @conseilles}\n end\n end", "title": "" }, { "docid": "759f8bd8656cdac8e7ea1a2ebe543846", "score": "0.5999892", "text": "def show\n @concedente = Concedente.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @concedente }\n end\n end", "title": "" }, { "docid": "57e0a7ece8e93e59fb0cfb705b0110c7", "score": "0.59878904", "text": "def index\n \n @controles_asistencias = ControlAsistencia.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @controles_asistencias }\n end\n end", "title": "" }, { "docid": "2edc7867bdfeb1f39d766edd7356658f", "score": "0.5986988", "text": "def index\n @clientes = Cliente.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @clientes }\n end\n end", "title": "" }, { "docid": "85afcc92ad05377eb3cfa56c65c2d529", "score": "0.5964266", "text": "def show\n @cegonha = Cegonha.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cegonha }\n end\n end", "title": "" }, { "docid": "00a28f1507275e94bb9eb888829c8b85", "score": "0.5963945", "text": "def contas\n list_contas = JSON.parse(get_and_give_me_a_json(\"/contas\"))\n rtn = []\n list_contas.each do |c_map|\n conta = Taxcalendario::Admin::Client::Entities::Conta.new\n conta.from_hash(c_map)\n rtn << conta\n end\n rtn\n end", "title": "" }, { "docid": "afa46f4e826a88cdfa43938d946918d5", "score": "0.59612477", "text": "def show\n @orden_cobro = OrdenCobro.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @orden_cobro }\n end\n end", "title": "" }, { "docid": "afa46f4e826a88cdfa43938d946918d5", "score": "0.59612477", "text": "def show\n @orden_cobro = OrdenCobro.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @orden_cobro }\n end\n end", "title": "" }, { "docid": "34a25c301dd48793e4826be4355e189d", "score": "0.59582245", "text": "def index\n @asociados = Asociado.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @asociados }\n end\n end", "title": "" }, { "docid": "cd05535e0b5549d5f42f180030911e47", "score": "0.59515816", "text": "def index\n @daw_curso_comunicados = DawCursoComunicado.all\n end", "title": "" }, { "docid": "be48a8c8609c63901c5d9e92fb87e660", "score": "0.59444094", "text": "def index\n @ordens = Orden.all\n render json: @ordens\n end", "title": "" }, { "docid": "ef8eab9b9ae0d77934927b19bc1bed76", "score": "0.5939424", "text": "def getOrden \n \t@orden = Orden.where(:rest => params[:id_res])\n \trender json: @orden\n end", "title": "" }, { "docid": "883e070aa19a8a9d98a22ead05382b2c", "score": "0.5937443", "text": "def index\n @participante_videoconferencia = ParticipanteVideoconferencium.all\n render json: @participante_videoconferencia\n end", "title": "" }, { "docid": "96bb9a1ea4ba410091d870f47be05afe", "score": "0.59329396", "text": "def index\n @cofis = Cofi.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @cofis }\n end\n end", "title": "" }, { "docid": "2795a913818efd74cf11153121f22fcc", "score": "0.59310395", "text": "def index\n seleccionarMenu(:juzgados)\n @juzgados = Juzgado.order(:ciudad_id)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @juzgados }\n end\n end", "title": "" }, { "docid": "5c977e36c57349a52d0a8e28981d357a", "score": "0.59245294", "text": "def index\n @ordenes = Orden.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ordenes }\n end\n end", "title": "" }, { "docid": "634fc53be1336d25f20ed4931871ca93", "score": "0.5917753", "text": "def index\n @tipo_vendas = TipoVenda.all\n end", "title": "" }, { "docid": "f0848070fed9cc7a737bf4ddd0304214", "score": "0.5915147", "text": "def set_codvenda\n @codvenda = Codvenda.find(params[:id])\n end", "title": "" }, { "docid": "506c2f73faafadd9a5afb14c2581f1bf", "score": "0.59091586", "text": "def index\n @diciplinas = Diciplina.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @diciplinas }\n end\n end", "title": "" }, { "docid": "70a9d23791650ff194a3a0908241fec0", "score": "0.5908996", "text": "def index\n @denuncia = Denuncium.all\n\n render json: @denuncia\n end", "title": "" }, { "docid": "dbbcdfb01905d9aef2aaad0274a5b963", "score": "0.59075236", "text": "def show\n @csosn = Csosn.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @csosn }\n end\n end", "title": "" }, { "docid": "d36ac871fc2a9150249c7c1674f606ea", "score": "0.5902815", "text": "def index\n @despesas = @condominio.despesas\n end", "title": "" }, { "docid": "bb4d7c65d7ed248b45867544362f141c", "score": "0.5901829", "text": "def index\n @registro_videoconferencia = RegistroVideoconferencium.all\n render json: @registro_videoconferencia\n end", "title": "" }, { "docid": "bef090958b1961a03848d4b98eac04ce", "score": "0.58755594", "text": "def index\n @servico_pacotes = Servico::Pacote.all\n end", "title": "" }, { "docid": "deed553b9b531530048478fd72072d4b", "score": "0.5872732", "text": "def reporte_clientes_nuevos\n\t\tcurrent_year = params[:year].to_i\n\t\tdata = FacturasRecibidas.reporte_clientes_nuevos_por_mes(current_year)\n\t\trender :json => data\n\tend", "title": "" }, { "docid": "bdfa28f9f19d9ef910dd981ca9e796c8", "score": "0.58721447", "text": "def index\n @deporte_usuarios = DeporteUsuario.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @deporte_usuarios }\n end\n end", "title": "" }, { "docid": "84f7a07ce10fa80dd2eb0385a7f99002", "score": "0.58674395", "text": "def index\n\n if params[:ventas_seguimiento]\n cliente_id = params[:ventas_seguimiento][:cliente_id]\n @ventas_seguimientos = Ventas::Seguimiento.where(\"cliente_id = ?\",cliente_id).order(\"created_at DESC\").paginate(:page => params[:page], :per_page => 5)\n @seguimientos = Ventas::Seguimiento.new(:cliente_id => cliente_id)\n else\n @ventas_seguimientos = Ventas::Seguimiento.order(\"created_at DESC\").paginate(:page => params[:page], :per_page => 5)\n @seguimientos = Ventas::Seguimiento.new\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ventas_seguimientos }\n end\n end", "title": "" }, { "docid": "ad405bf05b2b9d583bc520a7d3114382", "score": "0.5866899", "text": "def index\n @devolucoes = Devolucao.all\n end", "title": "" }, { "docid": "0913067c3ddc0b883fc38a3226f3d0fe", "score": "0.58656347", "text": "def index\n @contatos_clientes = ContatosCliente.all\n end", "title": "" }, { "docid": "f771b50ad34c0df56e6d5b662b0425d2", "score": "0.58648294", "text": "def index\n @categorias = Categoria.where(:status_id => Status.find_by_descricao('Ativo'))\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @categorias }\n end\n end", "title": "" }, { "docid": "a77fb544011693c601aa2a3cb53ec3c1", "score": "0.5863185", "text": "def index\n @ofertas = Oferta.where(:status_id => Status.find_by_descricao('Ativo'))\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @ofertas }\n end\n end", "title": "" }, { "docid": "e626f11b397e563ffc44f14442578e46", "score": "0.5860942", "text": "def index\n @coasters = Coaster.all\n\n render json: @coasters\n end", "title": "" }, { "docid": "89322b04a3340b00d4128e1c450b75b9", "score": "0.58605194", "text": "def show\n @arquivo = Arquivo.find(params[:id])\n @comentarios = Comentario.where(:comentavel_id => @arquivo.id, :comentavel_type => \"Arquivo\").order('created_at DESC')\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @arquivo }\n end\n end", "title": "" }, { "docid": "24fccd974461a9039623c414ad1242ea", "score": "0.58568096", "text": "def index\n @evac_centers = EvacCenter.all\n render json: @evac_centers\n end", "title": "" }, { "docid": "f9201bc6afc4e33d2950a3702aa00946", "score": "0.58478343", "text": "def index\n @concedentes = Concedente.all\n end", "title": "" }, { "docid": "61ad40708ba4051f482c14b569a58e48", "score": "0.5845488", "text": "def index\n \treclamos = Reclamo.all\n \trender json: reclamos.to_json(include: [:tipo_reclamo, :ubicacion, :user], methods: [:valoracion])\n end", "title": "" }, { "docid": "42a3bf0593e23dbdb4e1f6d01fb1c93a", "score": "0.58380985", "text": "def index\n @coordenador_estagios = CoordenadorEstagio.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @coordenador_estagios }\n end\n end", "title": "" }, { "docid": "b63e0cb240515eccc20780e48374579e", "score": "0.58377635", "text": "def show\n @venta = Venta.find(params[:id])\n\n @domicilios = Domicilio.where(usuario_id: @venta.usuario.id)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @venta }\n end\n end", "title": "" }, { "docid": "daad5aeb976f49bf6d33dfaecbba6949", "score": "0.5834691", "text": "def show\n @cerc = Cerc.find(params[:id])\n\n render json: @cerc\n end", "title": "" }, { "docid": "8f703056661e643ead8fc50acf3ab948", "score": "0.58319485", "text": "def index\n @comprobantes = Comprobante.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @comprobantes }\n end\n end", "title": "" }, { "docid": "3512eec158a0242c910ea3dd921c761a", "score": "0.58275247", "text": "def index\n @convidados = Convidado.all\n end", "title": "" }, { "docid": "8ba599fd79069dbdc43f5a567974210f", "score": "0.582674", "text": "def show\n @antecedente = Antecedente.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @antecedente }\n end\n end", "title": "" }, { "docid": "af4d844a60fb209e3fce37ab478533c7", "score": "0.5818926", "text": "def index\n @subcategorias = Subcategoria.where(:status_id => Status.find_by_descricao('Ativo'))\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @subcategorias }\n end\n end", "title": "" }, { "docid": "2a3ead2a1ebb6b5a299662268d1b48ec", "score": "0.58167833", "text": "def index\n @archdioceses = Archdiocese.all\n\n render json: @archdioceses\n end", "title": "" }, { "docid": "e79b4b88bba0e7805b64353647ca922f", "score": "0.5815061", "text": "def show\n @local_deportivo = LocalDeportivo.find(params[:id], :conditions=> \"estado = 'C' OR estado is NULL\")\n \n @espacio_deportivos = @local_deportivo.espacio_deportivos.find(:all)\n \n \n respond_to do |format|\n format.html \n format.json { render json: {:espacio_deportivos =>@espacio_deportivos, :local_deportivo => @local_deportivo }}\n end\n \n end", "title": "" }, { "docid": "9fddf42ba38f9c1090b38fbcf124cd85", "score": "0.58147407", "text": "def index\n @status_del_admitidos = StatusDelAdmitido.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @status_del_admitidos }\n end\n end", "title": "" }, { "docid": "91eb943e67496fab7fce52aa6f7be27e", "score": "0.58131784", "text": "def index\n @cegresos = Cegreso.all\n end", "title": "" }, { "docid": "0d8d1ac9747e7fc863b6b049e370a0a7", "score": "0.5812466", "text": "def show\n @coligacao_partido = ColigacaoPartido.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @coligacao_partido }\n end\n end", "title": "" }, { "docid": "a1e5d33c5e461f9297b2ffd206fe6b2a", "score": "0.58119434", "text": "def index\n @consents = Consent.all\n render json: @consents\n end", "title": "" }, { "docid": "b3ef8cf99047a4ab701dbe667a0c1530", "score": "0.5810837", "text": "def show\n @notadedebito = Notadedebito.find(params[:notadedebito_id])\n @renglon_nddndc = @notadedebito.renglon_nddndcs.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @renglon_nddndc }\n end\n end", "title": "" }, { "docid": "009ea430e359721b767c30afcbf5ba5e", "score": "0.5804225", "text": "def index\n @deportes = Deporte.all\n render json: @deportes, status: :ok \n @deportes = Deporte.paginate(:page => params[:page])\n end", "title": "" }, { "docid": "d10f9daba7a7d92ee0d75ddaa3013cb3", "score": "0.5802361", "text": "def show\n @concurso = Concurso.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @concurso }\n end\n end", "title": "" }, { "docid": "82fe75d323c57b12033bdb77b51c609c", "score": "0.5802117", "text": "def index\n @doencas = Doenca.all\n end", "title": "" }, { "docid": "3ebd167fa5df8f326d2f4b069b3adcbf", "score": "0.5797738", "text": "def index\n @distros = getmydata(\"Distro\")\n pagination\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @distros }\n end\n end", "title": "" }, { "docid": "24f10c2e9c1870b4c3f36b32e5b98eae", "score": "0.57962066", "text": "def index\n @dco_resources = DcoResource.all\n end", "title": "" }, { "docid": "1889d2561557c9c4ff01f70e944dc3e2", "score": "0.57954866", "text": "def show\n @ventas_seguimiento = Ventas::Seguimiento.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ventas_seguimiento }\n end\n end", "title": "" }, { "docid": "af47351c469c01362f0fc17da21b663c", "score": "0.57890445", "text": "def index\n @content_item_condos = ContentItemCondo.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @content_item_condos }\n end\n end", "title": "" }, { "docid": "8eab45e0a27727891b7ac5427ab56987", "score": "0.57886875", "text": "def show\n\trespond_to do |format|\n format.json { render json: @conta.to_json, status: :ok }\n end\n end", "title": "" }, { "docid": "c0866dddd93bf4580f20675ca79d2817", "score": "0.5787629", "text": "def index\n @ativo_outros = AtivoOutro.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ativo_outros }\n end\n end", "title": "" }, { "docid": "a1bed47961cb6d298279de48c93e8201", "score": "0.57856524", "text": "def index\n @clues = Clue.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @clues }\n end\n end", "title": "" }, { "docid": "3ea88987eba7dc75dadc8d5d25c3e400", "score": "0.57781214", "text": "def show\n @finalidad_cultivo = FinalidadCultivo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @finalidad_cultivo }\n end\n end", "title": "" }, { "docid": "8731588baa6fc866b0da251874d2a2c5", "score": "0.57754165", "text": "def index\n @listas_contato = ListaContato.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @listas_contato }\n end\n end", "title": "" }, { "docid": "218b049ef184a52b5e7aa86fa549d89b", "score": "0.5774925", "text": "def index\n @cn_curves = CnCurve.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @cn_curves }\n end\n end", "title": "" } ]
1451196990f47534c599192e08c484c2
Provide a default URL as a default if there hasn't been a file uploaded:
[ { "docid": "222f38049c8884a6cee18f9be593e519", "score": "0.7092646", "text": "def default_url\n if default_img_name = model.imageable.try(:default_img_name)\n ActionController::Base.helpers.asset_path(\"defaults/#{version_name}_#{default_img_name}\")\n end\n end", "title": "" } ]
[ { "docid": "b60fd9da936d3a3a2ede5b89d2cb78a3", "score": "0.8193984", "text": "def default_url\n '/no_file'\n end", "title": "" }, { "docid": "7e0c7efbe20c579ceeafc492e36148cb", "score": "0.74905765", "text": "def default_url\n ''\n end", "title": "" }, { "docid": "fa99ef84b22190e778e289f07417ac54", "score": "0.7487883", "text": "def set_default_url\n \"/img/missing.png\"\n end", "title": "" }, { "docid": "fe6c0f69333446483a2056451a6eebfd", "score": "0.7428417", "text": "def attachment_default_url\n ''\n end", "title": "" }, { "docid": "4e9a5b976396e1f1fe69e7067ef24987", "score": "0.7395345", "text": "def default_url\n '/test.jpg'\n end", "title": "" }, { "docid": "a7cef90bbeb6fc52fa8f0e4d075f7198", "score": "0.7391957", "text": "def set_default_url\n \t\"/img/missing.png\"\n end", "title": "" }, { "docid": "288d77d95238bf25d019b7cd728646ac", "score": "0.7389904", "text": "def attachment_default_url_for(name, url)\n attachment_definitions[name][:default_url] = url\n end", "title": "" }, { "docid": "cb6780a3af0b57c69d33f0ef41c2af28", "score": "0.73214865", "text": "def default_url\n \"/default_picture/default.jpg\"\n end", "title": "" }, { "docid": "cb6780a3af0b57c69d33f0ef41c2af28", "score": "0.73214865", "text": "def default_url\n \"/default_picture/default.jpg\"\n end", "title": "" }, { "docid": "c00fe8ebb21af8a895424c0dbc00a82f", "score": "0.7319226", "text": "def default_url\n if attachment_options[:default_url].respond_to?(:call)\n attachment_options[:default_url].call(@attachment)\n elsif attachment_options[:default_url].is_a?(Symbol)\n @attachment.instance.send(attachment_options[:default_url])\n else\n attachment_options[:default_url]\n end\n end", "title": "" }, { "docid": "c00fe8ebb21af8a895424c0dbc00a82f", "score": "0.7319226", "text": "def default_url\n if attachment_options[:default_url].respond_to?(:call)\n attachment_options[:default_url].call(@attachment)\n elsif attachment_options[:default_url].is_a?(Symbol)\n @attachment.instance.send(attachment_options[:default_url])\n else\n attachment_options[:default_url]\n end\n end", "title": "" }, { "docid": "5106841e693a57f4f2b94cbd5e483361", "score": "0.7302588", "text": "def set_default_url\n \"img/missing.png\"\n end", "title": "" }, { "docid": "c62e5dbf2ea5cf1d707e109843a8e809", "score": "0.7191459", "text": "def default_uri; end", "title": "" }, { "docid": "b9124c4c5253446799ad4f8dcd1dfe57", "score": "0.7162425", "text": "def default_url\n \"#{Rails.application.secrets.carrierwave_asset_host}/fallback/#{model.attachable_type.underscore}/default.png\"\n end", "title": "" }, { "docid": "92de88823ff56e3a0526ea7578cdb939", "score": "0.7161452", "text": "def default_url\n url 'default'\n end", "title": "" }, { "docid": "ce96d501a388b98899062ad099514cfc", "score": "0.7155136", "text": "def default_url\n \"/uploads/default_logo.png\"\n end", "title": "" }, { "docid": "e2517d5f793f6954c4ed589b971a7b01", "score": "0.7141467", "text": "def default_url\n # For Rails 3.1+ asset pipeline compatibility:\n # asset_path([version_name, \"default.png\"].compact.join('_'))\n \"/uploads/default/\" + [version_name, \"default.png\"].compact.join('_')\n end", "title": "" }, { "docid": "1c7fe7986a09dcd9de88a21bbd54dfd4", "score": "0.713886", "text": "def default_url\n file_path = [\n 'fallbacks',\n ([model.class.to_s.underscore, mounted_as, version_name].compact.join('_') + '.png')\n ].join '/'\n\n 'http://' + ENV['HOST'] + ActionController::Base.helpers.image_path(file_path)\n end", "title": "" }, { "docid": "7b0d00169d2486c25628c3fc8501060d", "score": "0.71262956", "text": "def default_url\n \"missing.gif\"\n end", "title": "" }, { "docid": "42cb1809ef3174107149b12a38c770ef", "score": "0.70650315", "text": "def avatar_default_url(configuration = {})\n configuration[:default].present? ? configuration[:default] : ::Faces::Configuration::UNIVERSAL[:default]\n end", "title": "" }, { "docid": "f38b498dbbb225be4c3f88dabc5ac3ac", "score": "0.70619255", "text": "def default_url\n image_path( Pathname.new(Figaro.env.asset_url!).join( \"assets\", \"fallback\", [mounted_as, version_name, \"#{model[:_type].try(:downcase)}.png\"].compact.join('_') ) )\n end", "title": "" }, { "docid": "5bc87ccad0dd6a0916ceb8f1d3ce55ee", "score": "0.7039095", "text": "def default_url\n \"/images/default.jpg\"\n end", "title": "" }, { "docid": "6fa6b41b003e8f27b15c99f67b210f7f", "score": "0.69845396", "text": "def url(url)\n self.default_url = url\n end", "title": "" }, { "docid": "fac344a465a5fda769044bbcbf88c65f", "score": "0.6980184", "text": "def default_url\n image_path( Pathname.new(Figaro.env.asset_url!).join( \"assets\", \"fallback\", [mounted_as, version_name, \"#{model.class.to_s.downcase}.png\"].compact.join('_') ) )\n end", "title": "" }, { "docid": "603d8cf49310346cdc2cfdf0a83f86ef", "score": "0.6963516", "text": "def thumbnail_url_with_default(type)\n if self.thumbnail.file?\n self.thumbnail.url(type)\n else\n self.url\n end\n end", "title": "" }, { "docid": "1ed1349787aa2b9d000e5b2b6e85e34d", "score": "0.69628274", "text": "def default_photo_url\n self.dig_for_string(\"defaultPhotoURL\")\n end", "title": "" }, { "docid": "c543d1fad00913ee8d7a8ffa4ea142f2", "score": "0.69572383", "text": "def default_url\n \"/public/images/fallback/\" + [model.name, \"default.png\"].compact.join('_')\n end", "title": "" }, { "docid": "8d366e73b16ca83ee58dd490f53b8067", "score": "0.6937693", "text": "def default_url\n file_path = [\n 'fallbacks',\n [model.class.to_s.underscore, \"#{mounted_as}.png\"].compact.join('_')\n ].join '/'\n\n ActionController::Base.helpers.image_path(file_path)\n end", "title": "" }, { "docid": "93cd438548f3378cd4b1da13cb966da8", "score": "0.69240916", "text": "def default_url\n \"/images/fallback/\" + [model.class.to_s.underscore, version_name, \"blank.png\"].compact.join('_')\n end", "title": "" }, { "docid": "5d0b420c553d251de4da99e0df86835e", "score": "0.6924041", "text": "def default_url\n Settings.image.default_avatar\n end", "title": "" }, { "docid": "b8db752d644392f798b67ebe75084176", "score": "0.6914545", "text": "def default_url\n # \"photo/#{version_name}.jpg\"\n end", "title": "" }, { "docid": "7a333fe60288c0330545766921cac053", "score": "0.69115597", "text": "def default_url\n if model.is_a?(FeedItem)\n \"/images/fallback/\" + [version_name, \"default.png\"].compact.join('_')\n end\n end", "title": "" }, { "docid": "961276d625f1b4ab5464161a4d981de8", "score": "0.690665", "text": "def default_url\n \"photo/#{version_name}.jpg\"\n end", "title": "" }, { "docid": "6b67468efc9f43e174adfb530f77f0c1", "score": "0.68944925", "text": "def default_url\n \"/images/fallback/\" + [model.name, \"default.png\"].compact.join('_')\n end", "title": "" }, { "docid": "0e3e895dff40870a692200c0ccd2bd6f", "score": "0.6888884", "text": "def default_path; end", "title": "" }, { "docid": "f64e814a04ac3aa38b48aafcfc794bcc", "score": "0.6885848", "text": "def default_url\n # \"/assets/base/\" + [version_name, \"user_default.jpg\"].compact.join('_')\n \"/assets/userpic.jpg\"\n end", "title": "" }, { "docid": "be12d7260989e8c3323dc2f06d7e7889", "score": "0.6884888", "text": "def default_url\n base = ['default', model.gender, version_name].compact.join('_')\n filename = \"#{base}.png\"\n image_path File.join('avatars', filename)\n end", "title": "" }, { "docid": "fd0b3f11599217e4293dfb314217a76a", "score": "0.6850991", "text": "def default_url\n \"https://res.cloudinary.com/dtbs7luvc/image/upload/v1559563021/noun_avatar_1901054_odfold.png\"\n end", "title": "" }, { "docid": "34bcb5749298b554bf115f3db3604655", "score": "0.683767", "text": "def default_url\n Settings.image.default_poster\n end", "title": "" }, { "docid": "34bcb5749298b554bf115f3db3604655", "score": "0.683767", "text": "def default_url\n Settings.image.default_poster\n end", "title": "" }, { "docid": "34bcb5749298b554bf115f3db3604655", "score": "0.683767", "text": "def default_url\n Settings.image.default_poster\n end", "title": "" }, { "docid": "78e62d44dee3e826bb4642ed64c21874", "score": "0.6836317", "text": "def default_url\n case version_name\n when ''\n '/cover-default-1.jpg'\n when 'thumb'\n '/thumb_cover-default-1.jpg'\n end\n end", "title": "" }, { "docid": "207613b6eeba272cd159323c15cd31ce", "score": "0.6836305", "text": "def default_url\n \"/images/fallback/\" + [version_name, \"default.jpg\"].compact.join('_')\n end", "title": "" }, { "docid": "6d9a88d4bc5eba7c248b6032fc729c5a", "score": "0.68329895", "text": "def default_url\n # \"/assets/base/\" + [version_name, \"user_default.jpg\"].compact.join('_')\n \"/assets/userpic.jpg\"\n end", "title": "" }, { "docid": "a9d7548c69b125a333e64ebd919d91cc", "score": "0.68296325", "text": "def default_url\n \"\" + [version_name, \"default_avatar.png\"].compact.join('_')\n end", "title": "" }, { "docid": "27cb75e29d2cb4734d6d189bb8e7415a", "score": "0.6824822", "text": "def default_url\n params = []\n\n params.push version_name\n \n if model.imageable_type\n params.push model.imageable_type.underscore\n else\n params.push model.class.to_s.underscore\n end\n\n params.push \"#{model.image_type}.png\"\n\n \"http://#{ActionMailer::Base.default_url_options[:host]}/assets/fallback/\" + params.compact.join('_')\n end", "title": "" }, { "docid": "18feea64e28ca33cdc64596ece0a2023", "score": "0.67955214", "text": "def photo_url(*args)\n photo = object.photos.default\n photo ? photo.file.url(*args) : uploader_default_url(*args)\n end", "title": "" }, { "docid": "253424f1395af12b3f91cb767fe2a0f8", "score": "0.6791249", "text": "def default_url\n ActionController::Base.helpers.asset_path(default_path)\n end", "title": "" }, { "docid": "fc79ca178ba9f6a68192dfdd01c2ed38", "score": "0.6781322", "text": "def default_url\n # For Rails 3.1+ asset pipeline compatibility:\n # ActionController::Base.helpers.asset_path(\"fallback/\" + [version_name, \"default.png\"].compact.join('_'))\n\n # asset_path(\"fallback/\" + [version_name, \"default.xls\"].compact.join('_'))\n \"default\"\n end", "title": "" }, { "docid": "4aec578b36993edc7499342fbcf4615f", "score": "0.6755188", "text": "def default_file; end", "title": "" }, { "docid": "4aec578b36993edc7499342fbcf4615f", "score": "0.6755188", "text": "def default_file; end", "title": "" }, { "docid": "11b679ecd5c813632185ef1319fe1125", "score": "0.67502433", "text": "def default_url\n \"/images/fallback/default_user.png\"\n end", "title": "" }, { "docid": "76b2b1bc365fe9c99e870bbc0f8d4c6a", "score": "0.6729053", "text": "def default_url\n asset_path(\"fallback/\" + [version_name, \"default-photo.png\"].compact.join('_'))\n end", "title": "" }, { "docid": "22d888d6a015ac8fb0494b08a3c547d8", "score": "0.67203075", "text": "def default_url\n '/fallback/' + [version_name, 'default.png'].compact.join('_')\n end", "title": "" }, { "docid": "b1c798b776904232dacc0e45d5e08140", "score": "0.6718218", "text": "def default_url\n asset_path(\"fallback/\" + [\"large_image\", version_name, \"default.gif\"].compact.join('_'))\n end", "title": "" }, { "docid": "dee0dcfd72e251c5b2feb3a48156f515", "score": "0.67097425", "text": "def default_url\n asset_path(\"fallback/\" + [version_name, \"default.jpg\"].compact.join('_'))\n end", "title": "" }, { "docid": "0501b85665beb02036851038c0aa66a1", "score": "0.67054504", "text": "def default_photo_url\n _photo = photos.first || Photo.new\n _photo.image.url(:thumb)\n end", "title": "" }, { "docid": "7727913df865772ddc1a4bb8dd037bb9", "score": "0.6692986", "text": "def default_url\n # For Rails 3.1+ asset pipeline compatibility:\n ActionController::Base.helpers.asset_path(\"shared/user_avatar/\" + [version_name, \"default.jpg\"].compact.join('_')).sub('/assets/', '')\n end", "title": "" }, { "docid": "6e83686267780a7e23584e19910ccb26", "score": "0.6692092", "text": "def default_path\n nil\n end", "title": "" }, { "docid": "c43bc823a9722bd0d90d6a9135345335", "score": "0.66880065", "text": "def default_url\n # For Rails 3.1+ asset pipeline compatibility:\n # ActionController::Base.helpers.asset_path(\"fallback/\" + [version_name, \"default.png\"].compact.join('_'))\n 'default.jpg'\n end", "title": "" }, { "docid": "ea9e69df11036fe7282540fcc694bcd3", "score": "0.6669379", "text": "def default_url\n '/images/fallback/' + [version_name, 'default-s.png'].compact.join('_')\n end", "title": "" }, { "docid": "ddc4db808db3ffc8fdafa83f57723110", "score": "0.66284096", "text": "def default_url\n \"/images/fallback/\" + [version_name, \"default.png\"].compact.join('_')\n end", "title": "" }, { "docid": "632066051f4ca3088aaf430634767122", "score": "0.66272324", "text": "def default_url\n \"/assets/default_avatar.gif\"\n end", "title": "" }, { "docid": "0db7410a92987515846b2dee33412358", "score": "0.661954", "text": "def default_url\n # For Rails 3.1+ asset pipeline compatibility:\n # ActionController::Base.helpers.asset_path(\"fallback/\" + [version_name, \"default.png\"].compact.join('_'))\n\n ActionController::Base.helpers.asset_path(\"placeholder.png\")\n end", "title": "" }, { "docid": "f6ff46fb81ccee3719d1c4a34e6c18b7", "score": "0.6616047", "text": "def default_url\n \"/assets/fallback/\" + [version_name, \"default.jpg\"].compact.join('_')\n end", "title": "" }, { "docid": "f6ff46fb81ccee3719d1c4a34e6c18b7", "score": "0.6616047", "text": "def default_url\n \"/assets/fallback/\" + [version_name, \"default.jpg\"].compact.join('_')\n end", "title": "" }, { "docid": "c78115c47a41a40a8fb5119dbbf5a2f0", "score": "0.6614194", "text": "def set_default\n url = params['article']['image_url']\n return unless url == ''\n params['article']['image_url'] = cl_image_path('hero_pink_clouds.jpg', transformation: [{ crop: 'fill' }])\n end", "title": "" }, { "docid": "0162772b18bf3a4150048d5647f21943", "score": "0.6611018", "text": "def default_url\n ActionController::Base.helpers.asset_url('nopic.jpg')\n end", "title": "" }, { "docid": "9f9f52d871f46ee562560a7b8f414bfc", "score": "0.660069", "text": "def default_url\n # For Rails 3.1+ asset pipeline compatibility:\n # asset_path(\"fallback/\" + [version_name, \"default.png\"].compact.join('_'))\n\n #{}\"/images/fallback/\" + [version_name, \"default.png\"].compact.join('_')\n \"https://s3.amazonaws.com/realmassive_nuggets/image_not_found.jpg\"\n end", "title": "" }, { "docid": "8c14abe3de7981ee0d0a3999f0aa7893", "score": "0.65970296", "text": "def default_url\n \"/images/default/#{self.categorize}/\" + \n [ version_name, \"default.png\" ].compact.join('_')\n end", "title": "" }, { "docid": "f091309191c8ecd9bf48f0163b5f4dfc", "score": "0.65955156", "text": "def img_url_or_default\n\t\tif img_url.present?\n\t\t\timg_url\n\t\telse\n\t\t\t\"http://loremflickr.com/320/240/#{CGI.escape name}\"\n\t\tend\n\tend", "title": "" }, { "docid": "70dd222b8dbf1b1519ab0cf64c955bc5", "score": "0.6585437", "text": "def default_url(*args)\n '/images/fallback/' + [version_name, 'default.png'].compact.join('_')\n end", "title": "" }, { "docid": "fcac7fabe4780fca4867cbd39a28f821", "score": "0.6576122", "text": "def default_url\n \"/images/fallback/#{version_name || 'default'}.png\"\n end", "title": "" }, { "docid": "cf08e8f7405b520843de54cbb954dcc5", "score": "0.6574932", "text": "def default_url\n ActionController::Base.helpers.asset_path('users/' +\n [version_name, 'avatar.gif'].compact.join('_'))\n end", "title": "" }, { "docid": "6682652fcb0a69d37c51a20a54d56e94", "score": "0.6574816", "text": "def default_url\n \"default/#{model.class.to_s.underscore}/#{version_name}.png\"\n end", "title": "" }, { "docid": "ef9a5a0e235d68215c1a441e7680e5ac", "score": "0.65673965", "text": "def filename_or_default(name, default)\n (f = get_filename(name)).empty? ? default : f\n end", "title": "" }, { "docid": "b68e733bc003af9942454b27385d1bbd", "score": "0.65572107", "text": "def most_appropriate_url(style = nil)\n if @attachment.processing_style?(style)\n if @attachment.original_filename.nil? || delayed_default_url?(style)\n\n if @attachment.delayed_options.nil? ||\n @attachment.processing_image_url.nil? ||\n !@attachment.processing?\n default_url\n else\n @attachment.processing_image_url\n end\n\n else\n @attachment_options[:url]\n end\n else\n super()\n end\n end", "title": "" }, { "docid": "72af6b34163d8e38ce014ba45802afa7", "score": "0.655466", "text": "def default_url\n \"/assets/no_event_image.png\"\n end", "title": "" }, { "docid": "c5609b2dbd52a9dbc0ab47275c450f35", "score": "0.6552107", "text": "def default_url\n # For Rails 3.1+ asset pipeline compatibility:\n \"/assets/\" + [version_name, \"default.gif\"].compact.join('_')\n end", "title": "" }, { "docid": "f287fa36dfb5f61811ad94622b7f771d", "score": "0.6547554", "text": "def url\n if @view_url\n @view_url # transient view_url can override url from model\n elsif has_value?(self.original_url)\n self.original_url\n else\n self.upload_url\n end\n end", "title": "" }, { "docid": "cb9ccb93a718473c55d2d374983220be", "score": "0.65362", "text": "def default_url\n # For Rails 3.1+ asset pipeline compatibility:\n asset_path(\"defaults/user/\" + [version_name, \"#{model.gender == User::GENDER_FEMALE ? 'girl_' : ''}avatar.png\"].compact.join('_'))\n # \"defaults/user/\" + [version_name, 'avatar.png'].compact.join('_')\n end", "title": "" }, { "docid": "115b67ef0fc309d8a5cbe8900a1ca097", "score": "0.6527272", "text": "def default_url(*args); end", "title": "" }, { "docid": "d1fb7e264461730b751f7c6c093d77c2", "score": "0.65198666", "text": "def default_url\n \"/assets/fallback/\" + [version_name, \"default_profile.jpg\"].compact.join('_')\n end", "title": "" }, { "docid": "0c50f88c0ec2e6146533f09f6162e525", "score": "0.6512378", "text": "def default_url\n 'default_user.png' #rails will look at 'app/assets/images/default_avatar.png'\n end", "title": "" }, { "docid": "01a53fdd08cf45ea2f7e91a56b932c30", "score": "0.6508064", "text": "def default_url(version_name = \"\")\n end", "title": "" }, { "docid": "a914e1380b88ff7693c62bbf69b12ef7", "score": "0.6504664", "text": "def ensure_default_img\n self.img_url ||= DEFAULT_PROFILE_PIC\n\n end", "title": "" }, { "docid": "e2dce2f47a444ab4506ecc4ac21ef2d3", "score": "0.64902174", "text": "def default_url\n # For Rails 3.1+ asset pipeline compatibility:\n # asset_path(\"fallback/\" + [version_name, \"default.png\"].compact.join('_'))\n\n # \"/images/fallback/\" + [version_name, \"default.png\"].compact.join('_')\n asset_path \"#{[version_name, DEFAULT_BADGE_NAME].compact.join('_')}.png\"\n end", "title": "" }, { "docid": "8cba3797cb537bbf46dd03622e5fd726", "score": "0.6487651", "text": "def default_url\n # For Rails 3.1+ asset pipeline compatibility:\n # asset_path(\"fallback/\" + [version_name, \"default.png\"].compact.join('_'))\n \n \"https://s3.amazonaws.com/media.valuethisnow.com/images/missingAvatar.png\"\n end", "title": "" }, { "docid": "ac0d889f3676c2d375ca547f0d52be77", "score": "0.6479683", "text": "def default_url\n \"http://i.stack.imgur.com/ILTQq.png\"\n end", "title": "" }, { "docid": "9cd6995e636ce36197129d28e5a9961e", "score": "0.6476441", "text": "def default_values\n self.image_url = \"guestpicture.png\"\n end", "title": "" }, { "docid": "b95115dd0f41b1aef95664c7748a837d", "score": "0.6476096", "text": "def default_url\n 'portrait.jpg'\n end", "title": "" }, { "docid": "4e1af60a82a50129547ca30e6b5195b8", "score": "0.6467368", "text": "def external_or_uploaded_image_url\n self.external_image_url && !self.external_image_url.empty? ? self.external_image_url : self.image_url\n end", "title": "" }, { "docid": "0601a66de7312cb71931230bc8b08dbb", "score": "0.6462579", "text": "def default_photo_url\n self.dig_for_string(\"listingSummary\", \"defaultPhotoURL\")\n end", "title": "" }, { "docid": "92892525021873174dcd5821bc97b2ee", "score": "0.6458472", "text": "def default_url\n # # For Rails 3.1+ asset pipeline compatibility:\n asset_path(\"default.png\")\n #\n # \"/images/fallback/\" + [version_name, \"default.png\"].compact.join('_')\n end", "title": "" }, { "docid": "7c6152c8dc93157c6eb4721f3d4a329d", "score": "0.6455848", "text": "def default_url\n #asset_path(\"fallback/\" + [\"nopic\",version_name].compact.join('_') + \".gif\")\n \"/images/\" + [\"nopic\",version_name].compact.join('_') + \".gif\"\n end", "title": "" }, { "docid": "d3f7a36dcc838b62039274c5642be188", "score": "0.64544594", "text": "def default_url\n \"/assets/fallback/\" + [version_name, \"default.gif\"].compact.join('_')\n end", "title": "" }, { "docid": "01250045c9cc5af176ae03465d617033", "score": "0.6452322", "text": "def set_default_url\n ActionController::Base.helpers.asset_path('star.jpg')\n end", "title": "" }, { "docid": "eb84e411f7f4e0f99f07fd7562530884", "score": "0.6451614", "text": "def default_url\n if file=Rails.application.assets.find_asset([\"blank/avatar\", \"#{version_name}.png\"].compact.join('_'))\n ActionController::Base.helpers.asset_path(\"/assets/\" + file.digest_path)\n end\n end", "title": "" }, { "docid": "d1d9897f63923dedd5a08b0533b13e96", "score": "0.6450937", "text": "def default_url_options\n Figgy.default_url_options\n end", "title": "" }, { "docid": "c54793a58150acca9e667886f219a8b9", "score": "0.6447176", "text": "def default_url\n ActionController::Base.helpers.asset_path(\"fallback/\" + [version_name, \"default.png\"].compact.join('_'))\n end", "title": "" } ]
0845a4f3fbf341b70c6caa7fe3048504
Used to join users into a meeting. Most of the work is done in before filters. Can be called via GET or POST and accepts parameters both in the POST data and URL.
[ { "docid": "3cb11d3f79cea887fdaae41cbbdb571a", "score": "0.6354361", "text": "def join\n join_internal(@user_name, @user_role, @user_id)\n end", "title": "" } ]
[ { "docid": "90482581fe503fb8ac17383b7fee4bfa", "score": "0.7035012", "text": "def join_meeting(meeting_id, user_name, password)\n send_api_request(:join, {:meetingID=>meeting_id, :password=>password,\n :fullName=>user_name, :redirectImmediately=>0} )\n doc.root.get_text('/response/entryURL').to_s\n end", "title": "" }, { "docid": "627ad39c076d9c2629df185ef52dc1e2", "score": "0.6969478", "text": "def join_conversation\n authorize! :modify, @conversation\n @conversation.add_participant(params[:user_ids], current_user)\n render nothing: true\n end", "title": "" }, { "docid": "898da559057f2e9654956ff88fa83a1e", "score": "0.694504", "text": "def create_and_join_meeting\n meeting_id = params[:meeting_id]\n meeting_name = params[:meeting_name]\n username = params[:username]\n user_password = params[:user_password]\n moderator_password = params[:moderator_password]\n\n if @@api.is_meeting_running?(meeting_id)\n join_meeting(meeting_id,username,password)\n else\n create_meeting(meeting_name,meeting_id,user_password,moderator_password)\n join_meeting(meeting_id,username,moderator_password)\n end\n \n end", "title": "" }, { "docid": "d6a760c61a63ea8297d8dd6b9cfc1f0e", "score": "0.69129616", "text": "def join\n \tif checkAuth(params)\n \t\ta = Activity.find_by(id: params[:ActID])\n\t a.update(member_number: a.member_number + 1)\n\t a.memberactivities.create(user_id: params[:UserID], activity_id: params[:ActID])\n\t\t\trtn = {\n\t\t \tstatus: \"201\"\n\t\t }\n\t\t\trender :json => rtn\n \telse\n \t\trtn = {\n\t\t\t\terrormsg: \"Authentication Denied.\",\n status: \"401\"\n }\n\t render :json => rtn\n \tend\n end", "title": "" }, { "docid": "9764bdf0b4ae6c021b598b5d418743b2", "score": "0.68990606", "text": "def join\n if check_valid()\n url = get_meeting_url()\n redirect_to \"#{url}\"\n else\n redirect_to root_path\n puts 'DEBUG: Problem joining meeting'\n end\n end", "title": "" }, { "docid": "cf897626427d6acb7b96c927e1c755d7", "score": "0.68225497", "text": "def join\n @event = Event.find(params[:id])\n if (!@event.users.include? current_user)\n @event.users << current_user\n end\n \n respond_to do |format|\n if @event.update\n format.html { redirect_to(@event) }\n format.json { head :ok }\n else\n format.html { render :action => \"show\" }\n format.json { render :json => @event.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1ee5aecd43f364c0753ac7d941efd7df", "score": "0.67094904", "text": "def join\n @camp = Camp.find(params[:id])\n\n params[:user] ? @user = User.find(params[:user]) : @user = nil\n\n #\n # Only add a user to the list of associated members if the user isn't\n # in the list. We should add a uniqueness validation to this.\n #\n\n if !@user\n flash[:notice] = \"You need to be logged in to add your email to the list.\"\n elsif @camp.users.include?(@user)\n flash[:notice] = \"Nice! You've already sent your email to the creator.\"\n else\n flash[:notice] = \"Sweet! You just sent your email adress to the creator.\"\n @camp.users << @user\n end\n redirect_to @camp\n end", "title": "" }, { "docid": "95dfbfd703f924dc7fc9300b127b968f", "score": "0.66416204", "text": "def join\n @room.users << current_user\n render json: @room, status: :ok\n end", "title": "" }, { "docid": "5f4e844f5b735990010d8a08a1cba947", "score": "0.65887225", "text": "def join_room(username, password, id = \"\")\n meeting_room = if id == \"\" then @meeting_id else id end\n\n\n url = @@api.join_meeting_url(meeting_room, username, password)\n redirect_to url.to_s\n end", "title": "" }, { "docid": "efa26bfbcec64ee83ab5eff28a0d9032", "score": "0.65499395", "text": "def join\n authorize! :manage_teams, @team_member_invitation\n action = params[:commit] == \"Oui\" ? :accept_invitation! : :refuse_invitation!\n @team_member_invitation.send(action)\n redirect_to dashboard_team_member_invitations_path\n end", "title": "" }, { "docid": "b575c55bcab6defa1808e4e4565bd118", "score": "0.6544738", "text": "def join_meeting_url(meeting_id, user_name, password, options={})\n params = { :meetingID => meeting_id, :password => password, :fullName => user_name }.merge(options)\n url, data = get_url(:join, params)\n url\n end", "title": "" }, { "docid": "e45c5910f99055171e1f692515a9e45b", "score": "0.653024", "text": "def create_and_join_meeting\n record = if request.params[:record] then true else false end\n\n create_room(request.params[:room_id], record)\n\n join_room(request.params[:name], request.params[:password])\n end", "title": "" }, { "docid": "84cec8922f07718614b1f35cb71c7e3c", "score": "0.6461543", "text": "def join\n\t\trender :json=>{:success=>false, :msg=>'User not logged in.'} and return if (@user.nil?)\n\t\trender :json=>{:success=>false, :msg=>'No competition selected'} and return if (!params.has_key?(:id))\n\t\t\n\t\tcompetition_id = params[:id]\n\t\t\n\t\tcompetition = Competition.find_by_id(competition_id)\n\t\tif (competition.status == STATUS[:ACTIVE])\n\t\t\tCompetitionParticipant.add_participant(@user.id, competition_id, @scope)\n\t\telsif (competition.status == STATUS[:PRIVATE])\n\t\t\tcode = nil\n\t\t\tcode = params[:code] if params.has_key?(:code)\n\t\t\tif Competition.is_competition_code_valid(competition_id, code)\n\t\t\t\tCompetitionParticipant.add_participant(@user.id, competition_id, @scope) \n\t\t\telse\n\t\t\t\trender :json=>{:success=>false, :msg=>'Could not join competition. Incorrect invitation code.'} and return\n\t\t\tend\n\t\tend\n\t\t\n\t\t#Check if joined successfully\n\t\tparticipant = CompetitionParticipant.where({:competition_id=>competition_id, :user_id=>@user.id, :status=>STATUS[:ACTIVE]}).first\n\t\trender :json=>{:success=>false, :msg=>'Could not join competition. You may have been kicked out.'} and return if (participant.nil?)\n\t\t\n\t\tCompetitionInvitation.delete_invitation(@user.id, competition_id)\n\t\trender :json=>{:success=>true, :msg=>'success'}\n\tend", "title": "" }, { "docid": "3630f966d4baf1281f2d948138f23edb", "score": "0.6439287", "text": "def join\n @availability = Availability.find(params[:availability_id])\n @user = User.find(params[:user_id])\n @availability.users << @user\n redirect_to(event_path(@availability.event.id))\n end", "title": "" }, { "docid": "02bf44ab9352547397186cd0701aaf72", "score": "0.6417777", "text": "def join\n if !member_of(current_group)\n current_group.add_member(current_user)\n \n redirect_to current_group\n end\n end", "title": "" }, { "docid": "e0b738544d2c61448c7fa0dcd3dbc4dd", "score": "0.64045274", "text": "def get_meeting_url\n prepare()\n @api.join_meeting_url(params[:id], params[:username], params[:password])\n end", "title": "" }, { "docid": "9c4c97e5d49a0aaf367ffac92cffbe97", "score": "0.63935596", "text": "def join\n classroom_id = params[:id]\n classroom = Classroom.find(classroom_id)\n group_id = classroom.gitlab_group_id\n user = User.find_by(gitlab_id: current_user.id)\n access = user.role == 'teacher' ? 50 : 20\n member = {\n user_id: current_user.id,\n access_level: access\n }\n add_group_member group_id, member\n classroom.users << User.find_by(gitlab_id: current_user.id)\n redirect_to classrooms_path\n end", "title": "" }, { "docid": "f921e33797ca0aefef8dbd14419ec33e", "score": "0.6381985", "text": "def join_url(username, role)\n if role == :moderator\n self.server.api.join_meeting_url(self.meetingid, username, self.moderator_password)\n else\n self.server.api.join_meeting_url(self.meetingid, username, self.attendee_password)\n end\n end", "title": "" }, { "docid": "405feb5c59af09592d783f39bf7eefb6", "score": "0.63554776", "text": "def join\n classroom_id = params[:id]\n classroom = Classroom.find(classroom_id)\n group_id = classroom.gitlab_group_id\n user = User.find_by(gitlab_id: current_user.id)\n access = user.role == 'teacher' ? 50 : 20\n member = {\n user_id: current_user.id,\n access_level: access\n }\n if user.role == 'teacher'\n add_group_member group_id, member\n end\n classroom.users << User.find_by(gitlab_id: current_user.id)\n redirect_to classrooms_path\n end", "title": "" }, { "docid": "2d45faae613ca63418ff4104243bad53", "score": "0.63392097", "text": "def perform_join(username, role, request=nil)\n fetch_is_running?\n\n # if the user is a moderator, create the room (if needed) and join it\n if role == :moderator\n add_domain_to_logout_url(request.protocol, request.host_with_port) unless request.nil?\n send_create unless is_running?\n ret = join_url(username, role)\n\n # normal user only joins if the conference is running\n # if it's not, wait for a moderator to create the conference\n else\n ret = join_url(username, role) if is_running?\n end\n\n ret\n end", "title": "" }, { "docid": "13d2eeb93cd11492c32d6d4a43d1b783", "score": "0.6321167", "text": "def join\n current_user.events << @event\n redirect_to @event\n end", "title": "" }, { "docid": "a09a54f20b1883f610e8418d4f8017ca", "score": "0.631885", "text": "def join\n respond_to do |format|\n if @event && !@event.private\n @event.joined_users << current_user unless @event.joined_users.include? current_user\n format.js { render :join }\n format.html { redirect_to event_path(current_user), notice: 'Successfully joined event.' }\n format.json { head :no_content }\n else\n format.html { render :edit }\n format.json { render json: \"Could not leave event\", status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2c5f91eb7a4340b5c01aaa53b0041c14", "score": "0.6318348", "text": "def join\n @travel = Travel.find_by(id: params[:travel_id])\n @traveler = Traveler.find_by(id: params[:id])\n validation = @travel.check_requirements(@traveler) if @travel\n already_included = @travel.travelers.include?(@traveler) if @travel\n if @travel && validation && !already_included\n @travel.travelers << @traveler\n @travel.update_people\n render status: 200, json: :no_content\n else\n render status: 404, json: :no_content\n end\n end", "title": "" }, { "docid": "824ceaaec4b478dfe722565bc0609f54", "score": "0.6289281", "text": "def join(*args)\r\n args.uniq.each do |user|\r\n conversation_members.where(:user_id => user.id).update_all :parted => true\r\n\r\n conversation_members.build :user_id => user.id rescue nil\r\n\r\n broadcast_save user\r\n end\r\n end", "title": "" }, { "docid": "ce967fca27ad617d8ff7de6f5b3ebcd4", "score": "0.62492806", "text": "def tujoinuri\n start_str = 'meetingID=' + id.to_s\n if !user.username.nil?\n start_str+='&fullName='+ tutor.user.fullname\n end \n \n if !moderatorPW.nil?\n start_str+='&password=' + moderatorPW\n end \n start_str.gsub!(' ', '+')\n buildurl(start_str,\"join\")\n end", "title": "" }, { "docid": "1932b46c0d6191aad01920b2086d0a36", "score": "0.62189645", "text": "def join\n setup_campuses_filter\n setup_groups\n @join = true\n\n respond_to do |format|\n format.html\n end\n end", "title": "" }, { "docid": "6bd36e8c8edc849cab1a8a1bc9ee23a0", "score": "0.6217686", "text": "def join\n if request.post?\n @group = Group.find(params[:id])\n if @group\n begin\n @user.group = @group\n @user.save!\n render :xml => @group\n rescue Exception => ex\n render_error(\"Could not join you to group!\", ex)\n end\n else\n render_error(\"Could not find the group you requested\", nil)\n end\n else\n render_error(\"Request type not supported. Expected POST.\", nil)\n end\n end", "title": "" }, { "docid": "e45371a64c121f340c5ab498bf70513b", "score": "0.62172174", "text": "def join\n if !logged_in?\n render json: [\"Invalid credentials\"], status: 401\n end \n \n @server = Server.find_by(invite_link: params[:server][:invite_link])\n # servers_user = ServersUser.find_by(server_id: @server.id, user_id: current_user.id) || ServersUser.new(server_id: @server.id, user_id: current_user.id)\n servers_user = ServersUser.find_or_initialize_by(server_id: @server.id, user_id: current_user.id)\n if @server.present? && servers_user.save\n # ServersUser will either exist or we create it \n render :show\n else \n render json: @server.errors.full_messages, status: 422\n end \n end", "title": "" }, { "docid": "8b18dd911a4dda834450c7fafe11a291", "score": "0.62148845", "text": "def join_request\n sender_id = join_request_params[:user_id]\n project_id = join_request_params[:project_id]\n task_id = join_request_params[:task_id]\n task_title = Task.find(task_id).title\n project_owner = UserToProject.find_by_project_id_and_project_user_class(project_id,ProjectUserClass::OWNER)\n Request.create( receiver_id: project_owner.user_id, \n sender_id: sender_id,\n request_type: 'project_task',\n request_type_id: task_id,\n message: \"Hi, I would like to take on task #{task_title}\", \n link: \"/users/#{sender_id}\")\n\n javascript = \"alert('There is a person who wants to take on a task');\"\n #PrivatePub.publish_to(\"/inbox/#{project_owner.user_id}\",javascript)\n redirect_to project_tasks_path(project_id), notice: 'Request sent!'\n end", "title": "" }, { "docid": "ab15440703d4bbb080a0b94a85a11a56", "score": "0.6212266", "text": "def join_url(username, role, password=nil)\n require_server\n\n case role\n when :moderator\n self.server.api.join_meeting_url(self.meetingid, username, self.moderator_password)\n when :attendee\n self.server.api.join_meeting_url(self.meetingid, username, self.attendee_password)\n else\n self.server.api.join_meeting_url(self.meetingid, username, password)\n end\n end", "title": "" }, { "docid": "bc05cf52f7055ac9dce2a6f11f9e97a0", "score": "0.62087566", "text": "def join_event\n\t\tevent = Event.find(params[:id])\n\n\t\t# don't add them if they are already attending this event\n\t\tunless event.attendees.find_by(user_id: current_user.id)\n\t\t\tnew_attendee = Attendee.new(user_id: current_user.id, event_id: params[:id], user_role: 'user')\n\n\t\t\t# couldn't save the user to this event for some reason\n\t\t\tunless new_attendee.save\n\t \t\trender \"events/show\", notice: \"Something went wrong! Please try again.\"\n\t \tend\n\t end\n\t redirect_to user_path(current_user.id), notice: \"Woohoo! Your ticket has been booked!\"\n\tend", "title": "" }, { "docid": "e854b5fd025a7b069ebab5503226f4d5", "score": "0.6196757", "text": "def join_user_params\n # gets the user information, given priority to a possible logged user\n if bigbluebutton_user.nil?\n @user_name = params[:user].blank? ? nil : params[:user][:name]\n @user_id = nil\n else\n @user_name = bigbluebutton_user.name\n @user_id = bigbluebutton_user.id\n end\n\n # the role: nil means access denied, :key means check the room\n # key, otherwise just use it\n @user_role = bigbluebutton_role(@room)\n if @user_role.nil?\n raise BigbluebuttonRails::RoomAccessDenied.new\n elsif @user_role == :key\n @user_role = @room.user_role(params[:user])\n end\n\n if @user_role.nil? or @user_name.blank?\n flash[:error] = t('bigbluebutton_rails.rooms.errors.join.failure')\n redirect_to_on_join_error\n end\n end", "title": "" }, { "docid": "a8debe57071edace8228ac35d089683e", "score": "0.6189273", "text": "def join\n @event = Event.find(params[:id])\n if (params[:type] == \"invite\")\n @uids = params[:uids]\n @uid_array = []\n @uid_array = @uids.split(\",\")\n\n @motlee_users = []\n @non_motlee_users = []\n\n @uid_array.each do |uid|\n motlee_user = User.where(:uid => uid).first\n\n if motlee_user.nil?\n token = params[:access_token]\n event_id = params[:id]\n Resque.enqueue(ProcessNewUserInvite, token, event_id, uid) \n else\n # User is already a part of Motlee\n # Add user to array of Motlee users\n @motlee_users << uid\n \n # Now we check to see if the user has already been added to the event\n @attendee = Attendee.where(\"user_id = ? AND event_id = ?\", motlee_user.id, params[:id]).first\n if @attendee.nil?\n # If user has not been added, create new Attendee object\n @attendee = Attendee.create(:user_id => motlee_user.id, :event_id => params[:id], :rsvp_status => 1)\n if (motlee_user.id != current_user.id)\n Resque.enqueue(AddEventNotification, motlee_user.id, params[:id], current_user.id)\n end\n end\n end\n end \n else\n @attendee = Attendee.create(:user_id => current_user.id, :event_id => @event.id, :rsvp_status => 1)\n end\n # Render a response so the devices are happy\n @event.update_attributes(:updated_at => Time.now)\n render :json => @event.as_json({:methods => [:owner, :attendee_count], \n :include => {:photos => {:include => {:comments => {}, :likes => {}}}, \n :people_attending => {:only => [:id, :uid, :name, :sign_in_count]}}})\n end", "title": "" }, { "docid": "d3f8143a124e72f0a9a74c825cadb90a", "score": "0.61597276", "text": "def join_room\n dispatch :player_join, { user_id: current_user.id }\n end", "title": "" }, { "docid": "38092024d664bf458b7abe8fcbb652fc", "score": "0.6143508", "text": "def join\n #make sure user isn't already a member of the list and that they have an open invite exiting\n if !@list.users.find_by(id: current_user.id) && @list.invites.exists?(email: current_user.email, status: \"open\")\n @list.users << current_user\n invite = current_user.invites.find_by(list_id: @list.id)\n #close out the invite\n invite.status = \"closed\"\n invite.save\n redirect_to @list\n else\n flash[:notice] = \"Not a valid invite.\"\n redirect_to @list\n end\n\n end", "title": "" }, { "docid": "979b7bfd2c2d4be49f8758b01cbe506c", "score": "0.6101388", "text": "def join_path(name, options = {}, uid = nil)\n # Create the meeting if it isn't running.\n start_session(options) unless running?\n\n # Set meeting options.\n options[:meeting_logout_url] ||= nil\n options[:moderator_message] ||= ''\n options[:user_is_moderator] ||= false\n options[:meeting_recorded] ||= false\n\n return call_invalid_res unless bbb\n\n # Get the meeting info.\n meeting_info = bbb.get_meeting_info(bbb_id, nil)\n\n # Determine the password to use when joining.\n password = if options[:user_is_moderator]\n meeting_info[:moderatorPW]\n else\n meeting_info[:attendeePW]\n end\n\n # Generate the join URL.\n join_opts = {}\n join_opts[:userID] = uid if uid\n\n bbb.join_meeting_url(bbb_id, name, password, join_opts)\n end", "title": "" }, { "docid": "570c705d62418a71079606443e5fce02", "score": "0.6099702", "text": "def join_internal(username, role, id)\n begin\n # first check if we have to create the room and if the user can do it\n unless @room.is_running?\n if bigbluebutton_can_create?(@room, role)\n if @room.create_meeting(bigbluebutton_user, request)\n logger.info \"Meeting created: id: #{@room.meetingid}, name: #{@room.name}, created_by: #{username}, time: #{Time.now.iso8601}\"\n end\n else\n flash[:error] = t('bigbluebutton_rails.rooms.errors.join.cannot_create')\n redirect_to_on_join_error\n return\n end\n end\n\n # room created and running, try to join it\n url = @room.parameterized_join_url(username, role, id, {}, bigbluebutton_user)\n\n unless url.nil?\n\n # change the protocol to join with a mobile device\n if BigbluebuttonRails.use_mobile_client?(browser) &&\n !BigbluebuttonRails.value_to_boolean(params[:desktop])\n url.gsub!(/^[^:]*:\\/\\//i, \"bigbluebutton://\")\n end\n\n redirect_to url\n else\n flash[:error] = t('bigbluebutton_rails.rooms.errors.join.not_running')\n redirect_to_on_join_error\n end\n\n rescue BigBlueButton::BigBlueButtonException => e\n flash[:error] = api_error_msg(e)\n redirect_to_on_join_error\n end\n end", "title": "" }, { "docid": "354cdd86efc0a4be39f874e2d710e87e", "score": "0.60954535", "text": "def join\n admin = current_user.roles.where(id: @conference.roles).any?\n registered_happening_now = @conference.user_registered?(current_user) && @event.happening_now?\n can_view_event = @event.url.present? && (admin || registered_happening_now)\n\n if can_view_event\n current_user.mark_attendance_for_conference(@conference)\n current_user.mark_attendance_for_event(@event)\n redirect_to @event.url, allow_other_host: true\n else\n redirect_to conference_program_proposal_path(@conference, @event),\n error: 'You cannot join this event yet. Please try again closer to the start of the event.'\n end\n end", "title": "" }, { "docid": "d4ba976d30b10308e4f631dfc5347f14", "score": "0.6054248", "text": "def join\n Member.create(:user_id => current_user.id, :tour_id => params[:id])\n @tour = Tour.find(params[:id])\n \n if @tour.user\n TourMailer.joined_tour_confirmation(@tour.user, current_user, @tour).deliver\n redirect_to current_user, :flash => { :success => \"Joined tour!\" }\n else\n redirect_to root_path, :flash => { :success => \"Sorry. There was a problem joining this tour.\" }\n end\n end", "title": "" }, { "docid": "fc5cd0cb97f13cebc9f8bff9d05e1d58", "score": "0.6013601", "text": "def join\n group = Group.find_by(:id => params[:id])\n @groupUser = GroupUser.new\n @groupUser.group_id = params[:id]\n @groupUser.user_id = session[:user_id]\n if @groupUser.save\n flash[:notice] = \"You have joined #{group.name}!\"\n end\n redirect_to '/groups'\n end", "title": "" }, { "docid": "a64b9637a81a713dd744d36af2b617d8", "score": "0.59947723", "text": "def join\n @membership = @project.memberships.where(user_id: current_user.id).find_or_create! { |m| m.user = current_user }\n respond_with @membership, location: project_url(@project)\n end", "title": "" }, { "docid": "7d77682d472d97a000b45fbbae453b16", "score": "0.5990081", "text": "def join\n @group = Group.find(params[:id])\n user = User.find(session[:user_id])\n\n unless user.group\n @group.users << user\n redirect_to groups_url, :notice => \"You successfully joined group #{@group.name}\"\n else\n redirect_to groups_url, :notice => \"You are already in group #{user.group.name}\"\n end\n end", "title": "" }, { "docid": "2c207d7d913b1e0751be141ac779dc1c", "score": "0.59670734", "text": "def join\n\t\tparams[:player] = {}\n\t\tparams[:player][:game_uuid] = params[:game_uuid]\n\t\tparams[:player][:user_uuid] = session[:user_uuid]\n\t\n\t\t@player = Player.new(params[:player])\n\t\tgames = Game.get_games\n\t\t@games = preview_games(games)\n\n\t\tif @player.save\n\t\t\tflash[:notice] = 'You joined the game!'\n\t\t\tredirect_to :action => 'index'\n\t\telse\n\t\t\tflash[:notice] = 'Unable to join game'\n\t\t\trender :action => 'show_games'\n\t\tend\n\tend", "title": "" }, { "docid": "809894b9e436c2b44455204726ead647", "score": "0.59587085", "text": "def join_team\n @pending_invites = current_user.user_invites.pending\n @pending_requests = current_user.user_requests.pending\n (@filterrific = initialize_filterrific(\n Team, params[:filterrific],\n select_options: {\n state: state_enum,\n country: country_enum,\n division: Division.all.map { |d| [d.name, d.id] }\n }\n )) || return\n @teams = @filterrific.find.includes(:division).page(params[:page])\n\n respond_to do |format|\n format.html\n format.js\n end\n end", "title": "" }, { "docid": "fc05f95ac9143b776cbd10719ec0f169", "score": "0.5941628", "text": "def join\n @event_attendee = EventAttendee.new(attendee: @user, event: @event)\n authorize @event\n if @event_attendee.save\n render json: {\n attending: true,\n attendees: @event.attendees_counter.value,\n attendee: current_user.card_json\n }\n else\n render json: @event.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "921b941945f00da32ef75df07d858c0e", "score": "0.5918347", "text": "def add_team\n current_user.join_team(params[:user][:team_id])\n redirect_to current_user.group_welcome_page\n end", "title": "" }, { "docid": "a4146b292145d5050951c6a3f1db48b4", "score": "0.5912692", "text": "def join\n if current_user.nil?\n format.html { redirect_to :signin, notice: 'Please log in' }\n #format.json { render json: @beer_club.errors, status: :unprocessable_entity }\n end\n\n if @beer_club.memberships.include? current_user\n format.html { redirect_to :back, notice: \"You're already a member of this beer club.\" }\n end\n\n paivitys = @beer_club.memberships.create user: current_user\n respond_to do |format|\n if paivitys\n format.html { redirect_to :back, notice: \"You joined #{@beer_club.name}\" }\n format.json { render :show, status: :ok, location: @beer_club }\n else\n format.html { redirect_to :back, notice: 'Something went wrong.' }\n format.json { render json: @beer_club.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c3aadf0048233df9f70d5b06828be909", "score": "0.5886117", "text": "def stjoinuri\n start_str = 'meetingID=' + id.to_s\n if !user.username.nil?\n start_str+='&fullName='+ user.fullname\n end \n \n if !attendeePW.nil?\n start_str+='&password=' + attendeePW\n end \n \n start_str.gsub!(' ', '+')\n buildurl(start_str,\"join\")\n end", "title": "" }, { "docid": "cff7f18300eff307b3c674f014af7a50", "score": "0.58686787", "text": "def user_joins\n visit games_path\n click_button('join')\n end", "title": "" }, { "docid": "b388c7e2c76e324ae07f02cdadc29d8e", "score": "0.58625984", "text": "def join_event\n \n @account = session[:id]\n @event = Event.find(params[:eid]).event_id\n \n if request.xhr?\n #creates the event they joined in the user's google calendar\n account = Account.find(session[:id])\n event = Event.find(@event)\n service = GCal4Ruby::Service.new\n service.authenticate(\"meevecalendar@gmail.com\", \"jtantongco\")\n calendar = GCal4Ruby::Calendar.find(\n service,\n {:id => account.gcal})\n gevent = GCal4Ruby::Event.new(service, { \t:calendar => calendar , \n\t\t\t\t\t\t\t\t\t\t\t \t:title => event.title,\n\t\t\t\t\t\t\t\t\t\t\t\t:start_time => Time.parse(event.start_date.to_s), \n\t\t\t\t\t\t\t\t\t\t\t\t:end_time => Time.parse(event.end_date.to_s), \n\t\t\t\t\t\t\t\t\t\t\t\t:where => event.location}) \t\t\t\t\t\t\t\t\n \n #marks them as Joined to the event in the Joinevent table\n @join = Joinevent.new\n @join.aid = @account\n @join.eid = @event\n gevent.save\n @join.geventid = gevent.id\n \n if @join.save\n render \"events/join_event\"\n end\n else\n redirect_to(:controller => :main, :action => :profile)\n end\n end", "title": "" }, { "docid": "3699e28e88ba88029809b6599926381f", "score": "0.584957", "text": "def join \n @community.members.create(:user_id=>current_user.id)\n @invitable_members = @community.members - @community.members.where(user_id: current_user.id)\n @invitable_members.map(&:user).uniq.each do |user|\n reciver = user\n notifications = reciver.notifications.unread \n Notification.create(recepient: user, user: current_user, body: \"#{current_user.screen_name } has join #{@community.topic}\", notificable: @community, :accept => true)\n PrivatePub.publish_to \"/profiles/new_#{user.id}\", \"jQuery('#all-notifications').html('#{notifications.count}'); jQuery('#all-notifications').addClass('push-notification');\"\n end\n if request.referrer.include?(\"followings\")\n @suggest=false\n else\n @suggested_communities, @suggest = suggested_communities \n end\n end", "title": "" }, { "docid": "c0e42da882a045edc0b4677fdadb5abb", "score": "0.5835702", "text": "def join_event(user, params)\n event = Event.find(params[:event_id])\n team = event.team\n Ability.new(user).authorize! :join_as_player, team\n\n role = TeamUsersService.add_player(team, user, false, nil, false)\n\n # TODO: Move this elsewhere, and generalize it.\n t = LandLord.o2_touch_tenant\n user.tenant = t\n user.configurable_set_parent(t)\n user.save!\n\n # SHITTY HACK for users that sign in with facebook (but we fake it)\n if params[:user].has_key? :authorization\n user.authorizations.create({\n token: params[:user][:authorization][:token],\n uid: params[:user][:authorization][:uid],\n provider: 'Facebook',\n name: user.name\n })\n end\n\n\n platform = PlatformHelper.get_platform_from_params(params)\n\n md = { event_id: event.id, team_id: team.id, processor: 'Ns2::Processors::TeamRolesProcessor' }\n AppEventService.create(role, user, \"created\", md)\n end", "title": "" }, { "docid": "c99f2ac7326d2bf62db7f30a2f6685ff", "score": "0.5818977", "text": "def join( user )\n user.active = true\n if user.save\n return \"Thanks for joining! :tada:\"\n else\n return \"Sorry, something went wrong. :robot_face: Please try again.\"\n end\n end", "title": "" }, { "docid": "0e785ae933e07433e7eaa3f343c01257", "score": "0.57953686", "text": "def join\n @round = Round.find(params[:round_id])\n participant = @round.participants.where(player_id: current_user.id).first!\n\n @round.create_games_for(participant)\n\n redirect_to root_path, notice: 'You have joined the round in progress'\n end", "title": "" }, { "docid": "db6da62e39fb31a9fd9bab656aea4b6c", "score": "0.57867074", "text": "def join\n unless @trip = Trip.find_by_id(params[:id])\n redirect_to '/404.html'\n return\n end\n flash[:success] = 'Your request was sent'\n @trip.save_request(current_user)\n redirect_to trip_path(@trip)\n end", "title": "" }, { "docid": "74142d685971796ea9a1fcb8461c5a93", "score": "0.57824314", "text": "def join\n @group = Group.find(params[:id])\n\n if !@group.can_join(current_user, activation_code: params[:activation_code])\n return redirect_to groups_path\n end\n\n if @group.add_member(current_user, activation_code: params[:activation_code])\n @success = true\n end\n\n redirect_to browse_events_path(group_id: @group.id)\n end", "title": "" }, { "docid": "966e04af866afc6a819329fcbad258a4", "score": "0.5774372", "text": "def join\n @group.members.create(:user_id=>current_user.id)\n @invitable_members = @group.members - @group.members.where(user_id: current_user.id) \n @invitable_members.map(&:user).uniq.each do |user|\n reciver = User.find(user)\n notifications = reciver.notifications.unread \n Notification.create(recepient: user, user: current_user, body: \"#{current_user.screen_name } has join #{@group.topic}\", notificable: @group, :accept => true)\n PrivatePub.publish_to \"/profiles/new_#{user.id}\", \"jQuery('#all-notifications').html('#{notifications.count}'); jQuery('#all-notifications').addClass('push-notification');\"\n end \n if request.referrer.include?(\"followings\")\n @suggest=false\n else \n @suggested_groups, @suggest = suggested_groups\n end\n \n respond_to do |format|\n format.js\n format.html { redirect_to groups_url }\n end\n end", "title": "" }, { "docid": "d91608fff8c638fffcc35f3d389908b3", "score": "0.5773194", "text": "def join_team(post, message, requested_user)\n @post = post\n @to = @post.user\n @greeting = message\n @requested_user = requested_user\n mail(:to => @to.email, :subject => \"Your project is quicky gaining traction!\", :from => \"staff@launcherr.com\")\n end", "title": "" }, { "docid": "9ed5cc9b7fa7f3a2b683ce0b3a08e0e1", "score": "0.5766831", "text": "def show_user_join\n # Get users name\n @name ||= if current_user\n current_user.full_name\n elsif cookies.encrypted[:guest_user_name]\n cookies.encrypted[:guest_user_name]\n else\n \"Guest\"\n end\n\n @search, @order_column, @order_direction, pub_recs =\n public_recordings(@room.bbb_id, params.permit(:search, :column, :direction), true)\n\n @pagy, @public_recordings = pagy_array(pub_recs)\n\n @is_guest_user = (@join_name.present? || @name.present?) && !room_authentication_required && (@room.access_code.blank? || (@room.access_code == session[:access_code])) && params[:guest_id].present?\n @is_reloading = request.query_parameters[:reload] == \"true\"\n\n render :join\n end", "title": "" }, { "docid": "603f4b4d0088b224a9e1fa1541bef10f", "score": "0.5758864", "text": "def join\n @conversation = Conversation.public_groups.find(params[:id])\n if @conversation.join!(current_user.id)\n render_conversation(@conversation)\n else\n render_error_model @conversation\n end\n end", "title": "" }, { "docid": "b860febe68a4e1c56cda1d022324f69b", "score": "0.57306397", "text": "def join\n @group = Group.find(params[:id]) || ( not_found and return )\n authorize! :join, @group\n current_user.add_role :member, @group\n\n respond_to do |format|\n format.html { redirect_to cooperative.group_url(@group), :notice => 'You have joined ' + @group.name + '.' }\n format.js { render :action => 'join'}\n end\n end", "title": "" }, { "docid": "48730f51e9d024e92523aaa2cf791e1d", "score": "0.57024544", "text": "def join(user)\n # Check if the user already joined the room or the room is open\n if not self.join?(user) and not self.is_full? and self.status == ROOM_STATUS[:open]\n self.users << user\n self.set_user_status(user, USER_STATUS[:join])\n self.edit_occupancy\n return self.save\n else\n return false\n end\n end", "title": "" }, { "docid": "aa3f99a484f9fb4548f86ad1de795080", "score": "0.5702223", "text": "def join_group\n @assignment = Assignment.find(params[:id])\n @grouping = Grouping.find(params[:grouping_id])\n @user = Student.find(session[:uid])\n @user.join(@grouping.id)\n m_logger = MarkusLogger.instance\n m_logger.log(\"Student '#{@user.user_name}' joined group '#{@grouping.group.group_name}'\" +\n '(accepted invitation).')\n redirect_to action: 'student_interface', id: params[:id]\n end", "title": "" }, { "docid": "bc6d07a6185bd674629982c09fb09dc2", "score": "0.5700207", "text": "def join\n @teetime = Teetime.find(params[:teetime_id])\n\n Timesheet.create(teetime: @teetime, member: current_member)\n Teetimerequest.where(teetime_id: @teetime.id, member_id: @teetime.members.last.id).destroy_all\n\n if @teetime.members.all.length == 4\n @teetime.full = true;\n end\n\n if @teetime.save\n flash[:notice] = \"You joined #{@teetime.creator}'s teetime.\"\n redirect_to member_teetimes_path\n end\n end", "title": "" }, { "docid": "d7c63f417944e2a812c6f2a27487ba4d", "score": "0.5700169", "text": "def join_team\n @team = Team.find(params[:id])\n if current_user.team_id == -1 && @team.applied_user_ids.exclude?(current_user.id)\n @team.applied_user_ids << current_user.id\n @team.save\n current_user.pending_team_ids << @team.id\n current_user.save\n redirect_to action: \"show\"\n flash[:warning] = \"You have successfully applied for this team.\"\n elsif current_user.team_id != -1\n redirect_to action: \"show\"\n flash[:warning] = \"You could not apply for this team since you are currently on a team.\"\n else\n redirect_to action: \"show\"\n flash[:warning] = \"You have already applied to this team.\"\n end\n end", "title": "" }, { "docid": "65c62594724185ccbe395ace1cd7957e", "score": "0.56974936", "text": "def invite\n @group = Group.find(params[:id])\n @users = User.where(id: params[:group][:user_ids])\n @users.each do |user|\n @join = Membership.create(group_id: @group.id, user_id: user.id)\n end\n redirect_to root_url\n end", "title": "" }, { "docid": "783508aa44e7018fa2a187bfd45eba53", "score": "0.56784356", "text": "def join_invitation(user, invitation)\n @invitation = invitation\n @user = user\n\n mail(\n :from => \"#{user.name} <#{user.email}>\", \n :to => \"#{invitation.name} <#{invitation.email}>\", \n :subject => \"You're invited to Drive Less by #{user.name}\"\n ) \n end", "title": "" }, { "docid": "74e728632e52b0e15681761b8fdeed3e", "score": "0.5675573", "text": "def join_room_id(room_id, third_party_signed: nil, **params)\n query = {}\n query[:user_id] = params.delete(:user_id) if protocol?(:AS) && params.key?(:user_id)\n\n body = {\n third_party_signed: third_party_signed\n }.compact\n\n room_id = ERB::Util.url_encode room_id.to_s\n\n request(:post, client_api_latest, \"/rooms/#{room_id}/join\", body: body, query: query)\n end", "title": "" }, { "docid": "608bbea1e958d5e95dfc3d5659306c21", "score": "0.56725895", "text": "def join(user, host)\n @user = user\n @host = host\n mail( to: @user.email,\n subject: \"Trip Itinerary\" )\n end", "title": "" }, { "docid": "829e371d978913fe0044fe25bfb328df", "score": "0.5666073", "text": "def join\n game_id = params[:game_id]\n url = URI.parse(\"#{server_url}/games/#{game_id}/join?player_id=#{current_user.id}\")\n req = Net::HTTP::Post.new(url.to_s)\n res = Net::HTTP.start(url.host, url.port) do |http|\n http.request(req)\n end \n json = JSON.parse(res.body)\n\n if json[\"status\"] == \"success\"\n game_id = json[\"data\"][\"game_id\"]\n session[:side] = \"o\"\n redirect_to \"/games/#{game_id}\"\n else\n flash[:error] = \"Error joining game: #{json[\"message\"]}\"\n redirect_to :back\n end\n end", "title": "" }, { "docid": "dc1404f2d9283b167f5767d8da88e314", "score": "0.56599104", "text": "def join_user_group\n \t@group = UserGroup.new\n \t@group_name = params[:group_name]\n \t@group_id = UserGroup.find_by_group_name(@group_name).id\n end", "title": "" }, { "docid": "c47e3aa79b63e2ee311fde64f79b2d2c", "score": "0.56548554", "text": "def join(room, third_party_signed = nil)\n if third_party_signed\n make_request(\n :post,\n \"/join/#{room}\",\n content: { third_party_signed: third_party_signed }\n )['room_id']\n else\n make_request(:post, \"/join/#{room}\")['room_id']\n end\n end", "title": "" }, { "docid": "264883b1f6308820f8cbe4d5f810e147", "score": "0.5650277", "text": "def attendee_url(meeting_id, user_name, attendee_password)\n get_url(:join, {:meetingID=>meeting_id,:password=>attendee_password, :fullName=>user_name})\n end", "title": "" }, { "docid": "bf667109153c240129886dda6d8fa2c9", "score": "0.5649297", "text": "def join\n @groups_user = GroupsUser.new\n\n respond_to do |format|\n format.html # join.html.erb\n format.xml { render :xml => @groups_user }\n end\n end", "title": "" }, { "docid": "bf667109153c240129886dda6d8fa2c9", "score": "0.5649297", "text": "def join\n @groups_user = GroupsUser.new\n\n respond_to do |format|\n format.html # join.html.erb\n format.xml { render :xml => @groups_user }\n end\n end", "title": "" }, { "docid": "4c5818e46f9779b8a88690cd893e8958", "score": "0.5642105", "text": "def join_discussion\n @discussion = Discussion.find(params[:id])\n @login_user.add_discussion?({:discussion => @discussion.discussion})\n @message = \"Discussion joined successfully.\"\n respond_to do |format|\n format.js \n end\n end", "title": "" }, { "docid": "4c5818e46f9779b8a88690cd893e8958", "score": "0.5642105", "text": "def join_discussion\n @discussion = Discussion.find(params[:id])\n @login_user.add_discussion?({:discussion => @discussion.discussion})\n @message = \"Discussion joined successfully.\"\n respond_to do |format|\n format.js \n end\n end", "title": "" }, { "docid": "ed9c2db36341004b843c38e8cd065a99", "score": "0.56420034", "text": "def user_join\n current_user.in_game = true\n current_user.save\n end", "title": "" }, { "docid": "72a75fa7d580b3551f6c23f0f210c1e6", "score": "0.56356597", "text": "def add_user\n team_now = Team.find(params[:team_id])\n #if user entered correct invition code and not in the team\n if team_now.invition_code == params[:invition_code] && !team_now.users.include?(current_user)\n team_now.users << current_user #Add current user to the team\n flash[:success] = \"You successfully joined the team!\"\n redirect_to team_now\n else\n flash[:danger] = \"Failed to join the team. Maybe you entered invalid invition code or you are already in the team.\"\n redirect_to teams_path\n end\n end", "title": "" }, { "docid": "71af2ccd4a2dbcdde845e594205ce271", "score": "0.56234324", "text": "def join_team\n @team = Team.find(params[:team_id])\n @roster = @team.rosters.new(params.require(:roster).permit(:is_owner, :user_id, :team_id))\n @roster.user = current_user\n if @roster.save\n redirect_to team_path(@team)\n else\n redirect_to root_path\n end\n end", "title": "" }, { "docid": "5780ca16c026812a6724a3c63d8259a5", "score": "0.5612139", "text": "def join(user) \n raise \"Can not join this game\" if new_record? || !open?\n \n players << user\n save!\n end", "title": "" }, { "docid": "49c2bb4692b36b65d4565af594a8e95c", "score": "0.55969733", "text": "def create\n user_to_meet = User.find_by_id(params[:user_to_meet])\n first_to_invite = true\n current_user.meetings.where(created_at: (Time.now - 20.seconds)..Time.now).each do |m|\n # I have already been invited by the person I'm trying to invite\n if m.users.where(id: user_to_meet.id, validated: true) && m.users.where(id: current_user.id, validated: false)\n m.handshakes.where(user_id: current_user.id, validated: false).each do |h|\n h.update_attributes(validated: true)\n first_to_invite = false\n end\n end\n end\n if first_to_invite\n meeting = Meeting.create(latitude: current_user.latitude, \n longitude: current_user.longitude)\n meeting.handshakes.create(user_id: current_user.id, validated: true)\n meeting.handshakes.create(user_id: params[:user_to_meet])\n end\n \n # add the user_to_meet to contacts\n current_user.add_contact!(user_to_meet) \n user_to_meet.add_contact!(current_user)\n \n render :nothing => true\n end", "title": "" }, { "docid": "2695cb60ca189a90a90548ed3564d03c", "score": "0.55801785", "text": "def join\n @group = Group.find(params[:group_id])\n\n @membership = @group.memberships.build\n \n @membership.profile_id = current_user.id\n @membership.group_id = @group.id\n\n if @membership.save\n # Save the membership successfully\n redirect_to group_home_url(@group, @membership)\n else\n render :action => \"new\"\n end\n end", "title": "" }, { "docid": "b8fb4a2daf6c486c53595b9db068a8f5", "score": "0.55797654", "text": "def create_meeting(user_id:, params:)\n parse(JSON.parse(connection.post(\"users/#{user_id}/meetings\", params.to_json).body))\n end", "title": "" }, { "docid": "c5936e822febc728bc3772115c7f0d0a", "score": "0.5575273", "text": "def join_params\n params.require(:registrations).permit(:userId, :hackathon_id)\n end", "title": "" }, { "docid": "27a27ac437ffe1aff4a6f62c453d8283", "score": "0.55705255", "text": "def join\n if user_signed_in?\n # Attempt to grab their membership\n membership = @club.memberships.find_by(user_id: current_user.id)\n if membership\n # User is already a member\n redirect_to @club, notice: 'You are already a member.'\n else\n # Add their membership\n @club.memberships.create(:user => @user, :rank => User.rank_member)\n\n redirect_to @club, notice: 'You have joined this club.'\n end\n else\n redirect_to @club, notice: 'You must sign in before you can join this club.'\n end\n end", "title": "" }, { "docid": "22d86343b15346f45407939c9577af2b", "score": "0.5569822", "text": "def join_leave\n @event = Event.find(params[:id])\n if !@event.has_participant(session[:user_id])\n \n @event.add_participant(session[:user_id]) \n else\n @event.delete_participant(session[:user_id])\n end\n \n redirect_to :action => :show, :id => @event.id\n end", "title": "" }, { "docid": "1dd4474e4f85b0e86bb190e5190a490a", "score": "0.55376786", "text": "def join\r\n @hunt = Hunt.find(params[:id])\r\n unless @hunt\r\n # If hunt not found, redirect\r\n redirect_to(root_path, notice: 'Hunt not found')\r\n return\r\n end\r\n\r\n @pirate_hunt, result = @hunt.join(current_user)\r\n if result == :success\r\n redirect_to(pirate_hunt_path(@pirate_hunt.id), notice: 'Hunt successfully joined')\r\n elsif result == :already_joined\r\n redirect_to(root_path, alert: 'You are already participating in this hunt')\r\n elsif result == :error\r\n redirect_to(hunts_path, alert: 'Error occurred while joining hunt') #also maybe changes?\r\n end\r\n end", "title": "" }, { "docid": "3bec4a672119ed8dae1e531cf76a9845", "score": "0.5537082", "text": "def join_by_email\n \t@user_group = UserGroup.find_by_token(params[:token])\n\t\tcurrent_user.update(:user_group => @user_group)\n\t\tUserGroupMailer.join_group_confirmation(@user_group.id, current_user.id).deliver\n\t\tredirect_to '/user_groups', :notice => \"You have joined #{@user_group.group_name}\"\n end", "title": "" }, { "docid": "23f640221de3ddedc92113ef5bf1b6e3", "score": "0.55362123", "text": "def join!(team)\n memberships.create!(:team_id => team.id)\n end", "title": "" }, { "docid": "2a4b77f9ae6c2dbb0930d8bc6bc34fa8", "score": "0.5524194", "text": "def involved_people\n\n support_req_id = params[:id]\n user_ubication_id = Administration::UserSession.find.record.attributes['ubication_id']\n user_id = Administration::UserSession.find.record.attributes['id'] \n @users = involved_all(support_req_id)\n\n end", "title": "" }, { "docid": "caea8dc9242e7840a8cc812771592b89", "score": "0.5520829", "text": "def join\n user = User.find_by(uuid: params[:user_uuid])\n project = Project.find_by(uuid: params[:uuid])\n if !user.nil? && !project.nil?\n Contributor.new(:uuid => UUIDTools::UUID.random_create.to_s, :project_id => project.id, :user_id => user.id).save!\n project.update_attributes(:contributors_count => (project.contributors_count + 1))\n render :json => { :message => 'Successfully added contributor' }\n else\n render :json => {:status => 500, :message => 'Could not add user as contributor'}\n end\n end", "title": "" }, { "docid": "d7f8f149dd0fd1b9945dcd670afcacdd", "score": "0.55041134", "text": "def join_project()\n \t@tempo_user = Volunteer.find_by_v_id(@tempo_report.volunteer_id)\n if (!@tempo_user.projects.exists?(@tempo_report.project))\n @tempo_user.projects << @tempo_report.project\n end\n end", "title": "" }, { "docid": "620db1638445b72a057fde85241adc39", "score": "0.54883677", "text": "def join_group\n @disc_group = DiscussionGroup.find(params[:id])\n @join = DiscussionGroupUser.new(:discussion_group_id => @disc_group.id, :user_id => @login_user.id, :is_member => 1)\n if @join.save\n respond_to do |format|\n format.js\n end\n else\n render :text=>\"Fail\"\n end\n end", "title": "" }, { "docid": "854f5e97eec54f10b48360a696b406f6", "score": "0.5486591", "text": "def new_join(driver, post, rider)\n @rider = rider\n @driver = driver\n @post = post\n mail(to: @driver.email, subject: rider.username + ' wants to join your ride!')\n end", "title": "" }, { "docid": "3b26d68f19d67130d22eae25b11cb4c0", "score": "0.54853916", "text": "def join\r\n \tif(@game.user1 == nil)\r\n session[:game_id] = @game.id\r\n @game.user1 = @current_user.username\r\n @game.save\r\n @current_game = @game\r\n \telsif(@game.user2 == nil)\r\n \t\r\n session[:game_id] = @game.id\r\n @game.user2 = @current_user.username\r\n @game.save\r\n @current_game = @game\r\n \telse\r\n \t flash[:invalid] = 'Game full!'\t\t# Display an error message if the game is full (more than 2 users)\r\n \tend\r\n redirect_to games_url\t\t\t# Redirect the page to game page\t\r\n end", "title": "" }, { "docid": "feaa5d5733bfd459cfde7352df7c0299", "score": "0.54848367", "text": "def joined\n\t\t@user_events = @events = current_student.events.where(user_events: { join_status: true }).paginate(page: params[:page])\n\tend", "title": "" }, { "docid": "e85163b78c4497f1e629ea2e9eced4fb", "score": "0.5476159", "text": "def create\n # create new meeting\n @meeting = current_user.meetings.new(meeting_params)\n # new meeting status as unconfirmed\n @meeting.confirm = false\n # add date and time from params to ruby datetime format\n @meeting.time = (meeting_params[:meetingdate] + \" \" + @meeting.time.hour.to_s + \":\" +@meeting.time.min.to_s + \":00\").to_datetime\n # create new join table record\n @usermeetings = Usermeeting.new\n @usermeetings.user_id = current_user.id\n @usermeetings.owner = true\n # create new post\n @post = Post.new\n @post.description = meeting_params[:description]\n @post.user_id = current_user.id\n\n respond_to do |format|\n if @meeting.save\n @usermeetings.meeting_id = @meeting.id\n @usermeetings.save\n @post.meeting_id = @meeting.id\n @post.save\n\n format.html { redirect_to @meeting, notice: 'Meeting was successfully created.' }\n format.json { render :show, status: :created, location: @meeting }\n else\n format.html { render :new }\n format.json { render json: @meeting.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ededf1aedddda76cf12ae029bf4e5861", "score": "0.54742175", "text": "def create\n \n if(current_user.email == \"admin@email.com\")\n @subjects = Subject.all\n else\n @subjects = Subject.joins(\"INNER JOIN studies ON studies.subject_id = subjects.id AND studies.user_id = '#{current_user.id}'\").distinct\n end\n \n @meeting = Meeting.new(meeting_params)\n @meeting.user_id = current_user.id\n\n respond_to do |format|\n if @meeting.save\n # format.html { redirect_to @meeting, notice: 'Meeting was successfully created.' }\n # format.json { render :index, status: :created, location: @meeting }\n format.html { redirect_to meetings_url}\n format.json { head :no_content }\n else\n format.html { render :new }\n format.json { render json: @meeting.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "30a8e81827c14596c38111a37bbc10af", "score": "0.5471992", "text": "def group_join(user, new_member, group)\n @greeting = \"Hi\"\n @user = user\n @new_member = new_member\n @group = group\n\n mail to: user.email, subject: \"#{new_member.username} joined your Group!\"\n end", "title": "" } ]
946f53c38cf76d1fe7389da4f84c03ef
GET /gupiaos/new GET /gupiaos/new.json
[ { "docid": "11c91d7affd8691e4baf84cf29c7bdf7", "score": "0.7472105", "text": "def new\n @gupiao = Gupiao.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gupiao }\n end\n end", "title": "" } ]
[ { "docid": "510bfbd829e61af6bd1b6ca37c85bb79", "score": "0.74077654", "text": "def new\n @genotipagem = Genotipagem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @genotipagem }\n end\n end", "title": "" }, { "docid": "a4f8057aa6559460afbd139ba45b6154", "score": "0.71831864", "text": "def new\n @gadd = Gadd.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gadd }\n end\n end", "title": "" }, { "docid": "396755cbaf53a40939ccddc758c8d5c0", "score": "0.7133611", "text": "def new\n @generation = Generation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @generation }\n end\n end", "title": "" }, { "docid": "6f65c0c7970ea6a42a6df46d358a2435", "score": "0.71053094", "text": "def create\n @genotipagem = Genotipagem.new(params[:genotipagem])\n\n respond_to do |format|\n if @genotipagem.save\n format.html { redirect_to @genotipagem, notice: 'Genotipagem was successfully created.' }\n format.json { render json: @genotipagem, status: :created, location: @genotipagem }\n else\n format.html { render action: \"new\" }\n format.json { render json: @genotipagem.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "61407d61f277bf30bb60bfdedb2b7f96", "score": "0.7092203", "text": "def new\n @gripe = Gripe.new\n @uuid = (0..29).to_a.map {|x| rand(10)}.join()\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gripe }\n end\n end", "title": "" }, { "docid": "0867ce805ccf15b08de9624a783943ae", "score": "0.7080719", "text": "def new\n @gotra = Gotra.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gotra }\n end\n end", "title": "" }, { "docid": "a2539d8f225c05f1e073f5036dd39fa0", "score": "0.7079609", "text": "def new\n @gopy = Gopy.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gopy }\n end\n end", "title": "" }, { "docid": "d89d88dcb488b2acf0e3af27a9893512", "score": "0.7076552", "text": "def new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: ''}\n end\n end", "title": "" }, { "docid": "2aa2e94fccd3de0b2ede6edc6d7b9b21", "score": "0.7068239", "text": "def new\n @agronomiagalera = Agronomiagalera.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @agronomiagalera }\n end\n end", "title": "" }, { "docid": "0f823991c91ee15dcc6b090f1dcb08a8", "score": "0.7062003", "text": "def create\n @gupiao = Gupiao.new(params[:gupiao])\n\n respond_to do |format|\n if @gupiao.save\n format.html { redirect_to @gupiao, notice: 'Gupiao was successfully created.' }\n format.json { render json: @gupiao, status: :created, location: @gupiao }\n else\n format.html { render action: \"new\" }\n format.json { render json: @gupiao.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "237f64eb79ee0bae83b02f5197ed8400", "score": "0.70476055", "text": "def new\n @registro = Registro.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @registro }\n end\n end", "title": "" }, { "docid": "925c4a4c69697aef9501232c5e3b6d62", "score": "0.704166", "text": "def new\n @genere = Genere.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @genere }\n end\n end", "title": "" }, { "docid": "f7ccf2fc4cdaad02419fddb79ee4d15a", "score": "0.7035074", "text": "def new\n @orgao = Orgao.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @orgao }\n end\n end", "title": "" }, { "docid": "f7ccf2fc4cdaad02419fddb79ee4d15a", "score": "0.7035074", "text": "def new\n @orgao = Orgao.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @orgao }\n end\n end", "title": "" }, { "docid": "9b706f37acf8b59ffbc6668e9ea84928", "score": "0.70318425", "text": "def new\n @gig = Gig.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gig }\n end\n end", "title": "" }, { "docid": "8b4fa04e93556a84d80a06c4952fdd9b", "score": "0.701393", "text": "def new\n @fetch_gi = FetchGi.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @fetch_gi }\n end\n end", "title": "" }, { "docid": "0c40ff4820a036817e9b05b09bcf7535", "score": "0.7003727", "text": "def new\n @phono = Phono.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @phono }\n end\n end", "title": "" }, { "docid": "baced5267d6957716d2244e06368758d", "score": "0.69874364", "text": "def new\n @gammi = Gammi.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gammi }\n end\n end", "title": "" }, { "docid": "c3265c2937d79fa8500020b3a4c9e361", "score": "0.69839835", "text": "def new\n @gossip = Gossip.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gossip }\n end\n end", "title": "" }, { "docid": "c3265c2937d79fa8500020b3a4c9e361", "score": "0.69839835", "text": "def new\n @gossip = Gossip.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gossip }\n end\n end", "title": "" }, { "docid": "3c50e36e6110aca4860d80d8cdb9e20c", "score": "0.6980041", "text": "def new\n @ocupacion = Ocupacion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ocupacion }\n end\n end", "title": "" }, { "docid": "f2cb261ff522a20c073d6a4884961450", "score": "0.69582593", "text": "def new\n @generator = Generator.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @generator }\n end\n end", "title": "" }, { "docid": "812d911af36fe6f3f621f91cf63041b5", "score": "0.69522893", "text": "def new\n @precio = Precio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @precio }\n end\n end", "title": "" }, { "docid": "38d89c21036adce47d5f96192564349b", "score": "0.6950161", "text": "def new\n @pelicula = Pelicula.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pelicula }\n end\n end", "title": "" }, { "docid": "f0181b9f7451172cc1baa1e7e723f5ac", "score": "0.69493383", "text": "def new\n @genu = Genu.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @genu }\n end\n end", "title": "" }, { "docid": "98aa449321e4a3dcf61fedfa61a9fe53", "score": "0.6948998", "text": "def new\n @grado = Grado.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @grado }\n end\n end", "title": "" }, { "docid": "8f3dadb527b8df7fa7168dbc7a5982e8", "score": "0.69372255", "text": "def new\n @registro = Registro.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @registro }\n end\n end", "title": "" }, { "docid": "23443d842bd622d29c4bc5c1eb53f699", "score": "0.69328016", "text": "def new\n @puesto = Puesto.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @puesto }\n end\n end", "title": "" }, { "docid": "8a85f82e7f7ed6fdf80363c2619e74e3", "score": "0.69252414", "text": "def new\n @gpf = Gpf.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gpf }\n end\n end", "title": "" }, { "docid": "dd68b81eb7d10c2caf6fe50d2f3b427d", "score": "0.69244796", "text": "def create\n @gopi = Gopi.new(gopi_params)\n\n respond_to do |format|\n if @gopi.save\n format.html { redirect_to @gopi, notice: 'Gopi was successfully created.' }\n format.json { render action: 'show', status: :created, location: @gopi }\n else\n format.html { render action: 'new' }\n format.json { render json: @gopi.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6a091a33b9a002a5aa4c96832336571c", "score": "0.6914589", "text": "def new\n @otu = Otu.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @otu }\n end\n end", "title": "" }, { "docid": "b6cb7238f101cf2c440d80bb8586f9e4", "score": "0.6910251", "text": "def new\n @polaczeny = Polaczenie.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @polaczeny }\n end\n end", "title": "" }, { "docid": "35238e972c920a6c02fc7c91ec18893f", "score": "0.6903382", "text": "def new\n @ubicacion_geografica = UbicacionGeografica.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ubicacion_geografica }\n end\n end", "title": "" }, { "docid": "9eb6d57b2fadf5aa7e21803f2201ef14", "score": "0.6901948", "text": "def new\n @giver = Giver.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @giver }\n end\n end", "title": "" }, { "docid": "b35aac31f934f7633f654f4ff37e0a5c", "score": "0.6898573", "text": "def new\n @tipo_galerium = TipoGalerium.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tipo_galerium }\n end\n end", "title": "" }, { "docid": "5501acd8f1f8d023fce5bab3b2e34c8c", "score": "0.68978536", "text": "def new\n @tipo = Tipo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tipo }\n end\n end", "title": "" }, { "docid": "f610197fb7f8c7e0fae1e061a2f0a128", "score": "0.6895398", "text": "def new\n @nail = Nail.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @nail }\n end\n end", "title": "" }, { "docid": "e44ccabdbca8f04365997e5df075db28", "score": "0.68940306", "text": "def new\n @ggsettimana = Ggsettimana.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ggsettimana }\n end\n end", "title": "" }, { "docid": "50f056f60841b0c393348ad4f10a1d79", "score": "0.68928975", "text": "def new\n @rg = Rg.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @rg }\n end\n end", "title": "" }, { "docid": "081a625633f03506b1aa057910e0f2eb", "score": "0.6887422", "text": "def new\n @pi = Pi.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pi }\n end\n end", "title": "" }, { "docid": "77dd799250730357783a025d7f4826c3", "score": "0.688288", "text": "def new\n @toushikomon = Toushikomon.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @toushikomon }\n end\n end", "title": "" }, { "docid": "85b996d448f9a01e24f638560b59c171", "score": "0.6875375", "text": "def new\n @posizione = Posizione.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @posizione }\n end\n end", "title": "" }, { "docid": "65a06561566770a6146dc1c38958b4f3", "score": "0.68741214", "text": "def new\n @aplicacion = Aplicacion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @aplicacion }\n end\n end", "title": "" }, { "docid": "ff09fffe1753841957e0a46eccd8dac9", "score": "0.68728566", "text": "def new\n @agronomiadecanato = Agronomiadecanato.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @agronomiadecanato }\n end\n end", "title": "" }, { "docid": "acaef71d7e6c15fefa4cdd0cb0a56794", "score": "0.6871429", "text": "def new\n @creation = Creation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @creation }\n end\n end", "title": "" }, { "docid": "30ad92d18d627f87b8fe94238b8cbbdb", "score": "0.6869059", "text": "def new\n @egreso = Egreso.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @egreso }\n end\n end", "title": "" }, { "docid": "d2fc13debc57fcdef8f0a0b1fd05f8eb", "score": "0.6868633", "text": "def new\n @tipo_ingreso = TipoIngreso.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tipo_ingreso }\n end\n end", "title": "" }, { "docid": "31c8c5a421b4dbecf26238b1bf18fb49", "score": "0.68624806", "text": "def new\n @newse = Newse.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @newse }\n end\n end", "title": "" }, { "docid": "f854cb70a095b6b16949bad94188e792", "score": "0.6861279", "text": "def new\n @aluno = Aluno.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @aluno }\n end\n end", "title": "" }, { "docid": "f854cb70a095b6b16949bad94188e792", "score": "0.6861279", "text": "def new\n @aluno = Aluno.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @aluno }\n end\n end", "title": "" }, { "docid": "f854cb70a095b6b16949bad94188e792", "score": "0.6861279", "text": "def new\n @aluno = Aluno.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @aluno }\n end\n end", "title": "" }, { "docid": "27cba940c206e6facec334b3ebc32821", "score": "0.6860857", "text": "def create\n @genu = Genu.new(params[:genu])\n\n respond_to do |format|\n if @genu.save\n format.html { redirect_to @genu, :notice => 'Genu was successfully created.' }\n format.json { render :json => @genu, :status => :created, :location => @genu }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @genu.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5cd8477da3d0d305c27f769528a1d270", "score": "0.6860753", "text": "def create\n @geniu = Geniu.new(geniu_params)\n\n respond_to do |format|\n if @geniu.save\n format.html { redirect_to @geniu, notice: 'Geniu was successfully created.' }\n format.json { render action: 'show', status: :created, location: @geniu }\n else\n format.html { render action: 'new' }\n format.json { render json: @geniu.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d20c8ed335ea0098d182c834e3ea3446", "score": "0.6860314", "text": "def create\r\n @ngo = Ngo.new(params[:ngo])\r\n Rails.logger.info \"-------create--------#{@json.inspect}\"\r\n respond_to do |format|\r\n if @ngo.save\r\n format.html { redirect_to @ngo, notice => 'Ngo was successfully created.' }\r\n format.json { render json => @ngo, status => :created, location => @ngo }\r\n else\r\n format.html { render action => \"new\" }\r\n format.json { render json => @ngo.errors, status => :unprocessable_entity }\r\n end\r\n end\r\n end", "title": "" }, { "docid": "1ccc8222a224a2acf907b90d9b545531", "score": "0.6853825", "text": "def new\n @gigaso = Gigaso.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @gigaso }\n end\n end", "title": "" }, { "docid": "2da298573ee774dc9006ad92aa0228b6", "score": "0.6852268", "text": "def new\n @pago = Pago.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pago }\n end\n end", "title": "" }, { "docid": "2da298573ee774dc9006ad92aa0228b6", "score": "0.6852268", "text": "def new\n @pago = Pago.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pago }\n end\n end", "title": "" }, { "docid": "ac0aba11d868c8a35a2836dad498d06d", "score": "0.6844768", "text": "def new\n @grupo = Grupo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @grupo }\n end\n end", "title": "" }, { "docid": "ac0aba11d868c8a35a2836dad498d06d", "score": "0.6844768", "text": "def new\n @grupo = Grupo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @grupo }\n end\n end", "title": "" }, { "docid": "d9628e521803b8aba46ad0f93f22853f", "score": "0.6841174", "text": "def new\n @aviso = Aviso.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @aviso }\n end\n end", "title": "" }, { "docid": "5ea6777e2e5f88f2ec27715a3f5161d6", "score": "0.6838504", "text": "def new\n @ubicacion = Ubicacion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ubicacion }\n end\n end", "title": "" }, { "docid": "71ab09445b806e0d9062f53bb3abaa92", "score": "0.68377537", "text": "def new\n @pig = Pig.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pig }\n end\n end", "title": "" }, { "docid": "46d3c12794bcb17ea401bdc71e37a10d", "score": "0.68347454", "text": "def new\n @ganador = Ganador.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ganador }\n end\n end", "title": "" }, { "docid": "331773cec7c30cc048544475537fa69b", "score": "0.68324155", "text": "def new\n @prodotto = Prodotto.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @prodotto }\n end\n end", "title": "" }, { "docid": "930d44ec8cd26b176811f258f26b5ec9", "score": "0.68265563", "text": "def new\n @objeto = Objeto.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @objeto }\n end\n end", "title": "" }, { "docid": "dbf8997514d4777a750c3731737f5501", "score": "0.68254733", "text": "def new\n @propietario = Propietario.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @propietario }\n end\n end", "title": "" }, { "docid": "b7ee736c99988d10c4423a1ee9a3896f", "score": "0.6819898", "text": "def new\n @nova = Nova.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @nova }\n end\n end", "title": "" }, { "docid": "0361af803aad997b57901f3ed31cf7f4", "score": "0.6819838", "text": "def new\n @provi = Provi.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @provi }\n end\n end", "title": "" }, { "docid": "acd1963091b5420cc42e7bfc68e9f3a3", "score": "0.6819577", "text": "def new\n @grit = Grit.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @grit }\n end\n end", "title": "" }, { "docid": "50b586c8057ef4920ba44c38779932c6", "score": "0.68097764", "text": "def new\n @tipo_organo_de_gobierno = TipoOrganoDeGobierno.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tipo_organo_de_gobierno }\n end\n end", "title": "" }, { "docid": "5c04c8159fe6fd000cee0cad671da8d5", "score": "0.680872", "text": "def new\n @tipo_egreso = TipoEgreso.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tipo_egreso }\n end\n end", "title": "" }, { "docid": "d463fc3f2b2e1e5d94ad701975da69fa", "score": "0.68081087", "text": "def new\n @azione = Azione.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @azione }\n end\n end", "title": "" }, { "docid": "70661f46203c0155bd8b673fada16569", "score": "0.68068165", "text": "def new\n @osignup = Osignup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @osignup }\n end\n end", "title": "" }, { "docid": "17d7da60333d97967bcd96628c11fd45", "score": "0.6805227", "text": "def new\n json_404\n end", "title": "" }, { "docid": "e045c720652c900fb9bc18223cc597e1", "score": "0.6804882", "text": "def new\n @grupa = Grupa.new\n\n respond_to do |format|\n format.html # new.html.erb\n #format.json { render json: @grupa }\n end\n end", "title": "" }, { "docid": "2708e1fe8a5a4f39b6e4b15432d61e1c", "score": "0.6797572", "text": "def new\n @policial = Policial.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @policial }\n end\n end", "title": "" }, { "docid": "a7fd19405479ccc4b63cec221612fad4", "score": "0.67957926", "text": "def new\n @pg = Pg.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pg }\n end\n end", "title": "" }, { "docid": "99dd5e094ad3486c8e9ad5dece37790e", "score": "0.67957413", "text": "def new\n @provincia = Provincia.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @provincia }\n end\n end", "title": "" }, { "docid": "ea4f3bc82cbe22ab46451ffce5bfea29", "score": "0.6794345", "text": "def new\n @oficio = Oficio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @oficio }\n end\n end", "title": "" }, { "docid": "2d20d62dcb8ffe2f9b7144a89fb8af12", "score": "0.6791068", "text": "def new\n @soupdejour = Soupdejour.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @soupdejour }\n end\n end", "title": "" }, { "docid": "f95826a5c37d3edfaf2598974ffb3cf3", "score": "0.67903924", "text": "def new\n @produto = Produto.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @produto }\n end\n end", "title": "" }, { "docid": "7c889366985b085cd34c9fcf130244e9", "score": "0.6788796", "text": "def new\n @gmp = Gmp.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gmp }\n end\n end", "title": "" }, { "docid": "f521037184d186d288aa197a04453c06", "score": "0.6785932", "text": "def new\n @outro = Outro.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @outro }\n end\n end", "title": "" }, { "docid": "da1bd82e14cb1e07f27c7084d73a7cf6", "score": "0.67851627", "text": "def new\n @os = Os.new\n @os.itens.build\n @os.pagamentos.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @os }\n end\n end", "title": "" }, { "docid": "8f46a13f9b800a783088ae0bdf3a549f", "score": "0.67825395", "text": "def new\n @lounge = Lounge.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lounge }\n end\n end", "title": "" }, { "docid": "a0788c16c833d75df4ca8171338b16a7", "score": "0.6780945", "text": "def new\n @puntaje = Puntaje.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @puntaje }\n end\n end", "title": "" }, { "docid": "cea7dd1209fc54e332692f14e1f285e2", "score": "0.6776511", "text": "def new\n @apodo = Apodo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @apodo }\n end\n end", "title": "" }, { "docid": "3211a9d1d653f636406e513ba31bb8fd", "score": "0.67761266", "text": "def new\n @gigibecali = Gigibecali.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @gigibecali }\n end\n end", "title": "" }, { "docid": "830f706eaefbe1716c9d26889d1f41f7", "score": "0.67718035", "text": "def new\n @glosentry = Glosentry.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @glosentry }\n end\n end", "title": "" }, { "docid": "3961744274ccf4162975131bec7cdacf", "score": "0.67709714", "text": "def new\n @loco = Loco.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @loco }\n end\n end", "title": "" }, { "docid": "9ea239cf3ae8cee558e90b7b93a7edc0", "score": "0.6770496", "text": "def new\n @pesaje = Pesaje.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pesaje }\n end\n end", "title": "" }, { "docid": "c4e6af69a24c7095d0e5a80aa5f25bf6", "score": "0.6769864", "text": "def new\n @getting_there = GettingThere.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @getting_there }\n end\n end", "title": "" }, { "docid": "b7cf0b457f23ad24510c5c78b62f6221", "score": "0.67680985", "text": "def new\n @jugador = Jugador.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @jugador }\n end\n end", "title": "" }, { "docid": "baf442ed728a847b711b6070aa276e36", "score": "0.6764756", "text": "def new\n @mongotest = Mongotest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @mongotest }\n end\n end", "title": "" }, { "docid": "78dd16e19db419ca27158b03d0ada990", "score": "0.67639285", "text": "def new\n @voluntario_pessoa_juridica = VoluntarioPessoaJuridica.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @voluntario_pessoa_juridica }\n end\n end", "title": "" }, { "docid": "b824e958921065851c0f09dd9d3ed134", "score": "0.6762196", "text": "def new\n unless current_user.try(:admin?)\n redirect_to \"/\"\n end\n @page = \"pieces\"\n @creator = Creator.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @creator }\n end\n end", "title": "" }, { "docid": "05a9ba553dc1ad6feb98d78fcd17eabf", "score": "0.67619413", "text": "def new\n @gstr2a = Gstr2a.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gstr2a }\n end\n end", "title": "" }, { "docid": "df6e97ba784354631e752894899b49cb", "score": "0.67611563", "text": "def new\n @anagrafica = Anagrafica.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @anagrafica }\n end\n end", "title": "" }, { "docid": "1729ca9807235134fe754e42b3e46576", "score": "0.67575717", "text": "def new\n @grup = Grup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @grup }\n end\n end", "title": "" }, { "docid": "e4bed09674a929fbd3deb1386bd1cb84", "score": "0.67540777", "text": "def new\n @jogo = Jogo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @jogo }\n end\n end", "title": "" } ]
116f23f05fd8ae61e427f3658525b3e3
Returns an object that represents the given port on the remote task context. The returned object is either an InputPort or an OutputPort Raises NotFound if no such port exists. Ports can also be accessed by calling directly the relevant method on the task context: task.port("myPort") is equivalent to task.myPort
[ { "docid": "ef76d74dd42ac7f72e7431cf32f50dc2", "score": "0.0", "text": "def port(name, verify = true)\n name = name.to_str\n CORBA.refine_exceptions(self) do\n if @ports[name]\n if !verify || has_port?(name) # Check that this port is still valid\n @ports[name]\n else\n @ports.delete(name)\n raise NotFound, \"no port named '#{name}' on task '#{self.name}'\"\n end\n else\n @ports[name] = raw_port(name)\n end\n end\n end", "title": "" } ]
[ { "docid": "3bf1f2d00af6c42ee53445805077e9c2", "score": "0.68174696", "text": "def [](port)\n port_mapping = port_mappings[port]\n return nil if port_mapping.nil?\n port_number = port_mapping[:number]\n case port_mapping[:type]\n when :input\n inputs[port_number]\n when :output\n outputs[port_number]\n end\n end", "title": "" }, { "docid": "a62d1564ff358cf9ab51ae745bc2c9a7", "score": "0.6724004", "text": "def [](port)\n port_mapping = @port_mappings[port]\n return nil if port_mapping.nil?\n\n port_number = port_mapping[:number]\n case port_mapping[:type]\n when :input\n inputs[port_number]\n when :output\n outputs[port_number]\n end\n end", "title": "" }, { "docid": "8be840c58e142bac43d48c3df78b20eb", "score": "0.6669803", "text": "def get_port()\n return @port\n end", "title": "" }, { "docid": "ba0eed235729b7578ec92cbbcd2d4255", "score": "0.6666279", "text": "def get_port()\n return @port\n end", "title": "" }, { "docid": "920f9ac14ed2cf185a91700bbdf9b047", "score": "0.66515756", "text": "def port( port_name )\n return @ports[ port_name.to_sym ]\n end", "title": "" }, { "docid": "2f67da439a023748e5ac3e833d2a00c9", "score": "0.6618238", "text": "def input_port(port)\n input_ports[port]\n end", "title": "" }, { "docid": "fe91d54b50764ca7f04baee3a2910fcb", "score": "0.65702045", "text": "def select_port_for_transform(port, from, to)\n if port.respond_to?(:name)\n port = port.name\n end\n\n task_port_name = model.port_mappings_for_task[port]\n if !task_port_name\n raise ArgumentError, \"#{port} is not a known output port of #{self}\"\n end\n\n task_port = component.find_output_port(task_port_name)\n if !task_port\n raise ArgumentError, \"#{port} is not an output port of #{self}\"\n end\n component.select_port_for_transform(task_port, from, to)\n end", "title": "" }, { "docid": "3ac9b3a078224d344103c9f47ad18102", "score": "0.6359486", "text": "def port(opts={})\n # Check if port was specified in options hash\n return opts[:port] if opts[:port]\n\n # Check if a port was specified in the config\n return env.config.ssh.port if env.config.ssh.port\n\n # Check if we have an SSH forwarded port\n pnum_by_name = nil\n pnum_by_destination = nil\n env.vm.vm.network_adapters.each do |na|\n # Look for the port number by name...\n pnum_by_name = na.nat_driver.forwarded_ports.detect do |fp|\n fp.name == env.config.ssh.forwarded_port_key\n end\n\n # Look for the port number by destination...\n pnum_by_destination = na.nat_driver.forwarded_ports.detect do |fp|\n fp.guestport == env.config.ssh.forwarded_port_destination\n end\n\n # pnum_by_name is what we're looking for here, so break early\n # if we have it.\n break if pnum_by_name\n end\n\n return pnum_by_name.hostport if pnum_by_name\n return pnum_by_destination.hostport if pnum_by_destination\n\n # This should NEVER happen.\n raise Errors::SSHPortNotDetected\n end", "title": "" }, { "docid": "1053d1ff8c4cc28127f5c529a3721e25", "score": "0.6324383", "text": "def port(num, target_port: nil, protocol: nil, name: nil, node_port: nil)\n _port = { port: num }\n _port[:targetPort] = target_port if target_port\n _port[:nodePort] = node_port if node_port\n _port[:protocol] = protocol.to_s if protocol\n _port[:name] = name.to_s if name\n return _port\n end", "title": "" }, { "docid": "ea909d127a223cac3798170b3df6868e", "score": "0.6315644", "text": "def port\n if p = read_attr(:port)\n p.to_i\n else\n nil\n end\n end", "title": "" }, { "docid": "f8df0094d5e50767faa2f8201a27f806", "score": "0.61792415", "text": "def port(arg = nil)\n set_or_return(:port, arg, kind_of: Integer)\n end", "title": "" }, { "docid": "f8df0094d5e50767faa2f8201a27f806", "score": "0.61792415", "text": "def port(arg = nil)\n set_or_return(:port, arg, kind_of: Integer)\n end", "title": "" }, { "docid": "37c155d04e2bff610ef33a70fca27fb3", "score": "0.61782914", "text": "def get_port_number\n @port_number\n end", "title": "" }, { "docid": "9cc8d8346d8352f9d329ef727c992463", "score": "0.6159981", "text": "def get_port(port)\n Rails.logger.debug(\"get_port for port=#{port}.\")\n begin\n result = get_connector.execute(\"show io\")\n rescue => exception\n Rails.logger.info(\"Execution failure:\\n #{exception}\")\n end\n\n if (result != nil) && (result.include? WiflyNames::CMD_PROMT)\n Rails.logger.debug(\"promt given #{result}\")\n startPosition = result.index(WiflyNames::CMD_PROMT)\n if startPosition > 0\n Rails.logger.debug(\"Start position is #{startPosition}\")\n begin\n value = result[startPosition-4, 3].hex\n Rails.logger.debug(\"value = #{value}\")\n result = value & port.to_i(16)\n if (result == 0)\n return WiflyNames::PORT_OFF\n else\n return WiflyNames::PORT_ON\n end\n rescue => exception\n Rails.logger.info(\"Convertation error:\\n #{exception}\")\n end\n else\n Rails.logger.debug(\"Position not found\")\n end\n else\n Rails.logger.debug(\"Invocation failure!\")\n end\n nil\n end", "title": "" }, { "docid": "0250773513ccccfb6ff0ab1d8a2619a1", "score": "0.6133526", "text": "def current_port\n return @current_port\n end", "title": "" }, { "docid": "6d72c65a49bbbfe450810d4d66b5b765", "score": "0.6126601", "text": "def get_port(node_id, port_id)\n debug \">> #{__method__}\"\n path = format(PORT_PATH, node_id, port_id)\n resp = get_object_to_network(@nwc_id, path)\n unless resp.status_code == Response::OK\n return nil\n end\n begin\n return Port.new(resp.body)\n rescue => ex\n error 'Exception: Get Invalid Message'\n error \" #{ex.message} #{ex.backtrace}\"\n return nil\n end\n end", "title": "" }, { "docid": "a24abb207b0ff7c87916517a4c45c983", "score": "0.61112064", "text": "def service_port(service_name, port_name)\n service = services.fetch(service_name)\n service.ports.fetch(port_name)\n end", "title": "" }, { "docid": "190d7c0b952342d7ca8b674cadc8fe52", "score": "0.6099872", "text": "def actual_port\n if !block_given?\n return @j_del.java_method(:actualPort, []).call()\n end\n raise ArgumentError, \"Invalid arguments when calling actual_port()\"\n end", "title": "" }, { "docid": "190d7c0b952342d7ca8b674cadc8fe52", "score": "0.6099872", "text": "def actual_port\n if !block_given?\n return @j_del.java_method(:actualPort, []).call()\n end\n raise ArgumentError, \"Invalid arguments when calling actual_port()\"\n end", "title": "" }, { "docid": "e48325125ba75be0f9790645ddc1ea7e", "score": "0.60650015", "text": "def port(port_name)\n send(\"port_#{port_name.to_s.downcase}\")\n end", "title": "" }, { "docid": "f5ebfb05b490c7b696d2548ea7129cc5", "score": "0.60561717", "text": "def port(opts={})\n # Check if port was specified in options hash\n return opts[:port] if opts[:port]\n\n # Check if a port was specified in the config\n return @env.config.winrm.port if @env.config.winrm.port\n\n # Check if we have an SSH forwarded port\n pnum_by_name = nil\n pnum_by_destination = nil\n @logger.info(\"Looking for winrm port: #{opts}\")\n @logger.info(\"Looking for winrm port: #{env.config.winrm.inspect}\")\n\n env.vm.vm.network_adapters.each do |na| \n # Look for the port number by destination...\n pnum_by_destination = na.nat_driver.forwarded_ports.detect do |fp|\n fp.guestport == env.config.winrm.guest_port\n end\n end\n\n return pnum_by_destination.hostport if pnum_by_destination\n\n # This should NEVER happen.\n raise Errors::WinRMPortNotDetected\n end", "title": "" }, { "docid": "44d9edb293d525296037ea3301d73a59", "score": "0.6032592", "text": "def read_port\n return @read_port\n end", "title": "" }, { "docid": "d78ec7036c90fa47b5d16c0bfb0b75b7", "score": "0.60324204", "text": "def port() to_io.addr[1]; end", "title": "" }, { "docid": "1bca82544ed21b9bee947bd0c69f4c33", "score": "0.5987687", "text": "def port(use_cache=nil)\n resolve(use_cache)\n @port\n end", "title": "" }, { "docid": "c4622a189297cb443e3f55e953794af4", "score": "0.5984721", "text": "def port\n @port ||= @node['port'].to_i\n end", "title": "" }, { "docid": "03ead9e5cacde555d72a896c74d58e7d", "score": "0.59834146", "text": "def port\n @port ||= @node['port'].to_i\n end", "title": "" }, { "docid": "a8c13c9bfcac018ceaa80130c7105f1a", "score": "0.5968625", "text": "def port\n information.port\n end", "title": "" }, { "docid": "f8c1c78f807048928daafc53f8f79499", "score": "0.59628487", "text": "def port\n unless defined?(@port)\n @port ||= user_configuration_from_key('port')\n @port ||= default_port\n @port = @port.to_i\n end\n @port\n end", "title": "" }, { "docid": "6f6d424f868b78a3c7d94cd88637bb0e", "score": "0.5951878", "text": "def [](name)\n @ports[name] or raise ArgumentError.new(\"no port named #{name}\")\n end", "title": "" }, { "docid": "9839654b24178060f01c3f7f18e63263", "score": "0.5925704", "text": "def bind(port:)\n {\n method: \"Tethering.bind\",\n params: { port: port }.compact\n }\n end", "title": "" }, { "docid": "aca7cd93f5fc1bcf06b51fdfc9d1d778", "score": "0.59146637", "text": "def port\n @attributes[:port]\n end", "title": "" }, { "docid": "aca7cd93f5fc1bcf06b51fdfc9d1d778", "score": "0.59146637", "text": "def port\n @attributes[:port]\n end", "title": "" }, { "docid": "4781a2c55c0480e66c34f86dd2903ea2", "score": "0.591418", "text": "def port\n return @port\n end", "title": "" }, { "docid": "4781a2c55c0480e66c34f86dd2903ea2", "score": "0.591418", "text": "def port\n return @port\n end", "title": "" }, { "docid": "4781a2c55c0480e66c34f86dd2903ea2", "score": "0.591418", "text": "def port\n return @port\n end", "title": "" }, { "docid": "2c61f9e98e283901d6613594c50b6c87", "score": "0.5864402", "text": "def target_port\n return @target_port\n end", "title": "" }, { "docid": "c0aa85e36be7bf5779a1df42fe5d48bc", "score": "0.58551395", "text": "def port\n data[:port]\n end", "title": "" }, { "docid": "c0aa85e36be7bf5779a1df42fe5d48bc", "score": "0.58551395", "text": "def port\n data[:port]\n end", "title": "" }, { "docid": "c0aa85e36be7bf5779a1df42fe5d48bc", "score": "0.58551395", "text": "def port\n data[:port]\n end", "title": "" }, { "docid": "73469e339caa91f27bf841ce2690c306", "score": "0.5851583", "text": "def connect_port(port)\n return if port.reachable?\n p = @mutex.synchronize do\n return unless valid_delegator?\n @delegator_obj.disable_emitting do\n #called in the context of @delegator_obj\n begin\n port(port.name,true,port.options)\n rescue Orocos::NotFound\n Orocos.warn \"task #{name} has currently no port called #{port.name}\"\n raise\n rescue Orocos::CORBA::ComError => e\n Orocos.warn \"task #{name} with error on port: #{port.name} -- #{e}\"\n raise\n end\n end\n end\n @event_loop.call do\n port.reachable!(p) unless port.reachable?\n end\n end", "title": "" }, { "docid": "7dd14578ec193e81a68285ad7da2f950", "score": "0.58430254", "text": "def port=(value)\n @port = value\n end", "title": "" }, { "docid": "7dd14578ec193e81a68285ad7da2f950", "score": "0.58423424", "text": "def port=(value)\n @port = value\n end", "title": "" }, { "docid": "7dd14578ec193e81a68285ad7da2f950", "score": "0.58423424", "text": "def port=(value)\n @port = value\n end", "title": "" }, { "docid": "7dd14578ec193e81a68285ad7da2f950", "score": "0.5842141", "text": "def port=(value)\n @port = value\n end", "title": "" }, { "docid": "7dd14578ec193e81a68285ad7da2f950", "score": "0.5842141", "text": "def port=(value)\n @port = value\n end", "title": "" }, { "docid": "7dd14578ec193e81a68285ad7da2f950", "score": "0.5842141", "text": "def port=(value)\n @port = value\n end", "title": "" }, { "docid": "7dd14578ec193e81a68285ad7da2f950", "score": "0.5841845", "text": "def port=(value)\n @port = value\n end", "title": "" }, { "docid": "7dd14578ec193e81a68285ad7da2f950", "score": "0.5841845", "text": "def port=(value)\n @port = value\n end", "title": "" }, { "docid": "7dd14578ec193e81a68285ad7da2f950", "score": "0.5841845", "text": "def port=(value)\n @port = value\n end", "title": "" }, { "docid": "7dd14578ec193e81a68285ad7da2f950", "score": "0.5841845", "text": "def port=(value)\n @port = value\n end", "title": "" }, { "docid": "7dd14578ec193e81a68285ad7da2f950", "score": "0.5841845", "text": "def port=(value)\n @port = value\n end", "title": "" }, { "docid": "7dd14578ec193e81a68285ad7da2f950", "score": "0.5841699", "text": "def port=(value)\n @port = value\n end", "title": "" }, { "docid": "05604e6fd4afed119492b292ba597f83", "score": "0.58168536", "text": "def port\n @port ||= options.fetch(:port, random_open_port).to_s\n end", "title": "" }, { "docid": "d56274c48b9a9d24bb2fc8c692a92c91", "score": "0.5812456", "text": "def port\n @port\n end", "title": "" }, { "docid": "d56274c48b9a9d24bb2fc8c692a92c91", "score": "0.5812456", "text": "def port\n @port\n end", "title": "" }, { "docid": "d56274c48b9a9d24bb2fc8c692a92c91", "score": "0.581047", "text": "def port\n @port\n end", "title": "" }, { "docid": "d56274c48b9a9d24bb2fc8c692a92c91", "score": "0.581047", "text": "def port\n @port\n end", "title": "" }, { "docid": "d56274c48b9a9d24bb2fc8c692a92c91", "score": "0.581047", "text": "def port\n @port\n end", "title": "" }, { "docid": "d56274c48b9a9d24bb2fc8c692a92c91", "score": "0.581047", "text": "def port\n @port\n end", "title": "" }, { "docid": "d56274c48b9a9d24bb2fc8c692a92c91", "score": "0.581047", "text": "def port\n @port\n end", "title": "" }, { "docid": "d56274c48b9a9d24bb2fc8c692a92c91", "score": "0.581047", "text": "def port\n @port\n end", "title": "" }, { "docid": "d56274c48b9a9d24bb2fc8c692a92c91", "score": "0.581047", "text": "def port\n @port\n end", "title": "" }, { "docid": "d56274c48b9a9d24bb2fc8c692a92c91", "score": "0.581047", "text": "def port\n @port\n end", "title": "" }, { "docid": "d56274c48b9a9d24bb2fc8c692a92c91", "score": "0.581047", "text": "def port\n @port\n end", "title": "" }, { "docid": "d56274c48b9a9d24bb2fc8c692a92c91", "score": "0.581047", "text": "def port\n @port\n end", "title": "" }, { "docid": "d56274c48b9a9d24bb2fc8c692a92c91", "score": "0.581047", "text": "def port\n @port\n end", "title": "" }, { "docid": "d56274c48b9a9d24bb2fc8c692a92c91", "score": "0.581047", "text": "def port\n @port\n end", "title": "" }, { "docid": "d56274c48b9a9d24bb2fc8c692a92c91", "score": "0.581047", "text": "def port\n @port\n end", "title": "" }, { "docid": "d56274c48b9a9d24bb2fc8c692a92c91", "score": "0.581047", "text": "def port\n @port\n end", "title": "" }, { "docid": "4cafa6ee7e8358cc2e6a3699156c84b9", "score": "0.58058566", "text": "def port\n @port\n end", "title": "" }, { "docid": "4cafa6ee7e8358cc2e6a3699156c84b9", "score": "0.58058566", "text": "def port\n @port\n end", "title": "" }, { "docid": "4cafa6ee7e8358cc2e6a3699156c84b9", "score": "0.58058566", "text": "def port\n @port\n end", "title": "" }, { "docid": "0f005b9d27f38ad07069140978f8f39a", "score": "0.5803921", "text": "def port\n @port ||= default_port\n end", "title": "" }, { "docid": "f3ed340db3620efb5e3187191d05a849", "score": "0.57912487", "text": "def port=(port)\n @port = port\n end", "title": "" }, { "docid": "7e9676a7f543363587089c4dcd1a56be", "score": "0.57876325", "text": "def extract_port(options)\n @port = options[:port]\n @port = PORTS[@port] if @port.is_a?(Symbol)\n\n return if @port.is_a?(Integer) && @port.between?(1, 655_35)\n\n raise ArgumentError, 'The :port must be a number between 1 and 65535.'\n end", "title": "" }, { "docid": "e62393cd790d0e2f3ab34626d5a4ed4a", "score": "0.57753795", "text": "def port(value = nil)\n if value.nil?\n @port\n else\n @port = value.to_s\n end\n end", "title": "" }, { "docid": "e62393cd790d0e2f3ab34626d5a4ed4a", "score": "0.57753795", "text": "def port(value = nil)\n if value.nil?\n @port\n else\n @port = value.to_s\n end\n end", "title": "" }, { "docid": "30848fe4ee2e848c0a9b3cf36e9dbd2b", "score": "0.57513785", "text": "def port_mapping(port)\n case port.to_s\n when /\\A(\\d+)(?:\\/([a-z]+))?\\z/\n port = $1.to_i\n {\n \"hostPort\" => port,\n \"containerPort\" => port,\n \"protocol\" => $2 || \"tcp\"\n }\n when /\\A(\\d+):(\\d+)(?:\\/([a-z]+))?\\z/\n {\n \"hostPort\" => $1.to_i,\n \"containerPort\" => $2.to_i,\n \"protocol\" => $3 || \"tcp\"\n }\n else\n raise \"Cannot parse port specification: #{port}\"\n end\n end", "title": "" }, { "docid": "b4c42c7d3865f34145ed866d23f0886e", "score": "0.57443994", "text": "def write_port\n return @write_port\n end", "title": "" }, { "docid": "bf2b1914e92d11019f3a1616858c085e", "score": "0.5739888", "text": "def output_port(port)\n output_ports[port] if finished?\n end", "title": "" }, { "docid": "f258661aaf14298442aa8d7e13f4d943", "score": "0.57229596", "text": "def find_port(name)\n find_output_port(name.to_str) || find_input_port(name.to_str)\n end", "title": "" }, { "docid": "dc31ec54295d0e1da5fe8b8732c1000d", "score": "0.5719956", "text": "def port(arg = nil)\n set_or_return(\n :port,\n arg,\n :kind_of => String,\n :callbacks => {\n 'should be a valid non-system port' => lambda do |p|\n Chef::Resource::MysqlService.validate_port(p)\n end\n }\n )\n end", "title": "" }, { "docid": "8a026b51c31edcc551e0b778d60a8e71", "score": "0.57005477", "text": "def port\n @port || 22\n end", "title": "" }, { "docid": "e3b11f5eff93990da7a5ab42b6bf4850", "score": "0.5687562", "text": "def port=(new_port)\n @port = new_port\n end", "title": "" }, { "docid": "e3b11f5eff93990da7a5ab42b6bf4850", "score": "0.5687562", "text": "def port=(new_port)\n @port = new_port\n end", "title": "" }, { "docid": "9b7b970e60e0e2cdc90b36473512f36f", "score": "0.56848955", "text": "def port=(value)\n @port = value\n end", "title": "" }, { "docid": "9b7b970e60e0e2cdc90b36473512f36f", "score": "0.56848955", "text": "def port=(value)\n @port = value\n end", "title": "" }, { "docid": "9b7b970e60e0e2cdc90b36473512f36f", "score": "0.56848955", "text": "def port=(value)\n @port = value\n end", "title": "" }, { "docid": "933db1aae0a179ec0f92041202ad0f22", "score": "0.56818336", "text": "def node_port\n return @node_port\n end", "title": "" }, { "docid": "11a1875cad8fff16548a0a2f27141211", "score": "0.56739795", "text": "def specified_port\n port = @specified_port.to_s.to_i\n if port == 0\n return nil\n else\n return port\n end\n end", "title": "" }, { "docid": "ab4a3c72b08ee0f35b1fcf3a75ac8691", "score": "0.56730056", "text": "def port(port, host=nil)\n host ||= default_host\n bind URI::Generic.build(scheme: 'tcp', host: host, port: Integer(port)).to_s\n end", "title": "" }, { "docid": "5356a8f213b46d54ac77f829e2fb2d18", "score": "0.5655492", "text": "def port\n Socket.unpack_sockaddr_in(get_sockname)[0]\n end", "title": "" }, { "docid": "3ea0a0dd0d6365a10c1936b0bdcfb322", "score": "0.56427395", "text": "def port\n @port ||= if raw_host_with_port =~ /:(\\d+)$/\n $1.to_i\n else\n standard_port\n end\n end", "title": "" }, { "docid": "91a8a54d37f94176038f148a7bafee95", "score": "0.56388754", "text": "def port()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "a34be7e484a0eb7c2d3c8981ffc21ebd", "score": "0.5612429", "text": "def ip_port\n raise Bud::Error, \"ip_port called before port defined\" if port.nil?\n ip.to_s + \":\" + port.to_s\n end", "title": "" }, { "docid": "41631b7c5c8c75ba3b412fa4a3dd9ab8", "score": "0.5608635", "text": "def get_port\n return [@buffer,@read_valid,@read_ready,@write_valid,@write_ready]\n end", "title": "" }, { "docid": "47f1b20c1257c2e55a81e4e3976b8013", "score": "0.55994993", "text": "def get_port(params)\n port = params[:port]\n if port.is_a? Symbol\n Config[port.to_s]['port']\n else\n port_i = port.to_i\n unless (port_i < 65_535) && (port_i > 49_152)\n raise RuntimeError.call('Port MUST be in (49152..65535)')\n end\n\n port\n end\n end", "title": "" }, { "docid": "5c6b8c5d2b37132137b1941b3973b716", "score": "0.5599209", "text": "def port=(p)\n write_attr :port, p\n end", "title": "" }, { "docid": "262019d6e65c15665accfcd2fc1f9ce1", "score": "0.5597293", "text": "def input_port(port_name)\n define_port(defined_input_ports, port_name)\n end", "title": "" }, { "docid": "f14fc839b4aa9ab66ac35bcd12f4914f", "score": "0.55903256", "text": "def fetch_port(host, port = 22, localport = nil)\n connect unless @rye_ssh\n if localport.nil?\n port_used = next_port\n else\n port_used = localport\n end\n # i would like to check if the port and host \n # are already an active_locals forward, but that \n # info does not get returned, and trusting the localport\n # is not enough information, so lets just set up a new one\n @rye_ssh.forward.local(port_used, host, port)\n return port_used\n end", "title": "" }, { "docid": "c102f38f9d9df46303f8626908b36bf9", "score": "0.5587382", "text": "def specified_port\n @specified_port = nil if !defined?(@specified_port)\n return nil if @specified_port.nil?\n port = @specified_port.to_s.to_i\n if port == 0\n return nil\n else\n return port\n end\n end", "title": "" } ]
9fe727d224bdc9bcd0882a3a03916506
before_filter :ensure_group_member belongs_to :motion def begin_of_association_chain
[ { "docid": "205131be94b2e4b40a9f52e8a2d2e39f", "score": "0.0", "text": "def destroy\n resource\n if @motion.voting?\n destroy! { @motion.discussion }\n else\n flash[:error] = \"The proposal has closed. You can no longer modify your posiiton.\"\n redirect_to @motion.discussion\n end\n end", "title": "" } ]
[ { "docid": "6cd56e9be6397b9a23ff28844a5c43cc", "score": "0.6810299", "text": "def begin_of_association_chain\n nil\n end", "title": "" }, { "docid": "d20a10355a387b22328d23b33d24e42a", "score": "0.6673275", "text": "def begin_of_association_chain\n unless current_user.is_admin?\n current_user.meta\n end\n end", "title": "" }, { "docid": "5b3d1f3fde2e2725cda717efb0a2a23f", "score": "0.66390467", "text": "def begin_of_association_chain\n\t\tcurrent_user\n\tend", "title": "" }, { "docid": "4f60e673f347b3ba10e208ab1991b349", "score": "0.64876354", "text": "def begin_of_association_chain\n current_user\n end", "title": "" }, { "docid": "f62bd4c4f258432334429d9abe930272", "score": "0.63764673", "text": "def begin_of_association_chain\n if current_user && !current_user.is_admin?\n current_user.meta\n end\n end", "title": "" }, { "docid": "d2c31062dce711d63a3244801bd3d4d1", "score": "0.6316932", "text": "def begin_of_association_chain\n begining = instance_variable_get(\"@#{@@name}\".to_sym)\n return begining if begining\n\n begining = send(\"current_#{@@name}\")\n instance_variable_set(\"@#{@@name}\".to_sym, begining)\n begining\n end", "title": "" }, { "docid": "7db181ea0e2172ce53c8bbd0d30e5145", "score": "0.6210983", "text": "def begin_of_association_chain\r\n current_account\r\n end", "title": "" }, { "docid": "1a9b38e83e17ee850aa1fdac4209f586", "score": "0.6082926", "text": "def begin_of_association_chain\n current_account\n end", "title": "" }, { "docid": "39aa1610321a9a78cf205a138000b3a1", "score": "0.6064095", "text": "def end_of_association_chain\n current_user.film_users\n end", "title": "" }, { "docid": "03a65684131f7e01c7e2656e4be79598", "score": "0.58633", "text": "def end_of_association_chain\n parent? ? parent_association : model\n end", "title": "" }, { "docid": "ecf621fcf5d2b9447b38572b95d9af2b", "score": "0.5811008", "text": "def trigger_parent_assignment\n begin\n association_chain\n rescue\n end\n end", "title": "" }, { "docid": "c2a2f02d8bd83dc0ea7032f1435085d0", "score": "0.5749462", "text": "def monitor_association\n super\n end", "title": "" }, { "docid": "c2a2f02d8bd83dc0ea7032f1435085d0", "score": "0.5749462", "text": "def monitor_association\n super\n end", "title": "" }, { "docid": "c2a2f02d8bd83dc0ea7032f1435085d0", "score": "0.5749462", "text": "def monitor_association\n super\n end", "title": "" }, { "docid": "c2a2f02d8bd83dc0ea7032f1435085d0", "score": "0.5749462", "text": "def monitor_association\n super\n end", "title": "" }, { "docid": "c2a2f02d8bd83dc0ea7032f1435085d0", "score": "0.5749462", "text": "def monitor_association\n super\n end", "title": "" }, { "docid": "c2a2f02d8bd83dc0ea7032f1435085d0", "score": "0.5749462", "text": "def monitor_association\n super\n end", "title": "" }, { "docid": "ebdaf2ad534c729c035864d59d33a027", "score": "0.5714099", "text": "def method_for_association_chain #:nodoc:\n nil\n end", "title": "" }, { "docid": "68d353094b156fe2e68f89ae89cb1791", "score": "0.5692107", "text": "def begin_of_association_chain\n current_client\n end", "title": "" }, { "docid": "1db0b6d09a19232d6be372f4adde2e99", "score": "0.5682517", "text": "def startgroup\n @group = Group.new\nend", "title": "" }, { "docid": "558b0356450fcbd08ac95007cb1ac2b0", "score": "0.5638122", "text": "def end_of_association_chain\n policy_scope super\n end", "title": "" }, { "docid": "462d0f1eaf0d7c1916776072ebf8cb9e", "score": "0.5636548", "text": "def collection_scope\n end_of_association_chain\n end", "title": "" }, { "docid": "462d0f1eaf0d7c1916776072ebf8cb9e", "score": "0.5636548", "text": "def collection_scope\n end_of_association_chain\n end", "title": "" }, { "docid": "af4da99d382cf7e3b6ecaf1078002cea", "score": "0.56319726", "text": "def set_group\n group = collection.friendly.find(params[:id])\n @group = Group.includes(:people).find(group.id)\n end", "title": "" }, { "docid": "931f643aa16ecbb84dc6f4265b1ff1c4", "score": "0.5597155", "text": "def around_save_collection_association; end", "title": "" }, { "docid": "70cc1a8a7a9f114a4555f8662a4c1d13", "score": "0.5520514", "text": "def association; end", "title": "" }, { "docid": "70cc1a8a7a9f114a4555f8662a4c1d13", "score": "0.5520514", "text": "def association; end", "title": "" }, { "docid": "6cc92d777e0b7dea19b410aec54ee5a2", "score": "0.5502755", "text": "def set_group\n @group = Group.includes(:creator).find(params[:id])\n end", "title": "" }, { "docid": "d929db773965b68255313efcb055f78e", "score": "0.54980737", "text": "def setup_has_some\n klass.setup_association_cache(inverse_of.name)\n end", "title": "" }, { "docid": "b83cfe01d5f2647eb7a759fa62b50523", "score": "0.5496272", "text": "def end_of_association_chain\n @end_of_association_chain ||= super\n end", "title": "" }, { "docid": "02e41ff0dea12775c1a0fab413aa95c9", "score": "0.5489186", "text": "def associated\n end", "title": "" }, { "docid": "82666c08fed29f73ed3c805812ae3fa2", "score": "0.5477173", "text": "def scoped_collection\n\n end_of_association_chain\n\n end", "title": "" }, { "docid": "e6cf3d106e92a2e0a147247f2714d935", "score": "0.5447201", "text": "def load_resources\n end_of_association_chain\n end", "title": "" }, { "docid": "1262d0f2a2887c2b52546196d6cf8302", "score": "0.5423708", "text": "def before_save_child_association(association, context)\n if association.respond_to?(:valid?)\n unless association.valid?(context)\n association.errors.each { |e| self.errors.add(:general, e) }\n end\n else\n self.errors.add(:general, \"child association is missing\")\n end\n end", "title": "" }, { "docid": "970860671e4f3d755547089077b9c587", "score": "0.54032665", "text": "def set_group\n @group = Group.last\n # $grou = @group.id\n # check if company has permission to view the group\n # if !(@group.company_id == @company.id)\n # redirect_to company_path(@company.slug)\n # end\n end", "title": "" }, { "docid": "b0facff499e9bb415ad231c2f2649e42", "score": "0.53697145", "text": "def object\n @object ||= parent? ? end_of_association_chain : nil\n end", "title": "" }, { "docid": "62f869d3290a09d03ad38ba02a624fdf", "score": "0.53555036", "text": "def remember_association(node)\n (node.body.grep_nodes(:message => :belongs_to) + node.body.grep_nodes(:message => :has_one)).collect do |body_node|\n class_name = node.subject.to_s.underscore\n @associations[class_name] ||= []\n @associations[class_name] << body_node.arguments[1].to_s\n end\n end", "title": "" }, { "docid": "ef874dc728edcf8b9307e2eb12b8452d", "score": "0.53256345", "text": "def auth_has_many_parents(assoc,options = {})\n conf = {:association => assoc, :user_scope => nil}\n conf.update(options)\n raise 'Need a parent association for has_many_parents' if conf[:association].nil?\n conf[:type] = :has_many_parents\n acts_as_authorizable_sources << conf\n end", "title": "" }, { "docid": "dec0f8ad57a8d510cba45eabf560f1c7", "score": "0.53114605", "text": "def parent_association\n ## Gotta find (as in another SQL query) it seperately, will get a recursive stack error elsewise\n \n # If we're viewing a FeatureNameRelation:\n return parent_object.parent_relations if params[:id].nil?\n \n # Gotta find it seperately (new query), will get a recursive stack error elsewise, rats!\n o = FeatureNameRelation.find(params[:id])\n parent_object.id == o.parent_node.id ? parent_object.child_relations : parent_object.parent_relations\n end", "title": "" }, { "docid": "5fc560826b8860f9819cb6959aa9ba16", "score": "0.5305213", "text": "def set_person\n @person = Person.friendly.includes(:groups).find(params[:id])\n end", "title": "" }, { "docid": "5fc560826b8860f9819cb6959aa9ba16", "score": "0.5305213", "text": "def set_person\n @person = Person.friendly.includes(:groups).find(params[:id])\n end", "title": "" }, { "docid": "c6f2c1352f7a5c8e8bd93af9fc889e74", "score": "0.52787197", "text": "def group_member_set\n end", "title": "" }, { "docid": "9a98a5c05cdbdb9dbf281d0a34254c0b", "score": "0.5278306", "text": "def group() parent end", "title": "" }, { "docid": "d5c0f6af0214f5ac7c23f5054fe8d5ba", "score": "0.5277947", "text": "def associations; end", "title": "" }, { "docid": "58822194a77240c777bbac7e76b59bc2", "score": "0.5267706", "text": "def member_of_related_group\n @event = Event.find(by_id)\n unless @event.group.has_member?(current_user)\n flash[:danger] = \"The page you requested is only available to members.\"\n redirect_to group_events_url(@event.group)\n end\n end", "title": "" }, { "docid": "afbd5bba3b0a18482bfd303ee8faab63", "score": "0.52647734", "text": "def emissions\n @group = Group.find(params[:id])\n @dopplremissions = DopplrEmission.find(:all, :include => @group.users, :conditions => [\"personal = '0'\"]) \n end", "title": "" }, { "docid": "c594dcdbfbeb565c7589a66923c86a3a", "score": "0.52352643", "text": "def relationships\n with_included_associations { super }\n end", "title": "" }, { "docid": "e3c26efbf8367fc56e85f362885a2561", "score": "0.52344096", "text": "def add_association(tag)\n self.parents << tag unless self.has_parent?(tag)\n end", "title": "" }, { "docid": "518ceff637c9c0f3d62243a3cb80133a", "score": "0.52297777", "text": "def set_occasional_group\n @occasional_group = OccasionalGroup.find(params[:id])\n end", "title": "" }, { "docid": "c9a61339cb1b8055fe5b76bdaa01bd66", "score": "0.52134174", "text": "def fix_up_references\n if self.person.nil? and !self.person_id.nil?\n self.person = GroupType.find(self.person_id)\n end\n if self.group.nil? and !self.group_id.nil?\n self.group = Region.find(self.group_id)\n end\n end", "title": "" }, { "docid": "6bed184223911b8194fbc766c582d977", "score": "0.5212848", "text": "def set_group\n @group = Group.includes(:users).find(params[:group_id])\n end", "title": "" }, { "docid": "a866cbd9be21ffbc4c35ee2fa64179d7", "score": "0.5201331", "text": "def add_to_group\n @user = current_user\n @groups = @user.shared_groups\n # this list all the places\n # @place = Place.all\n @place = Place.find(params[:place_id])\nend", "title": "" }, { "docid": "51ce72d52d2e565831d85932130a7f3f", "score": "0.5198423", "text": "def set_circulation\n @circulation = Circulation.includes(:author, :publisher).where(:id => params[:id], :admin_id => @current_user.id).first\n end", "title": "" }, { "docid": "b28d7fca085505837d9c18877a9dd8f5", "score": "0.5193112", "text": "def model_relationships; end", "title": "" }, { "docid": "4d48eee9dfae6c8c17c69c8b1377d1f8", "score": "0.51891613", "text": "def auth_belongs_to_parent(assoc,options = {})\n conf = {:association => assoc}\n conf.update(options)\n raise 'Need a parent association for has_many_parents' if conf[:association].nil?\n conf[:type] = :belongs_to_parent\n acts_as_authorizable_sources << conf\n end", "title": "" }, { "docid": "4429a6c022192c9f131a8f6f7fe5b348", "score": "0.5186938", "text": "def belongs_to_managers?\n return self.group >= Manager\n end", "title": "" }, { "docid": "f5fdcf4cf88650f3406f637965ad7514", "score": "0.5180567", "text": "def cascade;end", "title": "" }, { "docid": "3de3331cfe7d4cb1af13fd5d3327d28f", "score": "0.5173167", "text": "def parent_association\n ## Gotta find (as in another SQL query) it seperately, will get a recursive stack error elsewise\n\n # If we're viewing a DefinitionRelation:\n return parent_object.parent_relations if params[:id].nil?\n\n # Gotta find it seperately (new query), will get a recursive stack error elsewise, rats!\n o = DefinitionRelation.find(params[:id])\n parent_object.id == o.parent_node.id ? parent_object.child_relations : parent_object.parent_relations\n end", "title": "" }, { "docid": "f62aed2d2edee3418930da5dfdaa9172", "score": "0.5171365", "text": "def join_to_initial_groups\n initial_groups = Settings.initial_groups\n groups = Group.find(initial_groups)\n groups.each do |group|\n group.build_membership_for(self, true).save unless group.user_has_membership?(self)\n end\n end", "title": "" }, { "docid": "55112c98b4cc59538b88d46ad579964a", "score": "0.51651865", "text": "def guardians\n self.inverse_relations.guardians\n end", "title": "" }, { "docid": "f0dd5990d201fed7e23dbceb297de36e", "score": "0.5126357", "text": "def macro\n :belongs_to_related\n end", "title": "" }, { "docid": "96b0cd9a20051eac7703330645d73e28", "score": "0.5125449", "text": "def prepare_to_change_association(object)\n name = association_name(object)\n send(\"#{name}_will_change!\")\n end", "title": "" }, { "docid": "2055e0e789c91024a7999fe745d05f4f", "score": "0.51205117", "text": "def declare_setup_payment_by_loan_deduction\n @office = current_user.active_job_attachment.office\n @group_loan_membership = GroupLoanMembership.find params[:group_loan_membership_id]\n # we need to check whether such group loan membership can be updated by current user\n # Field Worker Task assignment : assigning responsibility between field_worker and the group loan \n @group_loan_membership.declare_setup_payment_by_loan_deduction\n \n end", "title": "" }, { "docid": "2570da5f66a4e98a7eca15d0051ebb15", "score": "0.5107653", "text": "def association_scope\n nil\n end", "title": "" }, { "docid": "30ab77ed26af6dc4fad91f00623304c5", "score": "0.5105565", "text": "def is_association?\n true\n end", "title": "" }, { "docid": "9dc9676b1ed84fe8e528a337814ef04b", "score": "0.5103396", "text": "def scoped\n ActiveDecorator::Decorator.instance.decorate_association(@association.owner, super)\n end", "title": "" }, { "docid": "774149d706062cf193f4e3fcfde0e5c6", "score": "0.5102616", "text": "def end_of_association_chain #:nodoc:\n if chain = association_chain.last\n if method_for_association_chain\n apply_scope_to(chain.send(method_for_association_chain))\n else\n # This only happens when we specify begin_of_association_chain in\n # a singletion controller without parents. In this case, the chain\n # is exactly the begin_of_association_chain which is already an\n # instance and then not scopable.\n chain\n end\n else\n apply_scope_to(resource_class)\n end\n end", "title": "" }, { "docid": "b41f0d7e4711b33117540d36740626fb", "score": "0.5088667", "text": "def create_entity(model)\n @entity = model.active_entities.add_group\nend", "title": "" }, { "docid": "c060c44f818cccf9ab6a96871eb6346c", "score": "0.50855255", "text": "def permissable_associations; self.class.permissable_associations || {}; end", "title": "" }, { "docid": "9c00250f8742277c5ea0949c3222152a", "score": "0.5083027", "text": "def set_association_with_user\n @association_with_user = @total_associations.find(params[:id])\n end", "title": "" }, { "docid": "97c91f50ccad10f19a6e9372595610a0", "score": "0.5068271", "text": "def relationships; end", "title": "" }, { "docid": "97c91f50ccad10f19a6e9372595610a0", "score": "0.5068271", "text": "def relationships; end", "title": "" }, { "docid": "97c91f50ccad10f19a6e9372595610a0", "score": "0.5068271", "text": "def relationships; end", "title": "" }, { "docid": "97c91f50ccad10f19a6e9372595610a0", "score": "0.5068271", "text": "def relationships; end", "title": "" }, { "docid": "97c91f50ccad10f19a6e9372595610a0", "score": "0.5068271", "text": "def relationships; end", "title": "" }, { "docid": "97c91f50ccad10f19a6e9372595610a0", "score": "0.5068271", "text": "def relationships; end", "title": "" }, { "docid": "97c91f50ccad10f19a6e9372595610a0", "score": "0.5068271", "text": "def relationships; end", "title": "" }, { "docid": "97c91f50ccad10f19a6e9372595610a0", "score": "0.5068271", "text": "def relationships; end", "title": "" }, { "docid": "97c91f50ccad10f19a6e9372595610a0", "score": "0.5068271", "text": "def relationships; end", "title": "" }, { "docid": "97c91f50ccad10f19a6e9372595610a0", "score": "0.5068271", "text": "def relationships; end", "title": "" }, { "docid": "97c91f50ccad10f19a6e9372595610a0", "score": "0.5068271", "text": "def relationships; end", "title": "" }, { "docid": "609033b8fc7950b72ee3fa24284d95d6", "score": "0.50611585", "text": "def set_grouped_member\n @grouped_member = GroupedMember.find(params[:id])\n end", "title": "" }, { "docid": "48111b3678f781741c4a5761b8cfd415", "score": "0.50583595", "text": "def eager_load_associations\n nil\n end", "title": "" }, { "docid": "c30fc17760ecd688bca3e20c56fe3443", "score": "0.5054527", "text": "def macro\n :has_one_related\n end", "title": "" }, { "docid": "c30fc17760ecd688bca3e20c56fe3443", "score": "0.5054527", "text": "def macro\n :has_one_related\n end", "title": "" }, { "docid": "4efc128b0e93b175ef8197d965fb4d3e", "score": "0.5052239", "text": "def setup_associations\n Set.new\n end", "title": "" }, { "docid": "6b4e16df5b87e2cd78513ae8557b7f07", "score": "0.50508463", "text": "def example_group_instance; end", "title": "" }, { "docid": "c246643ee3c9692e8919ccf63c7ab0c4", "score": "0.5034092", "text": "def set_specimen_group_relationship\n @specimen_group_relationship = SpecimenGroupRelationship.find(params[:id])\n authorize @specimen_group_relationship\n end", "title": "" }, { "docid": "d6e0612b7b659dee11508b2c16376b3a", "score": "0.503293", "text": "def on_example_group_definition_callbacks; end", "title": "" }, { "docid": "48b2ff7d42d2011bf55649032252b46f", "score": "0.50323063", "text": "def entity_relations\n EntityGroupRelationship.where(group_id: self.id)\n end", "title": "" }, { "docid": "eae1e338842ded26259dffe00a64b443", "score": "0.5024268", "text": "def load_associations\n @employee_allocations = @service.employee_allocations.joins(:employee).where(\n :fiscal_year_id => @year.id).includes(:employee).order(:last_name, :first_name)\n @products = @service.products.order(:name)\n @groups = @service.groups(@year).order(:name)\n end", "title": "" }, { "docid": "cde017c41320b2f1edb0338c83c5e4fe", "score": "0.5024088", "text": "def owner\n owner_group = super\n # trying to pre/eager load on relations other than owner does not work\n # when using this relation accessor override\n # ...and that makes me sad, it does work if you remove this owner override\n # but you lose the ability to return the correct owner resource...\n if owner_group&.identity?\n # ensure that this chained call matches the pre/eager loading setup\n owner_group.identity_membership.user\n else\n owner_group\n end\n end", "title": "" }, { "docid": "b8298d281389679ab6fdda40f6f868b0", "score": "0.5023913", "text": "def group_cannot_join_itself\n if !group.blank? and group == entity\n errors[:base] << \"Group cannot join with itself\"\n end\n end", "title": "" }, { "docid": "106d9463b87958477aaebc0229e972bd", "score": "0.50207597", "text": "def group\n self.author.group\n end", "title": "" }, { "docid": "029f1da1ad0bc5189382a8ff031a6586", "score": "0.50204724", "text": "def belongs_to\n associated_models :belongs_to\n end", "title": "" }, { "docid": "d1f646e9b5a1ba4f7198687d7bf3450a", "score": "0.5013488", "text": "def show\n # @user = User.find(params[:id])\n # @group = @user.group(params[:id])\n # @group = Group.find(params[:group_id])\n # @group_member = @group.group_members.build(params[:group_member])\n # @group_member = GroupMember.find(params[:group_members_id])\n # @orders = @group_member.orders\n end", "title": "" }, { "docid": "60cf20a71652a49c904cb510c12e1aab", "score": "0.5012669", "text": "def add_related model_object\n if Subgroup === model_object\n @region_array = get_subgroup_region_hash[model_object.id]\n @group_array = get_subgroup_group_hash[model_object.id]\n hsh = {:related_groups=>[],:related_regions=>[]}\n # sql1 = \"select distinct group_id from groups_subgroups where subgroup_id = #{model_object.id}\"\n # groups = Group.select(\"id,name,description,organization_id\").where(\"id in (#{sql1})\").to_a\n # groups.to_a.each do |grp|\n @group_array.each do |grp|\n # attr = grp.attributes\n hsh[:related_groups] << grp\n end\n # sql1 = \"select distinct region_id from subgroups_regions where subgroup_id = #{model_object.id}\"\n # Region.where(\"id in (#{sql1})\").to_a.each do |reg|\n @region_array.each do |reg|\n # hsh[:related_regions] << reg.attributes\n hsh[:related_regions] << reg\n end\n end\n hsh[:related_groups].sort_by!{|a| a['id']}\n hsh[:related_regions].sort_by!{|a| a['id']}\n hsh\n end", "title": "" }, { "docid": "d6984fbca7add132cb92cd9da5a1ce92", "score": "0.5006869", "text": "def macro\n :has_many_related\n end", "title": "" }, { "docid": "815cc99fe60189c0a2a9c749fbe5df0d", "score": "0.5003618", "text": "def set_group_member\n @group_member = GroupMember.find(params[:id])\n authorize @group_member\n end", "title": "" }, { "docid": "95f40f93770ba1c0ea87d5aa6c44a438", "score": "0.49994916", "text": "def reflect_on_association(association); end", "title": "" }, { "docid": "f3f8767e9065d14305d1359b9b9873d6", "score": "0.49984723", "text": "def edit\n # super\n @person = current_person\n # @person.people_middle_categories.build\n end", "title": "" } ]
2d746dee65cb6066061bdc07f08b5926
PUT /post434s/1 PUT /post434s/1.xml
[ { "docid": "fd6871a3bba1decd167181703eeaa5a0", "score": "0.6005289", "text": "def update\n @post434 = Post434.find(params[:id])\n\n respond_to do |format|\n if @post434.update_attributes(params[:post434])\n format.html { redirect_to(@post434, :notice => 'Post434 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post434.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" } ]
[ { "docid": "38979984bdedacd95706689e25f09f9e", "score": "0.66851765", "text": "def put(document, method='')\n @resource[method].put(document.to_s, :content_type => 'text/xml')\n end", "title": "" }, { "docid": "9ddf960eb3f437e62b9b99d34992bc0f", "score": "0.6512014", "text": "def test_should_update_status_post_via_API_XML\r\n get \"/logout\"\r\n put \"/status_posts/1.xml\", :api_key => 'testapikey',\r\n :status_post => {:body => 'API Status Post 1' }\r\n assert_response :success\r\n end", "title": "" }, { "docid": "23b5f5e4dacfb330cb1e0ffd4590ef63", "score": "0.6456215", "text": "def update opts = {}\n opts[:headers] ||= {}\n opts[:headers]['Content-Type'] ||= 'text/xml'\n post opts.fetch(:path, update_path), opts\n end", "title": "" }, { "docid": "2db8510634a8588feaf130b0ace4c384", "score": "0.64336735", "text": "def test_should_update_blog_post_via_API_XML\r\n get \"/logout\"\r\n put \"/blog_posts/1.xml\", :api_key => 'testapikey',\r\n :blog_post => {:title => 'API Test Post',\r\n :body => 'API Test Body',\r\n :published => true,\r\n :featured => false,\r\n :summary => 'Blog Post Summary',\r\n :url => 'http://www.apiblogpost.com',\r\n :guid => '22222' }\r\n assert_response :success\r\n end", "title": "" }, { "docid": "fbd7c46b15ae2792fd842ba0d764b7d0", "score": "0.63785285", "text": "def put uri, args = {}; Request.new(PUT, uri, args).execute; end", "title": "" }, { "docid": "ad54471b285e5e357d9be959c8ade2d8", "score": "0.6291921", "text": "def update\n path = \"/workflow/#{repo}/objects/druid:#{druid}/workflows/#{workflow}/#{step}\"\n conn = Faraday.new(url: config['host'])\n conn.basic_auth(config['user'], config['password'])\n conn.headers['content-type'] = 'application/xml'\n\n conn.put path, payload\n end", "title": "" }, { "docid": "d0fba1bf3c5e1dc0008c27994e1dabe4", "score": "0.62718403", "text": "def test_should_update_blog_post_via_API_XML\r\n get \"/logout\"\r\n put \"/blog_posts/1.xml\", :blog_post => {:title => 'API Test Post',\r\n :body => 'API Test Body',\r\n :published => true,\r\n :featured => false,\r\n :summary => 'Blog Post Summary',\r\n :url => 'http://www.apiblogpost.com',\r\n :guid => '22222' }\r\n assert_response 401\r\n end", "title": "" }, { "docid": "1e220620a52e1afb48cb40a1eba7c623", "score": "0.6231085", "text": "def update\n @post145 = Post145.find(params[:id])\n\n respond_to do |format|\n if @post145.update_attributes(params[:post145])\n format.html { redirect_to(@post145, :notice => 'Post145 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post145.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1308e2aec2b24f8d3f1fbc1a120db8f6", "score": "0.6097411", "text": "def update\n respond_to do |format|\n if @tag.update_attributes(params[:post])\n format.xml { head :ok }\n else\n format.xml { render :xml => @tag.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "238fd956be713471aa406c76bf19254a", "score": "0.6094809", "text": "def test_should_update_status_post_via_API_XML\r\n get \"/logout\"\r\n put \"/status_posts/1.xml\", :status_post => {:body => 'API Status Post 1' }\r\n assert_response 401\r\n end", "title": "" }, { "docid": "7dcf61d28367255f0ec9cea7ade341de", "score": "0.6058924", "text": "def update(id, name=\"Updated Name\", published=\"false\", genre=\"movie\")\r\n xml_req =\r\n \"<?xml version='1.0' encoding='UTF-8'?>\r\n <timeline>\r\n <published type='string'>#{published}</published>\r\n <id type='integer'>#{id}</id>\r\n <description>#{name}</description>\r\n <genre>#{genre}</genre>\r\n </timeline>\"\r\n \r\n request = Net::HTTP::Put.new(\"#{@url}/#{id}.xml\")\r\n request.add_field \"Content-Type\", \"application/xml\"\r\n request.body = xml_req\r\n \r\n http = Net::HTTP.new(@uri.host, @uri.port)\r\n response = http.request(request)\r\n \r\n # no response body will be returned\r\n case response\r\n when Net::HTTPSuccess\r\n return \"#{response.code} OK\"\r\n else\r\n return \"#{response.code} ERROR\"\r\n end\r\n end", "title": "" }, { "docid": "23013da92a79538a1b6edf4ce5dd5f3d", "score": "0.5990283", "text": "def update\n @post137 = Post137.find(params[:id])\n\n respond_to do |format|\n if @post137.update_attributes(params[:post137])\n format.html { redirect_to(@post137, :notice => 'Post137 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post137.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bb0b219297047d0a8a09a08e8c5ff21b", "score": "0.5968586", "text": "def update\n @post435 = Post435.find(params[:id])\n\n respond_to do |format|\n if @post435.update_attributes(params[:post435])\n format.html { redirect_to(@post435, :notice => 'Post435 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post435.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cf7581a1ccd9ff9352e577b25b44fd5d", "score": "0.59603226", "text": "def update\n @post144 = Post144.find(params[:id])\n\n respond_to do |format|\n if @post144.update_attributes(params[:post144])\n format.html { redirect_to(@post144, :notice => 'Post144 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post144.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ed46275f8f6f9727cd9c5632ce04964c", "score": "0.59273833", "text": "def update\n # Given the ID and Trend_Name and Comment Text, update\n uuid = params[:uuid]\n topic = params[:topic]\n comment = params[:comment]\n location_id = params[:location_id]\n\n # # to change later\n # uuid = \"91de7ee4-1cde-4aa8-9d0e-e16f46236d2f\"\n # comment = \"this is awesome111111!\"\n # topic = \"soytanrudo\"\n\n url= \"http://localhost:8080\"\n get_str = \"exist/atom/content/4302Collection/\"+location_id+\"/?id=urn:uuid:%s\"%uuid\n r = RestClient::Resource.new url\n res = r[get_str].get\n #puts res\n\n atom_string = res\n user_comment = comment\n\n atom_xml = Nokogiri::XML(atom_string)\n\n comment_ns = \"http://my.superdupertren.ds\"\n\n # assume the item exists and that there's only one of them\n topic_node = atom_xml.xpath(\"//tw:trend[@topic='\"+topic+\"']\", {\"tw\" => \"http://api.twitter.com\"})[0]\n\n puts \"Topic\"\n puts topic\n puts \"Comment\"\n puts user_comment\n\n comment_nodes = topic_node.xpath(\"//tw:trend[@topic='\"+topic+\"']/cm:user_comment\", {\"tw\" => \"http://api.twitter.com\", \"cm\" => comment_ns})\n if (comment_nodes.first)\n # Find user_comment node first and edit it\n comment_nodes.first.content = user_comment\n puts \"we found the comment nodes!!!!\"\n else\n # Create new node and add\n new_node = Nokogiri::XML::Node.new(\"user_comment\", atom_xml)\n new_node.add_namespace(nil, comment_ns)\n new_node.content = user_comment\n topic_node.add_child(new_node)\n end\n\n #update entry\n #puts atom_xml.to_xml\n\n url= \"http://localhost:8080\"\n r = RestClient::Resource.new url\n post_str = \"exist/atom/edit/4302Collection/\"+location_id+\"/?id=urn:uuid:%s\" % uuid\n res = r[post_str].put atom_xml.to_xml, :content_type => \"application/atom+xml\"\n\n #puts res\n render :xml => res\n\n end", "title": "" }, { "docid": "6753b4a0ab570111873ddfe2273efba8", "score": "0.59249914", "text": "def update\n @post160 = Post160.find(params[:id])\n\n respond_to do |format|\n if @post160.update_attributes(params[:post160])\n format.html { redirect_to(@post160, :notice => 'Post160 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post160.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "26aad9fd3c218beeef13b05af9d1c697", "score": "0.5891683", "text": "def update\n @post373 = Post373.find(params[:id])\n\n respond_to do |format|\n if @post373.update_attributes(params[:post373])\n format.html { redirect_to(@post373, :notice => 'Post373 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post373.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a2070e71328a87a64fa5423d02379131", "score": "0.58892906", "text": "def update\n @post167 = Post167.find(params[:id])\n\n respond_to do |format|\n if @post167.update_attributes(params[:post167])\n format.html { redirect_to(@post167, :notice => 'Post167 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post167.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1be44c3e0ba097e5e9e3383b5907538c", "score": "0.58882874", "text": "def update(id, member=\"Default member\", rating=\"9\", venue_Name=\"Default Venue_Name\", address=\"Default Address\", city=\"Default City\", phone=\"9999999999\" , date=\"\" , comment= \"Default Comment\")\r\n\t\txml_req =\r\n\t\t\"<?xml version='1.0' encoding='UTF-8'?>\r\n\t\t\t<review>\r\n\t\t\t\t<Member>#{member}</Member>\r\n\t\t\t\t<Rating>#{rating}</Rating>\r\n\t\t\t\t<Venue-Name>#{venue_Name}</Venue-Name>\r\n\t\t\t\t<Address>#{address}</Address>\r\n\t\t\t\t<City>#{city}</City>\r\n\t\t\t\t<Phone>#{phone}</Phone>\r\n\t\t\t\t<Date-of-Visit>date</Date-of-Visit>\r\n\t\t\t\t<Comment>#{comment}</Comment>\t\t\t\t\t\r\n\t\t\t</review>\"\r\n\r\n\t\trequest = Net::HTTP::Put.new(\"#{@url}/#{id}.xml\")\r\n\t\trequest.add_field \"Content-Type\", \"application/xml\"\r\n\t\trequest.body = xml_req\r\n\r\n\t\thttp = Net::HTTP.new(@uri.host, @uri.port)\r\n\t\tresponse = http.request(request)\r\n\r\n\t\t# no response body will be returned\r\n\t\tcase response\r\n\t\twhen Net::HTTPSuccess\r\n\t\t\treturn \"#{response.code} OK\"\r\n\t\telse\r\n\t\t\treturn \"#{response.code} ERROR\"\r\n\t\tend\r\n\tend", "title": "" }, { "docid": "55eaeb568c5c2ef9bb2ea917110674ba", "score": "0.5888118", "text": "def update\n @post345 = Post345.find(params[:id])\n\n respond_to do |format|\n if @post345.update_attributes(params[:post345])\n format.html { redirect_to(@post345, :notice => 'Post345 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post345.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5a9cb59962595d61d53499249cca568a", "score": "0.5884463", "text": "def update\n @post175 = Post175.find(params[:id])\n\n respond_to do |format|\n if @post175.update_attributes(params[:post175])\n format.html { redirect_to(@post175, :notice => 'Post175 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post175.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3f67b61e74a9e645824082659987310d", "score": "0.5884089", "text": "def update\n @post232 = Post232.find(params[:id])\n\n respond_to do |format|\n if @post232.update_attributes(params[:post232])\n format.html { redirect_to(@post232, :notice => 'Post232 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post232.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "358d775246ac7c71eeafc53ee93f688b", "score": "0.58783257", "text": "def update\n @post83 = Post83.find(params[:id])\n\n respond_to do |format|\n if @post83.update_attributes(params[:post83])\n format.html { redirect_to(@post83, :notice => 'Post83 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post83.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d61a25d69ed10b03601d4f17ba7d9ef3", "score": "0.58775073", "text": "def update\n #RAILS_DEFAULT_LOGGER.debug(\"******** REST Call to CRMS: Updating #{self.class.name}:#{self.id}\")\n #RAILS_DEFAULT_LOGGER.debug(caller[0..5].join(\"\\n\")) \n response = connection.put(element_path(prefix_options), to_xml, self.class.headers)\n save_nested\n load_attributes_from_response(response)\n merge_saved_nested_resources_into_attributes\n response\n end", "title": "" }, { "docid": "a91f803cdfce0e23f40d1545f1bdd14c", "score": "0.5874984", "text": "def update\n @post155 = Post155.find(params[:id])\n\n respond_to do |format|\n if @post155.update_attributes(params[:post155])\n format.html { redirect_to(@post155, :notice => 'Post155 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post155.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b801667c81eb4112f09aeb73fa2e60ea", "score": "0.5874873", "text": "def update\n @post432 = Post432.find(params[:id])\n\n respond_to do |format|\n if @post432.update_attributes(params[:post432])\n format.html { redirect_to(@post432, :notice => 'Post432 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post432.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "eab1edb70c66f182434a30492adcdebc", "score": "0.58714974", "text": "def update\n @post414 = Post414.find(params[:id])\n\n respond_to do |format|\n if @post414.update_attributes(params[:post414])\n format.html { redirect_to(@post414, :notice => 'Post414 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post414.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "82614acaaacef50ccc4ed62d41e1b422", "score": "0.58640456", "text": "def update\n @post178 = Post178.find(params[:id])\n\n respond_to do |format|\n if @post178.update_attributes(params[:post178])\n format.html { redirect_to(@post178, :notice => 'Post178 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post178.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b428e750b730404a4b5efb772e13eb4b", "score": "0.5842715", "text": "def update\n @post135 = Post135.find(params[:id])\n\n respond_to do |format|\n if @post135.update_attributes(params[:post135])\n format.html { redirect_to(@post135, :notice => 'Post135 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post135.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c9e03c6e9cea3ad78ce7eeb88229ded5", "score": "0.5831894", "text": "def update\n @post185 = Post185.find(params[:id])\n\n respond_to do |format|\n if @post185.update_attributes(params[:post185])\n format.html { redirect_to(@post185, :notice => 'Post185 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post185.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c8aeeb8195868bf9dcb1ebc5bb84ac56", "score": "0.5826564", "text": "def update\n @post173 = Post173.find(params[:id])\n\n respond_to do |format|\n if @post173.update_attributes(params[:post173])\n format.html { redirect_to(@post173, :notice => 'Post173 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post173.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "30d08ec0a629efc033036e65a30ddf33", "score": "0.582542", "text": "def update\n @post152 = Post152.find(params[:id])\n\n respond_to do |format|\n if @post152.update_attributes(params[:post152])\n format.html { redirect_to(@post152, :notice => 'Post152 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post152.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b11a5859a93bf961f4f2a61f699ffa8c", "score": "0.5820474", "text": "def update\n @post170 = Post170.find(params[:id])\n\n respond_to do |format|\n if @post170.update_attributes(params[:post170])\n format.html { redirect_to(@post170, :notice => 'Post170 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post170.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "47a4083a43e5d5f387d479fc70f23869", "score": "0.58138597", "text": "def update\n @post132 = Post132.find(params[:id])\n\n respond_to do |format|\n if @post132.update_attributes(params[:post132])\n format.html { redirect_to(@post132, :notice => 'Post132 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post132.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e2e55a6ecb4c00b7fe18a670cc021207", "score": "0.5812983", "text": "def put_entry(id,summary)\n xml = <<DATA\n <entry xmlns=\"http://purl.org/atom/ns#\">\n <summary type=\"text/plain\"></summary>\n </entry>\nDATA\n\n doc = REXML::Document.new(xml)\n doc.elements['/entry/summary'].add_text(summary)\n\n # REXML -> String\n data=String.new\n doc.write(data)\n\n #make request\n path=\"/atom/edit/#{id}\"\n req=Net::HTTP::Put.new(path)\n req['Accept']= 'application/x.atom+xml,application/xml,text/xml,*/*',\n req['X-WSSE']= @credential_string\n\n #YHAAAA!!!\n res = @http.request(req,data)\n return res\n end", "title": "" }, { "docid": "f162fd0f09d1f1f165db03a378cc454b", "score": "0.5810257", "text": "def update\n @post203 = Post203.find(params[:id])\n\n respond_to do |format|\n if @post203.update_attributes(params[:post203])\n format.html { redirect_to(@post203, :notice => 'Post203 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post203.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "06c6da1fa6055c739c208189cd48eb75", "score": "0.58008367", "text": "def update\n @post234 = Post234.find(params[:id])\n\n respond_to do |format|\n if @post234.update_attributes(params[:post234])\n format.html { redirect_to(@post234, :notice => 'Post234 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post234.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c3564c01efff497c93e03b4dc1022279", "score": "0.5799764", "text": "def update\n @post235 = Post235.find(params[:id])\n\n respond_to do |format|\n if @post235.update_attributes(params[:post235])\n format.html { redirect_to(@post235, :notice => 'Post235 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post235.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "46a50e899d4808f8dc7ae1f9f76746aa", "score": "0.5792948", "text": "def update\n @post112 = Post112.find(params[:id])\n\n respond_to do |format|\n if @post112.update_attributes(params[:post112])\n format.html { redirect_to(@post112, :notice => 'Post112 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post112.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f1ce17c9bca26f8260095ab269f11ea5", "score": "0.5789419", "text": "def update\n @post325 = Post325.find(params[:id])\n\n respond_to do |format|\n if @post325.update_attributes(params[:post325])\n format.html { redirect_to(@post325, :notice => 'Post325 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post325.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "dca2088afcf8d856430afe69f5574e5d", "score": "0.5786049", "text": "def update\n @post356 = Post356.find(params[:id])\n\n respond_to do |format|\n if @post356.update_attributes(params[:post356])\n format.html { redirect_to(@post356, :notice => 'Post356 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post356.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3212b407bf522908dd4110abd2566dc7", "score": "0.5778236", "text": "def update\n @post474 = Post474.find(params[:id])\n\n respond_to do |format|\n if @post474.update_attributes(params[:post474])\n format.html { redirect_to(@post474, :notice => 'Post474 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post474.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d804d614929e32f70dfba1290cd666c0", "score": "0.577631", "text": "def update\n @post433 = Post433.find(params[:id])\n\n respond_to do |format|\n if @post433.update_attributes(params[:post433])\n format.html { redirect_to(@post433, :notice => 'Post433 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post433.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "be3c42dd30a6be4cf80f6671e81cb660", "score": "0.5771652", "text": "def update\n @post439 = Post439.find(params[:id])\n\n respond_to do |format|\n if @post439.update_attributes(params[:post439])\n format.html { redirect_to(@post439, :notice => 'Post439 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post439.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8bea3bc70f6d0e732fdc4467cb575b27", "score": "0.57709306", "text": "def update\n @post343 = Post343.find(params[:id])\n\n respond_to do |format|\n if @post343.update_attributes(params[:post343])\n format.html { redirect_to(@post343, :notice => 'Post343 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post343.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "106da692837f1a52bd417af24628cbef", "score": "0.5769536", "text": "def update\n @post283 = Post283.find(params[:id])\n\n respond_to do |format|\n if @post283.update_attributes(params[:post283])\n format.html { redirect_to(@post283, :notice => 'Post283 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post283.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "49f6ab07066d89b76214f244b79b4a1c", "score": "0.57655483", "text": "def update\n @post153 = Post153.find(params[:id])\n\n respond_to do |format|\n if @post153.update_attributes(params[:post153])\n format.html { redirect_to(@post153, :notice => 'Post153 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post153.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6c6a4c32fa3757e4b3e6699b9772f45e", "score": "0.5761025", "text": "def update\n @post123 = Post123.find(params[:id])\n\n respond_to do |format|\n if @post123.update_attributes(params[:post123])\n format.html { redirect_to(@post123, :notice => 'Post123 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post123.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "87748658783c3b521189b6e3f53dd005", "score": "0.5759749", "text": "def update\n @post142 = Post142.find(params[:id])\n\n respond_to do |format|\n if @post142.update_attributes(params[:post142])\n format.html { redirect_to(@post142, :notice => 'Post142 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post142.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "545dadbe32aa3d9d0edf1d22293783fc", "score": "0.5745407", "text": "def test_put_existing\n request = Http::Request.new('PUT', '/file1', {}, 'bar')\n\n response = self.request(request)\n\n assert_equal(204, response.status)\n\n assert_equal(\n 'bar',\n @server.tree.node_for_path('file1').get\n )\n\n assert_equal(\n {\n 'X-Sabre-Version' => [Version::VERSION],\n 'Content-Length' => ['0'],\n 'ETag' => [\"\\\"#{Digest::MD5.hexdigest('bar')}\\\"\"]\n },\n response.headers\n )\n end", "title": "" }, { "docid": "2476f7274e376f454db82de076252ce5", "score": "0.57447994", "text": "def update\n @post347 = Post347.find(params[:id])\n\n respond_to do |format|\n if @post347.update_attributes(params[:post347])\n format.html { redirect_to(@post347, :notice => 'Post347 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post347.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d9c9ed1a785f637867d3db4942bfdd26", "score": "0.57443804", "text": "def update\n @post201 = Post201.find(params[:id])\n\n respond_to do |format|\n if @post201.update_attributes(params[:post201])\n format.html { redirect_to(@post201, :notice => 'Post201 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post201.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ba1fec11c6013fd1e88889961608634a", "score": "0.5743738", "text": "def update\n @post200 = Post200.find(params[:id])\n\n respond_to do |format|\n if @post200.update_attributes(params[:post200])\n format.html { redirect_to(@post200, :notice => 'Post200 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post200.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a51c3cab4816319fea67b2fd6f42af3c", "score": "0.5740148", "text": "def update\n @post136 = Post136.find(params[:id])\n\n respond_to do |format|\n if @post136.update_attributes(params[:post136])\n format.html { redirect_to(@post136, :notice => 'Post136 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post136.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fcd0928152ed9b0784a1efe8b038c984", "score": "0.57392275", "text": "def update\n @post320 = Post320.find(params[:id])\n\n respond_to do |format|\n if @post320.update_attributes(params[:post320])\n format.html { redirect_to(@post320, :notice => 'Post320 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post320.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8548fe36626fd21f2dbb01165399df4f", "score": "0.57380056", "text": "def update\n @post165 = Post165.find(params[:id])\n\n respond_to do |format|\n if @post165.update_attributes(params[:post165])\n format.html { redirect_to(@post165, :notice => 'Post165 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post165.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c99238efa98a6e05678c5d303dd5515d", "score": "0.5737154", "text": "def update_ticket(ticket_num)\n \n url = ['/tickets/',ticket_num,'.xml'].join\n result = @connection.put url, \n (\n xml = Builder::XmlMarkup.new( :indent => 2 )\n xml.instruct! :xml, :encoding => \"UTF-8\"\n xml.ticket do |t|\n t.tag! \"solved-at\", Time.now\n t.tag! \"status-id\", \"3\"\n end\n )\n end", "title": "" }, { "docid": "4b1cba03cc6c511e08a7aea6a714d445", "score": "0.57369703", "text": "def update\n @post171 = Post171.find(params[:id])\n\n respond_to do |format|\n if @post171.update_attributes(params[:post171])\n format.html { redirect_to(@post171, :notice => 'Post171 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post171.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c282e2e405577af4a750ec6c97d8e0c5", "score": "0.5732504", "text": "def update\n @post148 = Post148.find(params[:id])\n\n respond_to do |format|\n if @post148.update_attributes(params[:post148])\n format.html { redirect_to(@post148, :notice => 'Post148 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post148.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "518f86f04d1d90a9637e1084c67d9409", "score": "0.5731989", "text": "def update\n @post179 = Post179.find(params[:id])\n\n respond_to do |format|\n if @post179.update_attributes(params[:post179])\n format.html { redirect_to(@post179, :notice => 'Post179 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post179.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "449ac2400cbd9823a2d61cabf36b08d0", "score": "0.57313746", "text": "def update\n @post56 = Post56.find(params[:id])\n\n respond_to do |format|\n if @post56.update_attributes(params[:post56])\n format.html { redirect_to(@post56, :notice => 'Post56 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post56.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5a709be54da030e531e9297b7bde699d", "score": "0.57261866", "text": "def check_update_feed\n puts \"\\r\\n\\r\\nUpdate Feed:\"\n uri = URI.parse(\"http://0.0.0.0:8080/feed.json\")\n Net::HTTP.start(uri.host, uri.port) do |http|\n headers = {'Content-Type' => 'application/x-www-form-urlencoded'}\n put_data = \"key=1&uid=1&title=SomethingDifferent\"\n res = http.send_request('PUT', uri.request_uri, put_data, headers) \n puts res.body\n end\nend", "title": "" }, { "docid": "03187da98a18e95a21841c77643fc71a", "score": "0.57253695", "text": "def update\n @post457 = Post457.find(params[:id])\n\n respond_to do |format|\n if @post457.update_attributes(params[:post457])\n format.html { redirect_to(@post457, :notice => 'Post457 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post457.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fed201451a956693a59024aa506fec88", "score": "0.57244164", "text": "def update\n @post473 = Post473.find(params[:id])\n\n respond_to do |format|\n if @post473.update_attributes(params[:post473])\n format.html { redirect_to(@post473, :notice => 'Post473 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post473.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f2d757dd3bb39a188ce944e92f3e104e", "score": "0.5722491", "text": "def update\n @post324 = Post324.find(params[:id])\n\n respond_to do |format|\n if @post324.update_attributes(params[:post324])\n format.html { redirect_to(@post324, :notice => 'Post324 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post324.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "edc629ed6bd821a821e015fcf15c4e19", "score": "0.57222766", "text": "def update\n @post34 = Post34.find(params[:id])\n\n respond_to do |format|\n if @post34.update_attributes(params[:post34])\n format.html { redirect_to(@post34, :notice => 'Post34 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post34.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e8ff1a689c5e04c1cbd5cd8e5303d997", "score": "0.5722219", "text": "def update\n @post84 = Post84.find(params[:id])\n\n respond_to do |format|\n if @post84.update_attributes(params[:post84])\n format.html { redirect_to(@post84, :notice => 'Post84 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post84.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "90ccaceeaf25b5341b5fcd9139bb1477", "score": "0.5717065", "text": "def update\n @post140 = Post140.find(params[:id])\n\n respond_to do |format|\n if @post140.update_attributes(params[:post140])\n format.html { redirect_to(@post140, :notice => 'Post140 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post140.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "eef7009fbd3b5d99e29dfadf2f46ae1b", "score": "0.5716501", "text": "def update\n @post207 = Post207.find(params[:id])\n\n respond_to do |format|\n if @post207.update_attributes(params[:post207])\n format.html { redirect_to(@post207, :notice => 'Post207 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post207.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "231e8138063aecde0d81825cd71d8b3e", "score": "0.5714073", "text": "def update\n @post177 = Post177.find(params[:id])\n\n respond_to do |format|\n if @post177.update_attributes(params[:post177])\n format.html { redirect_to(@post177, :notice => 'Post177 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post177.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "31c440b0925ca543aef6c378d318052b", "score": "0.5713573", "text": "def update\n @post376 = Post376.find(params[:id])\n\n respond_to do |format|\n if @post376.update_attributes(params[:post376])\n format.html { redirect_to(@post376, :notice => 'Post376 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post376.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "74d83555aa01096d05f9017fc0351b5a", "score": "0.57125515", "text": "def update\n @post352 = Post352.find(params[:id])\n\n respond_to do |format|\n if @post352.update_attributes(params[:post352])\n format.html { redirect_to(@post352, :notice => 'Post352 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post352.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6fd8842ed08fa1572950f3e78514aecf", "score": "0.57112545", "text": "def do_PUT(req, res)\n domain, resource, id, format = parse_request_path(req.path_info)\n attributes = from_xml(resource, req.body)\n attributes['updated-at'] = Time.now.iso8601\n logger.debug \"Updating item with attributes: #{attributes.inspect}\"\n sdb_put_item(domain, attributes, true)\n raise WEBrick::HTTPStatus::OK\n end", "title": "" }, { "docid": "6479ca2baf6003f5250ce8830cd0d8f1", "score": "0.5711202", "text": "def update\n @post372 = Post372.find(params[:id])\n\n respond_to do |format|\n if @post372.update_attributes(params[:post372])\n format.html { redirect_to(@post372, :notice => 'Post372 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post372.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cabb465cb063c25e8cd4d09c19d2af2d", "score": "0.5708501", "text": "def update\n @post244 = Post244.find(params[:id])\n\n respond_to do |format|\n if @post244.update_attributes(params[:post244])\n format.html { redirect_to(@post244, :notice => 'Post244 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post244.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "24a2e434197ed6dfabf27daa9259c928", "score": "0.5708478", "text": "def update\n @post243 = Post243.find(params[:id])\n\n respond_to do |format|\n if @post243.update_attributes(params[:post243])\n format.html { redirect_to(@post243, :notice => 'Post243 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post243.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "943f3acd2f57e68ade7f7fe8e4733262", "score": "0.57080835", "text": "def update\n @post187 = Post187.find(params[:id])\n\n respond_to do |format|\n if @post187.update_attributes(params[:post187])\n format.html { redirect_to(@post187, :notice => 'Post187 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post187.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3db3e6a5672e8f54c11a33f03488e86d", "score": "0.5707237", "text": "def update\n @post164 = Post164.find(params[:id])\n\n respond_to do |format|\n if @post164.update_attributes(params[:post164])\n format.html { redirect_to(@post164, :notice => 'Post164 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post164.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "537ffb6f57303285da6e62e2d3f42a24", "score": "0.570277", "text": "def update\n @post189 = Post189.find(params[:id])\n\n respond_to do |format|\n if @post189.update_attributes(params[:post189])\n format.html { redirect_to(@post189, :notice => 'Post189 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post189.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6b632844f0f37bce61aa0d5968dc5e7d", "score": "0.5701971", "text": "def update\n @post479 = Post479.find(params[:id])\n\n respond_to do |format|\n if @post479.update_attributes(params[:post479])\n format.html { redirect_to(@post479, :notice => 'Post479 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post479.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9b9a7aab81fee35081a654ebe8fd0b49", "score": "0.5701928", "text": "def update\n @post415 = Post415.find(params[:id])\n\n respond_to do |format|\n if @post415.update_attributes(params[:post415])\n format.html { redirect_to(@post415, :notice => 'Post415 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post415.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "147a3abf441eb7e8f7a289e7c02a9372", "score": "0.5701853", "text": "def update\n @post73 = Post73.find(params[:id])\n\n respond_to do |format|\n if @post73.update_attributes(params[:post73])\n format.html { redirect_to(@post73, :notice => 'Post73 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post73.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9176b1b0bdde9517ae585ce5412b080a", "score": "0.5700859", "text": "def update\n @post291 = Post291.find(params[:id])\n\n respond_to do |format|\n if @post291.update_attributes(params[:post291])\n format.html { redirect_to(@post291, :notice => 'Post291 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post291.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "24177b5626837a078d82ab2f4fde808e", "score": "0.57000726", "text": "def update_rest\n @entry_question = EntryQuestion.find(params[:id])\n\n respond_to do |format|\n if @entry_question.update_attributes(params[:entry_question])\n flash[:notice] = 'EntryQuestion was successfully updated.'\n format.html { redirect_to(@entry_question) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @entry_question.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "da800b487174962a44465f6fa8db71f5", "score": "0.5699189", "text": "def update\n @post233 = Post233.find(params[:id])\n\n respond_to do |format|\n if @post233.update_attributes(params[:post233])\n format.html { redirect_to(@post233, :notice => 'Post233 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post233.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4c1660476c87a1706d1422b0c0e7f88f", "score": "0.56989837", "text": "def update\n @post438 = Post438.find(params[:id])\n\n respond_to do |format|\n if @post438.update_attributes(params[:post438])\n format.html { redirect_to(@post438, :notice => 'Post438 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post438.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fa8940db753e6ef934e653f3374c4a8b", "score": "0.56971544", "text": "def update\n @post463 = Post463.find(params[:id])\n\n respond_to do |format|\n if @post463.update_attributes(params[:post463])\n format.html { redirect_to(@post463, :notice => 'Post463 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post463.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "03bf7f12b9fe0c28bfb4315f818bf26b", "score": "0.5695839", "text": "def update\n @post151 = Post151.find(params[:id])\n\n respond_to do |format|\n if @post151.update_attributes(params[:post151])\n format.html { redirect_to(@post151, :notice => 'Post151 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post151.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9ff59d107a82418516e48389762ec2a2", "score": "0.56957936", "text": "def update\n @post124 = Post124.find(params[:id])\n\n respond_to do |format|\n if @post124.update_attributes(params[:post124])\n format.html { redirect_to(@post124, :notice => 'Post124 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post124.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "81ef62c01dfca1872a823149f45c839a", "score": "0.5695062", "text": "def update\n @post292 = Post292.find(params[:id])\n\n respond_to do |format|\n if @post292.update_attributes(params[:post292])\n format.html { redirect_to(@post292, :notice => 'Post292 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post292.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "aaf61cd9dd7843e7d234e61d0eb0c896", "score": "0.5693352", "text": "def update\n @post348 = Post348.find(params[:id])\n\n respond_to do |format|\n if @post348.update_attributes(params[:post348])\n format.html { redirect_to(@post348, :notice => 'Post348 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post348.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "713161fe04801b44f5b9cdb91a95fe89", "score": "0.5689982", "text": "def test_put\n request = Http::Request.new('PUT', '/file2', {}, 'hello')\n\n response = self.request(request)\n\n assert_equal(201, response.status, \"Incorrect status code received. Full response body: #{response.body_as_string}\")\n\n assert_equal(\n 'hello',\n @server.tree.node_for_path('file2').get\n )\n\n assert_equal(\n {\n 'X-Sabre-Version' => [Version::VERSION],\n 'Content-Length' => ['0'],\n 'ETag' => [\"\\\"#{Digest::MD5.hexdigest('hello')}\\\"\"]\n },\n response.headers\n )\n end", "title": "" }, { "docid": "62c824d1869d9a60a6a231b60c9bd5a3", "score": "0.5689359", "text": "def update\n @post442 = Post442.find(params[:id])\n\n respond_to do |format|\n if @post442.update_attributes(params[:post442])\n format.html { redirect_to(@post442, :notice => 'Post442 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post442.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cbafa1ee7f977a1a4163859d1009c581", "score": "0.56870556", "text": "def update\n @post327 = Post327.find(params[:id])\n\n respond_to do |format|\n if @post327.update_attributes(params[:post327])\n format.html { redirect_to(@post327, :notice => 'Post327 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post327.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9febcaabec62b3c45b2e04464a2a66a3", "score": "0.5686817", "text": "def update\n @post456 = Post456.find(params[:id])\n\n respond_to do |format|\n if @post456.update_attributes(params[:post456])\n format.html { redirect_to(@post456, :notice => 'Post456 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post456.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fe34536fd5f351320692e00ed18692d2", "score": "0.5685035", "text": "def update\n @post497 = Post497.find(params[:id])\n\n respond_to do |format|\n if @post497.update_attributes(params[:post497])\n format.html { redirect_to(@post497, :notice => 'Post497 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post497.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8e18db431964c254de53caa41795b702", "score": "0.56830853", "text": "def put *args\n make_request :put, *args\n end", "title": "" }, { "docid": "a1db7f1ff4b97e0b9cad64d05b57cfe8", "score": "0.56818354", "text": "def update\n @post259 = Post259.find(params[:id])\n\n respond_to do |format|\n if @post259.update_attributes(params[:post259])\n format.html { redirect_to(@post259, :notice => 'Post259 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post259.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a48b3229e830876ae619b936301400b2", "score": "0.5678482", "text": "def put(url, xml, version = nil)\n req = Net::HTTP::Put.new(url)\n req.content_type = 'application/x-ssds+xml'\n \n if(!version.nil?)\n req['if-match'] = version;\n end\n \n req.content_length = xml.to_s.size.to_s\n req.basic_auth @username, @password\n req.body = xml.to_s\n execute_request(req)\n end", "title": "" }, { "docid": "af30ffb3f00f5e39ef86b871e4a694b7", "score": "0.5678398", "text": "def update\n @post211 = Post211.find(params[:id])\n\n respond_to do |format|\n if @post211.update_attributes(params[:post211])\n format.html { redirect_to(@post211, :notice => 'Post211 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post211.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" } ]
d88463e8a42e6a9f860a6c72a344e050
Print out the sentence
[ { "docid": "9863c0dc9c629ace75b6b85b365e9a0e", "score": "0.0", "text": "def to_s\n\t\treturn self.words.join(\" \")\n\tend", "title": "" } ]
[ { "docid": "77e8d86a57a26273dd992b77c4ecd7ac", "score": "0.72701484", "text": "def show_word\n puts \"\\nWord: \" + cyan + bold + word_as_dashes + \"\\n\\n\"\n solved?\n end", "title": "" }, { "docid": "78a39b346d89191a8bd0bb0688656ae6", "score": "0.72265625", "text": "def output_word\n puts @show_word\n end", "title": "" }, { "docid": "d5f7e39a8129d005c7d69c54823cbd64", "score": "0.72078913", "text": "def sentence\n [intro, subject, verb, object].join(\" \")\n end", "title": "" }, { "docid": "86a1f0b67995c28ee6877147b001862f", "score": "0.7074296", "text": "def print_sentence(name, animal)\n p \"#{name} has a #{animal} as a pet.\"\nend", "title": "" }, { "docid": "4dbea85e55bfa0db177e9741bc432240", "score": "0.70383096", "text": "def banner(sentence)\n if sentence.length > 1\n puts \"+\" + \"#{'-' * sentence.length}\" + \"+\"\n puts \"|\" + \"#{\" \" * sentence.length}\" + \"|\"\n puts \"|\" + \"#{sentence}\" + \"|\"\n puts \"|\" + \"#{\" \" * sentence.length}\" + \"|\"\n puts \"+\" + \"#{'-' * sentence.length}\" + \"+\"\n else\n puts \"+\" + \"--\" + \"+\"\n puts \"|\" + \" \" + \"|\"\n puts \"|\" + \" \" + \"|\"\n puts \"|\" + \" \" + \"|\"\n puts \"+\" + \"--\" + \"+\"\n end\n end", "title": "" }, { "docid": "16f83942383c8f40a2f18faea388728f", "score": "0.6966178", "text": "def say(phrase)\n puts phrase\n end", "title": "" }, { "docid": "cb482def8179f833da73244eeb53b2cb", "score": "0.6963382", "text": "def output_word\n puts \"\"\n puts @guessed_word.join(\" \")\n puts \"#{@lives} lives left\"\n puts \"\"\n end", "title": "" }, { "docid": "85102845f44c17a1fa9ff5dad77478ea", "score": "0.6944599", "text": "def sentence # defining the method of sentence\n puts \"happy days\" # to do sentence, the method is to puts 'happy days'\nend", "title": "" }, { "docid": "b59e237a0ee55394aafa8f09f6442da5", "score": "0.6879569", "text": "def output_sentence(words)\n puts \"hello #{words}\"\nend", "title": "" }, { "docid": "f1b53dbb4cf7f7f2940f00b3300ee0a2", "score": "0.68728673", "text": "def sentence\n return \"#{name} is #{height}cm tall and #{weight}kg and says #{sound}. His owner is #{owner}.\"\n end", "title": "" }, { "docid": "5da445a508e42b70e59b0b3ccc5df7c9", "score": "0.68312347", "text": "def part_1\n puts \"All the single ladies (All the single ladies)\"\nend", "title": "" }, { "docid": "47e1b82bb1e894114fb80585e0778099", "score": "0.6797187", "text": "def say statement\n\t\tputs Cli.wrap(statement, LINE_WIDTH)\n\tend", "title": "" }, { "docid": "b5c74a69d96b75ba68ead18ec6fd11b0", "score": "0.67951196", "text": "def print\r\n puts name + \" \" + className + \" \" + movement + \" and said, \" + \"\\\"\" + call + \"\\\"\"\r\n end", "title": "" }, { "docid": "e9e1817f9a022b19209f8974d3798b18", "score": "0.67584264", "text": "def print\n puts name + \" \" + className + \" \" + movement + \" and said, \" + \"\\\"\" + call + \"\\\"\"\n end", "title": "" }, { "docid": "b9858b043b99e4a3eb0260242c8d3b57", "score": "0.675427", "text": "def say(words)\n puts words + '.'\n end", "title": "" }, { "docid": "a28d3619974900b652cad945efb10697", "score": "0.6731892", "text": "def print_word\n\t\tputs \"THE WORD\"\n\t\tcount = 0\n\t\t@is_winner = true\n\t\t@my_word.split(\"\").each{|letter|\n\t\t\tif @letters_guessed.include? \"#{letter}\"\n\t\t\t\tprint \"#{letter}\"\n\t\t\telse\n\t\t\t\t@is_winner = false\n\t\t\t\tprint \"_\"\n\t\t\tend\n\t\t\tcount += 1\n\t\t\t}\n\t\tif @is_winner\n\t\t\t@gameover = true\n\t\tend\n\t\tputs \"\"\n\tend", "title": "" }, { "docid": "65d32b81b739f9e7a9cffb0e60a05653", "score": "0.6706719", "text": "def speak\n puts \"#{@name}: 'Ho, ho, ho! Haaaappy holidays!'\"\n end", "title": "" }, { "docid": "f180fe0f2761c8b87adcaf66a87fc966", "score": "0.6695599", "text": "def display_content\n print @yel\n print \"\\n#{@lives} Lives left\t#{@std}[\"\n print @gre\n @lives.times do\n print \"|\"\n end\n print @std\n puts \"]\"\n print \"\\nLetters used : \"\n @used.each do |letter|\n print(\"#{letter} | \")\n end\n print(\"\\n\")\n puts word_define\n end", "title": "" }, { "docid": "14a2e676d8f1a7309244b0db6618d837", "score": "0.6668744", "text": "def output_word\n puts @displaying_word\n end", "title": "" }, { "docid": "14a2e676d8f1a7309244b0db6618d837", "score": "0.6668744", "text": "def output_word\n puts @displaying_word\n end", "title": "" }, { "docid": "8025767fdeed8430ff2c7b9bc3058c5c", "score": "0.6659471", "text": "def tell_Story(paragraph)\n\t\tputs paragraph\n\tend", "title": "" }, { "docid": "8025767fdeed8430ff2c7b9bc3058c5c", "score": "0.6659471", "text": "def tell_Story(paragraph)\n\t\tputs paragraph\n\tend", "title": "" }, { "docid": "88494eac780561ab1092e838e6aa46ab", "score": "0.6645138", "text": "def tell_Story(paragraph)\r\n puts paragraph\r\n end", "title": "" }, { "docid": "6f115b435dd4c63a9d7af1d0559d3509", "score": "0.66158986", "text": "def print\n output = \"Survey Answer: #{self.survey.get_title}<br>\"\n answers.each { |answer| output << answer.print }\n return output\n end", "title": "" }, { "docid": "6f115b435dd4c63a9d7af1d0559d3509", "score": "0.66158986", "text": "def print\n output = \"Survey Answer: #{self.survey.get_title}<br>\"\n answers.each { |answer| output << answer.print }\n return output\n end", "title": "" }, { "docid": "4dd092122d41e63cc34af6ec19997446", "score": "0.6610617", "text": "def shakil_says(phrase)\n puts phrase\nend", "title": "" }, { "docid": "9a98218597805321c432b98e98418f04", "score": "0.6603082", "text": "def speak(line)\n\t\t\twrite_line \":: #{line}\"\n\t\tend", "title": "" }, { "docid": "d0e427d1caa0cddffcfbeab9336808c7", "score": "0.66025823", "text": "def sentence\n sentences(1)\n end", "title": "" }, { "docid": "7fc3e17c2cc7f4637676752f3354867f", "score": "0.65942615", "text": "def pretty_output\r\n\t\tputs \"The #{face_value} of #{find_suit}\"\r\n\tend", "title": "" }, { "docid": "d90e0ffc59e8d385a164b8d856f930db", "score": "0.6589461", "text": "def say(text)\n puts text\n end", "title": "" }, { "docid": "eea7372128196fd9c7f7501017c45003", "score": "0.65876967", "text": "def print_word\r\n\t\tword_string = \"\"\r\n\t\t@word_guess.each { |letter| word_string = word_string + letter + \" \" }\r\n\t\treturn word_string.rstrip\r\n\tend", "title": "" }, { "docid": "e65bce2064ef2f2011a9d1af1f2a4dc0", "score": "0.6567513", "text": "def full_story\n puts \" This is your user story\".colorize(:color => :yellow)\n\n puts \"\n Today I went to the zoo. I saw a #{@adjective}\n #{@noun} jumping up and down in its tree.\n He #{@past_verb} #{@adverb} through the large tunnel \n that led to its #{@adjective2} #{@noun2}. I got some \n peanuts and passed them through the cage to a \n gigantic gray #{@noun3} towering above my head. Feeding\n that animal made me hungry. I went to get a \n #{@adjective3} scoop of ice cream. It filled my \n stomach. Afterwards I had to #{@verb2} #{@adverb2} \n to catch our bus. When I got home I #{@past_verb2} \n my mom for a #{@adjective4} day at the zoo. \"\n\n end", "title": "" }, { "docid": "5b76b0ac9a472fdb197452fd8c06fca8", "score": "0.6565308", "text": "def sentence\n sentences(1)\n end", "title": "" }, { "docid": "cdea6d6fb54bb775ede0bb639c73ca9f", "score": "0.6560636", "text": "def print(line)\n @shell.say(line, nil, true)\n end", "title": "" }, { "docid": "da2910c95894af06f9f48b2d662c5475", "score": "0.65546495", "text": "def print\r\n\t\tputs name + \" \" + className + \" just \" + movement + \" and said \" + call\r\n\tend", "title": "" }, { "docid": "1a56e74c352dc237f3892ede6de55c10", "score": "0.6554295", "text": "def print_play(guess)\n puts \"\\n#{@current_player.name} entered #{guess}:\"\n puts \"\\n-------------\\nCurrent word: #{@fragment}\\n-------------\\n\"\n end", "title": "" }, { "docid": "b5b66771d2dab1c2a1c9ea66edf9d7bc", "score": "0.65309423", "text": "def phrase_show\n @print_guess = @guess_word.inject([]) { |a,element| a << element.dup }\n @print_guess.each { |letter| letter.gsub!((/\\w/), '_ ') }\n end", "title": "" }, { "docid": "727719d02c7e197763cb7c2a1e8d1fe5", "score": "0.65239406", "text": "def print\n output = \"Survey Answer: #{self.survey.title}<br>\"\n answers.each { |answer| output << answer.print }\n return output\n end", "title": "" }, { "docid": "b56317afcfd9a029d1a7d306b953619c", "score": "0.65162957", "text": "def output_word\n end", "title": "" }, { "docid": "f3938e253838dafab41b96d54871f262", "score": "0.6516223", "text": "def essay_writer(title, person, place, topic, date, thesis)\n print \"\\t #{title}: The life of #{person} can be described as impactful. #{topic} was changed forever and a legend was created. Unfortunately, #{person}'s life was cut short on #{date} in #{place}. #{thesis}\" \nend", "title": "" }, { "docid": "cd8aa39479bcacdf2e5494c9d8f454ed", "score": "0.650354", "text": "def say(words)\n puts words + '.'\nend", "title": "" }, { "docid": "cd8aa39479bcacdf2e5494c9d8f454ed", "score": "0.6503115", "text": "def say(words)\n puts words + '.'\nend", "title": "" }, { "docid": "22a5611db607a3ef5b855bd868a1708b", "score": "0.6495372", "text": "def sentence\n words = @start.sample # Pick random word, then keep appending connected words.\n while next_word = next_word_for(words[-@depth, @depth])\n words << next_word\n end\n words[0..-2].join(\" \") + words.last # Format the sentence.\n end", "title": "" }, { "docid": "d561758b2ca137787f23e95ec69e4fde", "score": "0.64931667", "text": "def says(words)\n puts words + \".\"\nend", "title": "" }, { "docid": "332f84de91bfa10304886890e23beb45", "score": "0.6491368", "text": "def sally(phrase)\n\tputs \"SALLY: #{phrase}\"\nend", "title": "" }, { "docid": "8d99a526db6f3eb42c65fa5231020b6a", "score": "0.64726084", "text": "def print_poem\n if @spelled == \"one\"\n puts \"One little monkey jumping on the bed, \"\n puts \"He fell off and bumped his head,\"\n puts \"Mama called the doctor and the doctor said, \"\n puts \"Get those monkeys right to bed!\"\n puts '-' * 10\n else\n puts \"#{@spelled.capitalize} little monkeys jumping on the bed, \\n\"\n puts \"One fell off and bumped his head,\"\n puts \"Mama called the doctor and the doctor said, \"\n puts \"No more monkeys jumping on the bed!\"\n puts '-' * 10\n end\n end", "title": "" }, { "docid": "4e31a3bac26ebfae61082d7239cd6118", "score": "0.64658177", "text": "def speak\n\t\tputs \"Ho Ho Ho, I'm a #{@gender}\"\n\tend", "title": "" }, { "docid": "252c3f05910f400cf5eb6370f9727cd8", "score": "0.6447409", "text": "def consequence_text(journ_outcomes)\n puts \"#{journ_outcomes.consequence}\".wrap\n end", "title": "" }, { "docid": "3178b966346a5ede0abbce8abe5757a3", "score": "0.6443295", "text": "def displayInfo(text)\n puts \"( - ) #{text}\"\n end", "title": "" }, { "docid": "3178b966346a5ede0abbce8abe5757a3", "score": "0.6443295", "text": "def displayInfo(text)\n puts \"( - ) #{text}\"\n end", "title": "" }, { "docid": "25e4828fcddf5f7b6d96fed744b13614", "score": "0.64284354", "text": "def speak\r\n p \"Ho, ho, ho! Haaaappy holidays!\" \r\nend", "title": "" }, { "docid": "94cda15a03ab03f75957e6b6bb8655b3", "score": "0.64095104", "text": "def say (text)\n puts text if debug\n end", "title": "" }, { "docid": "7731899258134630d0740d35a223abbe", "score": "0.6407543", "text": "def _pprint\n @text.join ' / '\n end", "title": "" }, { "docid": "0487cae94b4f1e8d137ca7ceadfb2a7d", "score": "0.64038104", "text": "def sentence n\n if n > 0\n puts \"this is sentence #{n}\"\n sentence n-1\n end\nend", "title": "" }, { "docid": "c5629a8c714327a0a430e965870fc353", "score": "0.6402574", "text": "def paragraph \n sentences(5)\n end", "title": "" }, { "docid": "a77a8e582b8f06daeb417460be52bad2", "score": "0.64008796", "text": "def yell_happily(words)\n\t\tputs words + \"!!!!!!\" + \" :)\"\n\tend", "title": "" }, { "docid": "9453d921f967f3c0fb5813c643c05c65", "score": "0.6400338", "text": "def introduce_yourself\n puts \"I am a #{speak}\"\n end", "title": "" }, { "docid": "10a0dbd40be2e6a2269c3d3aea88b676", "score": "0.63994205", "text": "def print(text)\n @output += %Q|#{text}\\n|\n puts text\n @output\n end", "title": "" }, { "docid": "4fd43e8a58a55b553b3e628e3db1f652", "score": "0.6396085", "text": "def display_word\n\t\tputs \n\t\t@word.hash_array.each do |letter_hash_array|\n\t\t\tif letter_hash_array[:is_revealed?] == false\n\t\t\t\tprint \"_\"\n\t\t\telse\n\t\t\t\tprint letter_hash_array[:letter]\n\t\t\tend\n\t\tend\n\t\tprint \"\\n\\n\"\n\tend", "title": "" }, { "docid": "61097b848da8eba6feae88f2aadc3d37", "score": "0.63903695", "text": "def say(words)\n puts \"#{words}\"\n end", "title": "" }, { "docid": "fb7dcb05c044f18819ae2dd48c4736a8", "score": "0.63875955", "text": "def print_out\n return \"\\n✳︎ #{@name.upcase} ✳︎\\n\" +\n \" ⭐︎ #{@name} is #{@distance_from_core} light years away from core.\\n\" +\n \" ⭐︎ The native species of #{@name} are #{@native_species}.\\n\" +\n \" ⭐︎ #{@name} has #{@moons} moons.\\n\" +\n \" ⭐︎ #{@name}'s primary export: #{@primary_export}.\\n\"\n end", "title": "" }, { "docid": "7deae239a42d52355a1e6df22b132705", "score": "0.6379373", "text": "def say(words)\n puts words + \".\"\nend", "title": "" }, { "docid": "f000c36e9dd2c90a38e4c400fc9ba303", "score": "0.6367317", "text": "def say(s)\n puts \"==> \" + s.to_s\nend", "title": "" }, { "docid": "04318acf4a9ad1d7d2c30524b101715e", "score": "0.6366592", "text": "def speak\n \"#{@name} says aff!\"\n end", "title": "" }, { "docid": "cdbffec025903f5f278a7a6f019543f3", "score": "0.63640743", "text": "def printText\n puts @text\n @choices.each do |choice|\n puts \"#{choice.indicator}. #{choice.text}\\n\"\n end\n puts \"\\n\"\n end", "title": "" }, { "docid": "e680de9b8a73f1e9e53daf2ab59fb422", "score": "0.63626426", "text": "def print\n\t#\t\tputs to_s\n\t\tend", "title": "" }, { "docid": "cc36821ebae458dd769770776187d014", "score": "0.63585097", "text": "def pretty_output\r\n\t\tputs \"The #{@face_value} of #{@suit}\"\r\n\tend", "title": "" }, { "docid": "6d4dda1400257da304fa33d9c90e1eff", "score": "0.63551456", "text": "def welcome \n puts \"(*BELLOWS...slash, hisssss...!whoooo's that in my river!*)\"\n print \"Oh hey, I'm Al'. Sorry, thought you were someone else. Come on over, you'll be crunching through your workload like an alligator in no time.\"\n puts \" What's your name?\"\nend", "title": "" }, { "docid": "bb20fde9792131f0ec7bbb53f4c4e97b", "score": "0.63517696", "text": "def print\n return \"\\t#{time} #{movie.title}(#{movie.genre.join(\", \")}, #{movie.year}).\" +\n \" #{halls} hall(s).\\n\"\n end", "title": "" }, { "docid": "31f4564b3f9bbfe86df9067e39b4e91b", "score": "0.63488555", "text": "def say(words)\n puts words + '.' ## <= We only make the change here!\nend", "title": "" }, { "docid": "110d7526a61e10052c650e9f453147f0", "score": "0.63444835", "text": "def output(s)\n puts s\n end", "title": "" }, { "docid": "d2d4e440039ec94920a6c8aa33c5b6ab", "score": "0.63419944", "text": "def setup\n @sentence = 'These dull boring cards are part of a chaotic board game.'\n end", "title": "" }, { "docid": "1e24ae979ad48c8def303bcaf1f89764", "score": "0.6336222", "text": "def speak\n \"#{@name} says arf!\"\n end", "title": "" }, { "docid": "12432dff9869112cd1413bb15fb60496", "score": "0.63339686", "text": "def say(str)\n\t\t\tputs \"#{str}, #{@name}\"\n\t\tend", "title": "" }, { "docid": "b81a52e167d1d335749f8176337a100d", "score": "0.6333832", "text": "def speak \n \"#{name} said something\"\n end", "title": "" }, { "docid": "0546f5b96b82d5e3989a4ef280e3298e", "score": "0.6332081", "text": "def display\n puts\n puts \"Spell name: #{self.name}\"\n puts \"Description: #{self.description}\"\n puts \"Level: #{self.level}\"\n puts \"School of Magic: #{self.school}\"\n puts \"Compatible Classes: #{self.classes}\"\n puts \"-----------------------------------\"\n end", "title": "" }, { "docid": "4e3e814ded852415ac0d4dc5b1f79640", "score": "0.63289523", "text": "def display msg\n print msg, \"\\n\"\n end", "title": "" }, { "docid": "72149510a8c0134f5f7bfd6ec0239e6b", "score": "0.6327698", "text": "def print_post\n\t\tif @sponsor == \"yes\"\n\t\t\tputs \"*******\" + @title + \"*******\"\n\t\t\tputs \"********\"\n\t\t\tputs @text\n\t\t\tputs \"--------\"\n\t\telse\n\t\tputs @title\n\t\tputs \"********\"\n\t\tputs @text\n\t\tputs \"--------\"\n\tend\nend", "title": "" }, { "docid": "b136f4d41d9734bb4c5d535d4c1d85ea", "score": "0.63188106", "text": "def say *words\n $stdout.puts(Rib.prepare(words))\n end", "title": "" }, { "docid": "b136f4d41d9734bb4c5d535d4c1d85ea", "score": "0.63188106", "text": "def say *words\n $stdout.puts(Rib.prepare(words))\n end", "title": "" }, { "docid": "9f1190e8a7029886ed041a725630165d", "score": "0.6309191", "text": "def greet\n say doctor_says(\"Hello, this is Dr. Phil. If someone out there doesn't \"\\\n \"agree with me, then somewhere a village is missing their idiot.\", false)\n say doctor_says(\"I'll be asking you a few questions now.\", false)\n puts\n end", "title": "" }, { "docid": "f5fecab345b01f684ea9fc2a6c0742cb", "score": "0.6303277", "text": "def say\n\t\tputs \"#{@hello} #{@world}!\" \n\tend", "title": "" }, { "docid": "704046fb9863c83e95d8399901c8b684", "score": "0.630304", "text": "def chewing\n\t\tputs \"oh my sweetest! you're destroying my thing! !!!NO!!! ::act super scary:: ::maybe even flip the pup onto it's back:: ::growling is allowed:: ::suggest an alternative chew toy:: ::let the pup believe you are still angry for 2-30min depending on the severity of the incident:: ::be BEST FRIENDS again, make sure your dog knows that you love it more than anything else in the world::\"\n\tend", "title": "" }, { "docid": "3c1160a27a0b6b93f958d7c98511165d", "score": "0.6298443", "text": "def detail\n puts \" | #{self.str_add} | \\n #{self.str_count} | \\n #{self.str_reverse} | \\n #{self.str_upcase} | \\n #{self.str_split} | \\n #{self.str_remove} | \\n #{self.str_spaces} | \\n #{self.str_squeeze} | \\n #{self.str_center} | \"\n end", "title": "" }, { "docid": "c836c455ac6010cc0adeb450bfdae057", "score": "0.6296291", "text": "def speak\r\n\t\t#Print\r\n\t\tp \"Ho, ho ,ho! Haaaappy Holidays!\"\r\n\t#End method\r\n\tend", "title": "" }, { "docid": "903bdd804e37bee59965c106571550d3", "score": "0.6295807", "text": "def output_word\n print guess_word\n end", "title": "" }, { "docid": "d1e0fe55dd961acc9a586ca51668fd73", "score": "0.6294278", "text": "def muricah(text)\n phrase = \"Only in America!\"\n output = text.to_s + \" \" + phrase\n puts output\nend", "title": "" }, { "docid": "44d226b6e7e4e526cb48f92c1d717b3f", "score": "0.6292151", "text": "def show\n puts \"DFLKJL:KJSDFLJ:LSDFJLSDJFLSDJKFLSDJFL:SDFKJL:SDFJLSJDFLJKDLFJSDFL\"\n end", "title": "" }, { "docid": "47db689d787e49dccea05a1fd61d6535", "score": "0.62903386", "text": "def say(words)\n puts words\n end", "title": "" }, { "docid": "686a5d7b4e4c388d621e8cf5606bcf63", "score": "0.6288087", "text": "def echo( word )\n\n\tword\n\nend", "title": "" }, { "docid": "b03a0239ab3abc4a5bcee12d859657b9", "score": "0.6285837", "text": "def display(msg)\n\t\t\tself.print(@text = msg)\n\t\tend", "title": "" }, { "docid": "dfd19bfa601168070afbc3f5fa8c1533", "score": "0.62847257", "text": "def print\n str = self.map { |t| t.text }.join \"\\n\"\n # the result must end with a newline!\n str << \"\\n\"\n end", "title": "" }, { "docid": "5a5ed13e2803921efb16881fb387cc78", "score": "0.6283805", "text": "def speak\n puts \"Ho, ho, ho! Haaaaapy holidays!\"\n end", "title": "" }, { "docid": "fdeacc0e8d2c4a847cf28177e402cec4", "score": "0.62808204", "text": "def display_word\n dash_string = \"\"\n @disp_letters.each do |l|\n dash_string += l\n end\n puts dash_string\n end", "title": "" }, { "docid": "59440697dae89911f246552915fed764", "score": "0.6280024", "text": "def display\n \t\tputs \"#{@body}\\n\\n Guessed letters: #{past_letters.split(\"\").join(\"-\")}\\n Correct letters so far: #{@underscored_secret.split(\"\").join(\" \")}\"\n end", "title": "" }, { "docid": "1b1431f8dfe69e0a74d9daca0dc683ba", "score": "0.6278737", "text": "def output(s)\n puts(s)\n end", "title": "" }, { "docid": "1b1431f8dfe69e0a74d9daca0dc683ba", "score": "0.6278737", "text": "def output(s)\n puts(s)\n end", "title": "" }, { "docid": "1b1431f8dfe69e0a74d9daca0dc683ba", "score": "0.6278737", "text": "def output(s)\n puts(s)\n end", "title": "" }, { "docid": "1b1431f8dfe69e0a74d9daca0dc683ba", "score": "0.6278737", "text": "def output(s)\n puts(s)\n end", "title": "" }, { "docid": "1b1431f8dfe69e0a74d9daca0dc683ba", "score": "0.6278737", "text": "def output(s)\n puts(s)\n end", "title": "" }, { "docid": "4916ce0855f42d1dab88f5f558e617ba", "score": "0.6275439", "text": "def joke1\n puts(\"A peanut was walking down the street.... he was a-salt-ed.\")\nend", "title": "" } ]
0115298748603631a688327fbc99e5a3
Delete the specified component
[ { "docid": "661d20eb003272fcbceaee1ce822553a", "score": "0.789638", "text": "def delete_component(opts)\n delete_workflow(opts)\nend", "title": "" } ]
[ { "docid": "a78141e503643a3d05fe769cd8d5f2b4", "score": "0.8672886", "text": "def delete(component)\n Backlogjp.base._command \"deleteComponent\", Container.get_id(component)\n end", "title": "" }, { "docid": "506b7eb27a52595db725f464b095ed24", "score": "0.8134579", "text": "def destroy\n ComponentCreator.delete(id: @component.id)\n end", "title": "" }, { "docid": "f573cdebf234d90a7461df20f9602cbe", "score": "0.7972055", "text": "def destroy\n @component = Component.find(params[:id])\n @component.destroy\n\tredirect_to admin_session_path\n end", "title": "" }, { "docid": "dff5148aff326940ef89e8dbdd3f69c7", "score": "0.7826282", "text": "def destroy\n @component = Component.find(params[:id])\n @component.destroy\n\n respond_to do |format|\n format.html { redirect_to components_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "50356a61623121386a84355eebdef9ab", "score": "0.774182", "text": "def destroy\n @componente = Componente.find(params[:id])\n if @componente.destroy\n rwt_ok\n else\n rwt_err_messages(@componente)\n end\n end", "title": "" }, { "docid": "98e8858c88e29365bcad1e92738c28d1", "score": "0.773861", "text": "def destroy\n @component = Component.find(params[:id])\n @component.destroy\n \n respond_to do |format|\n format.html { redirect_to(components_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "02f4141989f31f45c81cb62a17b25213", "score": "0.7712241", "text": "def destroy\n\t\t@component = Component.find(params[:id])\n\t\t@component.destroy\n\n\t\trespond_to do |format|\n\t\t format.html { redirect_to components_url }\n\t\t format.json { head :no_content }\n\t\tend\n end", "title": "" }, { "docid": "cf0ce7605d07d9e6625cf26b00369dfb", "score": "0.7620315", "text": "def destroy\n @component = Component.find(params[:id])\n @component.destroy\n\n respond_to do |format|\n format.html { redirect_to components_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "cf0ce7605d07d9e6625cf26b00369dfb", "score": "0.7620315", "text": "def destroy\n @component = Component.find(params[:id])\n @component.destroy\n\n respond_to do |format|\n format.html { redirect_to components_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "cf0ce7605d07d9e6625cf26b00369dfb", "score": "0.7620315", "text": "def destroy\n @component = Component.find(params[:id])\n @component.destroy\n\n respond_to do |format|\n format.html { redirect_to components_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "cf0ce7605d07d9e6625cf26b00369dfb", "score": "0.76195264", "text": "def destroy\n @component = Component.find(params[:id])\n @component.destroy\n\n respond_to do |format|\n format.html { redirect_to components_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "873c3079d7ddf4e42e74ac83e6fb484d", "score": "0.76186854", "text": "def destroy\n @component = Component.find(params[:id])\n @component.destroy\n\n respond_to do |format|\n format.html { redirect_to(components_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "873c3079d7ddf4e42e74ac83e6fb484d", "score": "0.76186854", "text": "def destroy\n @component = Component.find(params[:id])\n @component.destroy\n\n respond_to do |format|\n format.html { redirect_to(components_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "873c3079d7ddf4e42e74ac83e6fb484d", "score": "0.76186854", "text": "def destroy\n @component = Component.find(params[:id])\n @component.destroy\n\n respond_to do |format|\n format.html { redirect_to(components_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "bf469ab68fd67eda712b3e5f2930ceac", "score": "0.76076657", "text": "def destroy\n @component.destroy\n respond_to do |format|\n format.html { redirect_to components_url, notice: \"Component deleted\" }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c7d22f911cf7b0ce3f32679882847d65", "score": "0.75591505", "text": "def delete\n self.class.manager.delete_component(self)\n self\n end", "title": "" }, { "docid": "5f7c3d5366acd6cc81bf2a2a3b8098c6", "score": "0.7524148", "text": "def destroy\n @component = current_cms.components.find(params[:id])\n @component.destroy\n\n respond_to do |format|\n format.html { redirect_to(big_cms_components_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "b68546d52b6c0c080cd3351ca27bcd15", "score": "0.74871004", "text": "def destroy\n @component.destroy\n respond_to do |format|\n format.html { redirect_to group_components_url, notice: 'component was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0b25dd631f07ce9099f12da1a9dfdb61", "score": "0.74764955", "text": "def destroy\n @component = Component.find(params[:id])\n begin\n @component.destroy\n end\n respond_to do |format|\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "76ac007d1970cd528cceed28fc900bd1", "score": "0.74044716", "text": "def destroy\n @component.destroy\n respond_to do |format|\n format.html { redirect_to admin_components_url, notice: 'Товар был успешно удалён.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8c3c3ae8fc9106d0c5dc2fa76680f33a", "score": "0.7326281", "text": "def component_remove(component_name, entity_id)\n @entities[entity_id].delete(component_name)\n end", "title": "" }, { "docid": "710b0f4faaf8242443f46d042b4184c3", "score": "0.73141384", "text": "def destroy\n @component = Admin::Component.find(params[:id])\n @component.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_theme_url(session[:theme_id]) }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "3adc46e5d4c5244e39a65f1ba29e4529", "score": "0.7308293", "text": "def destroy\n @component.destroy\n respond_to do |format|\n format.html { redirect_to components_url, notice: 'Component was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "3adc46e5d4c5244e39a65f1ba29e4529", "score": "0.7308293", "text": "def destroy\n @component.destroy\n respond_to do |format|\n format.html { redirect_to components_url, notice: 'Component was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "5b9521d43a92194931843d37a9b22a36", "score": "0.72901624", "text": "def destroy\n @component.destroy\n respond_to do |format|\n format.html { redirect_to components_url, notice: \"Component was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "35b2a8adf172ef61b8f570f6a279dff9", "score": "0.72607833", "text": "def destroy\n @component = Component.find(params[:id])\n @component.destroy\n\n respond_to do |format|\n format.html { redirect_to edit_user_system_sys_config_path(@user, @system, @sys_config) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "87fb647d9d74fcdf18c991a5ff8bd812", "score": "0.72027475", "text": "def destroy\n @eg_component.destroy\n respond_to do |format|\n format.html { redirect_to eg_components_url, notice: 'Eg component was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d9e3455616db101ebe9a50fee5f37313", "score": "0.7159977", "text": "def destroy\n @component.destroy\n respond_to do |format|\n format.html do\n redirect_to bridge_components_url(@bridge),\n notice: I18n.t('controller.common.success_on_destroy', model_name: Component.model_name.human)\n end\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "158712fe5f14f6dc06d4f91380909457", "score": "0.7126934", "text": "def destroy\n\tif user_type == 'admin'\n\t\t@component = Component.find(params[:id])\n\t\t@component.destroy\n\n\t\trespond_to do |format|\n\t\t format.html { redirect_to components_url }\n\t\t format.json { head :no_content }\n\t\tend\n\telse\n\t\tredirect_to '/404'\n\tend\n end", "title": "" }, { "docid": "1702c8b1e279acc192163cfa9a397de9", "score": "0.7120772", "text": "def destroy\n @component.destroy\n respond_to do |format|\n format.html { redirect_to component_ram_modules_url, notice: 'Component was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "bafc5138d2d153819882ccc2eea3f78c", "score": "0.70886993", "text": "def destroy\n @iogroupcomponent = Iogroupcomponent.find(params[:id])\n @iogroupcomponent.destroy\n redirect_to iogroup_iogroupcomponents_path(@iogroupcomponent.iogroup.id),\n :notice => 'IO-Gruppen-Komponente wurde gelöscht.'\n end", "title": "" }, { "docid": "15ba63f754ba2789bca14f07e239d8ad", "score": "0.70816", "text": "def destroy\n @registered_component.destroy\n respond_to do |format|\n format.html { redirect_to registered_components_url, notice: 'Registered component was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "75d02ee0b248506a4e66e58209cdfe16", "score": "0.70509064", "text": "def destroy\n @standard_component = StandardComponent.find(params[:id])\n @standard_component.destroy\n\n respond_to do |format|\n format.html { redirect_to standard_components_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d4d973137edf782e86fac52ee84315e8", "score": "0.7048194", "text": "def destroy\n @comp.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "09af7017a57a6d0a96ead605c829addc", "score": "0.69755375", "text": "def destroy\n @component.destroy\n respond_to do |format|\n format.html { redirect_to projects_url, notice: 'Компонент успешно удален.' }\n format.json { head :no_content }\n end\n current_user.current_state = CurrentState.first\n end", "title": "" }, { "docid": "04d332580ca05bc016aefcfdd6a58ca4", "score": "0.69704306", "text": "def destroy\n @componente.destroy\n respond_to do |format|\n format.html { redirect_to componentes_url, notice: 'Componente was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2e7481198a1fd595369679f1899728a5", "score": "0.6960117", "text": "def destroy\n @component_model = ComponentModel.find(params[:id])\n @component_model.destroy\n\n respond_to do |format|\n format.html { redirect_to component_models_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "80f39f6c1d9c75973d4f04f06f2b669d", "score": "0.69599396", "text": "def destroy\n @allergen_component.destroy\n respond_to do |format|\n format.html { redirect_to allergen_components_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "599c4849686fc7f969ff4af4b18bfd2b", "score": "0.6948689", "text": "def destroy\n @project_component = ProjectComponent.find(params[:id])\n @project_component.destroy\n\n respond_to do |format|\n format.html { redirect_to(project_components_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "ff5a466fbd13b9ed0119d6bfed4cde05", "score": "0.6939696", "text": "def destroy\n @sub_component.destroy\n respond_to do |format|\n format.html { redirect_to sub_components_url, notice: 'Sub component was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e078083c4f25b0c37f6f261d3e61af8d", "score": "0.6923712", "text": "def destroy\n @component_model = ComponentModel.find(params[:id])\n @component_model.destroy\n\n respond_to do |format|\n format.html { redirect_to component_models_url }\n # format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2f77bf4b7ef5da8861f6f5a24cc8d5f3", "score": "0.6901093", "text": "def destroy\n @assessment_component = AssessmentComponent.find(params[:id])\n @assessment_component.destroy\n\n respond_to do |format|\n format.html { redirect_to assessment_components_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "5e8ed4835977f4d901aab4e67d0c7a89", "score": "0.68392503", "text": "def destroy\n @device_component.destroy\n respond_to do |format|\n format.html { redirect_to device_components_url, notice: 'Device component was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "21640551085563d3fa378eb26ac68bbe", "score": "0.68217963", "text": "def componentes_destroy\n @componentes_produto = ComponentesProduto.find(params[:id])\n @componentes_produto.destroy\n respond_to do |format|\n format.html { redirect_to :back, notice: 'Componente foi deletado com sucesso.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "521274dc8c3fe60c01d104d22465a3a2", "score": "0.6814353", "text": "def destroy\n @group_component.destroy\n respond_to do |format|\n format.html { redirect_to group_components_url, notice: 'Group component was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "ee5d57f33f87efe7e691cd7dc2f343ca", "score": "0.68020284", "text": "def destroy\n @atributos_componente.destroy\n respond_to do |format|\n format.html { redirect_to atributos_componentes_url, notice: 'Atributos componente was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "76e8823ec618b6aabd02914247b5bd96", "score": "0.6797056", "text": "def destroy\n @product_assembly_component.destroy\n respond_to do |format|\n format.html { redirect_to product_assembly_components_url, notice: 'Product assembly component was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "df73a3f0fb7cf3e10c8e6e490cf88ee8", "score": "0.6793803", "text": "def delete(user_name, repo_name, component_id, params={})\n _update_user_repo_params(user_name, repo_name)\n _validate_user_repo_params(user, repo) unless user? && repo?\n\n _validate_presence_of component_id\n normalize! params\n\n delete_request(\"/1.0/repositories/#{user}/#{repo.downcase}/issues/components/#{component_id}\", params)\n end", "title": "" }, { "docid": "697b81cab702bbffd4aa5b4ad4c79f8b", "score": "0.67928916", "text": "def destroy\n @upper_component.destroy\n respond_to do |format|\n format.html { redirect_to upper_components_url, notice: 'Upper component was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d4b17be543375db5f9b9b25991a917d2", "score": "0.67895526", "text": "def destroy\n @subcomponent.destroy\n respond_to do |format|\n format.html { redirect_to subcomponents_url, notice: 'Subcomponent was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7aee9c9d22a9b1f338e33de75bac34ba", "score": "0.6786895", "text": "def destroy\n @componenttype = Componenttype.find(params[:id])\n @componenttype.destroy\n\n respond_to do |format|\n format.html { redirect_to componenttypes_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "5b4f4fc489465786d8f637b67041fe69", "score": "0.6784081", "text": "def rest__delete_component_using_workflow\n assembly = ret_assembly_instance_object()\n params_hash = ret_params_hash(:commit_msg, :task_action, :task_params, :start_assembly, :skip_violations, :noop_if_no_action)\n\n params_hash[:task_params] = params_hash[:task_params].is_a?(String) ? Hash.new : params_hash[:task_params]\n\n node_id = ret_node_id(:node_id, assembly) if ret_request_params(:node_id)\n\n component_id = ret_non_null_request_params(:component_id)\n assembly_id = assembly.id()\n cmp_full_name = ret_request_params(:cmp_full_name)\n\n # cmp_name, namespace = ret_non_null_request_params(:component_id, :namespace)\n cmp_name, namespace = ret_request_params(:component_id, :namespace)\n\n assembly_idh = assembly.id_handle()\n cmp_mh = assembly_idh.createMH(:component)\n\n if cmp_full_name && node_id\n component = Component.ret_component_with_namespace_for_node(cmp_mh, cmp_name, node_id, namespace, assembly)\n fail ErrorUsage.new(\"Component with identifier (#{namespace.nil? ? '' : namespace + ':'}#{cmp_name}) does not exist!\") unless component\n\n cmp_idh = component.id_handle()\n else\n cmp_idh = id_handle(component_id, :component)\n params_hash[:cmp_idh] = cmp_idh\n end\n opts = Opts.new(delete_action: 'delete_component', delete_params: [cmp_idh, node_id])\n\n rest_ok_response assembly.exec__delete_component(params_hash, opts)\n end", "title": "" }, { "docid": "86cf30b6c3a46f93fef18a4429ee7924", "score": "0.6778192", "text": "def destroy\n @component_data = ComponentData.find(params[:id])\n @component_data.destroy\n\n respond_to do |format|\n format.js { render :action => \"destroy_component\" }\n end\n end", "title": "" }, { "docid": "0d873dd8d5b79526fd361eb9973a0450", "score": "0.67733496", "text": "def destroy\n @component_type.destroy\n respond_to do |format|\n format.html { redirect_to admin_component_types_url, notice: 'Раздел был успешно удалён.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2eb34e18a05c3bcf6a8e742f8de0c2ce", "score": "0.67727065", "text": "def destroy\n #Finds selected component\n @component = Component.find(params[:id])\n #creates an array of all components\n @all_components = Component.all\n #creates an empty hash\n @all_components_hash = {}\n #call to function to destroy component\n destroy_component(@component)\n respond_to do |format|\n format.html { redirect_to '/admin' }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "e02e71cfae9025aa3cdd2e49860121f6", "score": "0.675984", "text": "def destroy\n @component_content.destroy\n respond_to do |format|\n format.html { redirect_to component_contents_url, notice: 'Component content was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2c257c74a14d043f57cb7861487a8690", "score": "0.6759749", "text": "def destroy\n @component_type = ComponentType.find(params[:id])\n @component_type.destroy\n\n respond_to do |format|\n format.html { redirect_to component_types_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "08cf09fa04921400955ec726852429aa", "score": "0.6750324", "text": "def destroy\n @workflow_component = WorkflowComponent.find(params[:id])\n @workflow_component.destroy\n\n respond_to do |format|\n format.html { redirect_to workflow_components_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9879fe43311397bddf8ce4c3af5cb77d", "score": "0.6735976", "text": "def destroy_component(component)\n if(component == nil || component.id == nil)\n return\n end\n for child in component.components\n if(child.component_parents.length < 2)\n #calls itself to destroy children\n destroy_component(child)\n end\n end\n #destroy component\n component.destroy\n end", "title": "" }, { "docid": "3f6be473eb481d1114540d0709f13a21", "score": "0.6731367", "text": "def destroy\n @description_of_component.destroy\n respond_to do |format|\n format.html { redirect_to description_of_components_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "35a6b6c26371d701158dc11595064a63", "score": "0.6672066", "text": "def destroy\n component_authorize(@component, \"destroy\", @component.componentable_type.singularize.downcase)\n\n if @component.destroy_and_log_work(current_user.id)\n head :no_content\n end\n end", "title": "" }, { "docid": "823007132bd12a9e883c6300afcc38bb", "score": "0.6645837", "text": "def destroy\n @component_tag.destroy\n respond_to do |format|\n format.html { redirect_to component_tags_url, notice: 'Component tag was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4b39bbce27b9407ef00033337f10d0b0", "score": "0.66328686", "text": "def destroy\n @component_in_game.destroy\n respond_to do |format|\n format.html { redirect_to component_in_games_url, notice: 'Component in game was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b60ae79620d61871b80726bbc63cfba3", "score": "0.65884393", "text": "def destroy\n @lesson_component.destroy\n respond_to do |format|\n format.html { redirect_to lesson_components_url, notice: 'Lesson component was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2097d97f73915a2177723ee66b3dd676", "score": "0.65810835", "text": "def destroy\n @stack_component.destroy\n respond_to do |format|\n format.html { redirect_to stack_components_url, notice: 'Stack component was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "adb88b58f2c9b4f20d050116f835a8e1", "score": "0.65810275", "text": "def destroy\n @component_attachment.destroy\n respond_to do |format|\n format.html { redirect_to component_attachments_url, notice: 'Component attachment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "dc42faebbd9bede82aff51fe1c1be77f", "score": "0.657581", "text": "def destroy\n @componente_modelo = ComponenteModelo.find(params[:id])\n @componente_modelo.destroy\n\n respond_to do |format|\n format.html { redirect_to componentes_modelos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "fb1dcb62ccee570ec412f9a16cdbba2d", "score": "0.65754896", "text": "def destroy\n @component = Component.find(params[:id])\n @parent = @component.parent\n @component.destroy\n\n respond_to do |format|\n format.html { \n if params.has_key? :redirect\n redirect_to(params[:redirect])\n elsif @parent.nil?\n redirect_to(project_components_url(@project)) \n else\n redirect_to(project_component_url(@project, @parent)) \n end\n }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "3608f278137488eadea827879c64c088", "score": "0.65702724", "text": "def destroy\n @system_component.destroy\n respond_to do |format|\n format.html { redirect_to [:admin, @system] }\n format.xml { head :ok }\n format.js\n end\n website.add_log(user: current_user, action: \"Deleted system_component: #{@system_component.name}\")\n end", "title": "" }, { "docid": "cdcc34dbca269cf9c79b421693a38072", "score": "0.6548708", "text": "def destroy\n @page_component.destroy\n respond_to do |format|\n format.html { redirect_to page_components_url, notice: 'Page component was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e8d607be0745e9c4d442829bc9b19213", "score": "0.6516997", "text": "def destroy\n @price_of_component.destroy\n respond_to do |format|\n format.html { redirect_to price_of_components_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "830919a0b5b102f1c9c504fe36d9336d", "score": "0.6493982", "text": "def destroy\n @componentes_juego.destroy\n respond_to do |format|\n format.html { redirect_to componentes_juegos_url, notice: 'Componentes juego was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "906c0c2970f21fc4bd655a4bc3bbaaf5", "score": "0.6489212", "text": "def delete_child(product)\r\n\t\tproduct = product.is_a?(Product) ? product.id : product.to_i\r\n\t\tcomponents.delete(components.find_by_child_id(product))\r\n\tend", "title": "" }, { "docid": "fc197926298dd4e7125584258ea08634", "score": "0.6470633", "text": "def destroy\n @partner_org_component = PartnerOrgComponent.find(params[:id])\n @partner_org_component.destroy\n\n respond_to do |format|\n format.html { redirect_to partner_org_components_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "94ef6e70539fe69a68f57e566e9c7160", "score": "0.645197", "text": "def destroy\n @component_subtype.destroy\n respond_to do |format|\n format.html { redirect_to admin_component_subtypes_url, notice: 'Подраздел был успешно удалён.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7025de7a6d8b0c83eedab20407b07360", "score": "0.64506435", "text": "def destroy\n @component = Component.find(params[:id])\n @aim_template = @component.aim_template\n @component.destroy\n respond_to do |format|\n format.html { redirect_to(components_url) }\n format.xml { head :ok }\n format.js { render :file => '/main/update_attribute.js.erb' }\n end\n end", "title": "" }, { "docid": "a9a4009217f9b7a2f3a9697c8789c239", "score": "0.6439519", "text": "def destroy\n @story_component.destroy\n respond_to do |format|\n format.html { redirect_to story_components_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0c874bb9452ec5b8ee992eaf6afa30cd", "score": "0.64154273", "text": "def destroy\n authorize! :destroy, @component\n @item = @component.item\n @component.destroy\n respond_to do |format|\n format.html { redirect_to @item, notice: 'Component was successfully destroyed.' }\n format.json { render action: 'show', status: :created, location: @item }\n format.js\n end\n end", "title": "" }, { "docid": "848871d8f2f941404af88ed4ac27ffb4", "score": "0.6413148", "text": "def destroy\n @component_widget_variable = ComponentWidgetVariable.find(params[:id])\n @component_widget_variable.destroy\n\n respond_to do |format|\n format.html { redirect_to component_widget_variables_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8fb6ea467311826a1e2278060495b772", "score": "0.64116436", "text": "def destroy\n @components_cog = Components::Cog.find(params[:id])\n @components_cog.destroy\n\n respond_to do |format|\n format.html { redirect_to(components_cogs_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "7763154f83e5e655af7b67a746910343", "score": "0.6409025", "text": "def destroy\n @component_category_value.destroy\n respond_to do |format|\n format.html { redirect_to admin_component_category_values_url, notice: 'Компонент: Подошва был успешно удалён.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "584648c8ce3ab98dc302790d5201f064", "score": "0.6404043", "text": "def destroy\n @component_package = ComponentPackage.find(params[:id])\n @component_package.destroy\n\n respond_to do |format|\n format.html { redirect_to(component_packages_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "584648c8ce3ab98dc302790d5201f064", "score": "0.6404043", "text": "def destroy\n @component_package = ComponentPackage.find(params[:id])\n @component_package.destroy\n\n respond_to do |format|\n format.html { redirect_to(component_packages_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "2fd4d8e79cf73ccab149ef5974aae22c", "score": "0.6381397", "text": "def destroy\n @text_component.destroy\n respond_to do |format|\n format.html { redirect_to text_components_url, notice: 'Text component was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "99633d412ee89adcc800ce650c2e272a", "score": "0.63684386", "text": "def destroy\n @logcomponent.destroy\n respond_to do |format|\n format.html { redirect_to logcomponents_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "3e77717ee7c55eb3c9e56adff47ee0a1", "score": "0.6365796", "text": "def destroy\n @memory_component.destroy\n respond_to do |format|\n format.html { redirect_to memory_components_url, notice: 'Memory component a bien été supprimé.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c4f3f09a21c91864049468e1aae0007d", "score": "0.6359042", "text": "def destroy\n @component_comment.destroy\n respond_to do |format|\n format.html { redirect_to component_comments_url, notice: 'Component comment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9c4c7aa22997b378fe40799b18a6eb5f", "score": "0.63463706", "text": "def delete(el)\n end", "title": "" }, { "docid": "68d7ff67ab3de011ff2f85812a5a9e4b", "score": "0.63367856", "text": "def destroy\n @component_court.destroy\n respond_to do |format|\n format.html { redirect_to component_courts_url, notice: 'Component court was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0094bff8c5740fa6dcc5b1673f0b3cfd", "score": "0.63154936", "text": "def destroy\n @report_component = ReportComponent.find(params[:id])\n @report_component.destroy\n\n respond_to do |format|\n format.html { redirect_to report_components_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4b932c771949d69de17409ddd34838ba", "score": "0.63150525", "text": "def destroy\n @complejo = Complejo.find(params[:id])\n @complejo.destroy\n\n respond_to do |format|\n format.html { redirect_to(complejos_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "a46a13e580adc6d96dec1df80998664c", "score": "0.6313125", "text": "def destroy\n @component_result = ComponentResult.find(params[:id])\n @component_result.destroy\n\n respond_to do |format|\n format.html { redirect_to(component_results_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "d0fb441073fc096098d65df448b3a12f", "score": "0.63127273", "text": "def remove_component_link(base_component, dep_component, opts = {})\n link_name = ComponentLink.find_and_check_link_name(base_component, dep_component, link_name: opts[:link_name])\n ComponentLink::Factory.new(self, base_component.id_handle, dep_component.id_handle, link_name).remove?\n update_dsl\n end", "title": "" }, { "docid": "244c8f3b219add86f7698afd71bc35d9", "score": "0.629479", "text": "def destroy\n @components_pedal = Components::Pedal.find(params[:id])\n @components_pedal.destroy\n\n respond_to do |format|\n format.html { redirect_to(components_pedals_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "39ae3ccdc96610836ff85ec334a82bfe", "score": "0.6291272", "text": "def delete(model, id)\n object = model.find_by_id(id)\n if object\n object.delete\n redirect \"/#{@component.name.downcase}/#{model.name.downcase}\"\n else\n not_found \"Record ##{id} not found for model #{model.name} \" +\n \"in component #{@component.name}\"\n end\n end", "title": "" }, { "docid": "153e5161f9e943c8531c018cf8458eab", "score": "0.62866163", "text": "def destroy\n @sallary_component_detail.destroy\n respond_to do |format|\n format.html { redirect_to sallary_component_details_url, notice: 'Sallary component detail was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e2c92a9499c43bd1f7cabc33dfebe81b", "score": "0.6278596", "text": "def destroy\n componente = Componente.find_by_componente_categoria_id(@componente_categoria.id)\n if(componente.blank?)\n if @componente_categoria.destroy\n flash.notice = \"Se ha eliminado la categoria #{@componente_categoria.nombre}.\"\n index\n else\n flash.alert = \"No se ha podido eliminar la categoria #{@componente_categoria.nombre}.\"\n end\n else\n flash.notice = \"No se ha podido eliminar #{@componente_categoria.nombre}, porque el componente #{componente.nombre} pertenece a esta categoria.\"\n index\n end\n end", "title": "" }, { "docid": "85731848a0e037564c3713a67c422435", "score": "0.6278453", "text": "def delete\n #TODO\n end", "title": "" }, { "docid": "07321c1a277eb3831bd1af2c103ae543", "score": "0.6274538", "text": "def destroy\n @component_category_type.destroy\n respond_to do |format|\n format.html { redirect_to admin_component_category_types_url, notice: 'Подраздел: Подошва был успешно удалён.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "3fda30304e0250b22cf3689c3281411f", "score": "0.624884", "text": "def destroy\n @components_handlebar = Components::Handlebar.find(params[:id])\n @components_handlebar.destroy\n\n respond_to do |format|\n format.html { redirect_to(components_handlebars_url) }\n format.xml { head :ok }\n end\n end", "title": "" } ]
0e75a83ea8a6bd4f209620ea729585b4
rubocop:disable Metrics/MethodLength rubocop:disable Metrics/AbcSize
[ { "docid": "a73dc35df172768955e436e72fb18b9f", "score": "0.0", "text": "def display_board(brd, player_score, computer_score)\n system 'clear'\n prompt_msg(\"You are #{PLAYER_MARKER}. Computer is #{COMPUTER_MARKER}\")\n prompt_msg(\"Win #{ROUNDS_TO_WIN} matches to win the game!\")\n prompt_msg(\"Score: Player #{player_score} Vs. Computer #{computer_score}\")\n puts \"\"\n puts \" | |\"\n puts \" #{brd[1]} | #{brd[2]} | #{brd[3]}\"\n puts \" | |\"\n puts \"-----+-----+-----\"\n puts \" | |\"\n puts \" #{brd[4]} | #{brd[5]} | #{brd[6]}\"\n puts \" | |\"\n puts \"-----+-----+-----\"\n puts \" | |\"\n puts \" #{brd[7]} | #{brd[8]} | #{brd[9]}\"\n puts \" | |\"\n puts \"\"\nend", "title": "" } ]
[ { "docid": "33e1db3c06643dd523dcc31fccf3a005", "score": "0.64725196", "text": "def used; end", "title": "" }, { "docid": "33e1db3c06643dd523dcc31fccf3a005", "score": "0.64725196", "text": "def used; end", "title": "" }, { "docid": "b6b2bcc0062aeb115edab7b10cbe6930", "score": "0.63806415", "text": "def desired; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", "score": "0.62897706", "text": "def bodystmt; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", "score": "0.62897706", "text": "def bodystmt; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", "score": "0.62897706", "text": "def bodystmt; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", "score": "0.62897706", "text": "def bodystmt; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", "score": "0.62897706", "text": "def bodystmt; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", "score": "0.62897706", "text": "def bodystmt; end", "title": "" }, { "docid": "6ab77a9219ee157923bc58599ba6aa77", "score": "0.6280021", "text": "def in_use; end", "title": "" }, { "docid": "6ab77a9219ee157923bc58599ba6aa77", "score": "0.6280021", "text": "def in_use; end", "title": "" }, { "docid": "b7567a2a68cade31f2360723a4c42dc7", "score": "0.6267469", "text": "def used_by; end", "title": "" }, { "docid": "3660c5f35373aec34a5a7b0869a4a8bd", "score": "0.62282014", "text": "def implementation; end", "title": "" }, { "docid": "3660c5f35373aec34a5a7b0869a4a8bd", "score": "0.62282014", "text": "def implementation; end", "title": "" }, { "docid": "3660c5f35373aec34a5a7b0869a4a8bd", "score": "0.62282014", "text": "def implementation; end", "title": "" }, { "docid": "3660c5f35373aec34a5a7b0869a4a8bd", "score": "0.62282014", "text": "def implementation; end", "title": "" }, { "docid": "3660c5f35373aec34a5a7b0869a4a8bd", "score": "0.62282014", "text": "def implementation; end", "title": "" }, { "docid": "58e2e07d11b107b6864a328f2187e248", "score": "0.6217041", "text": "def apop?; end", "title": "" }, { "docid": "2290804b238fc95bfd6b38f87c6d2895", "score": "0.60633767", "text": "def override; end", "title": "" }, { "docid": "005e6fc140cba1f79535dcb415d4bcd9", "score": "0.5944528", "text": "def strategy; end", "title": "" }, { "docid": "005e6fc140cba1f79535dcb415d4bcd9", "score": "0.5944528", "text": "def strategy; end", "title": "" }, { "docid": "170e7cc6f3b91fc8d88704f0d36db709", "score": "0.5927341", "text": "def initialize; super; end", "title": "" }, { "docid": "2811397aefca145cecd731fd0748b1e6", "score": "0.59169203", "text": "def preparable; end", "title": "" }, { "docid": "2811397aefca145cecd731fd0748b1e6", "score": "0.59169203", "text": "def preparable; end", "title": "" }, { "docid": "2811397aefca145cecd731fd0748b1e6", "score": "0.59169203", "text": "def preparable; end", "title": "" }, { "docid": "2811397aefca145cecd731fd0748b1e6", "score": "0.59169203", "text": "def preparable; end", "title": "" }, { "docid": "954c5828178f6e4a659c40ef92736547", "score": "0.5905853", "text": "def helpful!\n\n\t\tend", "title": "" }, { "docid": "0a39799e76643367f1b6bfac65569895", "score": "0.5892693", "text": "def used?; end", "title": "" }, { "docid": "0aa0db9270c5a88c81da713a1ee0e8f8", "score": "0.58431536", "text": "def rescued_exception; end", "title": "" }, { "docid": "7ff2011fa3dc45585a9272310eafb765", "score": "0.5808322", "text": "def isolated; end", "title": "" }, { "docid": "b7cfdec5315b5d3c26b002081b1dbae3", "score": "0.5802812", "text": "def coming_soon; end", "title": "" }, { "docid": "003f93545faf95741b6daf49b5599d9c", "score": "0.57898533", "text": "def _self; end", "title": "" }, { "docid": "3caf4c824a6d6a4a5616c13fcab418da", "score": "0.5761532", "text": "def applied; end", "title": "" }, { "docid": "3ae137b1a40ff3aae4f3cbb2b6082797", "score": "0.5752104", "text": "def reaper; end", "title": "" }, { "docid": "6e6891d187cd127b8bc7e632ec0b2d50", "score": "0.5749982", "text": "def unitary?; end", "title": "" }, { "docid": "e66c3e6966b775d1799a6b8fed500121", "score": "0.5742506", "text": "def check()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "a9dd648a5d0d2e7d56223e7c753f5e2e", "score": "0.5731401", "text": "def telegraphical()\n end", "title": "" }, { "docid": "a747cf4388fb3d14718cf9dda73c555f", "score": "0.5720987", "text": "def initalize; end", "title": "" }, { "docid": "a747cf4388fb3d14718cf9dda73c555f", "score": "0.5720987", "text": "def initalize; end", "title": "" }, { "docid": "5928f8efe9c6c2d408ea21a4cdce83ad", "score": "0.57027024", "text": "def preliminary?; end", "title": "" }, { "docid": "6a6ed5368f43a25fb9264e65117fa7d1", "score": "0.5687854", "text": "def internal; end", "title": "" }, { "docid": "072514f3348fe62556dcdfd4b06e3d08", "score": "0.56765187", "text": "def spec; end", "title": "" }, { "docid": "072514f3348fe62556dcdfd4b06e3d08", "score": "0.56765187", "text": "def spec; end", "title": "" }, { "docid": "072514f3348fe62556dcdfd4b06e3d08", "score": "0.56765187", "text": "def spec; end", "title": "" }, { "docid": "2dbabd0eeb642c38aad852e40fc6aca7", "score": "0.56681097", "text": "def operations; end", "title": "" }, { "docid": "2dbabd0eeb642c38aad852e40fc6aca7", "score": "0.56681097", "text": "def operations; end", "title": "" }, { "docid": "cdd58dace22c11a7043a695fbef6319a", "score": "0.5661484", "text": "def initialize\n\n end", "title": "" }, { "docid": "cdd58dace22c11a7043a695fbef6319a", "score": "0.5661484", "text": "def initialize\n\n end", "title": "" }, { "docid": "cdd58dace22c11a7043a695fbef6319a", "score": "0.5661484", "text": "def initialize\n\n end", "title": "" }, { "docid": "cdd58dace22c11a7043a695fbef6319a", "score": "0.5661484", "text": "def initialize\n\n end", "title": "" }, { "docid": "cdd58dace22c11a7043a695fbef6319a", "score": "0.5661484", "text": "def initialize\n\n end", "title": "" }, { "docid": "e7dd7cf73f02c76e4424413a397a3b50", "score": "0.5651", "text": "def data_support; end", "title": "" }, { "docid": "e7dd7cf73f02c76e4424413a397a3b50", "score": "0.5651", "text": "def data_support; end", "title": "" }, { "docid": "bb2cf20999efd9fcacf7668301ebe565", "score": "0.564905", "text": "def missing; end", "title": "" }, { "docid": "bb2cf20999efd9fcacf7668301ebe565", "score": "0.564905", "text": "def missing; end", "title": "" }, { "docid": "27b17d3efbfa96fcae1899acb992e406", "score": "0.56440926", "text": "def initialize; end", "title": "" }, { "docid": "27b17d3efbfa96fcae1899acb992e406", "score": "0.56440926", "text": "def initialize; end", "title": "" }, { "docid": "27b17d3efbfa96fcae1899acb992e406", "score": "0.56440926", "text": "def initialize; end", "title": "" }, { "docid": "27b17d3efbfa96fcae1899acb992e406", "score": "0.56440926", "text": "def initialize; end", "title": "" }, { "docid": "27b17d3efbfa96fcae1899acb992e406", "score": "0.56440926", "text": "def initialize; end", "title": "" }, { "docid": "27b17d3efbfa96fcae1899acb992e406", "score": "0.56440926", "text": "def initialize; end", "title": "" }, { "docid": "27b17d3efbfa96fcae1899acb992e406", "score": "0.56440926", "text": "def initialize; end", "title": "" }, { "docid": "27b17d3efbfa96fcae1899acb992e406", "score": "0.56440926", "text": "def initialize; end", "title": "" }, { "docid": "27b17d3efbfa96fcae1899acb992e406", "score": "0.56440926", "text": "def initialize; end", "title": "" }, { "docid": "27b17d3efbfa96fcae1899acb992e406", "score": "0.56440926", "text": "def initialize; end", "title": "" }, { "docid": "27b17d3efbfa96fcae1899acb992e406", "score": "0.56440926", "text": "def initialize; end", "title": "" }, { "docid": "27b17d3efbfa96fcae1899acb992e406", "score": "0.56440926", "text": "def initialize; end", "title": "" }, { "docid": "27b17d3efbfa96fcae1899acb992e406", "score": "0.56440926", "text": "def initialize; end", "title": "" }, { "docid": "27b17d3efbfa96fcae1899acb992e406", "score": "0.56440926", "text": "def initialize; end", "title": "" }, { "docid": "27b17d3efbfa96fcae1899acb992e406", "score": "0.56440926", "text": "def initialize; end", "title": "" }, { "docid": "27b17d3efbfa96fcae1899acb992e406", "score": "0.56440926", "text": "def initialize; end", "title": "" }, { "docid": "27b17d3efbfa96fcae1899acb992e406", "score": "0.56440926", "text": "def initialize; end", "title": "" }, { "docid": "27b17d3efbfa96fcae1899acb992e406", "score": "0.56440926", "text": "def initialize; end", "title": "" }, { "docid": "27b17d3efbfa96fcae1899acb992e406", "score": "0.56440926", "text": "def initialize; end", "title": "" }, { "docid": "27b17d3efbfa96fcae1899acb992e406", "score": "0.56440926", "text": "def initialize; end", "title": "" }, { "docid": "27b17d3efbfa96fcae1899acb992e406", "score": "0.56440926", "text": "def initialize; end", "title": "" }, { "docid": "f0d50116d6d067bd787bf1044910efcb", "score": "0.5638872", "text": "def attempt; end", "title": "" }, { "docid": "0e02f83784c17c376ac60c44d26d2ebb", "score": "0.56370074", "text": "def existing; end", "title": "" }, { "docid": "6f45e4b71e44fc9ae5916c1a9e3e58ab", "score": "0.5632381", "text": "def evaporate!()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "6f45e4b71e44fc9ae5916c1a9e3e58ab", "score": "0.5632381", "text": "def evaporate!()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "9b632aa1829227dfc5a873c0d05ccbee", "score": "0.56217897", "text": "def execution_order; end", "title": "" }, { "docid": "649182d51b1ab2ad45379a6b8b686a3f", "score": "0.561223", "text": "def initialize\n super\n end", "title": "" }, { "docid": "649182d51b1ab2ad45379a6b8b686a3f", "score": "0.561223", "text": "def initialize\n super\n end", "title": "" }, { "docid": "649182d51b1ab2ad45379a6b8b686a3f", "score": "0.561223", "text": "def initialize\n super\n end", "title": "" }, { "docid": "649182d51b1ab2ad45379a6b8b686a3f", "score": "0.561223", "text": "def initialize\n super\n end", "title": "" }, { "docid": "29a83735da59010f07e1633934837c20", "score": "0.5610433", "text": "def underconstruction\n end", "title": "" }, { "docid": "a18186567d58d46fbcb43c48faf2ab4b", "score": "0.56013376", "text": "def apply\n\t\t\n\tend", "title": "" }, { "docid": "e44ae2cef169d29f78b2b6306add59da", "score": "0.5598132", "text": "def huddlingly()\n end", "title": "" }, { "docid": "1151221aa9457e5cad317e4fec922758", "score": "0.55846393", "text": "def adjugate; end", "title": "" }, { "docid": "8d0e128ad87cd20a86507c09c46a6f67", "score": "0.5582423", "text": "def termitidae()\n end", "title": "" }, { "docid": "7db0727baf89eb76beac27c515d7fe32", "score": "0.5573151", "text": "def support; end", "title": "" }, { "docid": "a29c5ce532d6df480df4217790bc5fc7", "score": "0.55721384", "text": "def extra; end", "title": "" }, { "docid": "a29c5ce532d6df480df4217790bc5fc7", "score": "0.55721384", "text": "def extra; end", "title": "" }, { "docid": "a29c5ce532d6df480df4217790bc5fc7", "score": "0.55721384", "text": "def extra; end", "title": "" }, { "docid": "a29c5ce532d6df480df4217790bc5fc7", "score": "0.55721384", "text": "def extra; end", "title": "" }, { "docid": "750dff3807780d14440a128104770309", "score": "0.55708534", "text": "def initialize\r\n end", "title": "" }, { "docid": "18250542a2b1999be90588db1d071d92", "score": "0.55687004", "text": "def initialize\n\t\t\n\tend", "title": "" }, { "docid": "465936ef29dc887acdb2e6cb1a0a85f3", "score": "0.5563282", "text": "def initialize\n super\n end", "title": "" }, { "docid": "8e10117902ff3282a42ea5b72dde9df5", "score": "0.55595726", "text": "def initialize\n end", "title": "" }, { "docid": "8e10117902ff3282a42ea5b72dde9df5", "score": "0.55595726", "text": "def initialize\n end", "title": "" }, { "docid": "8e10117902ff3282a42ea5b72dde9df5", "score": "0.55595726", "text": "def initialize\n end", "title": "" } ]
e18e4c7169b4398e36f97b5ec1cfaeae
DELETE /auto24h_fold_changes/1 DELETE /auto24h_fold_changes/1.xml
[ { "docid": "75c2e291cbf649d442bdaa7966f6dd6e", "score": "0.73450756", "text": "def destroy\n @auto24h_fold_change = Auto24hFoldChange.find(params[:id])\n @auto24h_fold_change.destroy\n\n respond_to do |format|\n format.html { redirect_to(auto24h_fold_changes_url) }\n format.xml { head :ok }\n end\n end", "title": "" } ]
[ { "docid": "b21f3f87d3a773c9fac3db6617c56108", "score": "0.74281186", "text": "def destroy\n @auto1h_fold_change = Auto1hFoldChange.find(params[:id])\n @auto1h_fold_change.destroy\n\n respond_to do |format|\n format.html { redirect_to(auto1h_fold_changes_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "51df8665e1ee9d65e1533758ecb3efd2", "score": "0.6913294", "text": "def destroy\n @hetero1h_fold_change = Hetero1hFoldChange.find(params[:id])\n @hetero1h_fold_change.destroy\n\n respond_to do |format|\n format.html { redirect_to(hetero1h_fold_changes_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "2949a045a85007f9b40d6c80acf81b1d", "score": "0.67809045", "text": "def destroy\n @auto24h_r2_fold_change = Auto24hR2FoldChange.find(params[:id])\n @auto24h_r2_fold_change.destroy\n\n respond_to do |format|\n format.html { redirect_to auto24h_r2_fold_changes_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "ecaa4ca166d7d211fcb9b8e7de654334", "score": "0.6400397", "text": "def destroy\n @hetero24h_r2_fold_change = Hetero24hR2FoldChange.find(params[:id])\n @hetero24h_r2_fold_change.destroy\n\n respond_to do |format|\n format.html { redirect_to hetero24h_r2_fold_changes_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d43c887da50686f4c1c96b70ea763895", "score": "0.5973449", "text": "def delete_now\n revisions.each do |rev_id| \n CouchDB.delete( \"#{uri}?rev=#{rev_id}\" )\n end\n true \n end", "title": "" }, { "docid": "c1592c9a7c989d01a99d8c2f4e789eab", "score": "0.59618944", "text": "def netdev_resxml_delete( xml )\n top = netdev_resxml_top( xml )\n par = top.instance_variable_get(:@parent)\n par['delete'] = 'delete'\n end", "title": "" }, { "docid": "e1d6f603cb5ea1e475ea71422432aeae", "score": "0.5938038", "text": "def destroy\n RestClient.delete \"#{REST_API_URI}/contents/#{id}.xml\" \n self\n end", "title": "" }, { "docid": "289e6d2ddb249c0f9a74a908fcfb562e", "score": "0.5703701", "text": "def delete_all(xpath); end", "title": "" }, { "docid": "4fcc199e333a24681e20fa2289ac4cc0", "score": "0.5680627", "text": "def xml_on_delete( xml )\r\n return unless @under_vlans\r\n return if @under_vlans.empty?\r\n \r\n _xml_rm_under_vlans( xml, @under_vlans )\r\n end", "title": "" }, { "docid": "9238e26013aa5761defd86a65823c2a8", "score": "0.56720024", "text": "def delete(slide)\n # ./_rels/presentation.xml.rels\n # Update Relationship ids\n # Insert a new one slideRef\n @doc.edit_xml @doc.presentation.rels.path do |xml|\n # Calucate the next id\n # next_id = xml.xpath('//xmlns:Relationship[@Id]').map{ |n| n['Id'] }.sort.last.succ\n # TODO - Figure out how to make this more MS idiomatic up 9->10 instead of incrementing\n # the character....\n # Insert that into the slide and crakc open the presentation.xml file\n\n target = slide.path.relative_path_from(@doc.presentation.path.dirname)\n relationship = xml.at_xpath(\"/xmlns:Relationships/xmlns:Relationship[@Type='#{Slide::REL_TYPE}' and @Target='#{target}']\")\n # ./presentation.xml\n # Update attr\n # p:notesMasterId\n # Insert attr\n # p:sldId, increment, etc.\n @doc.edit_xml '/ppt/presentation.xml' do |xml|\n xml.at_xpath(\"/p:presentation/p:sldIdLst/p:sldId[@r:id='#{relationship['Id']}']\").remove\n end\n relationship.remove\n end\n\n # Delete slide link and slideNotes link from ./[Content-Types].xml \n @doc.edit_xml @doc.content_types.path do |xml|\n xml.at_xpath(\"/xmlns:Types/xmlns:Override[@ContentType='#{Slide::CONTENT_TYPE}' and @PartName='#{slide.path}']\").remove\n xml.at_xpath(\"/xmlns:Types/xmlns:Override[@ContentType='#{Notes::CONTENT_TYPE}' and @PartName='#{slide.notes.path}']\").remove\n end\n\n # Update ./ppt\n # !!! DESTROY !!!\n # ./slides\n # Delete files\n # ./_rels/notesSlide(\\d+).xml.rels\n @doc.delete slide.notes.rels.path\n # ./notesSlide(\\d+).xml file\n @doc.delete slide.notes.path\n # ./_rels/slide(\\d+).xml.rels\n @doc.delete slide.rels.path\n # ./slide(\\d+).xml file\n @doc.delete slide.path\n # ./notesSlides\n # Delete files\n\n # Hooray! We're done! Ummm, what should we return though? can't be the slide since\n # its destroyed and there's no practical way to keep it around in memory.\n end", "title": "" }, { "docid": "422e499c1fc730770475fd03ea48da2b", "score": "0.5652778", "text": "def destroy\n @cp_change.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "8a2bd4d6de437ce381d2df8e32a6605f", "score": "0.5606499", "text": "def destroy\n @document.destroy\n save_log({ :action => 'DELETE', :document => { :before => @old_document }})\n #TODO delete the file from disk\n respond_to do |format|\n format.html { redirect_to(documents_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "6f9c7f44a04793ee4e51eb2b938b7fb7", "score": "0.55368793", "text": "def destroy\n @diaper_change = DiaperChange.find(params[:id])\n @diaper_change.destroy\n\n respond_to do |format|\n format.html { redirect_to(diaper_changes_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "419ce5a1240eb5db29468e0c89175385", "score": "0.5528968", "text": "def destroy\n @changelog = Changelog.find(params[:id])\n @changelog.destroy\n\n respond_to do |format|\n format.html { redirect_to(changelogs_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "5f6b585b88098d80e14b7117de2208f3", "score": "0.552666", "text": "def destroy\n @yml_file = Cmtool::YmlFile.find(params[:id])\n @yml_file.destroy\n\n respond_to do |format|\n format.html { redirect_to(cmtool.yml_files_url, notice: I18n.t('cmtool.action.destroy.successful', model: Cmtool::YmlFile.model_name.human)) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "2f59fb31f7925721f74c0e30ba5be2dc", "score": "0.54685044", "text": "def destroy\n @config_xml = ConfigXml.find(params[:id])\n @config_xml.destroy\n\n respond_to do |format|\n format.html { redirect_to(config_xmls_url) }\n format.xml { head :ok }\n end\n rescue ActiveRecord::RecordNotFound => e\n prevent_access(e)\n end", "title": "" }, { "docid": "eebc376373500352a9bd08ec8222e23a", "score": "0.5438842", "text": "def destroy\n # set_chef\n @chef.destroy\n redirect_to chefs_path\n end", "title": "" }, { "docid": "0aabfd70910b8480a97cffeb53be8800", "score": "0.54248035", "text": "def delete_data(index_name)\n uri = @client.make_uri(\"/#{index_name}/update/\")\n req = HTTP::Post.new(uri)\n req.content_type = 'text/xml'\n req.body = '<delete><query>*:*</query></delete>'\n response = @client.send_http(req, true, ['200'])\n end", "title": "" }, { "docid": "d5e7b21651ce28fc17c87bf0982eb33f", "score": "0.53660697", "text": "def destroy\n @vdm_change.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "897c997c74036a4e9d22d8256387d51c", "score": "0.5350685", "text": "def destroy\n @user_testcase_xref = UserTestcaseXref.find(params[:id])\n @user_testcase_xref.destroy\n\n respond_to do |format|\n format.html { redirect_to(user_testcase_xrefs_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "e2df4976e7fb0e7c3717b071eaa32108", "score": "0.53442216", "text": "def destroy\n @change = @priority.changes_with_deleted.find(params[:id])\n flash[:notice] = t('changes.destroy')\n @change.delete!\n respond_to do |format|\n format.html { redirect_to(changes_url) }\n end\n end", "title": "" }, { "docid": "2211ade05bb1f35e4860ee364ae3e5fa", "score": "0.53340364", "text": "def destroy\n @req_breakdown = ReqBreakdown.find(params[:id])\n @req_breakdown.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_req_breakdowns_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "cd2bf62f6edafd26ecb998cc29a37be6", "score": "0.5329723", "text": "def delete_checksums\n # puts \"Del: #{@basename}\"\n @pkgdb.query(\"delete from checksums where basename = '#{@basename}'\")\n end", "title": "" }, { "docid": "fc328efa40f80ec0be09b4b8228616b8", "score": "0.5325245", "text": "def delete_content_paths\n\n # Delete all the paths with the ancestor as the current id\n ContentPath.delete_all(:ancestor => self.id)\n\n # Delete all the paths with the descendant as the current id\n ContentPath.delete_all(:descendant => self.id)\n end", "title": "" }, { "docid": "4c89c38a6feb73703ab3a2acba1a9752", "score": "0.53244483", "text": "def run_on_deletion(paths)\n end", "title": "" }, { "docid": "4c89c38a6feb73703ab3a2acba1a9752", "score": "0.53244483", "text": "def run_on_deletion(paths)\n end", "title": "" }, { "docid": "ba729b79142b2f904b45fa7d9d62def5", "score": "0.53098124", "text": "def delete_story_version(id)\n @client.raw('delete', \"/content/story-versions/#{id}\")\n end", "title": "" }, { "docid": "b0673ce24e49ae69f73c3b281b0c94af", "score": "0.53083026", "text": "def destroy\n @model_class.transaction do\n id = @object.id\n @object.destroy\n create_change_log_entry(id)\n end\n respond_to do |format|\n format.html { redirect_to(:action => 'index') }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "098ea242521df19d190ef8c1b19b46d8", "score": "0.52911013", "text": "def destroy\n @checkpoint_removed = CheckpointRemoved.find(params[:id])\n @checkpoint_removed.destroy\n\n respond_to do |format|\n format.html { redirect_to(checkpoint_removeds_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "a905b4d87d7751c1f154265267351a3d", "score": "0.5281533", "text": "def destroy\n @helocagree = Helocagree.find(params[:id])\n @helocagree.destroy\n\n respond_to do |format|\n format.html { redirect_to(helocagrees_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "4703da2c7162d8f90c4503345b228139", "score": "0.52711594", "text": "def file_delete(node, file)\n _out, _local, _remote, code = node.test_and_store_results_together(\"rm #{file}\", 'root', 500)\n code\nend", "title": "" }, { "docid": "4703da2c7162d8f90c4503345b228139", "score": "0.52711594", "text": "def file_delete(node, file)\n _out, _local, _remote, code = node.test_and_store_results_together(\"rm #{file}\", 'root', 500)\n code\nend", "title": "" }, { "docid": "73322275eacd980c2ea6009c2de46c74", "score": "0.5270113", "text": "def destroy\n @content = Content.find(params[:id])\n @folder = Folder.find(session[:folder_id])\n Searcher.open(Const.get('searcher_db')) do |db|\n db.erase(@content)\n end\n @content.destroy\n\n respond_to do |format|\n #format.html { redirect_to(contents_url) }\n format.html { redirect_to(@folder) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "751c73611628453f518274b0dcbf150d", "score": "0.5268005", "text": "def delete_from_disk; end", "title": "" }, { "docid": "084eec7c8edc0bb839a63c1dcfb98f0c", "score": "0.5264255", "text": "def destroy\n @convenio = Convenio.find(params[:id])\n @convenio.destroy\n\n respond_to do |format|\n format.html { redirect_to(convenios_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "5a65bc1213217f1a4d9c42dc1dea5997", "score": "0.5257138", "text": "def delete_operations; end", "title": "" }, { "docid": "2b0f75db6a99b0baa487065fac9b460d", "score": "0.52448094", "text": "def delete(key)\n configuration.hpath_delete.tap do |result|\n save if sync_down\n end\n end", "title": "" }, { "docid": "e3ad5903a2ebc1b6a03e11f011db8f7a", "score": "0.52390045", "text": "def destroy\n @flat_happening = FlatHappening.find(params[:id])\n @flat_happening.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "5fbcedda15077c0d80339fd4608350e6", "score": "0.5238317", "text": "def version_delete(version_delete = nil)\n\n change_log_nodes = @sopm.xpath('/otrs_package/ChangeLog')\n\n if !version_delete || version_delete == @structure['version']\n\n new_version = nil\n if change_log_nodes.length > 0\n @sopm.xpath('/otrs_package/ChangeLog').first.remove\n if @sopm.xpath('/otrs_package/ChangeLog').length > 0\n new_version = @sopm.xpath('/otrs_package/ChangeLog').first['Version']\n end\n end\n\n @sopm.xpath('/otrs_package/Version').children[0].content = new_version\n elsif change_log_nodes.length > 0\n\n change_log_nodes.each { |change_log_node|\n\n next if !change_log_node['Version'].is_a? String\n next if change_log_node['Version'] != version_delete\n\n change_log_node.remove\n\n break\n }\n end\n\n store\n end", "title": "" }, { "docid": "16926d0a968ef848c0e3f7f0f5b56547", "score": "0.523337", "text": "def destroy\n @change.destroy\n respond_to do |format|\n format.html { redirect_to changes_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e9ff8f11accb2eb4ed0b151ab27d2ae1", "score": "0.5228048", "text": "def after_soft_delete; end", "title": "" }, { "docid": "adcc73642545794007d81124da858873", "score": "0.52115387", "text": "def destroy\n @markup = Markup.find(params[:id])\n @markup.destroy\n\n respond_to do |format|\n format.html { redirect_to [@parent, :markups] }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "46abd963e84e43d34ad0e738ac5d1b9a", "score": "0.5207968", "text": "def delete\n\t\tdb.execute{ \"delete edge #{ref_name} #{rrid}\" }\n\tend", "title": "" }, { "docid": "e90d8a77001cb0854193b4368e2f3a01", "score": "0.52074", "text": "def destroy\n @auditflows_flownode = AuditflowsFlownode.find(params[:id])\n @auditflows_flownode.destroy\n\n respond_to do |format|\n format.html { redirect_to(auditflows_flownodes_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fd30428d0a8c89c92bf3e321f583ce70", "score": "0.5205597", "text": "def destroy\n @check = Check.find(params[:id])\n @check.destroy\n respond_to do |format|\n format.html { redirect_to(checks_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "32fb0a1fe1b6bc58e3b10821405d2300", "score": "0.5204184", "text": "def delete( )\n File.delete(@configFileDNE)\n self.clear\n self\n end", "title": "" }, { "docid": "ac33f9633d699840c63ce138b4750a52", "score": "0.52040887", "text": "def destroy\n @check = Check.find(params[:id])\n @check.destroy\n\n respond_to do |format|\n format.html { redirect_to(checks_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "69b205c158f7212cc750ed38fc878f1c", "score": "0.52022004", "text": "def delete()\n response = send_post_request(@xml_api_delete_path)\n response.is_a?(Net::HTTPSuccess) or response.is_a?(Net::HTTPRedirection)\n end", "title": "" }, { "docid": "218100352787460b880560b766ce5e02", "score": "0.5201093", "text": "def delete_node(current_node)\n\nend", "title": "" }, { "docid": "38249ae11c53d0d58cbdbedab7866919", "score": "0.51982987", "text": "def destroy\n chef_server_rest.delete(\"nodes/#{name}\")\n end", "title": "" }, { "docid": "4246955b57e7e195f3543c9b4db3aefe", "score": "0.519205", "text": "def destroy\n @defect = Defect.find(params[:id])\n @defect.destroy\n\n respond_to do |format|\n format.html { redirect_to(defects_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "f20d9ded5aae563e53bfaffd26ceb918", "score": "0.5186369", "text": "def destroy\n @retain_node_selector = RetainNodeSelector.find(params[:id])\n @retain_node_selector.destroy\n\n respond_to do |format|\n format.html { redirect_to(retain_node_selectors_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "f266251f161cb2cde78ea2a533db2ec2", "score": "0.5178872", "text": "def destroy\n @gstr_advance_receipts = GstrAdvanceReceipt.find_by_id_and_company_id(params[:id], @company.id)\n @gstr_advance_receipts.delete_gstr_one_entry \n @gstr_advance_receipts.delete\n respond_to do |format|\n @gstr_advance_receipts.register_delete_action(request.remote_ip, @current_user, 'deleted')\n format.html { redirect_to(gstr_advance_receipts_url, :notice =>\"Gstr Advance Receipt has been succesfully deleted\") }\n format.xml {head :ok}\n \n end\n end", "title": "" }, { "docid": "49fddd87989873b36535d9938627afc1", "score": "0.51695937", "text": "def delete(path)\n path = relativize_path path\n\n Precog.connect self do |http|\n uri = Addressable::URI.new\n uri.query_values = { :apiKey => api_key }\n\n http.delete \"/ingest/v#{VERSION}/fs/#{path}?#{uri.query}\"\n end\n end", "title": "" }, { "docid": "2a73c378a82d1b053e54b94822b03ed3", "score": "0.5169466", "text": "def file_delete(file)\n\t\tputs \"Delete entries to the local site store from file: #{file}\" if @verbose\n\t\traise \"File non-exist. Please check your file path and name again: #{file}\" unless File.exist?(file)\n\t\tsites=file_2_list(file)\n\t\tchanges=Array.new\n\t\tchanges=bulk_delete(sites) unless sites.nil? or sites.empty?\n\trescue => ee\n\t\tputs \"Exception on method file_delete: #{ee} for file: #{file}\" if @verbose\n\tend", "title": "" }, { "docid": "3430f4f1436bbfb3b2c27fe2c979bd0a", "score": "0.5159575", "text": "def clear_changes!\n @changes.clear\n end", "title": "" }, { "docid": "ebcd79516d276eccce8605752d4ba751", "score": "0.5159467", "text": "def delete!\n # delete changes the node.modified_index\n @etcd_node = etcd.delete(etcd_key).node\n end", "title": "" }, { "docid": "9476fe6cd97efc21d4a8305d0f47e722", "score": "0.51583725", "text": "def delete(command)\n pp @client.files.delete(clean_up(command[1]))\n end", "title": "" }, { "docid": "21a7f76bc946347f742b1745c207c24e", "score": "0.5154683", "text": "def db_delete\n assert_privileges(\"db_delete\")\n db = MiqWidgetSet.find(params[:id]) # temp var to determine the parent node of deleted items\n process_elements(db, MiqWidgetSet, \"destroy\")\n g = MiqGroup.find(@sb[:nodes][2].split('_').first)\n # delete dashboard id from group settings and save\n db_order = g.settings && g.settings[:dashboard_order] ? g.settings[:dashboard_order] : nil\n db_order&.delete(db.id)\n g.save\n nodes = x_node.split('-')\n self.x_node = \"#{nodes[0]}-#{nodes[1]}-#{nodes[2].split('_').first}\"\n replace_right_cell(:replace_trees => [:db])\n end", "title": "" }, { "docid": "2f16a4309bdf9a4f42bf9651c907a215", "score": "0.51521784", "text": "def clean!\n @changes = []\n end", "title": "" }, { "docid": "a135493943c7db3f92af212d0110c7b5", "score": "0.51501465", "text": "def destroy\n @upload_file = UploadFile.find(params[:id])\n doc_no=@upload_file.doc_no\n @upload_file.destroy\n\n respond_to do |format|\n format.html { redirect_to upload_files_url(:doc_no=>doc_no) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "68fc53799a9970d66d3eaa73bfc7e4c1", "score": "0.5148792", "text": "def destroy\n @chef_att_source.destroy\n respond_to do |format|\n format.html { redirect_to chef_att_sources_url, notice: 'Chef att source was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "79f6c1dc625b7028742c1da69decc7cf", "score": "0.5148424", "text": "def delete\n \n end", "title": "" }, { "docid": "6a5c6d0d6940292aa65910632639fdfb", "score": "0.51461196", "text": "def delete\n blacklight_items.each do |r|\n solr.delete_by_id r[\"id\"]\n solr.commit\n end\n end", "title": "" }, { "docid": "bddc9ebd679a24ef630fe953af0ef74c", "score": "0.5145321", "text": "def delete(cloud_file)\n\n payload = {\n root: \"auto\",\n path: cloud_file.path\n }\n\n connexion = Dropbox.start(:delete, access_token)\n response = connexion.post do |req|\n req.url \"fileops/delete\"\n req.body = payload\n end\n response = format_response(response)\n Filetree.new('dropbox').update([response[:path], nil])\n\n end", "title": "" }, { "docid": "22328cbae1768553b796ad8a4f04f990", "score": "0.5140724", "text": "def destroy\n @deposit_threshold = DepositThreshold.find(params[:id])\n @deposit_threshold.destroy\n\n respond_to do |format|\n format.html { redirect_to(deposit_thresholds_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "6e5494d695bea044f741249fb6c2b6be", "score": "0.5140623", "text": "def destroy\n @home_check = HomeCheck.find(params[:id])\n @home_check.destroy\n\n respond_to do |format|\n format.html { redirect_to(home_checks_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "d27d91c2dcdceaea51bf31126346ed72", "score": "0.5136744", "text": "def ensure_deletion_fixes \n # TO DO\n end", "title": "" }, { "docid": "6cb5e18f3ee159cf50904fa850c802d2", "score": "0.51358956", "text": "def destroy\n @label_sheet.destroy\n respond_to do |format|\n format.html { redirect_to(admin_label_sheets_url) }\n format.xml { head :ok }\n end\n website.add_log(user: current_user, action: \"Deleted Label Sheet: #{@label_sheet.name}\")\n end", "title": "" }, { "docid": "67a62b4f15810e70c182a6cff0d07acd", "score": "0.5129619", "text": "def destroy\n @xml_sample = XmlSample.find(params[:id])\n @xml_sample.destroy\n\n respond_to do |format|\n format.html { redirect_to xml_samples_url }\n format.xml do\n xml = {msg: \"complete\", status: \"OK\"}.to_xml\n return render xml: xml\n end\n end\n end", "title": "" }, { "docid": "1fd7dc0e91f151ed3e5049a52c30472f", "score": "0.5128993", "text": "def delete\n \n end", "title": "" }, { "docid": "d3196a67d87ee0aab145f901562593f1", "score": "0.5120023", "text": "def delete_fragments\n glob_cache_expire( 'C:/tmp/cache/views/user_type_id/*/browse/category_id/' + self.id.to_s )\n\n glob_cache_expire( 'C:/tmp/cache/views/user_type_id/*/shared_symbiont/symbiote_wrapper_container/symbiote_item_category_id/' + self.id.to_s )\n\n glob_cache_expire( 'C:/tmp/cache/views/user_type_id/*/shared_menu/menu_organized_category/category_id/' + self.id.to_s )\nend", "title": "" }, { "docid": "962744e3173a5dce528faf7aac8328d5", "score": "0.511845", "text": "def destroy\n @cultural_heritage_part = CulturalHeritage::Part.find(params[:id])\n @cultural_heritage_part.deleted = 1\n @cultural_heritage_part.save\n\n respond_to do |format|\n format.html { redirect_to(cultural_heritage_parts_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "f40b10ce3d08c30dfaf32c56ffe2fe36", "score": "0.51146007", "text": "def clear(opts = {}) \n save(setup_commit_options({:message => \"all clear\"}.merge(opts))) do |index|\n if tree = index.current_tree\n tree.contents.each do |entry|\n index.delete(key_for(entry.name))\n end\n end\n end\n end", "title": "" }, { "docid": "f40b10ce3d08c30dfaf32c56ffe2fe36", "score": "0.51146007", "text": "def clear(opts = {}) \n save(setup_commit_options({:message => \"all clear\"}.merge(opts))) do |index|\n if tree = index.current_tree\n tree.contents.each do |entry|\n index.delete(key_for(entry.name))\n end\n end\n end\n end", "title": "" }, { "docid": "eb77d9bcce20e85980b3713210c356de", "score": "0.51140296", "text": "def delete(id)\n raise RuntimeError, \"File datastore does not support document deletion\"\n end", "title": "" }, { "docid": "652f0986c9443229a9c1f1b218d66127", "score": "0.5113072", "text": "def delete_change_set(change_set_name, options = {})\n options['ChangeSetName'] = change_set_name\n request({\n 'Action' => 'DeleteChangeSet',\n :parser => Fog::Parsers::AWS::CloudFormation::Basic.new\n }.merge!(options))\n end", "title": "" }, { "docid": "13d368611a6b4a1e7695088f3b015559", "score": "0.51110506", "text": "def destroy\n @breakdown = Breakdown.find(params[:id])\n @breakdown.destroy\n\n respond_to do |format|\n format.html { redirect_to(breakdowns_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "b983c977d3ac97e6c9ba13ff71e8cecd", "score": "0.51093614", "text": "def delete uri\n @change_semaphore.synchronize do\n filename = uri_to_file(uri)\n library.delete filename\n # Remove diagnostics for deleted files\n send_notification \"textDocument/publishDiagnostics\", {\n uri: uri,\n diagnostics: []\n }\n end\n end", "title": "" }, { "docid": "808357163a7fb714f06d0b2080b01f4e", "score": "0.51092875", "text": "def delete\n self.class.delete(\"evss_dependents_retrieve_#{@user.uuid}\")\n end", "title": "" }, { "docid": "24981557698b7cd78b759e5fb16b715f", "score": "0.51075315", "text": "def destroy\n #FIXME: Double check auth is working for deletion. Also, maybe should only delete if not associated with any experiments.\n @data_file.destroy\n \n respond_to do |format|\n format.html { redirect_to(data_files_path) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "227d34498bbadb82852d5a0f489a9b1a", "score": "0.51066136", "text": "def deleteEssence\n \n begin\n \n # Gets @filename and @path\n getPathAndFilename \n name = @filename \n filepath = @path\n puts \"filepath: \" + filepath \n puts \"filename: \" + name\n \n # Find the device \n device = User.find_by_username(params[:username]).devices.find_by_dev_name(params[:devicename])\n \n # Essence can't be deleted from a virtual container\n if device.dev_type == \"virtual_container\"\n render :text => \"Error: Essence can't be deleted from a virtual container'\", :status => 409\n return \n end\n \n file = nil\n if device != nil\n file = device.devfiles.find(:first, :conditions => [\"name = ? and path = ?\", name, filepath])\n if file == nil\n puts \"FILE NOT FOUND: \" + name\n render :text => \"Error. File's metadata can not be found.\", :status => 404\n return\n end\n \n if params[:blob_hash]\n blob = file.blobs.find(:first, :conditions => [\"blob_hash = ?\", params[:blob_hash]])\n else\n blob = file.blobs.find_by_follower_id(nil)\n end\n end\n \n # Checks that the file's and it's version's metadata can be found in database.\n if file == nil or blob == nil\n puts \"Blob not found for file: \" + name\n render :text => \"Error. File's metadata can not be found.\", :status => 404\n return\n end\n \n if blob.uploaded == false\n render :text => \"Error: Essence of the file was not on the server.\", :status => 409\n return\n end\n \n # Remove the fileupload entry\n fup = Fileupload.find_by_blob_id(blob.id)\n if fup != nil\n fup.destroy\n end\n \n # Update blob not to be uploaded and upload_requested to nil\n blob.update_attribute(:uploaded, false)\n blob.update_attribute(:upload_requested, nil)\n \n \n # Remove the actual essence\n deletepath = \"public/devfiles/\" + file.device_id.to_s + \"/\" + blob.blob_hash + \"_\" + file.name\n \n if File.exists?(deletepath)\n FileUtils.rm_f(deletepath)\n puts \"deleted the essence...\"\n else\n puts \"Essence not found and could not be deleted...\"\n end\n \n rescue => exp\n putsE(exp)\n render :text => \"There was an error when trying to delete the essence from the server\", :status => 409\n return\n end\n \n render :text => \"Essence of the file deleted from the server\", :status => 200\n return\n end", "title": "" }, { "docid": "22915e0e8a4d3b6d1a8874124b7c1323", "score": "0.510547", "text": "def delete_empty_changelists\n pending_changelists.each { |changelist|\n changelist.delete\n }\n end", "title": "" }, { "docid": "2f0df61f9fb4ef9b10bea9b7f0160b0b", "score": "0.5103247", "text": "def delete\n end", "title": "" }, { "docid": "2d8764b1f2f25110816a17f73f497f0e", "score": "0.5101097", "text": "def delete()\n response = send_post_request(@xml_api_delete_path)\n response.is_a?(Net::HTTPSuccess) or response.is_a?(Net::HTTPRedirection)\n end", "title": "" }, { "docid": "8775538da87f35b17ab8bff9dee3c793", "score": "0.5097623", "text": "def destroy\n @alfresco = Alfresco.find(params[:id])\n @alfresco.destroy\n\n respond_to do |format|\n format.html { redirect_to(alfrescos_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "92baec3512e1908decee8b79a337a488", "score": "0.5095002", "text": "def destroy\n @wiki = @project.wikis.find(params[:id])\n @project.wikis.delete(@wiki)\n @wiki.destroy\n\n respond_to do |format|\n format.html { redirect_to project_wikis_path(@project) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "85aa4b60b1ba3f6b01b09a182ddfe3d1", "score": "0.5087963", "text": "def test_xml_should_not_destroy_project_with_fk\n assert_no_difference('Project.count') do\n delete :destroy, :id => 1, :format => 'xml'\n end\n assert_response :ok\n assert_select \"errors:root>error\", ERRORS[:foreign_key_problem]\n end", "title": "" }, { "docid": "ff0ec90ba013adb659830943ee96c841", "score": "0.5086208", "text": "def delete_decision\n\t\t# ES: Por medio de la configuracion del modelo, todo lo relacionado con esa decision, y sus hijos se borrará también\n\t\t# EN: According to the model configuration, all information related to that decision and it sons will be deleted also\n\t\tdecision = GovernanceDecision.find(params[:idDecision].to_i)\n\t\thijasToDelete = view_context.recursiveDarHijos(decision, []) # ES: Agrega sus hijos - EN: Add it sons\n\t\thijasToDelete.push(decision.id) # ES: Se agrega a si misma - EN: Add it itself\n\n\t\tdecision.destroy\n\n\t\trespond_to do |format|\n\t\t\t# ES: Envia el texto:\n\t\t\t# EN: Send the text:\n\t\t\tformat.json {render json: hijasToDelete}\n\t end\n\tend", "title": "" }, { "docid": "dfdfcbb7fc9dc8bb0179a5a59a73cbe4", "score": "0.5082812", "text": "def delete_analysis(analysis_id); rest_delete(\"#{link('analyses')}/#{analysis_id}\"); nil; end", "title": "" }, { "docid": "d155524c53214296e19f485283450c8d", "score": "0.5073019", "text": "def delBookmarks content\r\n\t\tfind('#del1449930755433').click\r\n\t\tfind('.jBox-Confirm-button-submit').click\r\n\t\tsleep 1\r\n\tend", "title": "" }, { "docid": "82ec189bdce2de5d528b27e0ec732a11", "score": "0.50727206", "text": "def delete; rest_delete(link('self')); end", "title": "" }, { "docid": "82ec189bdce2de5d528b27e0ec732a11", "score": "0.50727206", "text": "def delete; rest_delete(link('self')); end", "title": "" }, { "docid": "978a0a3057bbd5855fa3b0f3e32fca10", "score": "0.507201", "text": "def test_delete_custom_xml_part\n remote_file_name = 'TestDeleteCustomXmlPart.docx'\n\n upload_file File.join(local_test_folder, local_file), remote_data_folder + '/' + remote_file_name\n\n request = DeleteCustomXmlPartRequest.new(name: remote_file_name, custom_xml_part_index: 0, folder: remote_data_folder, dest_file_name: remote_test_out + '/' + remote_file_name)\n\n @words_api.delete_custom_xml_part(request)\n end", "title": "" }, { "docid": "a860d99cfb28f6db9530a66dbcd28e3c", "score": "0.50696933", "text": "def delete\n end", "title": "" }, { "docid": "a860d99cfb28f6db9530a66dbcd28e3c", "score": "0.50696933", "text": "def delete\n end", "title": "" }, { "docid": "a860d99cfb28f6db9530a66dbcd28e3c", "score": "0.50696933", "text": "def delete\n end", "title": "" }, { "docid": "a860d99cfb28f6db9530a66dbcd28e3c", "score": "0.50696933", "text": "def delete\n end", "title": "" }, { "docid": "a860d99cfb28f6db9530a66dbcd28e3c", "score": "0.50696933", "text": "def delete\n end", "title": "" }, { "docid": "a860d99cfb28f6db9530a66dbcd28e3c", "score": "0.50696933", "text": "def delete\n end", "title": "" } ]
45cffcd6bfeef27d0bb32f6b6640cbc1
Sets leading and trailing quotes
[ { "docid": "6b3863bd368141ef1e91bdc09e69a95c", "score": "0.67190677", "text": "def set_quotes(value)\n if value.class.to_s == \"String\"\n if value.delete(\" \").start_with?(\"{\") || value.delete(\" \").start_with?(\"[\")\n value\n else\n \"\\\"#{value}\\\"\"\n end\n else\n value\n end\n end", "title": "" } ]
[ { "docid": "6c3d17d58a0f1798d7dfd8898bc63956", "score": "0.67445093", "text": "def setQuoteString(flag = true)\n @chain.setQuoteString(flag) if(@chain) ;\n @quoteString = flag ;\n end", "title": "" }, { "docid": "1e418d8f19428881d886b55d2bf0726a", "score": "0.6709982", "text": "def set_quotes(value)\n if value.class.to_s == \"String\"\n if value.delete(\" \").start_with?(\"{\") || value.delete(\" \").start_with?(\"[\") \n value\n else\n \"\\\"#{value}\\\"\"\n end\n else\n value\n end\n end", "title": "" }, { "docid": "8f889575c7aff922ccbbecb207d90656", "score": "0.6641853", "text": "def escape_quotes(beg_str, end_str); end", "title": "" }, { "docid": "8f889575c7aff922ccbbecb207d90656", "score": "0.6641853", "text": "def escape_quotes(beg_str, end_str); end", "title": "" }, { "docid": "15f3dc282d316514ae53394d339fa74d", "score": "0.6566247", "text": "def single_quote; self.quote(\"'\"); end", "title": "" }, { "docid": "b74ee15032c0a8712b66e14b1ad3255d", "score": "0.6472917", "text": "def double_quote; self.quote('\"'); end", "title": "" }, { "docid": "4f086cd79dbfbc1705f0778bb4aaf812", "score": "0.6345791", "text": "def to_quoted_equivalent; end", "title": "" }, { "docid": "6026ae5c6089f1c5d913276e3109ecdd", "score": "0.6315193", "text": "def with_quotes; '\"' + self + '\"'; end", "title": "" }, { "docid": "16eee63ed0d8c8de1904b0895232a648", "score": "0.631402", "text": "def force_quotes?() @force_quotes end", "title": "" }, { "docid": "0eeb18c6b67544fe7a9388b35d339264", "score": "0.62953675", "text": "def quoting\n :single_quote_escape\n end", "title": "" }, { "docid": "deb9ac60de3fccf93b208aa22b21b5a9", "score": "0.6255389", "text": "def apostrophes\n\t\tself.envelop('\\'' , '\\'')\n\tend", "title": "" }, { "docid": "f4614abd764d85b22552b57725d0ed0c", "score": "0.62431604", "text": "def quote( val )\n\t\t%q{\"%s\"} % [ val.to_s.gsub(/\"/, '\\\\\"') ]\n\tend", "title": "" }, { "docid": "df2c12de287046371ea931be829209eb", "score": "0.6189705", "text": "def single_quote()\n \"'#{strip.gsub(/\\\\/) { '\\\\\\\\' }.gsub(/'/) { \"\\\\'\"}}'\"\n end", "title": "" }, { "docid": "0a32ab54fff1c26912d95158b15fd9dc", "score": "0.6181351", "text": "def quote(val) # :nodoc:\n return val unless val.is_a?(String)\n return \"'#{val.gsub(/\\'/, \"\\\\\\\\'\")}'\" # \" <= for Emacs font-lock\n end", "title": "" }, { "docid": "d0b94f1c0566c2bd2f2d3909487b39b8", "score": "0.6165727", "text": "def double_quote\n quote '\"', '\"'\n end", "title": "" }, { "docid": "4a509ddb282ebfd9190d33bde6b59321", "score": "0.6165261", "text": "def dquote\n quote('\"')\n end", "title": "" }, { "docid": "2ebbd48e6fe8868b7204c370bf06b976", "score": "0.6162839", "text": "def quote(str, q='\"'); \"#{q}#{str}#{q}\" end", "title": "" }, { "docid": "46d217322c2d7c833106e82bd8e3a87b", "score": "0.61348605", "text": "def single_quote\n\n I18n.t 'support.string.single_quoted', string: self, default: self\n\n end", "title": "" }, { "docid": "db18439fac5ebc014ca9caeeb958f357", "score": "0.6098571", "text": "def dress_up_quotes\n self[' '] ? \"\\\"#{self}\\\"\" : self\n end", "title": "" }, { "docid": "478de37e1809013d53d7517a747b2cdc", "score": "0.6081679", "text": "def cute_quote\n quote \"`\", \"'\"\n end", "title": "" }, { "docid": "92fc1e12df87ca90157154aa3b0d86ed", "score": "0.60673535", "text": "def single_quote\n quote \"'\", \"'\"\n end", "title": "" }, { "docid": "dc8478817a4ac9dfea0fb98045913b43", "score": "0.604817", "text": "def quote(str)\n '\"' << str.gsub(/[\\\\\\\"]/o, \"\\\\\\1\") << '\"'\n end", "title": "" }, { "docid": "41d757e8a5dce2b7866a1e28e6463ade", "score": "0.60369164", "text": "def esc\r\n \"\\\"#{self}\\\"\"\r\n end", "title": "" }, { "docid": "784db449d4b61d6c3faf5ef68ddca81c", "score": "0.6014472", "text": "def escape_for_single_quotes\n a = \"'\"\n b = \"\\'\"\n self.gsub(a,b)\n end", "title": "" }, { "docid": "90fa1fb19b9cca51605891bf84d9c00e", "score": "0.60107225", "text": "def add_quotes(str, qts='\"')\n if (str.is_a? String) and str.index(' ')\n str = qts+str+qts\n end\n str\nend", "title": "" }, { "docid": "44884db73979db9834a8a42eb631879f", "score": "0.6004002", "text": "def double_quote\n\n I18n.t 'support.string.double_quoted', string: self, default: self\n\n end", "title": "" }, { "docid": "6c24f08d96513e179575103499588b5e", "score": "0.59962285", "text": "def quote(str); end", "title": "" }, { "docid": "6c24f08d96513e179575103499588b5e", "score": "0.59962285", "text": "def quote(str); end", "title": "" }, { "docid": "e3998cf0bd8f1f03b7129b7eb2269009", "score": "0.5986617", "text": "def add_quotes_to_string(string)\n string = \"'#{string}'\"\n end", "title": "" }, { "docid": "30e538d2b6c187ef84fecc748d77545e", "score": "0.5976932", "text": "def quoted_string(str); end", "title": "" }, { "docid": "2561ec26fac6c02206a2941798254cbd", "score": "0.59769267", "text": "def quote\n quote_for(self) || '\"'\n end", "title": "" }, { "docid": "5783af06c13965212a6330f22b3bf544", "score": "0.59669983", "text": "def initial_quotes(text)\n return Typogruby.initial_quotes(text.to_s)\n end", "title": "" }, { "docid": "5a30636af065cfb453c911b593f2aeae", "score": "0.5949418", "text": "def quotePrefix; end", "title": "" }, { "docid": "f99e5c5757b36e764ee4ec59c9dc967b", "score": "0.59430856", "text": "def add_quotes_to_string(string)\n string = \"'#{string}'\"\n end", "title": "" }, { "docid": "f99e5c5757b36e764ee4ec59c9dc967b", "score": "0.59430856", "text": "def add_quotes_to_string(string)\n string = \"'#{string}'\"\n end", "title": "" }, { "docid": "f99e5c5757b36e764ee4ec59c9dc967b", "score": "0.59430856", "text": "def add_quotes_to_string(string)\n string = \"'#{string}'\"\n end", "title": "" }, { "docid": "7d1d2fbd6199833f4528ca07888f8f2c", "score": "0.592377", "text": "def quote(str)\n quoted?(str) ? str : \"\\\"#{str}\\\"\"\n end", "title": "" }, { "docid": "2be72b3fdb466f56540dee4c7fd5e17f", "score": "0.5913399", "text": "def quote(string)\n string.gsub(/'/, \"''\")\n end", "title": "" }, { "docid": "9b632ad9780d6ccfc06a0708a64bd68d", "score": "0.58925617", "text": "def quote( string )\n string.gsub( /'/, \"''\" )\n end", "title": "" }, { "docid": "9b632ad9780d6ccfc06a0708a64bd68d", "score": "0.58925617", "text": "def quote( string )\n string.gsub( /'/, \"''\" )\n end", "title": "" }, { "docid": "dc80d3f2bcd394481e6c06bb8c60996c", "score": "0.58833426", "text": "def quote(string); end", "title": "" }, { "docid": "242f389d42fa907717597b175cb54ed3", "score": "0.5882643", "text": "def quote(value)\n return value if quoted?(value)\n\n '\"%s\"' % value.gsub(/(?<!\\\\)\"/, '\\\"')\n end", "title": "" }, { "docid": "b3662927eac72289ab6e7cf0b92bf983", "score": "0.5876096", "text": "def quote1(opts) #single quote '\n \"&#39;#{opts[:text]}&#39;\"\n end", "title": "" }, { "docid": "1144fb6e572e33ea1b5a06dd82ec1fd1", "score": "0.5873638", "text": "def quote_and_escape(text, quote = '\"')\n \"#{quote}#{text.gsub(/#{quote}/) { |m| \"#{m}\\\\#{m}#{m}\" }}#{quote}\"\n end", "title": "" }, { "docid": "1144fb6e572e33ea1b5a06dd82ec1fd1", "score": "0.5873638", "text": "def quote_and_escape(text, quote = '\"')\n \"#{quote}#{text.gsub(/#{quote}/) { |m| \"#{m}\\\\#{m}#{m}\" }}#{quote}\"\n end", "title": "" }, { "docid": "1144fb6e572e33ea1b5a06dd82ec1fd1", "score": "0.5873638", "text": "def quote_and_escape(text, quote = '\"')\n \"#{quote}#{text.gsub(/#{quote}/) { |m| \"#{m}\\\\#{m}#{m}\" }}#{quote}\"\n end", "title": "" }, { "docid": "8a9e493283e2bfe094dde7a31cef7c93", "score": "0.58725166", "text": "def quoted_string(str)\n str = str.gsub(\"\\n\", \"\\\\n\").gsub(\"\\r\", \"\\\\r\")\n write(\"\\\"#{str}\\\"\")\n end", "title": "" }, { "docid": "72d6e2164ad1b672906c766a41bfb621", "score": "0.58517927", "text": "def option_quote(str)\n option?(str) ? str : quote(str)\n end", "title": "" }, { "docid": "9e555f12c919935d893d7286fdfc8dcc", "score": "0.585042", "text": "def dquote( str )\n '\"' + unquote(str).gsub(/[\\\\\"]/n) {|s| '\\\\' + s } + '\"'\n end", "title": "" }, { "docid": "ccae00fff868b962d992c9299cb9ab89", "score": "0.5847309", "text": "def quote(value); end", "title": "" }, { "docid": "4095566cf8c56df9fe0f4f09f04ecff1", "score": "0.58413166", "text": "def quote_string(s) #:nodoc:\n s.gsub(/'/, \"''\") # ' (for ruby-mode)\n end", "title": "" }, { "docid": "f037448686c7de9c4dd0fd72aca964fd", "score": "0.5803551", "text": "def quote(str)\n\t\t'\"' + str.gsub(/./){|c| (c =~ UNQUOTED_CHARS) ? c: '\\\\' + c} + '\"'\n\tend", "title": "" }, { "docid": "016e403027fc461f3989028853f6ba2b", "score": "0.58013415", "text": "def dquote(str); end", "title": "" }, { "docid": "46a3f0d153235288ad4444408d573824", "score": "0.57971513", "text": "def quoted_string\n string = match(:quoted_string)\n\n if string\n string[1..-2] # ignore quotes\n .gsub(/\\\\\"/, '\"')\n .gsub(/\\\\\\\\/, '\\\\')\n end\n end", "title": "" }, { "docid": "d114452a6530b40236269128281e0dea", "score": "0.5796931", "text": "def Quote(var)\n return \"\" if var == nil || var == \"\"\n Builtins.mergestring(Builtins.splitstring(var, \"'\"), \"'\\\\''\")\n end", "title": "" }, { "docid": "901aabd682937e062b37517dce733964", "score": "0.5796091", "text": "def quoted_newlines= val\n @gapi.configuration.load.update! allow_quoted_newlines: val\n end", "title": "" }, { "docid": "7e78c3d54b819fb0c31662e7583948d8", "score": "0.5795104", "text": "def quoted_definition_string\n \"'%s'\" % \\\n definition_string \\\n .gsub('\\\\') { '\\\\\\\\' } \\\n .gsub(\"'\") { \"\\\\'\" }\n end", "title": "" }, { "docid": "7e78c3d54b819fb0c31662e7583948d8", "score": "0.5795104", "text": "def quoted_definition_string\n \"'%s'\" % \\\n definition_string \\\n .gsub('\\\\') { '\\\\\\\\' } \\\n .gsub(\"'\") { \"\\\\'\" }\n end", "title": "" }, { "docid": "4d19ecc183e9f0a1f5725cef099bb0eb", "score": "0.57840145", "text": "def quote(str)\n '\"' << str.to_s << '\"'\nend", "title": "" }, { "docid": "61d799910a4f555fe8d4cc63ecc6921c", "score": "0.57746047", "text": "def escape_single_quotes\n self.gsub(\"'\", \"\\\\'\")\n end", "title": "" }, { "docid": "23ec4eb01203afb431c7b0b1155d2937", "score": "0.5772251", "text": "def quoted_string\n regexp(/' .*? '/x) |\n regexp(/\" .*? \"/x)\n end", "title": "" }, { "docid": "844bcdef63a530ab991c0d82f9b52e43", "score": "0.57670724", "text": "def quote_string(s)\n s.gsub(/'/, \"''\") # ' (for ruby-mode)\n end", "title": "" }, { "docid": "dd541b3797a46ec9fce313f3e5c220c0", "score": "0.57634956", "text": "def escape_for_double_quotes\n self.gsub('\"', '\\\"')\n end", "title": "" }, { "docid": "b396f6e0a9feb4ed97b985996a324c0e", "score": "0.5742344", "text": "def escape_for_single_quotes(str)\n str.gsub \"'\", \"''\"\n end", "title": "" }, { "docid": "900f6892888ce9ba92e98942bdece964", "score": "0.5741928", "text": "def safe_quote\n self.gsub(/['\"]/, '\\\\\\\"')\n end", "title": "" }, { "docid": "b1054fe2e82682d12ba8f884a6a42ae7", "score": "0.5738676", "text": "def quote(val)\n '\"' + val + '\"'\n end", "title": "" }, { "docid": "a7de26c93ec63bcfa83c4b5ef3bb419b", "score": "0.5719077", "text": "def quote(value)\n end", "title": "" }, { "docid": "5ae53559188a5c2c1adc29e39a9459b6", "score": "0.5718158", "text": "def quote(str)\n quoted?(str) ? str : \"\\\"#{str}\\\"\"\nend", "title": "" }, { "docid": "00a127a05ddefa1e00c54d3076a896b2", "score": "0.571059", "text": "def quote_string(s); end", "title": "" }, { "docid": "00a127a05ddefa1e00c54d3076a896b2", "score": "0.571059", "text": "def quote_string(s); end", "title": "" }, { "docid": "fec86d092a9b64b6fc7987d9a82330e1", "score": "0.5709932", "text": "def quote open='\"', close='\"'\n open + raw + close\n end", "title": "" }, { "docid": "8d1d4556798ff31ba5a8fb443c0cb772", "score": "0.5696654", "text": "def parse_quoted\n scan(/(\\\\\"|[^\"])*/).gsub(/\\\\(.)/, '\\1')\n end", "title": "" }, { "docid": "98209ca4450c6e19ccb56e1467d5623c", "score": "0.5683738", "text": "def option_quote(str)\n option?(str) ? str : quote(str)\nend", "title": "" }, { "docid": "d72c67ea480594a9c1e4b85f21d6dc91", "score": "0.56776977", "text": "def encode_quotes(text)\n end", "title": "" }, { "docid": "acd596ccbb86cb269fa8e0e0e54d657d", "score": "0.5667004", "text": "def quote(str)\n\t'\"' << str.to_s << '\"'\nend", "title": "" }, { "docid": "acd596ccbb86cb269fa8e0e0e54d657d", "score": "0.5666242", "text": "def quote(str)\n\t'\"' << str.to_s << '\"'\nend", "title": "" }, { "docid": "d6019077ba137b569ffba4e6c3a9d0db", "score": "0.56539404", "text": "def quoted(string)\n if string.to_s.match(/[\\t\\n\\r]/)\n string = string.gsub('\\\\', '\\\\\\\\\\\\\\\\').gsub('\"', '\\\\\"')\n\n %(\"\"\"#{string}\"\"\")\n else\n \"\\\"#{escaped(string)}\\\"\"\n end\n end", "title": "" }, { "docid": "8b72dca82a556a8aa84ebcad3f4a3926", "score": "0.5652461", "text": "def erase_quotation_marks(str)\n\tstr[0] = \"\" if str[0] == '\"'\n\tstr[-1] = \"\" if str[-1] == '\"'\n\treturn str\nend", "title": "" }, { "docid": "131385534191f56bac8be20e9b801fcd", "score": "0.56518525", "text": "def on_string_squote\n add_token(:T_STRING_SQUOTE)\n end", "title": "" }, { "docid": "b9871aca83e066edcd62defc0d35b824", "score": "0.564755", "text": "def ensure_quotes(h)\n h.each do |k, v|\n if v.is_a?(Hash)\n ensure_quotes(v)\n next\n end\n h[k] = v + \"__ensure_quotes__\\n \" unless v.blank?\n end\n end", "title": "" }, { "docid": "dc24dd780f6f77f19fd9dd9c6a5613e0", "score": "0.5622855", "text": "def on_string_dquote\n add_token(:T_STRING_DQUOTE)\n end", "title": "" }, { "docid": "6963e06d8df636b87d7597e7dc1034f8", "score": "0.5621149", "text": "def quote(string)\n '\"' + string + '\"'\nend", "title": "" }, { "docid": "0d6cfea9cb8fff4b74d1606734be717b", "score": "0.5619799", "text": "def quote(str)\n \"\\\"#{str}\\\"\"\nend", "title": "" }, { "docid": "a97e03cf91f6f0918919c7ee91591df6", "score": "0.5608439", "text": "def quote_char\n (quote_style == :double) ? '\"' : \"'\"\n end", "title": "" }, { "docid": "71804defa0732525ab672abedbc08463", "score": "0.5608014", "text": "def quo(str) \"\\\"#{str.gsub('\"','\\\\\"')}\\\"\".ljust(14) end", "title": "" }, { "docid": "06163fea61592928a63a55e6ca8f1105", "score": "0.5594588", "text": "def quoted_string_for_text(text)\n if text =~ /[\\r\\n]/\n text = \"%{#{escape_multiline_text(text)}}\"\n else\n text = \"\\\"#{escape_single_line_text(text)}\\\"\"\n end\n end", "title": "" }, { "docid": "01f59a2034f9465a776fd21316fa02ab", "score": "0.55715245", "text": "def tex_quote\n ''\n end", "title": "" }, { "docid": "d08f595aeb6bec4c98f57fa4fe6e2157", "score": "0.5571477", "text": "def quotes(q); end", "title": "" }, { "docid": "a685304a6b3e6af416f0b9b5d31cc5ec", "score": "0.55515856", "text": "def qesc(s)\n s.gsub(\"'\", \"''\")\nend", "title": "" }, { "docid": "2c714fd72aa9d844d2ae0293fe451692", "score": "0.5551483", "text": "def escape_value (value)\n value = value.to_s # turn it into a string\n value = value.gsub('\"', '\"\"') # turn all embedded double quotes into double double-quotes\n\n # surround it with double quotes if it contains the delimiter or double quotes or a carriage return.\n if value.include?(@delimiter) ||\n value.include?(QUOTE) ||\n value.include?(ROW_END_CHAR)\n\n value = '\"' + value + '\"'\n end\n\n value\n end", "title": "" }, { "docid": "fa997dbb5ce4f7b00b95c62fd911503f", "score": "0.55337167", "text": "def esc(v)\n return \"'\" + v.gsub(/\\'/, \"''\") + \"'\"\nend", "title": "" }, { "docid": "542ec00e598167c1aca5cd45f7c68b4a", "score": "0.5521109", "text": "def quote_string(s)\n s.gsub(/\\\\/, '\\&\\&').gsub(/'/, \"''\") # ' (for ruby-mode)\n end", "title": "" }, { "docid": "542ec00e598167c1aca5cd45f7c68b4a", "score": "0.5521109", "text": "def quote_string(s)\n s.gsub(/\\\\/, '\\&\\&').gsub(/'/, \"''\") # ' (for ruby-mode)\n end", "title": "" }, { "docid": "542ec00e598167c1aca5cd45f7c68b4a", "score": "0.5521109", "text": "def quote_string(s)\n s.gsub(/\\\\/, '\\&\\&').gsub(/'/, \"''\") # ' (for ruby-mode)\n end", "title": "" }, { "docid": "0ea781a38409bab41564f6b95e5f3cdb", "score": "0.55180883", "text": "def path_quote\n self.safe_quote.gsub(/[ ]/, '\\ ')\n end", "title": "" }, { "docid": "8528b705c13fe66117b484272703ce50", "score": "0.5506952", "text": "def chars_quoted_pair\n chars = chars_text.map {|c| \"\\\\\" + c }\n chars += chars_obs_qp\n chars\n end", "title": "" }, { "docid": "1a72374d0fee9f3d9c43f6f14d816524", "score": "0.55053866", "text": "def dress_up_quotes(name)\r\n name[' '] ? \"\\\"#{name}\\\"\" : name\r\n end", "title": "" }, { "docid": "c6368fbf1dfcb15c348e77261443c7f7", "score": "0.54958725", "text": "def to_quoted(string)\n return \"\\\"\" + \n string.gsub(/[\\\"]|#\\{/, \"\\\"\" => \"\\\\\\\"\", \"\\#{\" => \"\\\\\\#{\") +\n \"\\\"\"\n #}}} This comment is just to avoid confusing the text editor.\n end", "title": "" }, { "docid": "e2dbedffb8643f96de69af41ed14c71f", "score": "0.5486611", "text": "def escape(value)\r\n value.gsub(/\"/,'\"\"')\r\n end", "title": "" } ]
41b7bb7206dbdfd697943b7bcc15c016
rescue_from Kibali::AccessDenied do |e| render :text => 'AccessDenied' end protected
[ { "docid": "2f04869fcadc6b5189637f3fba38f6bc", "score": "0.0", "text": "def set_current_user\n if params[:user].blank?\n self.my_current_user = nil\n else\n self.my_current_user = User.find params[:user]\n end\n end", "title": "" } ]
[ { "docid": "05b41dc6f0ea5de638effd37c8422c1d", "score": "0.7338408", "text": "def access_denied\n render \"common/access_denied\"\n end", "title": "" }, { "docid": "ee88ae6cb2c35769b489c98ddb105ba7", "score": "0.72527504", "text": "def access_denied\n render status: 401, text: \"nice try\"\n end", "title": "" }, { "docid": "3c42311f8721bc4daa5d7a9d02ee8c92", "score": "0.7165773", "text": "def access_denied\n respond_to do |format|\n format.html {\n flash[:error] = \"Sie sind nicht angemeldet oder nicht berechtigt, auf die angeforderte Seite zuzugreifen.\"\n render text: \"\", layout: true, status: :unauthorized\n }\n \n format.any {\n head status: :unauthorized\n }\n end\n end", "title": "" }, { "docid": "31a747685fb5165d94e43687168f82ee", "score": "0.7085312", "text": "def access_denied\n\n end", "title": "" }, { "docid": "236bb2bded191347f380faa9cfb15bc8", "score": "0.707193", "text": "def access_denied_handler(exception)\n __debug_exception('RESCUE_FROM', exception)\n msg = exception.message\n respond_to do |format|\n format.html { redirect_back(fallback_location: root_path, alert: msg) }\n format.json { render_json({ error: msg }, status: :unauthorized) }\n format.xml { render_xml({ error: msg }, status: :unauthorized) }\n end\n rescue => error\n error_handler_deep_fallback(__method__, error)\n end", "title": "" }, { "docid": "93880e9b00e074f195a89699e5747c71", "score": "0.70582116", "text": "def access_denied\n end", "title": "" }, { "docid": "53fdb068dde5a6ac8d28073daec81b7a", "score": "0.7053628", "text": "def access_denied(exception)\n \t\tredirect_to root_path, :alert => exception.message\t\n \tend", "title": "" }, { "docid": "d669f71253d8a2c800ce87d208c07734", "score": "0.69766486", "text": "def access_denied\n error = error_response_method($e12)\n render :json => error\n end", "title": "" }, { "docid": "b30ce07a623a3b0526ee5f8815072135", "score": "0.69438463", "text": "def render_access_denied_page\n # Render fail page\n @meta = {}\n @meta[:title] = \"Access Denied\"\n @meta[:description] = \"You do not have access to this application\"\n render :template => \"pages/app_access_unauthorized\", :layout => 'application', :status => :forbidden\n end", "title": "" }, { "docid": "f2a2c9dd223b2d26c791d352e6d890f5", "score": "0.6941883", "text": "def rescue_unauthorized\n render nothing: true, status: 403\n end", "title": "" }, { "docid": "f2a2c9dd223b2d26c791d352e6d890f5", "score": "0.6941883", "text": "def rescue_unauthorized\n render nothing: true, status: 403\n end", "title": "" }, { "docid": "0ef56a9d6e428eca2c92909597aa6d6b", "score": "0.69130826", "text": "def access_denied!\n render partial: 'errors/401', status: 401 && return\n end", "title": "" }, { "docid": "b4f3edc2239221a826642eecaf1b7a97", "score": "0.6909413", "text": "def permission_denied\n render :template => \"shared/permission_denied\",\n :status => :forbidden\n end", "title": "" }, { "docid": "53d99d7939b0c58e0dd3d7d479c39841", "score": "0.688284", "text": "def forbidden\n\n render_error( :forbidden )\n\n end", "title": "" }, { "docid": "cc1b3a89ae510d127653dba23ec71e33", "score": "0.6860675", "text": "def permission_denied\n # render :status => 403, :json => {:message => \"You don't have permission to do that.\"}\n end", "title": "" }, { "docid": "ce40792c83b9c3511c35ab2f41492656", "score": "0.68545294", "text": "def access_denied(exception)\n \t\tredirect_to root_path, alert: exception.message\n\t end", "title": "" }, { "docid": "68badae72e46d5d92c1f5e8657028802", "score": "0.67791367", "text": "def cancan_exception_handling\n insert_into_controller :application, :after => \"ActionController::Base\\n\" do\n %{\n rescue_from CanCan::AccessDenied do |exception|\n flash[:error] = exception.message\n redirect_to root_url\n end\n }\n end\n end", "title": "" }, { "docid": "5da25b3d5f0f7f75e33421d8089652f6", "score": "0.67541456", "text": "def access_denied\n flash[:error] = I18n.t('activerecord.errors.messages.access_denied')\n redirect_to welcome_path\n end", "title": "" }, { "docid": "90903cc22a75ca9af9f7a3a7af35f38c", "score": "0.67313474", "text": "def access_denied(exception)\n redirect_to root_path, alert: exception.message\n end", "title": "" }, { "docid": "802a24c9dd6c26849e864d7c77e47eab", "score": "0.6724344", "text": "def permission_denied\n respond_to do |format|\n format.html { render :template => \"shared/forbidden\", :status => :forbidden }\n format.any { head :forbidden }\n end\n end", "title": "" }, { "docid": "da9dc652e61001d74e9fcd2538e08a44", "score": "0.67177117", "text": "def access_denied\n redirect_to main_app.root_url, alert: \"Not authorized\"\n end", "title": "" }, { "docid": "bc7aaab5f9e4ab2747612823a2830fb8", "score": "0.6714283", "text": "def supervisor_access_denied!(options = {})\n render file: \"#{Rails.root}/public/403.html\", :status => :forbidden, layout: false, content_type: 'text/html'\n end", "title": "" }, { "docid": "f4208f305a320425883f18f141774ace", "score": "0.66934294", "text": "def access_denied\n #@flash[:notice] = \"Permission denied.\"\n redirect_to :controller=>\"account\", :action =>\"login\"\n end", "title": "" }, { "docid": "0eb2020643eccaea74250ce28faaeee7", "score": "0.6690215", "text": "def unauthorized\n\n render_error( :unauthorized )\n\n end", "title": "" }, { "docid": "5c7d903c59252b42e2b3beefdbae2ad8", "score": "0.6678191", "text": "def access_denied\n flash[:danger] = \"Access denied. Please log in.\"\n redirect_to login_path\n end", "title": "" }, { "docid": "452b56735159f051a14fc192e522df5d", "score": "0.66770273", "text": "def access_denied\n flash[:notice] = \"No tiene permisos de acceso\"\n redirect_to :controller=>\"home\", :action =>\"index\"\n end", "title": "" }, { "docid": "5d9a89dfb9322ec24ebd3144811c940c", "score": "0.6672777", "text": "def rescue_action_in_public(exception)\n render :template => \"shared/error\", :status => \"500\"\n end", "title": "" }, { "docid": "187b2d19ce9d4dc72ddc77ca5aed7eec", "score": "0.6671818", "text": "def permission_denied\n flash[:error] = \"Usted no tiene permisos para acceder a esta pagina.\"\n redirect_to root_url\n end", "title": "" }, { "docid": "92b70acc07062d85b03c1c52c5109e53", "score": "0.66692084", "text": "def rescue_action_in_public exception\n case exception\n when Hobo::PermissionDeniedError \n redirect_to :controller => :front, :action => :index\n else\n # **TODO Fix to the \"when\" to catch the correct exception;\n # in the meantime, catch every exception\n redirect_to :controller => :front, :action => :index\n end\n end", "title": "" }, { "docid": "94429d1ad94ffd79b3eba7bf52edc6b1", "score": "0.6665019", "text": "def access_denied\n render :json => %Q~{\"errors\": [\"Please login to consume the REST API\"]}~, :status => 401\n end", "title": "" }, { "docid": "94429d1ad94ffd79b3eba7bf52edc6b1", "score": "0.6665019", "text": "def access_denied\n render :json => %Q~{\"errors\": [\"Please login to consume the REST API\"]}~, :status => 401\n end", "title": "" }, { "docid": "94429d1ad94ffd79b3eba7bf52edc6b1", "score": "0.6665019", "text": "def access_denied\n render :json => %Q~{\"errors\": [\"Please login to consume the REST API\"]}~, :status => 401\n end", "title": "" }, { "docid": "94429d1ad94ffd79b3eba7bf52edc6b1", "score": "0.6665019", "text": "def access_denied\n render :json => %Q~{\"errors\": [\"Please login to consume the REST API\"]}~, :status => 401\n end", "title": "" }, { "docid": "94429d1ad94ffd79b3eba7bf52edc6b1", "score": "0.6665019", "text": "def access_denied\n render :json => %Q~{\"errors\": [\"Please login to consume the REST API\"]}~, :status => 401\n end", "title": "" }, { "docid": "94429d1ad94ffd79b3eba7bf52edc6b1", "score": "0.6665019", "text": "def access_denied\n render :json => %Q~{\"errors\": [\"Please login to consume the REST API\"]}~, :status => 401\n end", "title": "" }, { "docid": "94429d1ad94ffd79b3eba7bf52edc6b1", "score": "0.6665019", "text": "def access_denied\n render :json => %Q~{\"errors\": [\"Please login to consume the REST API\"]}~, :status => 401\n end", "title": "" }, { "docid": "e910c14b59989642940efd94ccb0327b", "score": "0.66569406", "text": "def permission_denied(exception)\n log_error(exception, request.fullpath)\n render \"errors/permission_denied\"\n end", "title": "" }, { "docid": "fdfe839b59bf07d8cfc33e3928f6057e", "score": "0.66499716", "text": "def render_access_denied\r\n RenderError.new('422')\r\n end", "title": "" }, { "docid": "ed830d3b3d1f4033c0b715cad4fb24ea", "score": "0.66488665", "text": "def permision_denied_error\n error(403, 'Permision Denied!')\n end", "title": "" }, { "docid": "80c959f3ec1f70c62dccc74ad741b533", "score": "0.6623164", "text": "def permission_denied\n\t\tflash[:error] = \"You do not have access to view that material.\"\n\t\tredirect_to root_url\n\tend", "title": "" }, { "docid": "98c4ae9dc4fbd8b21694e172e74372eb", "score": "0.6619899", "text": "def permission_denied\n flash[:error] = 'Sorry, your account has insufficient privileges for the requested resource.'\n redirect_to :root\n end", "title": "" }, { "docid": "98c4ae9dc4fbd8b21694e172e74372eb", "score": "0.6619899", "text": "def permission_denied\n flash[:error] = 'Sorry, your account has insufficient privileges for the requested resource.'\n redirect_to :root\n end", "title": "" }, { "docid": "60746a8c2b1c916e083a6a6f2af9d500", "score": "0.6613469", "text": "def permission_denied\n respond_to do |format|\n flash[:error] = 'Sorry, you are not allowed to view the requested page.'\n format.html { redirect_to(:back) rescue redirect_to('/') }\n format.xml { head :unauthorized }\n format.js { head :unauthorized }\n end\n end", "title": "" }, { "docid": "d7df26d105d6b9106cab78dcc37a9b20", "score": "0.6604821", "text": "def admin_access_denied(exception)\n redirect_to root_path, alert: exception.message\n end", "title": "" }, { "docid": "1d79bfdf2c2f1ffe0902db356f16ac1d", "score": "0.658979", "text": "def rescue_action_in_public(exception)\n # Make sure expiry time for session is set (before_filters are\n # otherwise missed by this override) \n session_remember_me\n\n # Display user appropriate error message\n @exception_backtrace = exception.backtrace.join(\"\\n\")\n @exception_class = exception.class.to_s\n render :template => \"general/exception_caught.rhtml\", :status => 404\n end", "title": "" }, { "docid": "5973d5288c68aa60a28c83714d9b8f7f", "score": "0.6560096", "text": "def access_denied\n store_location\n redirect_to root_path(:target => request.request_uri)\n #respond_to do |format|\n # format.json do\n # render :partial => \"json/response\",\n # :locals => {\n # :success => false,\n # :message => \"Authorization Required\",\n # :body => nil}\n # end\n # format.html do \n # redirect_to root_path#(:after_login => request.request_uri)\n # end\n #end\n end", "title": "" }, { "docid": "e19ff83faf456b6365d9dd9a0b4fc1d5", "score": "0.655798", "text": "def permission_denied\n flash[:alert] = \"Desculpe, voce nao tem permisao.\"\n redirect_to root_url\n end", "title": "" }, { "docid": "8a46ff1b0d53612b42ad5c3891c74558", "score": "0.65538603", "text": "def deny_access(exception)\n # For the JSON message, we don't want to display the default CanCan messages,\n # just custom Hydra messages such as \"This item is under embargo.\", etc.\n json_message = exception.message if exception.is_a? Hydra::AccessDenied\n if current_user && current_user.persisted?\n respond_to do |wants|\n wants.html do\n if [:show, :edit, :create, :update, :destroy].include? exception.action\n render 'curation_concerns/base/unauthorized', status: :unauthorized\n else\n redirect_to main_app.root_url, alert: exception.message\n end\n end\n wants.json { render_json_response(response_type: :forbidden, message: json_message) }\n end\n else\n session['user_return_to'.freeze] = request.url\n respond_to do |wants|\n wants.html { redirect_to main_app.new_user_session_path, alert: exception.message }\n wants.json { render_json_response(response_type: :unauthorized, message: json_message) }\n end\n end\n end", "title": "" }, { "docid": "074d6103ae264799dd842d771fb68e48", "score": "0.65517867", "text": "def render_403\n respond_to do |format|\n format.html { render :template => 'errors/error_403', status: 403 }\n format.any { head :forbidden }\n end\n end", "title": "" }, { "docid": "0ad0599914e4ebf4fead4404d0f493ba", "score": "0.6545235", "text": "def permission_denied\n flash[:error] = \"Sorry, you are not allowed to access this module\"\n redirect_to :controller=>\"dashboard\"\n end", "title": "" }, { "docid": "50b15cac571078713e1f33e029e6e9f5", "score": "0.6542805", "text": "def rescue_from_access_denied(exception)\n if user_signed_in?\n if params[:s].present? && controller_name != 'home'\n redirect_to :home\n return\n end\n else\n if request.get?\n session[\"user_return_to\"] = request.fullpath\n redirect_to new_user_session_path\n return\n end\n end\n\n raise exception\n end", "title": "" }, { "docid": "9a50041e01512d3f27f3909bcd967c18", "score": "0.65413314", "text": "def rescue_action_in_public(exception) #:doc:\n render_text \"<html><body><h1>Application error (Rails)</h1></body></html>\"\n end", "title": "" }, { "docid": "9a50041e01512d3f27f3909bcd967c18", "score": "0.65413314", "text": "def rescue_action_in_public(exception) #:doc:\n render_text \"<html><body><h1>Application error (Rails)</h1></body></html>\"\n end", "title": "" }, { "docid": "89548f9c728919e0ee8460fe18c1107f", "score": "0.6538214", "text": "def access_denied\n redirect_to controller: :users, action: :login\n end", "title": "" }, { "docid": "e2a7b098b9c1f7b22edcf78e21a71a10", "score": "0.65298533", "text": "def access_denied\n if ( user_signed_in? )\n render :file => File.join( RAILS_ROOT, 'public', '404.html' ),\n :status => :not_found\n else\n authenticate_user!\n end\n end", "title": "" }, { "docid": "37c76d54c5c295c8934fd993675cc368", "score": "0.65152454", "text": "def access_denied\n if @current_user\n render_401\n else\n redirect_to \"#{FUSESOURCE_URL}/login?return_to=#{external_url_to(request.request_uri)}\"\n end\n end", "title": "" }, { "docid": "6c072daf389130cfbaf6b93b2322969e", "score": "0.6514669", "text": "def deny_access\n respond_to do |format|\n format.html {\n flash[:alert] = 'You are not authorized to perform this action'\n\n redirect_to root_path\n }\n\n format.json {\n # Some schools of thought advocate the use of 404 (:not_found). See\n # http://www.bennadel.com/blog/2400-handling-forbidden-restful-requests-401-vs-403-vs-404.htm\n render json: {}, status: :unauthorized\n }\n end\n end", "title": "" }, { "docid": "42689637eb9b9825278f908bf665e047", "score": "0.65113527", "text": "def rescue_action_in_public(exception)\n case exception\n when CustomNotFoundError, ::ActionController::UnknownAction then\n #render_with_layout \"shared/error404\", 404, \"standard\"\n render :template => \"errors/404\", :status => 404\n else\n #@reference = Xircles::Logger.log( exception, binding )\n render :template => 'errors/generic', :status => 500\n end\n end", "title": "" }, { "docid": "6b685d71f405b6afa97364388c2db346", "score": "0.65079486", "text": "def not_allowed! redirect = root_url\n raise Exceptional::Unauthorized.new(\"Sorry, I was could not perform the action you requested!\")\n end", "title": "" }, { "docid": "22bc319aff13c7eb70d05730364d57ff", "score": "0.65053725", "text": "def access_denied\n return render(text: 'access_denied: requires a role')\n end", "title": "" }, { "docid": "89b428861ee100fe991c12d243c8116a", "score": "0.6504815", "text": "def rescue_action_in_public(exception)\n flash[:error] = exception\n redirect_to(:controller => 'account', :action => 'error')\n end", "title": "" }, { "docid": "fde7b12958fd2d8aa90abf4d3359b069", "score": "0.64980775", "text": "def access_denied\n redirect '/login'\n end", "title": "" }, { "docid": "f7e55afde08c21a59da5975fc4bc823f", "score": "0.649473", "text": "def access_denied\n {\n :html => 'Sorry, we cannot verify that you are a user. Please reinstall this Raplet.',\n :status => 401\n }\n end", "title": "" }, { "docid": "3a3208a145695a3fa3283475e334f7a8", "score": "0.64886516", "text": "def umn_access_denied\n redirect_to(login_and_redirect_url)\n end", "title": "" }, { "docid": "9bb27b174910275084d6dc1581049369", "score": "0.64875656", "text": "def access_denied(exception)\n redirect_to request.referer || root_path, :alert => exception.message\n end", "title": "" }, { "docid": "2d2d6479b92baf09e9e8658ccbbb8e41", "score": "0.6480281", "text": "def new\n flash[:error] = t(\"messages.errors.access_denied\")\n redirect_to root_path\n end", "title": "" }, { "docid": "5713640e1de0151e9a294aed23c7e364", "score": "0.6472988", "text": "def access_denied(msg=MESSAGE_INSUFFICIENT_RIGHTS)\n flash[:error] = msg\n redirect_to root_url\n return false\n end", "title": "" }, { "docid": "1758d72132369c7b16af9fd4828c9fe2", "score": "0.6455199", "text": "def authority_forbidden(error)\n Authority.logger.warn(error.message)\n render :file => Rails.root.join('public', '403.html'), :status => 403, :layout => false\n end", "title": "" }, { "docid": "10404423cec5893a1ccfceefd3500205", "score": "0.64523643", "text": "def access_denied(msg)\n flash[:error] = msg\n redirect_to root_path\n end", "title": "" }, { "docid": "662c71ca44fe82f63b44e1e24303ab6e", "score": "0.64399946", "text": "def access_denied\n redirect_to :controller => \"/usr\", :action => \"login\"\n end", "title": "" }, { "docid": "42aa08adefff7862d6c004c85d580e6e", "score": "0.64263505", "text": "def access_denied(exception)\n redirect_to admin_organizations_path, alert: exception.message\n end", "title": "" }, { "docid": "9f0b487a99d9d751fc537299de34d40b", "score": "0.64170504", "text": "def access_denied\n if logged_in?\n flash[:notice] = I18n.t('application.not_authorized')\n respond_to do |f|\n f.html do\n unless request.xhr?\n redirect_to current_user.has_any_role? ? admin_nodes_path : root_path\n else\n render text: flash[:notice], status: :forbidden # Render HTML\n end\n end\n f.js do\n render :update do |page|\n page.redirect_to '/admin' # Redirect through JS\n end\n end\n f.json do\n render json: { error: flash[:notice] }.to_json, status: :forbidden\n end\n end\n else\n super\n end\n end", "title": "" }, { "docid": "d4874a237237b2f0565d6ad3e6e1862a", "score": "0.6403703", "text": "def access_denied\n respond_to do |format|\n format.html do\n store_location\n #redirect_to new_<%= sessions_singular_name %>_path\n redirect_to :controller => 'sessions', :action => 'index'\n end\n end\n end", "title": "" }, { "docid": "58aa75121c0343595b073daacba75e56", "score": "0.6395397", "text": "def deny_access\n @status = 401\n respond_to do |format|\n format.html { render template: \"errors/401\", status: @status, layout: \"errors\" }\n format.all { render nothing: true, status: @status }\n end\n end", "title": "" }, { "docid": "96d254d38497944091edb2848c2c391a", "score": "0.63921213", "text": "def permission_denied\n\t\tif current_user\n\t\t\tflash[:warning] = \"Sorry, your account is not allowed to do that. Try another?\"\n\t\telse\n\t\t\tflash[:notice] = \"To do that, I need to know who you are.\"\n\t\tend\n\t\tif request.request_method == :get\n\t\t\tsession[:next] = request.request_uri\n\t\telse\n\t\t\tsession.delete(:next)\n\t\tend\n\t\tlogin_page = url_for :controller => :user_sessions, :action => :new, :secure => true, :host => request.host\n\t\trespond_to do |format|\n\t\t\tformat.html { return redirect_to login_page }\n\t\t\tformat.js { render(:update) {|p| p.redirect_to login_page }}\n\t\t\tformat.all { render :file => \"#{RAILS_ROOT}/public/403.html\", :status => '403 Forbidden' }\n\t\tend\n\t\tno_cache\n\tend", "title": "" }, { "docid": "98672fc36eafde9b1fc5c6ba642fca96", "score": "0.6380267", "text": "def rescue_cancan\n redirect_to login_path, alert:'You are not authorized to access that page!'\n end", "title": "" }, { "docid": "9d66093850f6d36eedbdf3f115cb5f76", "score": "0.6379682", "text": "def permission_denied\n flash[:notice] = \"Usted no tiene los privilegios para realizar esta acción.\" \n return redirect_to(:controller => 'login', :action => 'denied')\n end", "title": "" }, { "docid": "e80fdf6e691bc5e7b12097d44aab66db", "score": "0.6357489", "text": "def not_authorized\n flash[:error] = I18n.t :forbidden\n response.headers['Status-Code'] = '403'\n redirect_to root_path\n end", "title": "" }, { "docid": "e6349ab1aa58872485420558f79e3601", "score": "0.6349178", "text": "def permission_denied \n flash[:error] = \"Извините, у вас нет доступа к этой странице.\" \n redirect_to ('/')\n end", "title": "" }, { "docid": "0f6613772121511a8dec179add75cba7", "score": "0.6348276", "text": "def render_error(msg, status)\n render_403\n end", "title": "" }, { "docid": "ffdd4d113f9b4f64ee32243b64887566", "score": "0.6337338", "text": "def permission_denied\n flash[:error] = 'Sorry, you are not allowed to the requested page.'\n respond_to do |format|\n format.html { logged_in? ? redirect_back_or_default(root_path) : redirect_to(login_path) } \n format.xml { head :unauthorized }\n format.js { head :unauthorized }\n end\n end", "title": "" }, { "docid": "4d0480452d9ea563faf2bd9a358ce874", "score": "0.6320728", "text": "def render_forbidden\n render :file => File.join(Rails.root.to_s, 'public/403.html'), :status => :forbidden, :layout => false\n end", "title": "" }, { "docid": "5cf20e77ef1c2a95bda1f866fdd3cee2", "score": "0.6316626", "text": "def permission_denied\n flash[:alert] = I18n.t(current_user ? :access_denied : :unauthenticated, :scope => :\"devise.failure\")\n\n respond_to do |format|\n format.js { head 401 }\n format.xml { head 401 }\n format.html do \n if request.xhr?\n head 401\n else \n store_path_with_scope\n redirect_to(permission_denied_fallback_url)\n end\n end\n end\n end", "title": "" }, { "docid": "a2e7662ee3b65bcc401a42ded20662b8", "score": "0.63154095", "text": "def rescue_action_in_public(exception)\n logger.error exception\n\n case exception\n when ActiveRecord::RecordNotFound, ActionController::RoutingError, ActionController::UnknownAction\n error_404\n when SecurityError\n error_403\n else\n error_500\n end\n end", "title": "" }, { "docid": "c15ec0eb9083428d6c955db90386d82f", "score": "0.6308585", "text": "def error_403\n render 'error/error403'\n end", "title": "" }, { "docid": "b3589ad4bcb49f1b23a1c936212abf91", "score": "0.6305105", "text": "def deny_access\n store_location\n redirect_to signin_path, :notice =>'Merci de vous identifier pour accéder à cette page.'\n end", "title": "" }, { "docid": "7017d32c4ee02d911d25a20dea1a87c3", "score": "0.6293784", "text": "def error_403\n end", "title": "" }, { "docid": "a9ad91a8fcd494737b9eefbb475cbd7e", "score": "0.62883484", "text": "def appctrl_not_permitted\n render( { :text => 'Action not permitted', :status => 403 } )\n end", "title": "" }, { "docid": "874867b067b724efc75f1d6114fdf43e", "score": "0.628387", "text": "def authority_forbidden(error)\n Authority.logger.warn(error.message)\n redirect_to request.referrer.presence || root_path, :alert => '당신은 이 행동을 수행할 권한이 없습니다.'\nend", "title": "" }, { "docid": "749aa010956d3b5ea7166283cbc551b3", "score": "0.62742203", "text": "def access_denied\n redirect_to login_path, :notice => \"Veuillez vous enregistrer pour continuer\" and return false\n end", "title": "" }, { "docid": "e0c6c4aa4bb7b43368268bd007e186c6", "score": "0.62742066", "text": "def access_denied\n redirect_to signin_url\n end", "title": "" }, { "docid": "ff0c2681ed91092a1222f8818754d9b8", "score": "0.6249542", "text": "def access_denied\n redirect_to(new_account_login_path)\n end", "title": "" }, { "docid": "13667e3d4ac0650278a335f077378327", "score": "0.6246902", "text": "def unavailable! redirect = root_path\n raise Exceptional::NotAllowed.new(\"Sorry, I was unable to perform the action you requested!\")\n end", "title": "" }, { "docid": "7ffa7ce88c7ccac910c36baa1051a54f", "score": "0.6243838", "text": "def access_denied\n render :file => \"#{RAILS_ROOT}/public/422.html\", :status => 422 and return\n end", "title": "" }, { "docid": "8c739c3defdcab82466e670d502b575d", "score": "0.6201325", "text": "def invalid_authentication\n render json: { error: 'Invalid request' }, status: 403\n end", "title": "" }, { "docid": "1a17104a6f9de6dde51e4f4fd973e530", "score": "0.61963713", "text": "def access_denied(body = nil)\n error 403, body\n end", "title": "" }, { "docid": "a33548c79cc5e8a4793301bc03522082", "score": "0.6189766", "text": "def rescue_with_handler(exception)\n\t\tif current_user and current_user.is_administrator?\n\t\t\treturn\n\t\t\t@exception = exception\n\t\tend\n\t\t\n\t\tif current_user\n\t\t\trender template: \"errors/500\"\n\t\telse\n\t\t\trender template: \"errors/500\", layout:\"login\"\n\t\tend\n\tend", "title": "" }, { "docid": "e2d5bfd045801a3d6c382eb3653de4d6", "score": "0.6178292", "text": "def access_denied\n redirect_to :controller => '/account', :action => 'login'\n end", "title": "" }, { "docid": "628b1a0b878968f2fe3547ec52e097a0", "score": "0.6175186", "text": "def forbidden\n respond_with 403\n end", "title": "" }, { "docid": "f10dd551d996683b76c6841148c77966", "score": "0.6162163", "text": "def new\n raise CanCan::AccessDenied\n end", "title": "" }, { "docid": "368bd0658cd590f8ec2f501202445599", "score": "0.6160946", "text": "def not_authorized(msg = \"Access Denied. You don't have access to this resource.\")\n flash[:error] = msg\n redirect_to root_path\n end", "title": "" } ]
11de2732738b18d0b9ad89cf50d5015b
Sets board element of move index to respective player's token
[ { "docid": "97e2db62a74731baec8d986a045b77bd", "score": "0.8641832", "text": "def move(move_index, player_token = \"X\")\r\n @board[move_index] = player_token\r\n end", "title": "" } ]
[ { "docid": "a59114590ad2946c2b43eef9b53e2a3c", "score": "0.89151615", "text": "def move (board, index, token)\n #token = current_player(board)\n board[index] = token\nend", "title": "" }, { "docid": "dfcb13904575284f771ce6da260fcd17", "score": "0.87792635", "text": "def move(board_index, player_token = \"X\")\n @board[board_index] = player_token\n end", "title": "" }, { "docid": "1ca781e313055a04b0e5011b48a82b32", "score": "0.85774696", "text": "def player_move(board, index, current_player_token)\r\n board[index] = current_player_token\r\nend", "title": "" }, { "docid": "8748e2e551d2c1eb894a932e9f15bcf4", "score": "0.85668796", "text": "def move(index,token)\n return @board[index] = token\n end", "title": "" }, { "docid": "7201c622b9c689cfaa95a4e3947ef639", "score": "0.8554173", "text": "def move(index, token = 'X')\n @board[index] = token\nend", "title": "" }, { "docid": "f36944ae4c4e7be7b6c0a2e1a082a8ec", "score": "0.854658", "text": "def move(board, index, token)\n board[index] = token\nend", "title": "" }, { "docid": "f36944ae4c4e7be7b6c0a2e1a082a8ec", "score": "0.854658", "text": "def move(board, index, token)\n board[index] = token\nend", "title": "" }, { "docid": "f36944ae4c4e7be7b6c0a2e1a082a8ec", "score": "0.854658", "text": "def move(board, index, token)\n board[index] = token\nend", "title": "" }, { "docid": "4047e1c267c7e62eb15886c02c406a8c", "score": "0.85245067", "text": "def move(index, token = \"X\")\n @board[index] = token\n end", "title": "" }, { "docid": "f2f63f71a308d6359338c178bf937b05", "score": "0.8488212", "text": "def move(board, index, token)\n board[index] = token\n display_board(board)\nend", "title": "" }, { "docid": "849991b2e48ff2e66c0310f914647c33", "score": "0.83638704", "text": "def move(position, player_token)\n @board[position] = player_token\n end", "title": "" }, { "docid": "f6fb10e7c0fd3d83b47ed63ad3ba5536", "score": "0.8335813", "text": "def move(board, index, token=\"X\")\n board[index] = token\n return board\nend", "title": "" }, { "docid": "9e940e3945cf8ace26886a0470d55b2d", "score": "0.83138806", "text": "def move (board, index, token = \"X\")\n board[index] = token\nend", "title": "" }, { "docid": "9f02327af5a2f86a26f3bb72e68c1bf4", "score": "0.83084065", "text": "def move(board, index, token = \"X\")\r\n board[index] = token\r\nend", "title": "" }, { "docid": "25c669c6036746ef9345e60db6def779", "score": "0.82971394", "text": "def move(board, index, token = \"X\")\n board[index] = token\nend", "title": "" }, { "docid": "25c669c6036746ef9345e60db6def779", "score": "0.82971394", "text": "def move(board, index, token = \"X\")\n board[index] = token\nend", "title": "" }, { "docid": "4de87a63c1d08befddc9fc256d88d6d6", "score": "0.8281446", "text": "def move(board, index, token = \"X\")\n board[index] = token\n display_board(board)\nend", "title": "" }, { "docid": "46c2f9fc9b74895fe2a493b5b4369411", "score": "0.82669187", "text": "def move(board, index, token = \"X\")\n board[index] = token\nend", "title": "" }, { "docid": "4d66843b71789ad9561f5bdbe6dc491f", "score": "0.8234707", "text": "def move(index, token = \"X\")\n\t\t@board[index] = token\n\t\tdisplay_board\n\tend", "title": "" }, { "docid": "f26a7e611dd9ac05748dc4dcbbc7eed2", "score": "0.8041783", "text": "def move(board, position, token)\n board[position] = token\nend", "title": "" }, { "docid": "d7b05608d442a6948ecb4b3e95ec9be0", "score": "0.7855917", "text": "def move(location, token)\n @board[location.to_i-1] = token\nend", "title": "" }, { "docid": "e13d8afd9db84865d291847fce9b4bbc", "score": "0.78511375", "text": "def move(board, position, token=\"X\")\n board[position.to_i - 1] = token \nend", "title": "" }, { "docid": "26fde42fd2d1db053d1e0c31e791b460", "score": "0.7835797", "text": "def move( index, current_player = \"X\" )\n @board[index] = current_player\n end", "title": "" }, { "docid": "26f1ed85f7fee9d604bd9cc6a7740a45", "score": "0.78283983", "text": "def move(index, current_player = \"X\")\n @board[index] = current_player\n end", "title": "" }, { "docid": "c64f000c74c5657fd319582a0b2d5bac", "score": "0.7739808", "text": "def move(index, current_player)\n @board[index] = current_player\n end", "title": "" }, { "docid": "6f5191a03698e720f018fb6a57a543b3", "score": "0.7723497", "text": "def move(position,token=\"X\")\n position=position.to_i - 1\n @board[position]=token\n end", "title": "" }, { "docid": "9e491f7ad3ebf048a3c3584e81bd50af", "score": "0.7723171", "text": "def move(index, current_player)\n @board[index] = current_player\n end", "title": "" }, { "docid": "6697a59b8a675b39566bb0baa404b5a7", "score": "0.77043957", "text": "def move(position, token='X')\n @board[position] = token\n end", "title": "" }, { "docid": "edd9c4cddd22bb00d7fa528ad69a8fcc", "score": "0.76384175", "text": "def move(index, current_player)\n @board[index] = current_player\nend", "title": "" }, { "docid": "edd9c4cddd22bb00d7fa528ad69a8fcc", "score": "0.76384175", "text": "def move(index, current_player)\n @board[index] = current_player\nend", "title": "" }, { "docid": "c7f8c8fd992e7755f0a193b57694e5a8", "score": "0.7597874", "text": "def move(board, index, current_player)\n board[index] = current_player\n end", "title": "" }, { "docid": "dd3c58dc15900d0ed80687799cc03778", "score": "0.7585531", "text": "def move(index, current_player = \"X\")\n @board[index] = current_player\nend", "title": "" }, { "docid": "984ce60ab5cff15c658de2d5664e6856", "score": "0.7575072", "text": "def move(board, index, current_player)\n @board[index] = current_player\nend", "title": "" }, { "docid": "42f9d144aee587f8fed99e19ffaecb6d", "score": "0.7547808", "text": "def move(location, token =\"X\")\r\n @board[(location.to_i) -1 ]=token\r\n end", "title": "" }, { "docid": "5a10470025c6876c0204693592434688", "score": "0.7437332", "text": "def move(board, index, current_player)\r\n board[index] = current_player\r\nend", "title": "" }, { "docid": "3fc9bcd9939851d55b0dcf3f229d0708", "score": "0.7435176", "text": "def move(board, index, current_player = 'X')\n board[index] = current_player\nend", "title": "" }, { "docid": "8cd791ee9ff73163a15f636629e15181", "score": "0.74239445", "text": "def move(board, index, current_player)\n board[index] = current_player\nend", "title": "" }, { "docid": "8cd791ee9ff73163a15f636629e15181", "score": "0.74239445", "text": "def move(board, index, current_player)\n board[index] = current_player\nend", "title": "" }, { "docid": "8cd791ee9ff73163a15f636629e15181", "score": "0.74239445", "text": "def move(board, index, current_player)\n board[index] = current_player\nend", "title": "" }, { "docid": "8cd791ee9ff73163a15f636629e15181", "score": "0.74239445", "text": "def move(board, index, current_player)\n board[index] = current_player\nend", "title": "" }, { "docid": "8cd791ee9ff73163a15f636629e15181", "score": "0.74239445", "text": "def move(board, index, current_player)\n board[index] = current_player\nend", "title": "" }, { "docid": "8cd791ee9ff73163a15f636629e15181", "score": "0.74239445", "text": "def move(board, index, current_player)\n board[index] = current_player\nend", "title": "" }, { "docid": "8cd791ee9ff73163a15f636629e15181", "score": "0.74239445", "text": "def move(board, index, current_player)\n board[index] = current_player\nend", "title": "" }, { "docid": "e44b4b4714b2962468b6410c4e333fa9", "score": "0.7416773", "text": "def player_move(board, index, marker)\n board[index] = marker\n end", "title": "" }, { "docid": "0d1948f2d0d64f5935840f01c4c4443c", "score": "0.74088025", "text": "def move(board,index,current_player)\n board[index] = current_player\nend", "title": "" }, { "docid": "f0b96d168905ebda8fab1fd18bdc1517", "score": "0.7405451", "text": "def move(board, index, player)\n board[index] = player\nend", "title": "" }, { "docid": "d3adde59019ec9a64d25042d1c675cde", "score": "0.73845685", "text": "def move(board, index, player)\n board[index] = player\nend", "title": "" }, { "docid": "4557ea7cca0ab650d2b2caac24cb42dd", "score": "0.73742396", "text": "def move(board, index, player_character)\n board[index] = player_character\nend", "title": "" }, { "docid": "17cfbe8ce0a39cfc6413910febe7af39", "score": "0.73595446", "text": "def update(position, player)\n self.cells[position.to_i-1] = player.token\n end", "title": "" }, { "docid": "30b09158c134979807b6197b23de47b6", "score": "0.7358433", "text": "def move idx\n\t\t@board[idx] = @turn\n\t\t@turn = other_turn\n\t\t@movelist << idx\n\t\tself\n\tend", "title": "" }, { "docid": "d5f5c7fe71defc464e6d1086f28cc036", "score": "0.7343679", "text": "def move(board, index, player = \"X\")\n board[index] = player\nend", "title": "" }, { "docid": "d66e81bb2791b3b6bcba50ba14d2c464", "score": "0.7325047", "text": "def move(board, index, player = \"X\")\r\n board[index] = player\r\nend", "title": "" }, { "docid": "6311e941bb32df52cec38c81c2cda1d2", "score": "0.72944117", "text": "def move(location, token = \"X\")\n #this sets the correct index value of the chosen position on the board equal to the token \n #(i.e., puts an X or O where you chose, if valid)\n @board[location.to_i-1]= token\n end", "title": "" }, { "docid": "d94f2057d4d175a5b5f4f48e7a5e10d8", "score": "0.7282395", "text": "def move(board, index, user_char)\n board[index] = user_char\nend", "title": "" }, { "docid": "f2bfce97c2e432c587e904bec3a18af3", "score": "0.72805494", "text": "def move(index, character)\n @board[index] = character\n end", "title": "" }, { "docid": "7f7b1d7c62f6f33206f44b987f82aaa6", "score": "0.7273908", "text": "def move(index, value = \"X\")\n @board[index] = value\n end", "title": "" }, { "docid": "dc9efabde468d6c17a298dd08d1fd65d", "score": "0.72726536", "text": "def move(index, value=\"X\")\n @board[index] = value\nend", "title": "" }, { "docid": "cde618e25a9678111f6145e5d2e10dca", "score": "0.72697806", "text": "def set_index(index, player)\n index -= 1\n\n if board_position(index)\n if validate_index(index)\n @board[index] = player == 1 ? X_TOKEN : O_TOKEN\n true\n else\n false\n end\n else\n false\n end\n end", "title": "" }, { "docid": "29cb4c87f1c0fa0a511c576459267253", "score": "0.7263773", "text": "def update(position, player)\n cells[move_to_index(position)] = player.token\n end", "title": "" }, { "docid": "cbcdaf23485661d9c9d6d96df700f492", "score": "0.725858", "text": "def move(index, value)\n @board[index] = value\n end", "title": "" }, { "docid": "cbcdaf23485661d9c9d6d96df700f492", "score": "0.725858", "text": "def move(index, value)\n @board[index] = value\n end", "title": "" }, { "docid": "da975ef4249abe9f53ab25275b36b80c", "score": "0.7253924", "text": "def move(board, index, current_player = \"X\")\n board[index] = current_player(board)\nend", "title": "" }, { "docid": "2c3545ef3b05a873dbbc80cadbb6cf5e", "score": "0.7158737", "text": "def move(index, character)\n @board[index] = character\n return @board\n end", "title": "" }, { "docid": "579c77d02cd88c4f46e9ee2f2958136b", "score": "0.71370304", "text": "def update(position, player)\n self.cells[self.input_to_index(position)] = player.token if !self.taken?(self.convert_to_i(position))\n end", "title": "" }, { "docid": "c94d55b471e2dbaebe950fdbf8943309", "score": "0.71198094", "text": "def set_move move\n@board[move] = @player\nend", "title": "" }, { "docid": "3a86686707f9411024448087c2a0adcf", "score": "0.7078712", "text": "def move(board, index, value)\n board[index] = value\n end", "title": "" }, { "docid": "29ba150a4e02cd8d85c3015a616447c2", "score": "0.7069145", "text": "def move(board, index, character)\n board[index] = character\nend", "title": "" }, { "docid": "f67aab2fa598deac26190d7f6140e39a", "score": "0.70552015", "text": "def move(board, index, character)\n return board[index] = character\nend", "title": "" }, { "docid": "0045e82525f7bd3008a1c4c6f07386f1", "score": "0.70393723", "text": "def move(board, index, player_character = \"X\")\n board[index] = player_character\nend", "title": "" }, { "docid": "304b60f59850208561ead51e698c3bda", "score": "0.7019973", "text": "def move(location, token=\"X\") # move( 0 , O ) \n @board[location] = token\n #binding.pry\n end", "title": "" }, { "docid": "d4f8b2c5feac35e6ba119ff1134eef72", "score": "0.6997962", "text": "def move(board, index, character)\n board[index] = character\n return board\nend", "title": "" }, { "docid": "d4f8b2c5feac35e6ba119ff1134eef72", "score": "0.6997962", "text": "def move(board, index, character)\n board[index] = character\n return board\nend", "title": "" }, { "docid": "f10db3a8539aa691f4e377cbc3d9bb90", "score": "0.69938993", "text": "def move (board,index,character=\"X\")\n board[index]=character\nend", "title": "" }, { "docid": "825347d90af17c64da1618376726c043", "score": "0.69929385", "text": "def move (board, index, value=\"X\")\n board [index] = value\n return board\nend", "title": "" }, { "docid": "d73e3b60f2660d26098b0d9410644038", "score": "0.6986252", "text": "def move(board, index, player_choice = \"X\")\n board[index] = player_choice\nend", "title": "" }, { "docid": "2058eb5f9e946b592aeb24299d527eb6", "score": "0.6983561", "text": "def move(board, index, char)\n board[index] = char\nend", "title": "" }, { "docid": "ac9a4442e57197cea8331803c6a9bf73", "score": "0.6965482", "text": "def move(board, position, current_player= \"X\")\n board[position.to_i - 1] = current_player\nend", "title": "" }, { "docid": "f485b97d1861d9b81af083680b6340ff", "score": "0.6959034", "text": "def move(board,index,spot = \"X\")\n board[index] = spot\n return board\nend", "title": "" }, { "docid": "1980c1899d8c36c69c0f8a4dadd6e428", "score": "0.6912219", "text": "def move(board, index, marker)\n board[index] = marker\nend", "title": "" }, { "docid": "59b35950eaf83db07e87ab43afdafeac", "score": "0.6912025", "text": "def move(board)\r\n puts \"Com #{token} is thinking...\"\r\n @board = board\r\n (min_max(4, token, -Float::INFINITY, Float::INFINITY)[1]+1).to_s\r\n end", "title": "" }, { "docid": "c3ea9030992fff86523e1c50151a8478", "score": "0.6905639", "text": "def move(board, position, current_player = \"X\")\n board[position.to_i-1] = current_player\nend", "title": "" }, { "docid": "1d97b87e5111ba450919acfd869d16bb", "score": "0.689781", "text": "def move(board,index,avatar)\n board[index] = avatar\n board\nend", "title": "" }, { "docid": "1406cd6d5ad196b3c17a8d743d568616", "score": "0.6895748", "text": "def move(board, index, character)\n board[index] = character #check!\nend", "title": "" }, { "docid": "f1a03db3fbbd6cdec5f4b2cb9f0e8d1d", "score": "0.68857324", "text": "def move(board,index,symbol=\"X\")\n board[index]=symbol\nend", "title": "" }, { "docid": "c3e76aa59fab11adfc1fb636e56de119", "score": "0.68800896", "text": "def move(board, index, value = 'X')\n board[index] = value\nend", "title": "" }, { "docid": "931be911523133fea145df260a472759", "score": "0.6874101", "text": "def move(board, index, value)\n board[index] = value\nend", "title": "" }, { "docid": "931be911523133fea145df260a472759", "score": "0.6874101", "text": "def move(board, index, value)\n board[index] = value\nend", "title": "" }, { "docid": "e26545be7cec40976fa4041d2f07d99f", "score": "0.68682015", "text": "def move(move_position, player=\"X\")\n @board[move_position] = player\n end", "title": "" }, { "docid": "dc3e6767a3f927a8967ca63ea572a577", "score": "0.6861031", "text": "def move(board,index,char)\n board[index] = char\n return board\nend", "title": "" }, { "docid": "95076158a6c6707c632dd62b5516bbbb", "score": "0.68526435", "text": "def move(board, index, character = \"X\")\n board[index] = character\n return board\nend", "title": "" }, { "docid": "06769f47c12dfad0d8ebdd799c4a05aa", "score": "0.6851806", "text": "def move(index, tictac)\n @board[index] = tictac\n end", "title": "" }, { "docid": "95076158a6c6707c632dd62b5516bbbb", "score": "0.68511367", "text": "def move(board, index, character = \"X\")\n board[index] = character\n return board\nend", "title": "" }, { "docid": "95076158a6c6707c632dd62b5516bbbb", "score": "0.68511367", "text": "def move(board, index, character = \"X\")\n board[index] = character\n return board\nend", "title": "" }, { "docid": "bfd27601c6c00a17b75fb74bcf04a99f", "score": "0.6844832", "text": "def move(board, position, current_player)\n board[position] = current_player\nend", "title": "" }, { "docid": "4bbaae73aaa9cffbaffc57f5506dd3b1", "score": "0.68212384", "text": "def turn\n current_move = current_player.move(@board)\n current_token = current_player.token\n if self.board.valid_move?(current_move)\n self.board.update(current_move, current_player)\n self.board.display\n # binding.pry\n else\n turn\n end\n end", "title": "" }, { "docid": "538ce671ee8c03830ce045d856560833", "score": "0.68186426", "text": "def move(board, index, value = \"X\")\n board[index] = value\nend", "title": "" }, { "docid": "a1fa69ed5c98e44dd2124d88ca06f307", "score": "0.6818469", "text": "def move(board, i, player)\n # if valid_move?(board, i)\n board[i] = player\n # end\n return board\nend", "title": "" }, { "docid": "0f10084d1e93d9bf21534dc65b2dacc8", "score": "0.6814968", "text": "def move(board, index, char=\"X\")\n update_array_at_with(board, index, char)\nend", "title": "" }, { "docid": "a4c37af76e4e8b83a1dc7a676ae2bac2", "score": "0.6804209", "text": "def move (board, index, character = \"X\")\n board[index] = character\nend", "title": "" }, { "docid": "1a2eb42b0d8c3ff94b78570abda6ee0a", "score": "0.6794919", "text": "def move(board, input_to_index, player_character = \"X\")\n board[input_to_index] = player_character\nend", "title": "" } ]
e078d2540ad484db6a59abd478814e65
Determines if the current line represents a keyword/value pair
[ { "docid": "6a62d7291b3b27bcb7c5c9ac65b7025f", "score": "0.5724239", "text": "def keyword_present\n\n\t\t# Prepare result\n\t\tblock_parse_result = false\n\t\n\t\t# Iterate through all keywords\n\t\t@@keywords.each do |keyword|\n\t\t\n\t\t\t# Initialize overrides, none by default\n\t\t\tkeyword_override = nil\n\t\t\n\t\t\t# Store keyword name, current status\n\t\t\tkeyword_name = keyword[:name]\n\t\t\tkeyword_data = @current_block[keyword_name]\n\t\t\t\n\t\t\t# Determine if keyword has already been found, get eventual overrides\n\t\t\tkeyword_found = keyword_data[:found]\n\t\t\tkeyword_override = keyword[:override] if keyword.has_key?(:override)\n\t\t\n\t\t\t# Parse keyword if not already found\n\t\t\tunless keyword_found\n\n\t\t\t\t# Get block item\n\t\t\t\tblock_parse_result = get_block_item(keyword_name, keyword_override)\n\n\t\t\t\t# Eventually mark as found\n\t\t\t\tkeyword_repeatable = keyword_data.has_key?(:repeat)\n\t\t\t\tkeyword_data[:found] = !keyword_repeatable\n\t\t\t\t\t\t\t\t\n\t\t\t\t# Store and exit iteration\n\t\t\t\tkeyword_data[:value] = block_parse_result\n\t\t\t\tbreak\n\t\t\tend\n\t\t\t\n\t\tend # each\t\n\t\t\n\t\t# Return result\n\t\tblock_parse_result\n\tend", "title": "" } ]
[ { "docid": "f48543989382db8011d7eb041ac91ae8", "score": "0.6535332", "text": "def is_interesting?(a_line)\n a_downcased_line = a_line\n is_interesting = false\n $key_words.each do |a_word|\n is_interesting ||= a_downcased_line.include?(a_word)\n break if is_interesting\n end\n return is_interesting\nend", "title": "" }, { "docid": "808b56024ef3cb0e1693d5cee5d51716", "score": "0.65093887", "text": "def key_matches?(line, key)\n line.start_with? \"#{key}=\"\nend", "title": "" }, { "docid": "aee33848ab94deb0f45e975359daa3e8", "score": "0.64872074", "text": "def keyword?(value)\n !value.to_s.match(KEYWORD_PARAMETER).nil?\n end", "title": "" }, { "docid": "d77f99888360707d0363ebd9fc932ef6", "score": "0.6332103", "text": "def read_keyword(cur, depth = 0)\n if cur.string(4) == 'true'\n cur.index += 4\n return true\n elsif cur.string(5) == 'false'\n cur.index += 5\n return false\n elsif cur.string(4) == 'null'\n cur.index += 4\n return nil\n else\n return UnexpectedString, 'expected false, null, or true.'\n end\n end", "title": "" }, { "docid": "7909a634eb3b5b63dadc65c41b0609f4", "score": "0.6331026", "text": "def keyword?\n to_s[-1] == ?:\n end", "title": "" }, { "docid": "f346aad54410f367b24b2b411ac81fea", "score": "0.63216394", "text": "def check_keyword?(keyword)\n @keywordPairs.each do |pair|\n if pair[0] == keyword\n return true\n end\n end\n return false\n end", "title": "" }, { "docid": "56dfe4083be042934c41fe137697487a", "score": "0.61373067", "text": "def next_key?(line)\n same_trial?(line) &&\n (@data_type == :salt && line[:pos_char_onphrase] == @prev_pos_char + 1 ||\n @data_type == :pepper)\n end", "title": "" }, { "docid": "210e3b72446f83b06b4c510bfe4e2bdb", "score": "0.61134356", "text": "def keyword_is_symbol?\n current_index = self.index(self.last)\n previous_event = self.at(current_index - 1)\n\n return false if previous_event.nil?\n return false unless self.last[1] == :on_kw\n return false unless previous_event[1] == :on_symbeg\n\n true\n end", "title": "" }, { "docid": "9b04d3e37654c9aa84259bab1b82e0fe", "score": "0.6083107", "text": "def has_keyword?(keyword)\n @key_list ||= (self.keywords || '').downcase.split(',').map {|k| k.strip }\n @key_list.include? keyword.to_s.downcase\n rescue\n false\n end", "title": "" }, { "docid": "b3d20a90c22921c230ee3d5a44cb97e5", "score": "0.605475", "text": "def keyword_constant?\n token = current_token\n return false unless token\n\n token.value == \"true\" ||\n token.value == \"false\" ||\n token.value == \"null\" ||\n token.value == \"this\"\n end", "title": "" }, { "docid": "3540faa4682ee5ec0ef7626db644a22e", "score": "0.6044646", "text": "def starts_with_keyword?\r\n return true if self[0].class == Dortha::Keyword\r\n end", "title": "" }, { "docid": "13cb6ba216178f2cc04719bbc987c44f", "score": "0.5967291", "text": "def isKeyword?\n self.category =~ /(keyword)/i\n end", "title": "" }, { "docid": "59d71bb7af85ae76ce9ded8cc4cee399", "score": "0.59665066", "text": "def identify_line_type(line)\n blank_regex = /\\A\\s*\\z/\n section_regex = /\\A\\[.+\\]/\n # note: key_regex assumes keys can be multi-word, e.g. \"all key 1 : val1\"\n key_regex = /\\A\\S.*:/\n\n case line\n when blank_regex then :blank\n when section_regex then :section\n when key_regex then :key\n else :value\n end\n end", "title": "" }, { "docid": "69a1b96595e03985e448295de0fe782e", "score": "0.5943731", "text": "def kv?(candidate_string)\n return false if candidate_string.blank? || yaml?(candidate_string)\n\n lines = candidate_string.split(\"\\n\")\n return false if lines.blank?\n\n lines.all? { |kv| kv.split('=').count >= 1 }\n end", "title": "" }, { "docid": "f76a544c163f0ea1197755ade37d1e5c", "score": "0.5937119", "text": "def is_kw?\n @is_kw\n end", "title": "" }, { "docid": "ba21a87c16c017e3344b8eb52ec31cf0", "score": "0.5894573", "text": "def keywords?\n loc.end&.is?('end')\n end", "title": "" }, { "docid": "16744316d5923af1f6ec8ab3c738ee4a", "score": "0.5862664", "text": "def keyword_splat?\n @keyword_splat\n end", "title": "" }, { "docid": "bd3937c932f479c41f63ecd112f279a8", "score": "0.58318454", "text": "def keyword?(token)\n return true if %w[LET PRINT QUIT].include?(token)\n end", "title": "" }, { "docid": "ff16296e9fc32d2fa9c1c08c1aa7c5e5", "score": "0.5801531", "text": "def keyword?(text)\n @keyword_map.include?(text)\n end", "title": "" }, { "docid": "809bca2736cffaff348827ffd154d812", "score": "0.579829", "text": "def parse_line_abstract(line)\n\n if line==\"\" or line=~/Keywords/\n @empty_lines+=1\n return false if @empty_lines>=2\n else\n @empty_lines=0\n @abstract_lines.push(line)\n @abstract_lines.push(\"\\n\") if line[-1]==\".\"\n end\n true\n end", "title": "" }, { "docid": "02bf39524abaec6cdcb4744bfc8c939b", "score": "0.57831717", "text": "def matchKeyword(keyword) \n token = lookahead()\n return token[:type] == Token[:Keyword] && token[:value] == keyword\n end", "title": "" }, { "docid": "d1097961608abb5b01fc1bab7b2e3689", "score": "0.577032", "text": "def both_block?(line_lex)\n return line_lex.first[1] == :on_kw && @both_block.include?(line_lex.first[2])\nend", "title": "" }, { "docid": "77f5a8cb217a7bc29735b396d4ce21f5", "score": "0.5717004", "text": "def starts_block?(line_lex)\n line_lex.first[1] == :on_kw && @open_block_start.include?(line_lex.first[2])\nend", "title": "" }, { "docid": "aa5c855d8e07d0f9d940ada7053d64e2", "score": "0.5690776", "text": "def line_ends_with_single_token_indenter?(lexed_line)\n lexed_line.ends_with_op? ||\n lexed_line.ends_with_comma? ||\n lexed_line.ends_with_period? ||\n lexed_line.ends_with_label? ||\n lexed_line.ends_with_modifier_kw?\n end", "title": "" }, { "docid": "0ac0063772094e8609c175b2e6781699", "score": "0.5672222", "text": "def handle_kw(keyword, lineno_column)\n raise Solid::SyntaxError, 'unknown Ripper sexp' unless KEYWORDS.has_key? keyword\n KEYWORDS[keyword]\n end", "title": "" }, { "docid": "4bcec8aaca40a4ecbdbb5fe074849b78", "score": "0.5658667", "text": "def keyword_transition?(env, node)\n match_transition_parser?(env, node, :keyword_transition)\n end", "title": "" }, { "docid": "07f9d8a3f5bc4f5efcb4d4ea8b72735f", "score": "0.56526375", "text": "def keywords?; end", "title": "" }, { "docid": "07f9d8a3f5bc4f5efcb4d4ea8b72735f", "score": "0.56526375", "text": "def keywords?; end", "title": "" }, { "docid": "6408946b488df1c092f0f8f4b420cd30", "score": "0.5648914", "text": "def keyword? string\n\t\treturn false unless (kws = keywords)\n\t\tkws.each do |kw|\n\t\t\tkwregex = kw.to_regex\n\t\t\tif (m = string.match(kwregex))\n\t\t\t\tret = [m[0], string =~ kwregex]\n\t\t\t\treturn ret\n\t\t\tend\n\t\tend\n\t\treturn false\n\tend", "title": "" }, { "docid": "5e05fbf921765f50d38a445d6eb4947b", "score": "0.56452024", "text": "def ends_with_modifier_kw?\n return false unless ends_with_kw?\n\n token = Tailor::Lexer::Token.new(last.last,\n { full_line_of_text: to_s })\n\n token.modifier_keyword?\n end", "title": "" }, { "docid": "b79ef9bb7521adeedd893f94d86ea328", "score": "0.564268", "text": "def passes_keyword_filter?(value)\n return true if title.to_s =~ /#{value}/i\n return true if teaser.to_s =~ /#{value}/i\n\n with_description = self.respond_to?(:detail) ? self.detail : self\n return false unless with_description.respond_to?(:description)\n with_description.description.to_s =~ /#{value}/i\n end", "title": "" }, { "docid": "72589fe13d898f6a06aef8b65f22bf3d", "score": "0.5587747", "text": "def prev_token_is_keyword?(n = 2)\n return false if n <= 0\n (1..n).each do |i|\n t = tokens[-i]\n if t && t[1] && KEYWORDS.include?(t[1])\n return @invalid_keyword = t[1]\n end\n end\n false\n end", "title": "" }, { "docid": "b921053f1e169bd2d4e4cec0f082aa37", "score": "0.5587344", "text": "def keyword?(name)\n KEYWORDS.include?(name)\n end", "title": "" }, { "docid": "fd17d8c01a76fb3ea589bc0ba186a809", "score": "0.55798614", "text": "def keyword?(section, keyword)\r\n\tif section?(section)\r\n\t keywords = @sections[section]\r\n\t keywords.has_key?(keyword)\r\n\tend\r\n end", "title": "" }, { "docid": "382dfbfe53d108171211d2f3b40356ce", "score": "0.55511385", "text": "def next_token?\n @value.is_a? Hash\n end", "title": "" }, { "docid": "e52a162dcb6c92fa6567abe3ee789d2f", "score": "0.55507606", "text": "def valid_keyword?(keyword)\n available_keywords.include?(keyword)\n end", "title": "" }, { "docid": "a48ba4902033cfa6ef34ab953360d0c4", "score": "0.5538555", "text": "def is_multiline?(line, previous = nil)\n single = 0 + ((:single == previous) ? 1 : 0)\n double = 0 + ((:double == previous) ? 1 : 0)\n\n (0...line.length).each { |i|\n if single%2 == 0\n double += 1 if line[i].eql? '\"'\n end\n\n if double%2 == 0\n single += 1 if line[i].eql? \"'\"\n end\n\n if line[i].eql? '#'\n if single%2 == 0 and double%2 == 0\n break\n end\n end\n }\n\n if double%2 == 1\n return :double\n elsif single%2 == 1\n return :single\n else\n return nil\n end\n end", "title": "" }, { "docid": "4e574781f3f315621dcaa2fa437da8ce", "score": "0.55159146", "text": "def parse_line(line)\n k, v = line.split\n k = k.to_sym\n v = true if v == 'true'\n v = false if v == 'false'\n [k, v]\n end", "title": "" }, { "docid": "bc9a6eda1a7ff85159bc161d087e89b9", "score": "0.5489428", "text": "def keywords_type; end", "title": "" }, { "docid": "191a83753993547e5f6691e20015299f", "score": "0.5486342", "text": "def known_line_type?(line)\n line_key = segment_peek(line)\n @segment_keys.include?(line_key)\n end", "title": "" }, { "docid": "563df4b7c474ce385be901af8444607e", "score": "0.5485406", "text": "def on_line?(line)\n end", "title": "" }, { "docid": "f3ec5aecb9e30c22d023f2591a57117f", "score": "0.54722863", "text": "def test_invalid_keyword_position\n \tval = @checker.check_line \"PRINT A 45 PRINT 45 +\"\n \tassert_equal val, false\n end", "title": "" }, { "docid": "09073a5e851146bd00a10de800a37431", "score": "0.54583406", "text": "def both_block?(line_lex)\n\t\tline_lex.each do |x|\n\t\t\t# search for a first non-space token\n\t\t\tif not x[1] == :on_sp\n\t\t\t\treturn x[1] == :on_kw && BOTH_BLOCK.include?(x[2])\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "b5624e47319b8ab7f21fe3f0c061b015", "score": "0.54374164", "text": "def non_configuration_line?(line)\n line =~ /^[\\#;]/ || line =~ /^[\\s]+$/\n end", "title": "" }, { "docid": "841805a5b4eda31315a1d3cfe9865a54", "score": "0.5428988", "text": "def both_block?(line_lex)\n line_lex.each do |x|\n # search for a first non-space token\n if not x[1] == :on_sp\n return x[1] == :on_kw && @both_block.include?(x[2])\n end\n end\nend", "title": "" }, { "docid": "4db43f0f70b35dcc599bcff0c96a3c4e", "score": "0.5427026", "text": "def keyword?(word)\n return word.upcase if [\n \"true\",\n \"false\",\n \"int\",\n \"void\",\n \"return\",\n \"if\",\n \"else\",\n \"float\",\n \"while\",\n ].include? word\n end", "title": "" }, { "docid": "8d7969426e1fe7518182245c54a72e50", "score": "0.5424843", "text": "def item_line?(line)\n line.start_with? \"\\s-\"\n end", "title": "" }, { "docid": "848d7be5173111a04471d8f2a5ac3e8a", "score": "0.54073733", "text": "def ing_key?(k, v)\n k.index(\"strIngredient\") && v != \"\"\nend", "title": "" }, { "docid": "a55c36d760627c43327c3cf03e2d3858", "score": "0.53786796", "text": "def has_option?(key)\n @lines.has_key?(key.to_s)\n end", "title": "" }, { "docid": "b3742636f6991110df8c5114d6036612", "score": "0.5374626", "text": "def parse_line(line)\n no_keyword = line[0].match?(/^(\\d+|-\\d+|[a-zA-Z])\\z/)\n val = evaluate([], line) if no_keyword\n val = key_choice(key = line.delete_at(0), line) unless no_keyword\n puts val if !val.nil? && (@mode || key.match?(/^print\\z/i))\n val\n end", "title": "" }, { "docid": "e26dae43f4a465830938c4ea3281d4cf", "score": "0.53631437", "text": "def test_keyword_let\n val = Token.keyword? 'lEt'\n assert_equal val, true\n end", "title": "" }, { "docid": "4192836e953b9d0cc03177f9890686dd", "score": "0.5344795", "text": "def term?(c)\n \"\\n;}\".include? c\n end", "title": "" }, { "docid": "14c45533dc4686e3ba052096d5cd4e50", "score": "0.53430545", "text": "def two_in_a_row?(hash, marker)\n if hash.values.count(marker) == 2\n hash.select {|k, v| v == \" \"}.keys.first\n else\n false\n end\nend", "title": "" }, { "docid": "f00b8cc5f43d964e9aa46a37572dad35", "score": "0.53376555", "text": "def get_keyword_value(string)\n return_string = String.new()\n found = false\n @keywordPairs.each do |pair|\n if pair[0] == string\n found = true\n return_string = pair[1]\n end\n end\n if found == false\n raise \"Error: In the command #{@utype}:#{@command_name} Attempted to get a Keyword pair #{string} present in the command\\n Is this keyword missing? \\n#{output}\"\n end\n return return_string\n end", "title": "" }, { "docid": "e14729c2c74c9c3aa12baa3cc866fa60", "score": "0.53331405", "text": "def keyword_match?(input)\n keywords.any? do |keyword_exp|\n parsed = keyword_exp.match(/\\A(?<op>[=^~])?(?<keyword>.*)\\z/)\n\n method = case parsed[:op]\n when \"=\" then :==\n when \"^\" then :start_with?\n when \"~\" then :end_with?\n else :include?\n end\n\n input.downcase.strip.send(method, parsed[:keyword].downcase)\n end\n end", "title": "" }, { "docid": "cbe210cdf697a5a4da48b8e78ef62042", "score": "0.5328835", "text": "def non_configuration_line?(line); end", "title": "" }, { "docid": "268043ee5eaafbb4668093949856e3ee", "score": "0.53238994", "text": "def conditional? line\n\t\t\tline.strip =~ /[\\w.|)(]+::$/\n\t\tend", "title": "" }, { "docid": "1b43f8f3e2c8ef7d6b5f2316eb45e69c", "score": "0.5294641", "text": "def starts_with_keyword?(str)\n self.stars_with?(str+':') || self.starts_with?(str+' ') || self == str\n def starts_with_one_of?(arr)\n arr.each do |str|\n return true if self.starts_with? str\n end\n false\n end\nend", "title": "" }, { "docid": "8070e09a51c996a8c179e27491387f9f", "score": "0.5291559", "text": "def important?\n /^>! (.*)$/ =~ @line\n end", "title": "" }, { "docid": "650cfada11a08e3c3e7c9178b06b6315", "score": "0.52811337", "text": "def needed?\n line[:ded_hm_int, :present]\n end", "title": "" }, { "docid": "104580ce17006cd1b08feb210c780837", "score": "0.5280738", "text": "def test_keyword_print\n val = Token.keyword? 'pRiNt'\n assert_equal val, true\n end", "title": "" }, { "docid": "62a72433fe61ef9516dc50b3e20ae813", "score": "0.52807164", "text": "def recognise? line\n line.strip =~ @@pattern\n end", "title": "" }, { "docid": "3b9bf92937ef65597b83ba63c480b2cf", "score": "0.5271307", "text": "def actual_keyword; end", "title": "" }, { "docid": "544993ad0a6989177e188168b76e1fbc", "score": "0.52499133", "text": "def keyword_type?(term)\n ALL_KEYWORDS.each do |arr|\n # Check each set of keywords to see what kind of keyword a term contains\n return KEYWORDS_SYMBOL[arr] if arr.any? { |keyword| term.include?(keyword) }\n end\n nil\n end", "title": "" }, { "docid": "64e5f16c4ea8b0215fc9c4daa2f88ef3", "score": "0.5240638", "text": "def property_is_next?\n\t\t\tpos = @css.index(':', @index+1)\n\n\t\t\tif ! pos\n\t\t\t\treturn false\n\t\t\tend\n\n\t\t\t# get the length until just before the ':'\n\t\t\tsize_of_property = pos - @index - 1\n\n\t\t\t# extract the name of the property\n\t\t\tproperty_to_find = (@css[@index+1,size_of_property]).strip.downcase\n\n\t\t\tif PROPERTIES.has_key?(property_to_find)\n\t\t\t\t#$this->log('Added semicolon to the end of declaration','Warning');\n\t\t\t\treturn true\n\t\t\telse\n\t\t\t\treturn false\n\t\t\tend\n\t\tend", "title": "" }, { "docid": "15599cc12e569bea35480219d041e6ef", "score": "0.52371603", "text": "def includes_token?(obj, value); end", "title": "" }, { "docid": "ea0d75cd5328d3e80d8b3e03b3488dbf", "score": "0.52246654", "text": "def is_assignment? line\n /\\s*=\\s*/.match line\n end", "title": "" }, { "docid": "7b7367be8aa3ce68d0e8ac668764142b", "score": "0.5221508", "text": "def test_unknown_keyword_known?\n token_parser = TokenParser.new\n str = 'LET'\n assert 0, token_parser.unknown_keyword?(str)\n end", "title": "" }, { "docid": "5b6ef9e1c7fa66e1de29970bedf087d0", "score": "0.52201706", "text": "def is?(key)\n Hedgehog::Input::Mapping::KNOWN_KEYS[@string] == key\n end", "title": "" }, { "docid": "aaa2d510313c317a03da58ec95b26032", "score": "0.52156305", "text": "def parse(line)\n\n # ignore comments and blank lines\n unless /^(\\s*\\#|\\s*\\n)/.match(line) \n\n # only handling case for key/val pairs, other parsing \n # considerations not defined in spec (ie. inline comments)\n key, val = line.strip.split(/\\s*=\\s*/) \n\n # handle boolean cases\n case val.downcase\n when \"on\", \"true\"\n val = true\n when \"off\", \"false\"\n val = false\n end\n\n # golden, add to hash\n @properties[key] = val\n end\n end", "title": "" }, { "docid": "182c0638002409a8f6d1cfc00c1f4cc6", "score": "0.5212481", "text": "def lineIsParamsFunctionStart(line)\n\tif line =~ /[A-Za-z0-9]+ *= *\\([A-Za-z0-9,_ :-]*\\) ->\\n?/\n\t\treturn true\n\telse\n\t\treturn false\n\tend\nend", "title": "" }, { "docid": "5dab164901fd7faf64665af8f92dfe05", "score": "0.52118874", "text": "def test_keyword_error\n token_parser = TokenParser.new\n str = 'TACO'\n refute token_parser.keyword?(str)\n end", "title": "" }, { "docid": "214c1020f381f9911effb5a89dd6c32a", "score": "0.5210676", "text": "def single_line?\n loc.begin.line == loc.end.line\n end", "title": "" }, { "docid": "6e1f3a18a57935f13745bd96b3f70731", "score": "0.52081794", "text": "def test_parse_line_wrong_keyword\r\n input = [\"1\", \"hello\", \"+\"]\r\n val = 0\r\n assert_output(\"Line 0: Unknown keyword hello\\n\") {val = @arg_checker.parse_line(input)}\r\n assert_equal val, 'INV'\r\n end", "title": "" }, { "docid": "03c7ebb15f64d45993520ae36f116c48", "score": "0.5205836", "text": "def parse_infobox_line(line)\n if match = line.match(/^\\s*\\|\\s*(.*?)\\s*\\=\\s*(.*?)\\s*$/) then\n key, value = match.captures\n return simplify_key(key), value\n end\nend", "title": "" }, { "docid": "d74f3bf6f10d7d84cbf3405b0551e274", "score": "0.5198418", "text": "def test_keyword_false\n val = Token.keyword? 'egg'\n assert_equal val, false\n end", "title": "" }, { "docid": "bcc9d83348a375d6022827b7dcb21528", "score": "0.51933557", "text": "def two_in_a_row(row, marker)\n if row.values.count(marker) == 2\n row.select{|_k,v| v == ' '}.keys.first\n else\n false\n end\nend", "title": "" }, { "docid": "0bd97d3f91e18ce8fcd5aaf95fe9a8ad", "score": "0.51656026", "text": "def two_in_a_row(hash, marker)\n if hash.values.count(marker) == 2\n hash.select{|k,v| v == \" \"}.keys.first\n else\n false\n end\nend", "title": "" }, { "docid": "b2f937f5d1ff6573992fddd56862c4b4", "score": "0.51548916", "text": "def is_elsem?(line)\n @elsem.match(line.strip)\n end", "title": "" }, { "docid": "c305fc1fa031aa4df7d57056801deac4", "score": "0.5153948", "text": "def isSymbol?(key)\n key[0, 1] == \":\"\n end", "title": "" }, { "docid": "797948ae9bd7c52dd5d45eb6f4186c8a", "score": "0.5151967", "text": "def has_key_text?(key_text)\n return true if key_text.nil?\n @comment.include?(key_text)\n end", "title": "" }, { "docid": "64be5f6a2afc020fff1fd7e2dcb4d2e5", "score": "0.51460916", "text": "def starts_block?(line_lex)\n line_lex.each do |x|\n # search for a first non-space token\n if not x[1] == :on_sp\n return x[1] == :on_kw && @open_block_start.include?(x[2])\n end\n end\nend", "title": "" }, { "docid": "b84366781aeeb7b36febae3abea41781", "score": "0.5144126", "text": "def is_multi_line_hack(val)\n val.is_a?(Hash) && val['email']\n end", "title": "" }, { "docid": "fbf1b18105d04f50479d2f9e4cba3eeb", "score": "0.5139374", "text": "def can_interpret?(parent, keyword, *args, &block)\n result = false\n result ||= keyword.downcase == keyword if self.class.downcased?\n result ||= keyword.upcase == keyword if self.class.upcased?\n result ||= keyword.capitalize == keyword if self.class.capitalized?\n result\n end", "title": "" }, { "docid": "ea71a0879ca5b82e98ba29f8aeb6f015", "score": "0.51390487", "text": "def color_keyword?(string)\n color_keyword_to_code(string) && string != 'transparent'\n end", "title": "" }, { "docid": "24fe35b8292ee32f21315ab757547fdc", "score": "0.51335114", "text": "def line?\n 'line' == self.type\n end", "title": "" }, { "docid": "a0ba39d9109862010b2d6fa8a4c8464f", "score": "0.5129837", "text": "def is_var?(line) \n\n\t\traise ArgumentError, \"Expected String but got #{line.class.name} instead\" unless line.is_a? String\n\t\t#In order to detect casting, a var can't contain \"()\" and \"=\"\n\t\tflag = false\n\t\tif line.include? \"(\" \n\t\t\tif line.include? \"=\" then\n\t\t\t\tflag = true\n\t\t\tend\n\t\tend\n\t\ttokens = line.gsub(\" \", \",\").gsub(\"(\", \",\").gsub(\")\",\",\").split(\",\").map(&:strip).reject(&:empty?)\n\t\ttype_matches = 0\n\t\tspec_matches = 0\n\t\t\n\t\ttokens.each do |token|\n\t\t\tif @type.include? token then\n\t\t\t\ttype_matches += 1\n\t\t\tend\n\t\t\tif @specifier.include? token then\n\t\t\t\tspec_matches += 1\n\t\t\tend\n\t\tend\n\t\treturn false if type_matches > 1\n\t\treturn true if spec_matches >= 0 && type_matches == 1 && flag == false\n\t\treturn nil\n\tend", "title": "" }, { "docid": "d2ecb44f7282891e7fd0cdf84f2b665c", "score": "0.5110231", "text": "def is_var?(line) \n\n\t\traise ArgumentError, \"Expected String but got #{line.class.name} instead\" unless line.is_a? String\n\t\t#In order to detect casting, a var can't contain \"()\" and \"=\"\n\t\tflag = false\n\t\tif line.include? \"(\" \n\t\t\tif line.include? \"=\" then\n\t\t\t\tflag = true\n\t\t\tend\n\t\tend\n\t\ttokens = line.gsub(\" \", \",\").gsub(\"(\", \",\").gsub(\")\",\",\").split(\",\").map(&:strip).reject(&:empty?)\n\t\ttype_matches = 0\n\t\tspec_matches = 0\n\t\t\n\t\ttokens.each do |token|\n\t\t\tif @type.include? token then\n\t\t\t\ttype_matches += 1\n\t\t\tend\n\t\t\tif @specifier.include? token then\n\t\t\t\tspec_matches += 1\n\t\t\tend\n\t\tend\n\t\t#print \"TypeMatches: #{type_matches} SpecMatches: #{spec_matches}\"\n\t\treturn false if type_matches > 1\n\t\treturn true if spec_matches >= 0 && type_matches == 1 && flag == false\n\t\treturn nil\n\tend", "title": "" }, { "docid": "4882e4a4fc0abc2e6768c5c4d3c66c3e", "score": "0.5109705", "text": "def expectKeyword(keyword) \n token = lex()\n if (token[:type] != Token[:Keyword] || token[:value] != keyword) \n throwUnexpected(token)\n end\n end", "title": "" }, { "docid": "6d24f66296e30aefdca85b0607989b38", "score": "0.5107874", "text": "def unqualify?(key)\n key[0, 1] == \":\"\n end", "title": "" }, { "docid": "55d26cddfa870b0fcfed51b1d840acff", "score": "0.510735", "text": "def single_line?\n start_line == end_line\n end", "title": "" }, { "docid": "b0a5963bdae60574c7e8e99f30380ca5", "score": "0.5105475", "text": "def tuple_valued?( symbol )\n @definition.member?(symbol) && @definition[symbol].tuple_valued?\n end", "title": "" }, { "docid": "9d469738754e1761ab23f69eae17b27b", "score": "0.5095166", "text": "def expecting_value?\n @keyval_stack.last.positive?\n end", "title": "" }, { "docid": "cf1b5c8a579b594c962f1adeff2af0e6", "score": "0.509367", "text": "def key?(key)\n attributes.key?(key.to_sym)\n end", "title": "" }, { "docid": "3e3d012d5efe0f8519337084b35192a0", "score": "0.50902426", "text": "def style\n keyword = loc_hash[:keyword]\n keyword ? keyword.source.to_sym : :ternary\n end", "title": "" }, { "docid": "640b29e9f890d567174d76143807146d", "score": "0.50889575", "text": "def checkValues(line)\n return true\n end", "title": "" }, { "docid": "0776423ce4a4c3d7263dceee8a158571", "score": "0.5080746", "text": "def matched_keyword; end", "title": "" }, { "docid": "2424f4c052aa7d4329bfe18a81ea4a44", "score": "0.5078621", "text": "def key_found?(lines, key)\n not lines.detect { |l| key_matches?(l, key) }.nil?\nend", "title": "" }, { "docid": "49a358d8c0ea5e9ffab30c7abe80cf59", "score": "0.5078417", "text": "def keyword_check(kw)\n unless (@keywords || %w(a is of has)).include?(kw)\n raise ParserException, \"unqualified keyword '#{kw}' used without @keyword directive\" if @strict\n end\n end", "title": "" }, { "docid": "6efe89f576713e554878e8eba1e9e96a", "score": "0.5071868", "text": "def tokenize_keyword(&block)\n keyword = current_char\n keyword << next_char while /[^=~<>\\s\\&\\|\\)\\(,]/ =~ peek_char\n KEYWORDS.has_key?(keyword.downcase) ? yield(KEYWORDS[keyword.downcase]) : yield(keyword)\n end", "title": "" } ]
b5e8921b739d7ded831d5a433a455373
An Example helper function In you test case, you can use login_as("homer", "Password") login_as("bart") the password will be default to 'TestWise' login("lisa") same as login_as def login_as(username, password = "TestWise") enter_text("username", username) enter_text("password", password) click_link("Login") end alias login login_as
[ { "docid": "79fc4c79df14251c32b8c86772239383", "score": "0.0", "text": "def browser_type\n if $TESTWISE_BROWSER then\n $TESTWISE_BROWSER.downcase.to_sym\n elsif ENV[\"BROWSER\"]\n ENV[\"BROWSER\"].downcase.to_sym \n else\n :chrome\n end\n end", "title": "" } ]
[ { "docid": "7c6a16e48c9e52192ceb171fd3a59ff4", "score": "0.86774695", "text": "def login_as(username, password = \"agileway\")\n enter_text(\"userName\", username)\n enter_text(\"password\", password)\n click_button_with_image(\"btn_signin\")\n end", "title": "" }, { "docid": "09a60e5571f9f6070a00387134c579f9", "score": "0.85940146", "text": "def login_as(username, password = \"test\")\n home_page = expect_page HomePage\n home_page.enter_username(username)\n home_page.enter_password(password)\n home_page.click_login\n end", "title": "" }, { "docid": "d9da8b55faeab7dfbf2ee207c0b60499", "score": "0.83225036", "text": "def login_as(username, password = \"test\")\n home_page = HomePage.new(@browser)\n home_page.enter_login(username)\n home_page.enter_password(password)\n home_page.click_login\n end", "title": "" }, { "docid": "d9da8b55faeab7dfbf2ee207c0b60499", "score": "0.83225036", "text": "def login_as(username, password = \"test\")\n home_page = HomePage.new(@browser)\n home_page.enter_login(username)\n home_page.enter_password(password)\n home_page.click_login\n end", "title": "" }, { "docid": "d9da8b55faeab7dfbf2ee207c0b60499", "score": "0.832184", "text": "def login_as(username, password = \"test\")\n home_page = HomePage.new(@browser)\n home_page.enter_login(username)\n home_page.enter_password(password)\n home_page.click_login\n end", "title": "" }, { "docid": "c35c32062e6f05fe36f7c340a8f46d4b", "score": "0.81730795", "text": "def login(username, password)\n \t\t fill_in('username', :with=> username)\n\t\t fill_in('password', :with=> password)\n\t\t click_button('')\n\t\tend", "title": "" }, { "docid": "fa3bd9250f7216cba0c6b1f95224ce1a", "score": "0.81520265", "text": "def login_as(user, pass)\n fill_in 'user_username', :with=>user\n fill_in 'user_password', :with=>pass\n click_button :submit\n end", "title": "" }, { "docid": "47a7e13f3f3a5f5d0f0e4d4c83ec0cfa", "score": "0.78922355", "text": "def login_as(user, password = \"password\")\n visit root_path\n click_link \"Entrar\"\n\n fill_in \"E-mail\", with: user.email\n fill_in \"Senha\", with: password\n\n click_button \"Entrar\"\n end", "title": "" }, { "docid": "d25cac4afb67f0dfb6f2136a5ee9979e", "score": "0.78911215", "text": "def login(entered_username, entered_password)\n username.click\n username.send_keys(entered_username)\n password.click\n password.send_keys(entered_password)\n signin_button.click\n end", "title": "" }, { "docid": "1beda2562a33bbd234126a5cc0424886", "score": "0.78751963", "text": "def login(username, password)\n username_input.set username\n password_input.set password\n login_button.click\n end", "title": "" }, { "docid": "c352117b1b9769f9e7d4cfbf20e065b6", "score": "0.7857264", "text": "def login(username, password)\n username_tb.type_text(username)\n password_tb.type_text(password)\n login_btn.click\n end", "title": "" }, { "docid": "5e1425f991410ab74aa699a4364ae3b3", "score": "0.7837678", "text": "def login(username = \"root\", password = \"root\")\n # open login page\n open \"auth/login\"\n wait_for_text_present($page_titles[\"auth_login\"])\n\n # type username & password\n type(\"login\", username)\n type(\"password\", password)\n\n # log in\n click \"commit\"\n wait_for_page_to_load \"30000\"\n end", "title": "" }, { "docid": "0cefe82eadf2fdf2b0eefa94480093e9", "score": "0.7799637", "text": "def login(username, password)\n username_tb.type_text(username)\n password_tb.type_text(password)\n\n login_btn.click\n end", "title": "" }, { "docid": "16e1b847ce494f4179cd6d05cb80676c", "score": "0.77512", "text": "def log_in(user_name, pwd)\r\n user_email.set(user_name)\r\n password.set(pwd)\r\n click_on('log in')\r\n end", "title": "" }, { "docid": "62294933a55e6dd5c6ce5c6ba7fd474d", "score": "0.7729597", "text": "def login_as(userarg, pwarg, browser = @browser)\n puts \"login as #{userarg}, pw #{pwarg}, #{browser}\"\n b = @wait.until do\n e = browser.find_element(:xpath, '//div/a[@href=\"/login\"]')\n e\n end\n b.click\n un = get_ext_element(:xpath, '//input[@name=\"email\"]', browser)\n pw = get_ext_element(:xpath, '//input[@name=\"password\"]', browser)\n sub = get_ext_element(:xpath, '//button[@type=\"submit\"]', browser)\n refute_nil un\n refute_nil pw\n refute_nil sub\n # puts \"found user name: text #{un.text}\"\n # puts \"found password: text #{pw.text}\"\n # puts \"found submission: text #{sub.text}\"\n un.send_keys(userarg)\n pw.send_keys(pwarg)\n sub.click\n end", "title": "" }, { "docid": "7742e009825b241c725bc7b00eec5e74", "score": "0.77118975", "text": "def login(name, password)\r\n $ie.text_field(:name, \"username\").set(name)\r\n $ie.text_field(:name, \"password\").set(password)\r\n $ie.link(:text, \"Login\").click\r\n \r\n verify($ie.text.include?(\"Homepage\"), message=\"The login was unsuccessful, the user was not taken to the Homepage.\")\r\nend", "title": "" }, { "docid": "ac789cf538f116aa6cfd50df7e61eb9f", "score": "0.76871115", "text": "def login_flow(user:, pass:)\n visit_site\n fill_in(form_field_name: 'username', value: user)\n click_button(button_name: 'Go')\n fill_in(form_field_name: 'password', value: pass)\n click_button(button_name: 'Go')\n end", "title": "" }, { "docid": "6fa611b15a936d591f0bb3c7f98c90dc", "score": "0.7676556", "text": "def system_log_in_as(user)\n visit(login_path)\n fill_in(\"Username\", with: user.name)\n fill_in(\"Password\", with: \"password\")\n click_on(\"Log in\")\n end", "title": "" }, { "docid": "163bb19ecf61a591ddadd57e56fc6a0e", "score": "0.76180094", "text": "def log_in(user, password)\n visit( '/')\n click_link_or_button(\"Log in with password\")\n fill_in 'Email', :with => user.email\n fill_in 'Password', :with => password\n click_button 'Log in'\nend", "title": "" }, { "docid": "d52c67e12ba77c0e5da25aec8a06ff83", "score": "0.76140785", "text": "def login(username,title)\n\n open_page('login')\n\n @browser.text_field(:class => 'test-login-user-id').wait_until_present.click\n puts \"Entering #{username} into user field\"\n @browser.text_field(:class => 'test-login-user-id').set \"#{username}\"\n\n puts \"Entering #{password} into password field\"\n @browser.text_field(:class => 'test-login-password').set \"#{password}\"\n if @browser.text.include? 'Change Organization'\n @browser.a(:data_test_id => 'link-change-organization', :text => 'Change Organization').click\n click_delay\n end\n\n if @browser.text_field(:class => 'test-login-organization').exists?\n puts \"Entering #{tenant} into organization field\"\n enter_organization(tenant, 'organization')\n end\n\n click_delay\n @browser.send_keys :return\n page_delay\n verify_page?(title)\n end", "title": "" }, { "docid": "097b0743bed6ea8ac92260f52884f01e", "score": "0.7546496", "text": "def login_as(user, pass)\n\t\tuser_field.set user\n\t\tpassword_field.set pass\n\n\t\tgo_button.fire_event(\"onclick\")\n\n begin\n next_page = MainPage.new(@browser)\n\t\t Watir::Wait.until { next_page.loaded? }\n\t\t return next_page\n end\n\tend", "title": "" }, { "docid": "73bcf877373483ef2e29c84dc185729e", "score": "0.7514979", "text": "def logged_in_as(user = nil)\n visit new_user_session_path\n email = user ? user.email : users(:shane).email\n password = 'password'\n fill_in 'Email', with: email\n fill_in 'Password', with: password\n click_button 'Log in'\n end", "title": "" }, { "docid": "b02eb1fa71d2709c00058ae9881860f2", "score": "0.75119907", "text": "def login_as(user)\n visit login_path\n fill_in :email, with: user.email\n fill_in :password, with: 'password123'\n click_button 'Login'\n end", "title": "" }, { "docid": "ec573bf12bd816260afe139ef4a2a9af", "score": "0.7464", "text": "def login_on_the_current_page(options = {})\n user(options)\n fill_in \"Username\", :with => @user.username\n unless options[:blank_password]\n fill_in \"Password\", :with => @user.password\n end\n click_button \"Login\"\n unless options[:blank_password]\n response.should contain(\"Welcome, #{@user.username}\")\n response.should contain(\"Logout\")\n end\nend", "title": "" }, { "docid": "3de4d33af6c01507c66f25900db59656", "score": "0.7460984", "text": "def _formal_login(\n username:,\n password:\n )\n @login_popup.text_field(id: 'id_login').set(username)\n @login_popup.text_field(id: 'id_password').set(password)\n @login_popup.button(type: 'submit').click\n end", "title": "" }, { "docid": "cf4f9db8085d64b007f416379a37360d", "score": "0.742644", "text": "def login_with username=nil, password=nil\n\tself.username = username\n\tself.password = password\n\tself.login\n end", "title": "" }, { "docid": "5be41ae610043204c406de73c4efcb45", "score": "0.7422449", "text": "def login (email_id, pass_word)\n\t\n\tputs \"************** START : Login to Razoo ****************\"\t\n\t$browser.click \"link=Log in\"\n\t$browser.wait_for_page_to_load \n\tputs \"Step 1 : Entering valid User credintials - User Name as #{email_id} and Password as #{pass_word}\"\n\t$browser.type \"user_session_email\", email_id \n\t$browser.type \"user_session_password\", pass_word\n\t$browser.click \"//button[@type='submit']\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"Login successful!\")\n\t\tputs \"Passed. Login was Successful!!!\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Failed. Login Failed\"\n\tend\n\tputs \"************** END : Login to Razoo ****************\"\t\nend", "title": "" }, { "docid": "cd71e1837178666a9ca0dab13d79a70d", "score": "0.74013674", "text": "def login(email_id, pass_word)\n\t\n\tputs \"************** START : Login to Razoo ****************\"\t\n\t$browser.click \"link=Log in\"\n\t$browser.wait_for_page_to_load \n\tputs \"Step 1 : Entering valid User credintials - User Name as #{email_id} and Password as #{pass_word}\"\n\t$browser.type \"user_session_email\", email_id \n\t$browser.type \"user_session_password\", pass_word\n\t$browser.click \"//button[@type='submit']\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"Login successful!\")\n\t\tputs \"Step 2 : Passed. Login was Successful!!!\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 2 : Failed. Login Failed\"\n\tend\n\tputs \"************** END : Login to Razoo ****************\"\t\nend", "title": "" }, { "docid": "cd71e1837178666a9ca0dab13d79a70d", "score": "0.74013674", "text": "def login(email_id, pass_word)\n\t\n\tputs \"************** START : Login to Razoo ****************\"\t\n\t$browser.click \"link=Log in\"\n\t$browser.wait_for_page_to_load \n\tputs \"Step 1 : Entering valid User credintials - User Name as #{email_id} and Password as #{pass_word}\"\n\t$browser.type \"user_session_email\", email_id \n\t$browser.type \"user_session_password\", pass_word\n\t$browser.click \"//button[@type='submit']\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"Login successful!\")\n\t\tputs \"Step 2 : Passed. Login was Successful!!!\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 2 : Failed. Login Failed\"\n\tend\n\tputs \"************** END : Login to Razoo ****************\"\t\nend", "title": "" }, { "docid": "cd71e1837178666a9ca0dab13d79a70d", "score": "0.74013674", "text": "def login(email_id, pass_word)\n\t\n\tputs \"************** START : Login to Razoo ****************\"\t\n\t$browser.click \"link=Log in\"\n\t$browser.wait_for_page_to_load \n\tputs \"Step 1 : Entering valid User credintials - User Name as #{email_id} and Password as #{pass_word}\"\n\t$browser.type \"user_session_email\", email_id \n\t$browser.type \"user_session_password\", pass_word\n\t$browser.click \"//button[@type='submit']\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"Login successful!\")\n\t\tputs \"Step 2 : Passed. Login was Successful!!!\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Step 2 : Failed. Login Failed\"\n\tend\n\tputs \"************** END : Login to Razoo ****************\"\t\nend", "title": "" }, { "docid": "b5917857b94e5171b7330892c9959b2b", "score": "0.7393753", "text": "def log_in_as(user, opt ={})\n password = opt[:password] || 'password'\n visit new_user_session_path\n fill_in \"Email\", with: user.email.to_s\n fill_in \"Password\", with: password\n click_button \"Log in\"\n end", "title": "" }, { "docid": "878663425ba69c941536e1b73af2dc33", "score": "0.7380367", "text": "def login_as(user)\n fill_in 'Email', with: \"#{user}@volontari.at\"\n fill_in 'Password', with: 'password'\n click_button :submit\n end", "title": "" }, { "docid": "3113acd78981f3cf115cc310ad8575c1", "score": "0.73206437", "text": "def login( login_info = {} )\n if @username\n @browser.goto @@config[:login_url]\n else\n raise \"Username cannot be nil\"\n end\n\n @browser.text_field(:id => @@config[:username_field]).set @username\n @browser.text_field(:id => @@config[:password_field]).set @password\n @browser.button(:value => @@config[:login_button]).click\n Watir::Wait.until { @browser.div( :class => @@config[:ready_condition] ).exists? }\n\n @username\n end", "title": "" }, { "docid": "8d09c86baf0a8352fc09835d935921e5", "score": "0.7307975", "text": "def loginUser\n sleep(3)\n enter.click\n selectEmail.click\n email.set'gustavogimenez.santos@gmail.com'\n password.set'12345teste'\n submit.click\n sleep(3)\n end", "title": "" }, { "docid": "9021cfdb5827540100b47a782bdf8993", "score": "0.72980493", "text": "def admin_login\n $site = \"http://localhost:3000/admin\" \n puts \"\\nStarting test case #{test_case}\\n\"\n goto_site($site)\n admin_user_name_text_field.set(\"#{user_name}\")\n admin_password_field.set(\"#{user_password}\")\n admin_login_button.click\n return true\n end", "title": "" }, { "docid": "48ee60544db73771a786f2ba3778d587", "score": "0.7284521", "text": "def login_with_proper_credentials\r\n\r\n valid_user_name = PropertiesReader.get_user_name\r\n valid_password = PropertiesReader.get_password\r\n\r\n set_text(ElementNames::USERNAME_TEXTFIELD_NAME, valid_user_name)\r\n\r\n set_text(ElementNames::PASSWORD_TEXTFIELD_NAME, valid_password)\r\n\r\n click_on_button(ElementNames::SUBMIT_BUTTON_ID)\r\n\r\n end", "title": "" }, { "docid": "6c8d8e24a3121dbbb562b14348049ae2", "score": "0.72518986", "text": "def login_as(user)\n visit login_path\n fill_in :email, with: user.email\n fill_in :password, with: 'password123'\n click_button 'btn-Connect'\n end", "title": "" }, { "docid": "f0a7081c5f62c5c092cefe7e8f5fc458", "score": "0.723356", "text": "def login_without_username_password\n\tclick_login_button\nend", "title": "" }, { "docid": "7afd47185065a0c8f0b72cfcc49b102b", "score": "0.72283274", "text": "def test_login\n login_as(\"user_admin\") #administrator of the app\n login_as(\"user_normal\") # a normal user\n login_as(\"user_disabled\") # a disabled user\n login_as(\"user_no_resources\") # a user with no resources assigned\n end", "title": "" }, { "docid": "41706c19c018f26f3e7a6d85e1466327", "score": "0.72192246", "text": "def login(user)\n visit \"/\"\n click_link \"ログイン\"\n find(\"#session_email\").set user.email\n find(\"#session_password\").set \"password\"\n find(\"#app > div > main > div > div > div > div > div.card__actions > button > div\").click\nend", "title": "" }, { "docid": "1690fad501fbf26ed3dad7eebf6336f9", "score": "0.7216335", "text": "def login_user_crm(username_crm, password_crm)\n user_name_field.should_exist\n user_name_field.value = username_crm\n password_field.should_exist\n password_field.value = password_crm\n log_on_button.should_exist\n log_on_button.click\n end", "title": "" }, { "docid": "a316ee4f8f78d04250238efada2a7073", "score": "0.7214037", "text": "def login(username, password)\n @navigator.go_to(LOGIN_URL)\n\n form_values = []\n form_values << { finder: LOGIN_FINDER, value: username }\n form_values << { finder: PASSWORD_FINDER, value: password }\n\n @navigator.fill_form(form_values)\n @navigator.click(LOGIN_BUTTON_FINDER)\n\n @navigator.wait_until_appears(WELCOME_STR_FINDER)\n end", "title": "" }, { "docid": "d21b66392f53b88bad1229641093fbff", "score": "0.719038", "text": "def log_user(login, password)\n visit '/my/page'\n assert_equal '/login', current_path\n within('#login-form form') do\n fill_in 'username', :with => login\n fill_in 'password', :with => password\n find('input[name=login]').click\n end\n assert_equal '/my/page', current_path\n end", "title": "" }, { "docid": "8593be7696ba9eb37930ecca2e39e214", "score": "0.7185931", "text": "def login_as(role = :author1)\n visit new_user_session_path\n\n fill_in \"Email\", with: users(role).email\n fill_in \"Password\", with: \"password\"\n \n click_on \"Log in\"\n end", "title": "" }, { "docid": "101487ef50754a36325e3ac62bad55f9", "score": "0.7180073", "text": "def login(driver)\n # find the right elements\n username_field = driver.find_element(:id, 'Email')\n password_field = driver.find_element(:id, 'Passwd')\n signin_button = driver.find_element(:id, 'signIn')\n\n puts \"[#{Time.now}] Now I'm logging in with the username #{@username} and the password.\\n\\n\"\n # fill in credentials\n username_field.send_keys(@username)\n password_field.send_keys(@password)\n signin_button.click\n end", "title": "" }, { "docid": "b944e5585344a59f3c764b06bb65bcb0", "score": "0.71639746", "text": "def login_as(user)\n post login_url, params: {username: user.username, password: user.username}\n end", "title": "" }, { "docid": "c01a9f846b83fdbc22f2c600ead41d95", "score": "0.71438414", "text": "def login(username: 'anonymous', password: nil)\n write_command(\"USER #{username}\")\n write_command(\"PASS #{password}\")\n end", "title": "" }, { "docid": "311d426e21cbd4e148e5240cc51b5801", "score": "0.71373844", "text": "def login\n user = with_test_user\n fill_in('Email', with: user.email)\n fill_in('Password', with: user.password)\n click_button('Log In')\n end", "title": "" }, { "docid": "324df148bbe16b5eadf3ea3b32df36f4", "score": "0.713598", "text": "def loginas(user)\n uri = URI.parse(current_url)\n query = URI.decode_www_form(uri.query ? uri.query : '').to_h\n query[:username] = user\n uri.query = URI.encode_www_form(query)\n visit uri.to_s\nend", "title": "" }, { "docid": "2d76902854639c9c1be612848983b22b", "score": "0.7133639", "text": "def log_user(login, password)\n visit '/my/page'\n assert_equal '/login', current_path\n within('#login-form form') do\n fill_in 'username', :with => login\n fill_in 'password', :with => password\n find('input[name=login]').click\n end\n assert_equal '/my/page', current_path\n end", "title": "" }, { "docid": "2d76902854639c9c1be612848983b22b", "score": "0.7133639", "text": "def log_user(login, password)\n visit '/my/page'\n assert_equal '/login', current_path\n within('#login-form form') do\n fill_in 'username', :with => login\n fill_in 'password', :with => password\n find('input[name=login]').click\n end\n assert_equal '/my/page', current_path\n end", "title": "" }, { "docid": "d13c982ac86e134345bbf3f1b8bd8817", "score": "0.71264696", "text": "def login\n # visit '/'\n # click_link 'Register'\n # fill_in 'Email', with: 'a@a.com'\n # fill_in 'Password', with: '12345678'\n # fill_in 'Password confirmation', with: '12345678'\n # click_button 'Sign up'\n visit '/'\n user = create(:user)\n login_as(user)\nend", "title": "" }, { "docid": "4291cd8572979d30b15cb9d8d40d14b2", "score": "0.71246845", "text": "def login_as_jhon\n visit user_session_path\n fill_in 'Eメール', with: 'john@example.com'\n fill_in 'パスワード', with: 'password'\n click_button 'ログイン'\n end", "title": "" }, { "docid": "915f98643883f6101cea6cb4c7556445", "score": "0.7120237", "text": "def login_as(user, password)\n post login_url, params: { \n \temail: user.email, password: password }\n end", "title": "" }, { "docid": "e3d52b968a9045e3b5ec290f3d7081f1", "score": "0.711474", "text": "def login_user(email, password)\n visit root_path\n fill_in(\"user[email]\", with: email)\n fill_in(\"user[password]\", with: password)\n click_button \"ログイン\"\n end", "title": "" }, { "docid": "145f0ffa7d3cf9c4915f6685fb20e9e5", "score": "0.7113882", "text": "def login_as(user)\n post login_url params: { name: user.name, password: 'secret' }\nend", "title": "" }, { "docid": "d36af3d745968faf645bd395c5bd588c", "score": "0.7109652", "text": "def login_to_app(username=nil, password=nil)\n enter_username(username)\n enter_password(password)\n click_login_button\n end", "title": "" }, { "docid": "36a03076a1d37cd3b1ce271f0ecf9a6f", "score": "0.7095716", "text": "def login_by_password! login, password\n user = User.authenticate_by_password login, password\n become_logged_in_as! user\n end", "title": "" }, { "docid": "496e985abd422fe3149b487b95ab2633", "score": "0.70907646", "text": "def log_in_as(user)\n if integration_test?\n visit login_path\n fill_in 'Email', with: user.email\n fill_in 'Password', with: user.password\n click_button 'Log in'\n else\n session[:user_id] = user.id\n end\n end", "title": "" }, { "docid": "fbc7e4483f1acfede8e5ce9fbef98541", "score": "0.70882726", "text": "def test_02_test_login\n\t\tset_login_details(\"Albin\", \"Albin\")\n\t\tassert(enter_login_details(\"Albin\", \"Albin\"), \n\t\t\tmessage = \"Could not set login details\")\n\t\tassert(press_login_button, \n\t\t\tmessage = \"could not click login button\")\n\t\tassert(check_who_is_logged_in(), \n\t\t\tmessage = \"Logged in user does not match login details\")\n\tend", "title": "" }, { "docid": "713d0382af4f562bd110d9ec573b6018", "score": "0.70781285", "text": "def login_as(user_name, password)\n post login_url, params: { user: { name: user_name, password: password } }\n end", "title": "" }, { "docid": "31b39e96dc7e4dea0ee41f8656b1a320", "score": "0.70752144", "text": "def login_as(user)\n visit new_user_session_path\n \n assert_equal(new_user_session_path, path)\n \n fill_in \"email\", :with => user.email\n fill_in \"password\", :with => \"testing\"\n click_button\n assert_true(redirect?) \n follow_redirect!\n end", "title": "" }, { "docid": "3d0f9595fd8d5caa9ffd8512d94407f0", "score": "0.70691276", "text": "def sign_in_as(user)\n visit '/signin'\n fill_in \"Name\", with: user.name\n fill_in \"Password\", with: 'topsecret'\n click_button 'Sign in'\n end", "title": "" }, { "docid": "f9973e2635a0a0a77ee266ba213a9151", "score": "0.70673376", "text": "def login (user, password, expected_success=true)\n @b.goto @base_url\n screenshot('scr_before_login.png')\n @b.text_field(:id => 'identity').set user\n @b.text_field(:id => 'password').set password\n @b.button(:type => 'submit').click\n screenshot('scr_after_login_click.png')\n if (expected_success)\n check(@b.text.include?(user), \"utilisateur #{user} connecté\")\n end\n screenshot('scr_after_login.png')\n end", "title": "" }, { "docid": "5255b24667d83f7d10d36417a8c0a146", "score": "0.70643795", "text": "def login(user, password)\n puts \"usuario #{user} logando no sistema\"\n if user == \"root\"\n puts \"Usuario admin detectado\"\n elsif user == \"admin\"\n puts \"Usuario normal logando\"\n else \n puts \"Usuario guest\"\n end\nend", "title": "" }, { "docid": "1d4b46368e86433858af0fbd7a7b5efc", "score": "0.70619065", "text": "def test00_login\r\n if $runTests[\"loginUser\"] == \"Yes\"\r\n login($username, $password)\r\n else\r\n puts \" \"\r\n puts \"You chose not to run the login test.\"\r\n end\r\n end", "title": "" }, { "docid": "1d32bdb2a4ce61dc4e1dc7ce1c97e6d5", "score": "0.7053239", "text": "def capy_login(input_user = nil)\n user = input_user || create_user\n visit login_path\n fill_in \"user_name\", :with => user.user_name\n fill_in \"password\", :with => \"welcome\"\n click_button 'Log in'\n user\nend", "title": "" }, { "docid": "ebb295ed5f719d93286a9b45ed273e1a", "score": "0.7041876", "text": "def log_in\n visit \"/home/empreses_ca.html\"\n fill_in \"u\", :with => @user\n fill_in \"p\", :with => @password\n first(\".loginbut\").click\n end", "title": "" }, { "docid": "8e8bfd06c8b83c5bd56f724292120ef7", "score": "0.703586", "text": "def login(username, password)\n fill_in 'email', with: username\n fill_in 'password', with: password + \"\\n\"\n end", "title": "" }, { "docid": "e556e91bd487f6b14653565774701056", "score": "0.70333946", "text": "def login_to_system(username='admin', password='dirtybird')\n self.username = username\n self.password = password\n login\n end", "title": "" }, { "docid": "d2d06b55b89b3811a9502ba28091cf1f", "score": "0.70167285", "text": "def log_in_as(user)\n puts \" \"\n puts \"$$> test/test_helper.rb : executing def log_in_as(user)\"\n puts \"$$> user.inspect the argument(user) returns: #{user.inspect} \"\n puts \" \"\n puts \"$$> Will now attempt to POST to sign_in_path to create a session using this, \"\n puts \"$$> post sign_in_path, session: {email: user.email, password: user.password} \"\n puts \"$$> GO TO post sign_in_path NOW\"\n post sign_in_path, session: {email: user.email, password: user.password}\n end", "title": "" }, { "docid": "e332508f1f08a4707396fb529174f616", "score": "0.7015837", "text": "def login_click()\n login_link.click\n end", "title": "" }, { "docid": "2e2bc4e6c814ce4d1930bf2140ca5fdc", "score": "0.7013768", "text": "def login!(user, pass)\n end", "title": "" }, { "docid": "4760e58435de0efd4dfd22940c13610a", "score": "0.700769", "text": "def log_in email: \"oscar@gmail.com\", password: \"password\"\n visit '/sessions/new' unless current_path == \"/sessions/new\"\n fill_in 'Email', with: email\n fill_in 'Password', with: password\n click_button 'Log In'\nend", "title": "" }, { "docid": "97b182c0cfbaaea9dee1366ba937f687", "score": "0.70021015", "text": "def login(options = {})\n @browser.goto 'https://' + @hostname + '/ccmadmin/showHome.do'\n @browser.text_field(:name => 'j_username').set options[:username]\n @browser.text_field(:name => 'j_password').set options[:password]\n @browser.button(:value => 'Login').click\n raise 'Unable to Login' unless @browser.text.include? 'Logout'\n end", "title": "" }, { "docid": "c489cb6a58ee7af7561fd06ddbb88e96", "score": "0.69966567", "text": "def login\n login_page = @agent.get(@login)\n login_form = login_page.form(name: 'Login')\n login_form.fields[6].value = @username\n login_form.fields[7].value = @password\n\n @agent.submit login_form\n end", "title": "" }, { "docid": "e2a74a69d294e6f4914272dae3783f2c", "score": "0.6980699", "text": "def sign_in(username, password)\n visit '/sessions/new'\n fill_in 'username', :with => username\n fill_in 'password', :with => password\n click_button 'Sign in!'\n end", "title": "" }, { "docid": "c87a072bc3f91f2f464bfe9ec5676325", "score": "0.69762415", "text": "def login_user(user, password)\n visit login_path\n fill_in 'session_email', with: user.email\n fill_in 'session_password', with: password\n find(:css, \"input[type='submit']\").click\n end", "title": "" }, { "docid": "b7e2878b6cc64c899b9bef4f8ded5640", "score": "0.6974252", "text": "def login_user_admin(username_admin, password_admin)\n\t sign_in_link.should_exist\n\t sign_in_link.click\n sign_in_name_field.value = username_admin\t\n\t sign_in_password_field.value = password_admin\n keep_signedin_checkbox.click\n\t sign_in_button.click\n\t user_profile_name_link.innerText.should == username_admin\n end", "title": "" }, { "docid": "70dd3e3c04521588a0011a0182bbce3c", "score": "0.69718546", "text": "def login\n username, password = CREDENTIALS\n raise AssertionError, \"You're already logged in\" if browser.link(href: '/logout').present?\n change_endpoint(:login)\n username_field = browser.text_field(id: 'username')\n update_action_log(:text_field, !username_field.nil? && username_field.present?)\n username_field.set(username)\n update_action_log(:set_text, username_field.value == username)\n\n browser.text_field(id: 'password').set(password)\n input_button = browser.input(type: 'submit')\n update_action_log(:input, !input_button.nil? && input_button.present?)\n\n input_button.click\n sleep 2\n update_action_log(:submit_login, browser.link(href: '/logout').present?)\n update_action_log(\n :link,\n browser.link(href: '/logout').present? || browser.link(href: '/login').present?\n )\n browser.link(href: '/logout').present?\n end", "title": "" }, { "docid": "d4170cab4a0e9570ff257c74bcf1eb51", "score": "0.6971631", "text": "def user_login\r\n @company = FactoryBot.create(:company)\r\n @application = FactoryBot.create(:application, company: @company)\r\n @user = FactoryBot.create(:user, company: @company)\r\n #expect(page).to have_content(\"You need to sign in or sign up before continuing.\")\r\n\r\n login_as(@user, :scope => :user)\r\n #visit \"/admin\"\r\n #fill_in 'user_email', with: user.email\r\n #fill_in 'user_password', with: user.password\r\n #click_button \"Sign in\"\r\n #expect(page).to have_content(\"Dashboard\")\r\n end", "title": "" }, { "docid": "71b2a5cb6e553f745981c35a34999691", "score": "0.6967317", "text": "def sign_in()\t\r\n \tvisit \"/\"\r\n \tfill_in \"user_session_username\", with: \"john\"\r\n \r\n \tfill_in \"user_session_password\", with: \"pass\"\r\n \tclick_button \"Login\"\r\n\tend", "title": "" }, { "docid": "f5d187177b1eb52cf50c0a5cc26cc4c5", "score": "0.69589096", "text": "def log_in_as(user, password = DEFAULT_PASSWORD, swapcase = false)\n username = user.username\n username.swapcase! if swapcase\n post login_path, params: { session: { username: username, password: password, } }\n end", "title": "" }, { "docid": "48263ae53933acbb51d9b3d83d28d3f0", "score": "0.69456226", "text": "def loginpewcwithdefault \n\tputs \"logging Term\"\t\n\t$b.text_field(:name => 'j_username').set 'test010@hmsonline.com'#@namelog\n\t$b.text_field(:name => 'j_password').set 'P@ssw0rd'#@passwlog\n\t$b.image(:id => 'submitButton').click\n\tsleep(4)\t\n\tif not($b.div(:id => 'loginError').exist?) then\n\t\t$b.div(:id => 'hello').wait_until_present\t\n\t\t@output = $b.body.text.include?('Welcome kms test!')\t\t\n\telse\n\t\t@output = false\n\tend\n\treturn @output\nend", "title": "" }, { "docid": "187c041ed00bea5e6507662b0c145ac5", "score": "0.6944331", "text": "def login_as( user=nil )\n\t\tuid = ( user.is_a?(User) ) ? user.uid : user\n\t\tif !uid.blank?\n\t\t\tstub_ucb_ldap_person()\n\t\t\tu = User.find_create_and_update_by_uid(uid)\n\t\t\tassert u.is_a?(User), \"Created User isn't a User?\"\n\t\t\tassert !u.new_record?, \"Created user didn't save?\"\n\n\t\t\t#\tRather than manually manipulate the session,\n\t\t\t#\tI created a fake controller to do it.\n\n\t\t\tpage.visit new_fake_session_path()\t#, { }, { 'HTTPS' => 'on' }\n\t\t\tassert_equal current_path, new_fake_session_path,\n\t\t\t\t\"Didn't actually get new fake session path?\"\n\n\t\t\tassert page.has_field?('id'),\n\t\t\t\t\"id field not found. Probably didn't actually load new session page.\"\n\n\t\t\t#Capybara::ElementNotFound: cannot fill in, no text field, text area or password field with id, name, or label 'id' found\n\t\t\tpage.fill_in 'id', :with => u.id\n\n\t\t\tpage.click_button 'login'\n\n\t\t\t#\tassert that there is a user logged in\t\t\t\n\t\t\tassert_equal current_path, user_path(u),\n\t\t\t\t\"Login_as seems to have failed.\" \n\t\tend\n\tend", "title": "" }, { "docid": "df5335d39d48d8f1c4455955f19733a5", "score": "0.69424033", "text": "def login\n\n end", "title": "" }, { "docid": "67bcd2257be6cd5d25f43f41c3094cc8", "score": "0.6942391", "text": "def common_login(email, password)\n visit('/')\n fill_in('Email', with: email)\n fill_in('Password', with: password)\n click_on('Log In')\n\n expect(current_path).to eql('/events')\nend", "title": "" }, { "docid": "e101122296303e0255d4d28e1487dee1", "score": "0.69423187", "text": "def test_successfull_login \n Keywords.new().enter_valid_user_id(@driver,\"user-id\")\n Keywords.new().enter_password(@driver,\"password\")\n Keywords.new().click_button(@driver)\n assert_equal(ObjectRepository::NEXT_PAGE_TITLE,@driver.title(),\"Login Successful\")\n end", "title": "" }, { "docid": "ad28b0e8ab13e5acb235f6f5ad94f88a", "score": "0.693134", "text": "def login(username, password)\n visit ('/')\n wait_a_second\n begin\n fill_in :placeholder => \"Username\", :with => username\n fill_in :placeholder => \"Password\", :with => password\n click_button(\"Login\")\n rescue\n return false\n end\n wait_a_second\n return true if page.body.include? \"Client login succeeds\"\n false\n end", "title": "" }, { "docid": "7b56962c30d42665471c6aa721ffc0af", "score": "0.6923187", "text": "def do_login username, password\n\t\tself.signinsstars_btn\n\t\tself.username_field = username\n\t\tself.nextgmail_btn\n\t\tsleep (2)\n\t\tself.password_field = password\n\t\tself.signingmail_btn\n\tend", "title": "" }, { "docid": "552c9bfb04c103f6b5c3230e17a6dace", "score": "0.69210786", "text": "def login(user=nil)\n if user == nil\n user = FactoryBot.create(:user)\n end\n visit new_user_session_path\n fill_in 'Email', with: user.email\n fill_in 'Password', with: user.password\n click_button \"Log in\"\nend", "title": "" }, { "docid": "9d151dd077bdb9f9c4ea33ec35533f20", "score": "0.6919696", "text": "def login\n visit login_path\n\n fill_in 'username', with: Forgery(:internet).email_address\n fill_in 'password', with: Forgery(:basic).password\n\n click_button t('signin').upcase\n end", "title": "" }, { "docid": "07d56875cf90e40dec8d3cb7deecd265", "score": "0.6919606", "text": "def Surveyhead_sm_login(email,passwd)\n \n # New IE instance creation\n driver = Selenium::WebDriver.for :firefox, :profile => \"Selenium\"\n ff = Watir::Browser.new driver\n #ff.maximize\n\n # Opening Usampadmin site\n ff.goto('http://www.sm.p.surveyhead.com')\n\n # Setting login credentials (email/password)\n ff.text_field(:name, \"txtEmail\").quick_set(email)\n ff.text_field(:name, \"txtPassword\").quick_set(passwd)\n #Click login button\n ff.button(:value, \"Login\").click\n \n # Checkpoint to verify that login was successful\n raise(\"Sorry! System Failed to login to Usampadmin\") unless ff.link(:text,'Logout').exists?\n return ff\n end", "title": "" }, { "docid": "c7e25dbbd64b4e3e6ecaf570b28f808c", "score": "0.69063205", "text": "def login_with(user)\n visit new_user_session_path\n fill_in \"user_login\", with: user.email\n fill_in \"user_password\", with: \"12345678\"\n click_button \"Sign in\"\n Thread.current[:current_user] = user\n end", "title": "" }, { "docid": "18d74d41b95a7b0d183c2a27ba8dbcec", "score": "0.69029456", "text": "def login(username, password)\n page = @scraper.get(@LOGIN_URL)\n f = page.forms[0]\n f.Email = username\n f.Passwd = password\n @scraper.submit(f, f.buttons.first)\n end", "title": "" }, { "docid": "2e7492a85a0d6af14700a6fee838765e", "score": "0.6900265", "text": "def full_login(userid, password)\n performAction('clear_id_field', $member_number_field_id)\n performAction('enter_text_into_id_field', userid, $member_number_field_id)\n performAction('enter_text_into_id_field', password, $password_field_id)\n custom_screenshot userid\n performAction('press_button_with_text', $loginbutton)\nend", "title": "" }, { "docid": "517d4d451b54cb6bd44746fc1229f964", "score": "0.689886", "text": "def sign_in(a_user = nil)\n user = a_user || Fabricate(:user)\n\n visit login_path\n fill_in 'Email Address', with: user.email\n fill_in 'Password', with: user.password\n click_button 'Sign in'\nend", "title": "" }, { "docid": "051150b8201d1d7d072211dad83ec6a0", "score": "0.6897683", "text": "def doLogin()\n print \"Please enter your login credentials\\n\" if @debug\n @browser.link(:id, 'gb_70').click\n @browser.text_field(:name, 'q').wait_until_present\n end", "title": "" }, { "docid": "ce109bd0299aa15a916670475349ddd2", "score": "0.6896364", "text": "def Login\n visit '/'\n click_on 'Sign in'\n fill_in 'Email', with: 'testuser@example.com'\n fill_in 'Password', with: 'password'\n click_on 'Sign in!'\n end", "title": "" }, { "docid": "1afc60f2f64dcb3481860a9311ea507d", "score": "0.6896044", "text": "def sign_in(a_user = nil)\n user = a_user || Fabricate(:user)\n\n visit login_path\n fill_in 'Email', with: user.email\n fill_in 'Password', with: user.password\n click_button 'Log in'\nend", "title": "" }, { "docid": "7df07746997f39b120bb3f67127e8ac5", "score": "0.6895723", "text": "def login(username, password)\n self.div(:id=>\"topnavigation_user_options_login_wrapper\").fire_event(\"onmouseover\")\n self.text_field(:id=>\"topnavigation_user_options_login_fields_username\").set username\n self.text_field(:name=>\"topnav_login_password\").set password\n self.button(:id=>\"topnavigation_user_options_login_button_login\").click\n sleep 3 # TODO : Make into a wait clause\n if self.button(:id=>\"emailverify_continue_button\").present?\n self.button(:id=>\"emailverify_continue_button\").click\n end\n self.linger_for_ajax(2)\n MyDashboard.new @browser\n end", "title": "" } ]
8cd4df98ccb0ecf81797c7759d6f8232
Access an Cell by indices.
[ { "docid": "1dc694cb7693d475b46a10df5c68f85d", "score": "0.5986959", "text": "def cell( row, col )\n Cell.new( self, indices_to_address( row, col ) )\n end", "title": "" } ]
[ { "docid": "c6534b5c7ccd85c1a7899e4004fff62d", "score": "0.707181", "text": "def cell(row_index, column_index)\n row(row_index).cell(column_index)\n end", "title": "" }, { "docid": "4303af7fd9ccbc75591bcb95b333274c", "score": "0.69572854", "text": "def [](row, column)\n cell(row, column)\n end", "title": "" }, { "docid": "9a7839eb7ee5ea8cdf3e6ac05aecf258", "score": "0.6823415", "text": "def [](idx)\n row(:index, idx)\n end", "title": "" }, { "docid": "aa0e5dfcbeb126a36a787e611e13ba81", "score": "0.66937476", "text": "def cellAt(row, col)\n\t\treturn @rows[row][col]\n\tend", "title": "" }, { "docid": "ea93d7bf5507ddfb8189d5602503838a", "score": "0.65173674", "text": "def [](row_index, col_index)\n row = data[row_index]\n row && row[col_index]\n end", "title": "" }, { "docid": "9c50c2c666f38250c35314bb7a802a90", "score": "0.65170544", "text": "def get_cell(x, y)\n grid[x][y]\n end", "title": "" }, { "docid": "ebf6b63f8fa7048a9d93e1e752e749e5", "score": "0.6484599", "text": "def [](row, col)\n @grid[row][col]\n end", "title": "" }, { "docid": "7b8b75006fa6eb264c8fe57b7aaf6efe", "score": "0.6472887", "text": "def [](idx)\n send(idx)\n end", "title": "" }, { "docid": "a3c1f721caec728c4a43b7da0e0d5139", "score": "0.64428544", "text": "def [](index)\n self.grid[index]\n end", "title": "" }, { "docid": "66720ee1976361be0214e5539f5e41c5", "score": "0.63931394", "text": "def [](index)\n @rows[index]\n end", "title": "" }, { "docid": "88c2044e56cde4e9f81d0c278c075882", "score": "0.6370764", "text": "def values_at(*indices)\n indices.collect {|key| self[key]}\n end", "title": "" }, { "docid": "d5f6857a0d7c92dd1af8781395dcfb76", "score": "0.63651264", "text": "def [](pos)\n row, col = pos\n @rows[row][col]\n end", "title": "" }, { "docid": "efe0aef8fb5540b97d7dd820467da30f", "score": "0.6349485", "text": "def row_at(row_idx)\n @grid[row_idx]\n end", "title": "" }, { "docid": "39db0367e6dbd77cdc6f50bea627307d", "score": "0.63332295", "text": "def [](row, column)\n end", "title": "" }, { "docid": "7f7c18c632faf89ac68cc292ff2ec7be", "score": "0.63023555", "text": "def [](pos)\n x, y = pos\n @rows[x][y]\n end", "title": "" }, { "docid": "4dd8141a3f7aa24b45d0958ea2570dad", "score": "0.6300597", "text": "def [](pos)\n grid[pos[0]][pos[1]]\n end", "title": "" }, { "docid": "f4b2033c34d97730dd39cb41d138073a", "score": "0.62725365", "text": "def get_row_by_idx(idx)\n @row[idx]\n end", "title": "" }, { "docid": "ad404e7e6caa303151c9f29255fcd019", "score": "0.6258957", "text": "def [](index)\n self.__getitem__ index\n end", "title": "" }, { "docid": "dabe119d66cf43d8e203dcfcc31f3475", "score": "0.6250558", "text": "def [](pos)\n x, y = pos\n grid[x][y]\n end", "title": "" }, { "docid": "823ffe20a9bfbdd4c5c328ed30d104c7", "score": "0.6236177", "text": "def [](pos)\n row, col = pos\n @grid[row][col]\n end", "title": "" }, { "docid": "f156a43ac6ad0c558837f525e122aa08", "score": "0.6233521", "text": "def [](pos)\n self.grid[pos[1]][pos[0]]\n end", "title": "" }, { "docid": "1eba20f96f544bf8948a0c4df62de6e8", "score": "0.6224685", "text": "def [](pos)\n x, y = pos\n @grid[x][y]\n end", "title": "" }, { "docid": "55e9a16f6f3c67c3cc067b8355b45762", "score": "0.6201531", "text": "def getCell(row,col)\n the_row = @rows[row]\n the_cell = the_row.cells[col]\n return the_cell\n end", "title": "" }, { "docid": "08332d99d97b4e7f44b1d89c17c26a3d", "score": "0.62002796", "text": "def [](pos)\n row, col = pos \n @grid[row][col]\n end", "title": "" }, { "docid": "7941a0aaf32f976a78635e994fcd9e71", "score": "0.61971474", "text": "def [](pos)\n @grid[pos[0]][pos[1]]\n # row,col = pos\n # @grid[row][col]\n end", "title": "" }, { "docid": "dd7ab4d4104a2886f8f7c4ca6535fa99", "score": "0.61963886", "text": "def [](pos)\n row, col = pos\n grid[row][col]\n end", "title": "" }, { "docid": "dd7ab4d4104a2886f8f7c4ca6535fa99", "score": "0.61963886", "text": "def [](pos)\n row, col = pos\n grid[row][col]\n end", "title": "" }, { "docid": "00826558ce66aeb82a3dbff02a6236c6", "score": "0.61899555", "text": "def [](pos)\n x, y = pos\n @grid[x][y] \n end", "title": "" }, { "docid": "78f5fadb8a3c1c2abd95e7d63096e3cd", "score": "0.61855805", "text": "def cell_at(x, y)\n return nil if (x < 0 || y < 0)\n @cells[y][x] if @cells[y]\n end", "title": "" }, { "docid": "889c8e05aee84f881da32018b290142b", "score": "0.61801165", "text": "def element_at(row_idx, column_idx)\n target_row = row_at(row_idx)\n target_row[column_idx]\n end", "title": "" }, { "docid": "3469e60b2c0ff472a89b12c33f751f90", "score": "0.6150596", "text": "def [](pos)\n row, col = pos\n @grid[row][col]\n end", "title": "" }, { "docid": "a4c8d39dcceb774b8e943305fc392cff", "score": "0.6134953", "text": "def [](index) # i.e. array style index lookup.\n end", "title": "" }, { "docid": "6c31451c5323b8a28155ee933469349e", "score": "0.6121794", "text": "def getCell(x, y)\n return @grid.getCell(x,y)\n end", "title": "" }, { "docid": "c590f6da1249390aba5348b1651c69c7", "score": "0.6117992", "text": "def at_index(x,y)\n @board[x][y]\n end", "title": "" }, { "docid": "bdbdca7423fcf9a99ad18dc1acb0826a", "score": "0.6111962", "text": "def cell(pos_x, pos_y)\n @board[pos_y][pos_x]\n end", "title": "" }, { "docid": "14f4c79d3f7331a26750fb7250162858", "score": "0.6108438", "text": "def cell(row_num, col_num)\n return @puzzle[row_num][col_num]\n end", "title": "" }, { "docid": "8dc4f3d9273165269bbe82c8ff51131c", "score": "0.6107598", "text": "def [](index)\n @index[index]\n end", "title": "" }, { "docid": "c8f2850bd40973e323bc0453a7bb025d", "score": "0.6104434", "text": "def [](pos)\n x, y = pos.first, pos[1]\n @grid[x][y]\n end", "title": "" }, { "docid": "ce2e475f9362ec4b1e9f3bd0b6e63fac", "score": "0.6088629", "text": "def [] (key)\r\n assert_exists\r\n arr_cells = cells\r\n return arr_cells[key - 1]\r\n end", "title": "" }, { "docid": "6a2ba6ea4e1b43cdae23cd47be66d17f", "score": "0.60724026", "text": "def [](pos)\n r, c = pos[0],pos[1]\n grid[r][c]\n end", "title": "" }, { "docid": "12044a53dce2f3fef4acdb2114f60a22", "score": "0.6065419", "text": "def [](pos)\n row = pos.first\n col = pos.last\n @grid[row][col]\n end", "title": "" }, { "docid": "1769cb86e3b7b7108a3b61fb11cd2bf1", "score": "0.60509217", "text": "def read_cell(x, y)\n offset = (y * @height) + x\n\n @cells[offset] if x >= 0 && y >= 0 && x < @width && y < @height\n end", "title": "" }, { "docid": "759d9e374a885c12f700d3c5c621a6c1", "score": "0.6045814", "text": "def [](pos) #pos = [1,2]\n # x, y = pos\n x = pos[0]\n y = pos[1]\n @rows[x][y] \n end", "title": "" }, { "docid": "8c2703503f4b5efa0503124d6c5b117f", "score": "0.6019607", "text": "def [](i,j)\n return @rows[i][j]\n end", "title": "" }, { "docid": "60ae5aaf11a551cfa81a1f08ef2e7bd4", "score": "0.60113037", "text": "def index\n @cells = Cell.all\n end", "title": "" }, { "docid": "b75721550164ab829332f1042cbbf0a0", "score": "0.60010016", "text": "def [] x, y\r\n @rows[y][x]\r\n end", "title": "" }, { "docid": "8d8ba58ea7a029b7f3441b688fac32cd", "score": "0.5995197", "text": "def [](pos)\n row, col = pos[0], pos[1]\n @rows[row][col]\n end", "title": "" }, { "docid": "2be916ed18c3579b37a5f2cacb43eb77", "score": "0.5995061", "text": "def values_at(*indices)\n indices.collect {|key| self[convert_key(key)]}\n end", "title": "" }, { "docid": "c995d9a41ee42ae368ddc882826f3794", "score": "0.5993321", "text": "def cell(cell)\n @board[cell]\n end", "title": "" }, { "docid": "3f298048157a25c42b00e6ad8f04e85c", "score": "0.5965503", "text": "def cell_index_array\n use_default_index ? 0.upto(points - 1) : concatenate_data_arrays('index', 'cells')\n end", "title": "" }, { "docid": "3e2be5064e24275fd250d88c6a4c69e7", "score": "0.5949813", "text": "def [](pos)\n raise 'invalid pos' if !valid_pos?(pos)\n \n row, col = pos\n @rows[row][col]\n end", "title": "" }, { "docid": "d78a342a21de4cc9d68dc3265846f01d", "score": "0.59242857", "text": "def cell(loc)\n @map[loc]\n end", "title": "" }, { "docid": "b4a09a602e2ca20b15316c0e9aea06cf", "score": "0.59181786", "text": "def [](row, col)\n get_disc(row, col)\n end", "title": "" }, { "docid": "3407e6a243b4b27f4e3432c03365bd4f", "score": "0.5917424", "text": "def [](idx)\n if idx.is_a?(Range)\n return @index[idx].each_with_index.map {|val, idx| force_load(idx)}\n end\n # idx is an index now\n force_load(idx)\n end", "title": "" }, { "docid": "60bd2a060948de773df22c50b5be34c3", "score": "0.59106904", "text": "def get_cell(row, column)\n @fields[row][column]\n end", "title": "" }, { "docid": "2b3a24b14a2b7055f43a756e16ef264b", "score": "0.5906025", "text": "def data_at(sheet_index, record_index, cell_index)\n @sheets[sheet_index].records[record_index].cells[cell_index]\n end", "title": "" }, { "docid": "59f8add6ab1b5f546db69ef76b84fcab", "score": "0.5903338", "text": "def at(row = @row, col = @col)\n row, col = wrap(row, col)\n return nil unless in_bounds?(row, col)\n\n @cells[row][col]\n end", "title": "" }, { "docid": "0656564f10b8c90c93ebebe01e5e0113", "score": "0.58953446", "text": "def [](x,y)\n @board[x][y]\n end", "title": "" }, { "docid": "8e434388ea28ce98f589bd5d56f81500", "score": "0.589037", "text": "def [](i)\n values[column_index i]\n end", "title": "" }, { "docid": "47f4b07475db7815ceb5589830b9b1da", "score": "0.58896464", "text": "def [](indx)\n elements[indx]\n end", "title": "" }, { "docid": "0c2c24a33fdbda26f46f046010b01d04", "score": "0.588282", "text": "def row(index)\n @data[index]\n end", "title": "" }, { "docid": "cad82b66ba550bd8d231517821d34ae8", "score": "0.5877336", "text": "def [](index)\n all[index]\n end", "title": "" }, { "docid": "90382fb232441a931e61f81bed8208ec", "score": "0.5860729", "text": "def [](row, col)\n #convert row values by * by 9\n @grid[row * 9 + col]\n end", "title": "" }, { "docid": "0b06efe8d5a0c17b4f029331cb1b61fc", "score": "0.5849546", "text": "def row(index)\n @rows[index]\n end", "title": "" }, { "docid": "87cec158747cdd9660d3709e9b85026f", "score": "0.58407825", "text": "def [] (row, col)\n _get(gsl, row, col)\n end", "title": "" }, { "docid": "d5238b018bc8701ee4c7c4c9709c6b03", "score": "0.58386165", "text": "def [](index)\n cast get(index)\n end", "title": "" }, { "docid": "fc9d87b5c916e92b79f66dd41afad74e", "score": "0.58245075", "text": "def find(k)\n @cells[k]\n end", "title": "" }, { "docid": "4628c15f19907f69cf985d9211b1e6fd", "score": "0.58238304", "text": "def at(index)\n self[index]\n end", "title": "" }, { "docid": "03c7333ac336ae35de435da89ba229cb", "score": "0.5811869", "text": "def cells(*args)\n args.each { |col| cell(col) }\n @cells\n end", "title": "" }, { "docid": "fc63659cb954010d252ae90f5d88b179", "score": "0.58075565", "text": "def show_cell(i)\n return @genes[i]\n end", "title": "" }, { "docid": "d1590b54bed4825a9bb7e917fce45b99", "score": "0.58052933", "text": "def get(row, column)\n cell(normalize_key(row), normalize_key(column))\n end", "title": "" }, { "docid": "d1590b54bed4825a9bb7e917fce45b99", "score": "0.58052933", "text": "def get(row, column)\n cell(normalize_key(row), normalize_key(column))\n end", "title": "" }, { "docid": "01e3755fff0d9c25bd12bb07ce740aa6", "score": "0.5784308", "text": "def [](index); @data[index]; end", "title": "" }, { "docid": "1a291cffa904e794039772b35412ece6", "score": "0.57800984", "text": "def [](x, y)\n fail OutOfRange unless check_range(x, y)\n data[index(x, y)]\n end", "title": "" }, { "docid": "04983644baa1895eb8a6d56dd965143e", "score": "0.5779911", "text": "def []( index )\n case index\n when 0\n @x\n when 1\n @y\n else\n nil\n end\n end", "title": "" }, { "docid": "540674df47b1d392251fab1894dc2af7", "score": "0.57744235", "text": "def [](index)\n @board[index]\n end", "title": "" }, { "docid": "c75fabbad894ef19fb23a4e9af680a7b", "score": "0.576362", "text": "def [](pos)\n if valid_pos?(pos)\n row, col = pos\n @grid[row][col]\n else\n puts \"Invalid position\"\n end\n end", "title": "" }, { "docid": "291d329d990b2f94002af69e155dc687", "score": "0.57444555", "text": "def [](index)\n lookup(index.to_sym)\n end", "title": "" }, { "docid": "b88c023f932b53c5fb55459bded034f3", "score": "0.574041", "text": "def get_cell(x, y)\n get_cell_from_board(@board, x, y)\n end", "title": "" }, { "docid": "24693211d2637efea41c613a3628d063", "score": "0.5739176", "text": "def []( index )\n reg = to_reg()\n reg[index]\n end", "title": "" }, { "docid": "fd6bb339186de384309b6003c52ca1a6", "score": "0.5737924", "text": "def evaluate(indexes)\n indexes.collect { |i| self[i] }\n end", "title": "" }, { "docid": "b8debf22764da117c1d51c285931844c", "score": "0.57206744", "text": "def cells\n rows.map { |r| r[key] }\n end", "title": "" }, { "docid": "0eaf61ffd71250b3bee51a926f3d1122", "score": "0.57205003", "text": "def [](cell_name)\n cell = Cell.select_or_create_cell(cell_name, self)\n \n end", "title": "" }, { "docid": "5a58c3e573f46cbfae076b1bc46973c4", "score": "0.5718804", "text": "def [](row, column)\n\t\treturn nil unless row.between?(0, @rows-1)\n\t\treturn nil unless column.between?(0, @columns-1)\n\t\t@grid[row][column]\n\tend", "title": "" }, { "docid": "10251a765e696eadcc23f11290dd624b", "score": "0.5710782", "text": "def [](position)\n\n pRow, pColumn = position\n @grid[pRow][pColumn]\n\n end", "title": "" }, { "docid": "d7353c043a727f6c464b8915ad21cd66", "score": "0.5698166", "text": "def get_row(index)\n @board[index]\n end", "title": "" }, { "docid": "3eec095e46942cbf7ed8f936379f75a4", "score": "0.56927305", "text": "def get(i, j)\n @pos[i][j]\n end", "title": "" }, { "docid": "270e914219b39b1804d6ee41964074fc", "score": "0.56819975", "text": "def [](pos)\n @board[pos[0]][pos[1]]\n end", "title": "" }, { "docid": "5790e825299ad8f549cf4108e6bf9d0b", "score": "0.56807375", "text": "def at(cell_x, cell_y)\n assert_ok_coords(cell_x, cell_y)\n @grid[cell_x - 1][cell_y - 1]\n end", "title": "" }, { "docid": "7f1e928111428ae1dc3ebf43a916cfaa", "score": "0.56766367", "text": "def [](x, y)\n @pole[x][y]\n end", "title": "" }, { "docid": "6f5a2cb3f6748fee1c2d17db71b994ff", "score": "0.56686723", "text": "def [](x, y)\n row = @state[y]\n row ? row[x] : nil\n end", "title": "" }, { "docid": "7b17ccb1758f298eda029923a682fc2d", "score": "0.5664211", "text": "def get_elem cell\n\t\treturn @elements[cell]\n\tend", "title": "" }, { "docid": "7bc329297319d521ed65dd6e3c49b8c1", "score": "0.5658908", "text": "def read(y, x)\n cy, cx = Vedeu::Geometry::Position[y, x].as_indices\n\n row = fetch(cells, cy)\n cell = fetch(row, cx)\n\n cell\n end", "title": "" }, { "docid": "29836481b30fe2b26af499a93a8c3966", "score": "0.56529236", "text": "def row(index)\n end", "title": "" }, { "docid": "94284a5017f1a79424c35c1647dbd21c", "score": "0.56517565", "text": "def [](row,col)\n case col\n when 0...81\n @row_column[row][col]\n when 81...162\n @row_number[row][col - 81]\n when 162...243\n @column_number[row][col - 162]\n when 243...324\n @box_number[row][col - 243]\n else\n nil\n end\n end", "title": "" }, { "docid": "a996944aef3582b41d1e418829b7f12d", "score": "0.5648804", "text": "def [](index); end", "title": "" }, { "docid": "47bd6f652032de8647eaea5be6188a13", "score": "0.5644188", "text": "def [](row, col)\n @move[[row, col]]\n end", "title": "" }, { "docid": "9fa5270656578ef2e9aa0625a0a629a3", "score": "0.5631809", "text": "def [](pos)\n raise \"pos not on board\" unless on_board?(pos)\n i, j = pos\n @rows[i][j]\n end", "title": "" }, { "docid": "2e18386915180ad005936e03a346a8d4", "score": "0.5621319", "text": "def [](index)\n get(index)\n end", "title": "" }, { "docid": "a1421afd238969a7fbae8edf78194542", "score": "0.56179094", "text": "def [](*index)\n if index[0].kind_of?(Array)\n index = index[0]\n end\n return @delegate[index]\n end", "title": "" } ]
6e490ef915002e7b8f5f1952673703cb
Apply macros and filters to +text+.
[ { "docid": "aececce3560b48595ab02aa4d450d202", "score": "0.85773784", "text": "def process_text text\n @filter.process(Blogitr.expand_macros(@filter, text))\n end", "title": "" } ]
[ { "docid": "eede983d98129eb384f0718314b48e4a", "score": "0.67197466", "text": "def compile_text(tmp)\n @prefilters.each do |f| \n tmp=f.run( tmp )\n end\n\n # compile to latex\n tmp=Kramdown::Document.new(tmp, @kramdown_opts).to_latex\n\n # post filters\n @postfilters.each{ |f| tmp=f.run(tmp) }\n return tmp\n end", "title": "" }, { "docid": "ef1e188351ccabffc264509071dc96ed", "score": "0.6695925", "text": "def apply(text)\n\t\t\tbody = text.dup\n\t\t\t# Parameters\n\t\t\tbody.gsub!(/\\{\\{(\\d+)\\}\\}/) do\n\t\t\t\traw_param($1.to_i).to_s.strip\n\t\t\tend\n\t\t\t# Attributes\n\t\t\tbody.gsub!(/\\{\\{([^\\[\\]\\|\\\\\\s]+)\\}\\}/) do\n\t\t\t\traw_attr($1.to_sym).to_s.strip\n\t\t\tend\n\t\t\tinterpret body\n\t\tend", "title": "" }, { "docid": "a8a70c894c2eefbd26c064cfa08fab49", "score": "0.6563166", "text": "def _perform(text)\n lines = text.split(\"\\n\")\n lines.map! {|line|\n line.gsub(/\\[\\[(.)+\\]\\]/i){|found|\n /\\[\\[([a-z_]*): ([a-z_]*)\\]\\]/i =~ found\n _perform(self.send($1.to_sym, $2))\n }\n }\n lines.join(\"\\n\")\n end", "title": "" }, { "docid": "703f6f33378b05ffeb50c7b7d1089b87", "score": "0.6560943", "text": "def compile_text(tmp)\n @prefilters.each do |f| \n tmp=f.run( tmp )\n end\n\n # compile to latex\n # puts tmp\n tmp=Kramdown::Document.new(tmp, @kramdown_opts).to_html\n\n # post filters\n @postfilters.each{ |f| tmp=f.run(tmp) }\n return tmp\n end", "title": "" }, { "docid": "69dfbd701a3f6c10c716f404e462beae", "score": "0.64603424", "text": "def filter(text, *filters)\n filters.inject(text) do |text,method_name|\n send(method_name, text)\n end\n rescue => boom\n \"<p><strong>Boom!</strong></p><pre>#{escape_html(boom.to_s)}</pre>\"\n end", "title": "" }, { "docid": "69dfbd701a3f6c10c716f404e462beae", "score": "0.64603424", "text": "def filter(text, *filters)\n filters.inject(text) do |text,method_name|\n send(method_name, text)\n end\n rescue => boom\n \"<p><strong>Boom!</strong></p><pre>#{escape_html(boom.to_s)}</pre>\"\n end", "title": "" }, { "docid": "4d8bb53145a452b2508d92114b1587d5", "score": "0.63830215", "text": "def filter_all(text)\n state = :copying\n result = []\n tagged_lines = []\n tag = args = nil\n text.split(/\\n/).each do |line|\n case state\n when :copying\n if line =~ inline_tag\n tag = $1\n args = $2.strip\n state = :inside_tag\n elsif line =~ single_tag\n tag = $1\n args = $2.strip\n result << @filters[tag.to_sym].filter_single(args)\n else\n result << line\n end\n when :inside_tag\n # :endinlinewhatever, :endwhatever or just plain :end\n if line =~ /^:end(inline#{tag}|#{tag})?(\\s.*)?$/\n result << @filters[tag.to_sym].filter_inline(tagged_lines.join(\"\\n\"),args)\n tagged_lines = []\n state = :copying\n else\n tagged_lines << line\n end\n end\n end\n\n result.join(\"\\n\")\n end", "title": "" }, { "docid": "14d7946390a5f50c83e2b936b4e559b6", "score": "0.63565975", "text": "def preprocess_text data\n parse_formatted_text data\n end", "title": "" }, { "docid": "a35cb625f82827a11e7864d5a5c64d68", "score": "0.6344643", "text": "def filter_inline(text,args)\n Ritex::Parser.new.parse(text)\n end", "title": "" }, { "docid": "6f4e137520d901f83ffa5903a482d34c", "score": "0.6320127", "text": "def _post_process_text(text)\n\n # Make the \"Multiple choices\" output easier to read.\n if text.match /Multiple choices/\n text.gsub! /,\\s+/, \"\\n\"\n text.gsub! /^ */, \"\"\n text.gsub! /\\n/, \"\\n \"\n end\n\n # Highlight the names of included modules.\n bold_on = \"\\x1b[1m\"\n bold_off = \"\\x1b[0m\"\n parts = text.split /([\\r\\n]\\S*Includes:.*?[\\r\\n][\\r\\n])/m\n parts.map! { |s|\n if s =~ /[\\r\\n]\\S*Includes:/\n # Modules have parentheses following them.\n s.gsub! /(\\S+)\\(/, bold_on + '\\1' + bold_off + '('\n else\n s\n end\n }\n text = parts.join\n\n return text\n end", "title": "" }, { "docid": "b468f56b02d6d1e01d36aa7761ab702b", "score": "0.62906283", "text": "def process_text text\n newtext = text.gsub(/if/, 'IF')\n\n 30.times { |i|\n newtext.gsub!(/for/, 'FOR')\n newtext.gsub!(/while/, 'WHILE')\n newtext.gsub!(/switch/, 'SWITCH')\n newtext.gsub!(/case/, 'CASE')\n newtext.gsub!(/goto/, 'GOTO')\n newtext.gsub!(/struct/, 'STRUCT')\n newtext.gsub!(/int/, 'INT')\n newtext.gsub!(/char/, 'CHAR')\n newtext.gsub!(/return/, 'RETURN')\n }\n\n return newtext\nend", "title": "" }, { "docid": "4655f4a2a2f6bd0adb4f5fef46286d08", "score": "0.62719", "text": "def scan_text(&block)\n scan_all(text_criteria, &block)\n end", "title": "" }, { "docid": "6284d072b5d3b9e003c7128957ea14c4", "score": "0.61892486", "text": "def filter(text) #:nodoc:\n return text unless @options[:filter]\n if (process = RTeX.filters[@options[:filter]])\n process[text]\n else\n raise FilterError, \"No `#{@options[:filter]}' filter\"\n end\n end", "title": "" }, { "docid": "9286ea9dc2264e4e02eb267ef9d10d39", "score": "0.6132593", "text": "def call_filter(name, text)\n gcontext[:filters] ||= %w(comment)\n name = name.to_s\n raise Errors::NoSuchFilter.new(name) unless gcontext[:filters].member? name\n method(name).call text\n end", "title": "" }, { "docid": "15a9d60149d27a07a25507214aaf9e7b", "score": "0.60902625", "text": "def erubis_filter(text)\n return text if text.nil?\n \n t = text.dup\n t.gsub!('<%', '&lt;%')\n t.gsub!('%>', '%&rt;')\n t\n end", "title": "" }, { "docid": "30cdedcf2863bce19168429f878ea292", "score": "0.60720265", "text": "def apply_custom_formatting(text)\n\n # Define custom formatting codes and replacement values.\n codes = []\n codes << '<code>'\n codes << '</code>'\n replacements = []\n replacements << '<font name=\"SF Mono\"><color rgb=\"e83e8c\"><b>'\n replacements << '</b></color></font>'\n\n # Process each replacement.\n codes.each_with_index do |code, index|\n text.gsub!(code, replacements[index])\n end\n\n end", "title": "" }, { "docid": "7ab6ddb0c5e2f5f1c08d97c8d44d5de9", "score": "0.60384053", "text": "def transform(text)\n\t\t\t@rules.each do |rule|\n\t\t\t\tif rule.replace.is_a?(String)\n\t\t\t\t\ttext = text.gsub(rule.pattern, rule.replace)\n\t\t\t\telse\n\t\t\t\t\ttext = text.gsub(rule.pattern) {rule.replace.call($~)}\n\t\t\t\tend\n\t\t\tend\n\t\t\treturn text\n\t\tend", "title": "" }, { "docid": "3260d2548e8fea229bd8e8efd79097c3", "score": "0.6026294", "text": "def process_text(text)\n regexp = /(?:\\s|^|>)(?<word>(\\w{0,3}|[-–—]|\\&ndash\\;|\\&mdash\\;|aboard|about|above|across|after|against|along|amid|among|anti|around|before|behind|below|beneath|beside|besides|between|beyond|concerning|considering|despite|down|during|except|excepting|excluding|following|from|inside|into|like|minus|near|onto|opposite|outside|over|past|plus|regarding|round|save|since|than|that|this|through|toward|towards|under|underneath|unlike|until|upon|versus|with|within|without)(?<space>\\s))/i\n text.gsub(regexp).each { |m| \"#{m[0..-2]}&nbsp;\" }\n end", "title": "" }, { "docid": "15c072a8ae31dc1da1a60ad0a7cdf4c9", "score": "0.6023325", "text": "def pre_filter(text)\n return nil unless text\n\n text.gsub!(/every(\\s)?/, '')\n text.gsub!(/each(\\s)?/, '')\n text.gsub!(/repeat(s|ing)?(\\s)?/, '')\n text.gsub!(/on the(\\s)?/, '')\n text.gsub!(/([^\\w\\d\\s])+/, '')\n text.downcase.strip\n text = normalize_us_holidays(text)\n end", "title": "" }, { "docid": "9e8d8392d33657e5a8816bb87725982c", "score": "0.5995359", "text": "def post_process_text(s) \n # extract math\n math, arrays = [], []\n s.scan(/\\$([^$]+)\\$/) {|m| math << m } # $$\n s.scan(/\\\\\\[([^$]+)\\\\\\]/) {|m| arrays << m } # \\[ \\]\n # citations\n s = replace_citations(s)\n # listings, algorithms, tables\n s = replace_listings(s)\n # custom \n s = replace_custom_refs(s)\n # texttt\n s = replace_texttt(s)\n # emph\n s = replace_emph(s)\n # textbf\n s = replace_bf(s)\n # urls\n s = replace_urls(s)\n # footnotes\n s = replace_footnotes(s)\n # paragrams\n s = replace_paragraphs(s)\n # chapter refs\n s = replace_chapter_refs(s)\n # section refs\n s = remove_section_refs(s)\n # replace markboth with nothing\n s = replace_markboth(s)\n # remove hypenation suggestions\n s = remove_hyph_suggestions(s)\n # umlats etc\n s = character_processing(s)\n # replace \\% with %\n s = s.gsub(\"\\\\%\", \"\\%\")\n # replace \"\\ \" with a space\n s = s.gsub(\"\\\\ \", \" \")\n # replace \\\" and \\' with nothing\n s = s.gsub(\"\\\\\\\"\", \"\")\n s = s.gsub(\"\\\\\\'\", \"\")\n # replace ~ with space\n s = s.gsub(\"~\", \" \")\n # replace \\$ with $ (testing algorithms)\n s = s.gsub(\"\\\\$\", \"$\")\n # replace \\_ with _ (testing algorithms)\n s = s.gsub(\"\\\\_\", \"_\") \n # replace \\# with # (appendix)\n s = s.gsub(\"\\\\#\", \"#\")\n # replace \\{ with { (appendix)\n s = s.gsub(\"\\\\{\", \"{\")\n # replace \\} with } (appendix)\n s = s.gsub(\"\\\\}\", \"}\") \n # replace \\\\ with <br /> (appendix, de)\n s = s.gsub(\"\\\\\\\\\", \"<br />\") \n # replace \\Latex with LaTex\n s = s.gsub(\"\\\\LaTeX\", \"LaTex\") \n # replace \\copyright with html copyright\n s = s.gsub(\"\\\\copyright\", \"&copy;\")\n # replace \\mybookdate\\ with publication date 2011\n s = s.gsub(\"\\\\mybookdate\", DATE)\n # replace \\mybookauthor with the author ame\n s = s.gsub(\"\\\\mybookauthor\", \"Jason Brownlee\")\n # replace \\mybooktitle with the book title\n s = s.gsub(\"\\\\mybooktitle\", TITLE)\n # replace \\mybooksubtitle with the book subtitle\n s = s.gsub(\"\\\\mybooksubtitle\", SUBTITLE)\n # finally switch ` for ' (late in the subs)\n s = s.gsub(\"`\", \"'\")\n \n # put the math back\n if !math.empty?\n index = 0\n s = s.gsub(/\\$([^$]+)\\$/) do |m|\n index += 1\n \"$#{math[index - 1]}$\"\n end\n end \n if !arrays.empty?\n index = 0\n s = s.gsub(/\\\\\\[([^$]+)\\\\\\]/) do |m|\n index += 1\n \"\\\\[#{arrays[index - 1]}\\\\]\"\n end\n end\n return s\nend", "title": "" }, { "docid": "542c01363b7ec8a31a10c8de69e1af4e", "score": "0.5984474", "text": "def parse_and_process_text(text, parse_options={})\n postprocess(parse_xml(parse_text(text, parse_options)))\n end", "title": "" }, { "docid": "c7f7e00813bc160a5a184779deb8b3b9", "score": "0.5980578", "text": "def filter(text)\n text.upcase.gsub(@filter, '')\n end", "title": "" }, { "docid": "3ade9216e47cc1916cf5c77d83d98647", "score": "0.5980433", "text": "def process_code(text)\n begin\n results = text.clone\n # processing code function\n text.scan(/\\${i2x.code\\((.*?)\\)}/).each { |k|\n k.each { |m|\n puts \"\\n\\tProcessing: #{m}\"\n results[\"${i2x.code(#{m})}\"] = eval(m.to_s).to_s\n }\n } if text.include? 'i2x.code'\n rescue Exception => e\n Services::Slog.exception e\n end\n results\n end", "title": "" }, { "docid": "8e17438981d513822e4dd5c1c4f45ef7", "score": "0.5977665", "text": "def parse(text)\n text.split(/(<code.*?>.*?<\\/code>)/m).inject(\"\") do |result, piece|\n if piece =~ /^<code/\n result << highlight(piece.gsub(/<code.*?>|<\\/code>/, \"\"), parse_lang(piece)).chomp\n else\n result << format(piece)\n end\n end\n end", "title": "" }, { "docid": "8ed8e524353380228f819d641902db6e", "score": "0.5962912", "text": "def evaluate(text, item)\n self.class.evaluate_raw_filter filter_for(item), text\n end", "title": "" }, { "docid": "a0f399d8b9e8bd4782cd9d4d7ec07ca4", "score": "0.595519", "text": "def compile(compiler, text)\n filter = self\n node = compiler.instance_variable_get('@node')\n\n filename = compiler.options[:filename]\n line = node.line\n name = node.value[:name]\n\n compiler.instance_eval do\n return if options[:suppress_eval]\n\n text = unescape_interpolation(text).gsub(/(\\\\+)n/) do |s|\n escapes = $1.size\n next s if escapes % 2 == 0\n \"#{'\\\\' * (escapes - 1)}\\n\"\n end\n # We need to add a newline at the beginning to get the\n # filter lines to line up (since the Haml filter contains\n # a line that doesn't show up in the source, namely the\n # filter name). Then we need to escape the trailing\n # newline so that the whole filter block doesn't take up\n # too many.\n text = %[\\n#{text.sub(/\\n\"\\Z/, \"\\\\n\\\"\")}]\n push_script <<RUBY.rstrip, :escape_html => false\nfind_and_preserve(#{filter.inspect}.render_with_options(#{text}, _hamlout.options.merge(filename: \"#{filename}\", line: #{line}, name: \"#{name}\")))\nRUBY\n return\n end\n\n rendered = Haml::Helpers::find_and_preserve(filter.render_with_options(text, compiler.options, filename, line), compiler.options[:preserve])\n rendered.rstrip!\n rendered.gsub!(\"\\n\", \"\\n#{' ' * @output_tabs}\") unless options[:ugly]\n push_text(rendered)\n end", "title": "" }, { "docid": "e62c527041727aa2370a1c743ed7390e", "score": "0.5950147", "text": "def write_text(text)\n if (@text_filter)\n text = @text_filter.call(text)\n end\n @out << text\n end", "title": "" }, { "docid": "12de514870f68910227c6683a6604627", "score": "0.5891341", "text": "def initialize text\n @filters = Despamilator::Filter.new text\n end", "title": "" }, { "docid": "fff4254235f8d9e4a0b3b5786ff26433", "score": "0.58898795", "text": "def filter_text(text)\n text = text.to_s\n text.gsub('&', '&amp;')\n text.gsub('\\'', '&#039;')\n text.gsub('\"', '&quot;')\n text.gsub('<', '&lt;')\n text.gsub('>', '&gt;')\n text\n end", "title": "" }, { "docid": "c4059786002d01f2e1adfb3ec76574c1", "score": "0.58744115", "text": "def format(text, &block)\n extract(text).each_with_object(text.clone) do |extract, redacted_text|\n sub = block_given? ? block.call(extract) : default_replacement\n redacted_text[extract.start..extract.finish] = sub\n end\n end", "title": "" }, { "docid": "af2868c46e33b7e0f111361634e00884", "score": "0.58605146", "text": "def process_text(content)\n content\n end", "title": "" }, { "docid": "5503da762db1b3d20c77d2a8bf1390af", "score": "0.5831997", "text": "def scrub_text(text)\n TEXT_GSUBS.inject(text) { |memo, sub| memo = memo.gsub(*sub) }\n end", "title": "" }, { "docid": "076896498c1c011db3195723254fdecd", "score": "0.5826648", "text": "def process_code text\n # the first line is the lang identifier\n lang = text.lines.first.scan(/^#!+[\\s+]?(\\w+)/).flatten.first\n\n # if found remove first line from text\n if lang\n lang.downcase!\n text = text.lines.to_a[1..-1].join\n else\n lang = 'text'\n end\n\n # highlight and put into a `div` element\n html = CodeRay.scan(text, lang).div(:css => :class)\n end", "title": "" }, { "docid": "17ba01f62f2af47915f21f2a5d8811f3", "score": "0.58182704", "text": "def on_slim_text(content)\n compile(content)\n end", "title": "" }, { "docid": "c0ca3d8f0baca1cca57b27401f99f509", "score": "0.57955754", "text": "def parse_text(text)\n\n end", "title": "" }, { "docid": "0aaf72430b78ad59281366ebd3b8f847", "score": "0.568924", "text": "def visit_Text(text, *rest)\n end", "title": "" }, { "docid": "917e34f58d25dc490275220821cad4bc", "score": "0.5684171", "text": "def macro(text)\n return text if text.nil?\n\n copy = text.dup\n\n # Links\n # \n # Example [[image:foo.png][name]]\n # 1. the prefix image\n # 2. the link, with colon :foo.png\n # 3. the link itself foo.png\n # 4. the second half of the link [name]\n # 5. the name name \n #copy.gsub!(/\\[\\[(([^\\]]+):)?([^\\]]+)(\\]\\[([^\\]]+))?\\]\\]/) do |match|\n copy.gsub!(/\\[\\[([^\\]]+?)(:([^\\]]+))?(\\]\\[([^\\]]+))?\\]\\]/) do |match|\n prefix = $1\n path = $3\n name = $5\n\n # Name of the link\n name ||= path\n\n Ramaze::Log.debug prefix\n\n # Create link to this target\n case prefix\n when 'attachments'\n # A list of attachments\n attachment_list self\n when 'image'\n # Create an inline image\n target = attachment(path)\n \"<img class=\\\"attachment\\\" src=\\\"#{target.public_path}\\\" alt=\\\"#{name.gsub('\"', '&quot;')}\\\" title=\\\"#{name.gsub('\"', '&quot')}\\\" />\"\n when 'page_nav'\n # Create a page table of contents\n subpage_navigation self\n when 'url'\n # Create a URL\n target = attachment(path)\n target.public_path\n else\n # Create a full link\n target = attachment(path)\n \"<a href=\\\"#{target.public_path}\\\">#{Rack::Utils.escape_html(name).gsub(/#([{@$]@?)/, '&#35;\\1')}</a>\"\n end\n end\n \n copy\n end", "title": "" }, { "docid": "fedc599457cd8e76122ca9f668540ed0", "score": "0.5668206", "text": "def guard_text( text )\n # todo/fix 2: note we need to differentiate between blocks and inline\n # thus, to avoid runs - use guard_block (add a leading newline to avoid getting include in block that goes before)\n \n # todo/fix: remove wrap_markup; replace w/ guard_text\n # why: text might be css, js, not just html\n \n ### !!!!!!!!!!!!\n ## todo: add print depreciation warning\n \n wrap_markup( text )\n end", "title": "" }, { "docid": "4a8db235774cbed7f764125a52637379", "score": "0.5644254", "text": "def replace_text(text)\n @txt .set_editable(true) # .freeze\n @txt .buffer .set_text(\"\")\n# hdr, value = text .split(\"\\n\\n\", 2)\n# hdr .to_s .each_line{|line|\n# case line\n# when /^Subject:/ ;color = BLUE\n# when /^X-SC-Subject:/ ;color = BLUE\n# when /^From:/ ;color = PURPLE\n# #when /^To:|Cc:/ ;color = ORANGE\n# #when /^Date:/ ;color = GREEN\n# when /^X-SC-(Time|Day):/ ;color = RED\n# else ;color = BLACK\n# end\n# @txt .insert(nil, color, nil, line) if line != ''\n# }\n# @txt .insert(nil, RED, WHITE, hdr .to_s)\n# @txt .insert(nil, BLACK, nil, \"\\n\\n\" + value .to_s)\n\n @txt .buffer .insert(@txt.buffer.start_iter, MhcKconv::todisp(text))\n @txt .set_editable(@text_editable) #.thaw\n end", "title": "" }, { "docid": "fa0e77aafe842aed7469bc91d4cfb6f2", "score": "0.5637571", "text": "def handle(text)\n text.gsub!(/^([ \\t#]*):(\\w+):\\s*(.+)?\\n/) do \n prefix = $1\n directive = $2.downcase\n param = $3\n\n case directive\n when \"include\"\n filename = param.split[0]\n include_file(filename, prefix)\n\n else\n yield(directive, param)\n end\n end\n end", "title": "" }, { "docid": "7da8b632473e0cdeac224fa71a6eb2df", "score": "0.5636541", "text": "def pre_process(text_line)\n text_line\n end", "title": "" }, { "docid": "1a2ed75245b23f63eab1ff90f5c0e90d", "score": "0.5600412", "text": "def postprocess(text)\n inline_emoji(text)\n end", "title": "" }, { "docid": "1e1d438a42e8b783fb248139dcc8700e", "score": "0.5597706", "text": "def text(txt)\r\n puts \"text: #{txt}\" if $DEBUG\r\n\r\n if (inRule?)\r\n txt = cleanText(txt)\r\n @curRuleSrc += txt\r\n end\r\n end", "title": "" }, { "docid": "960035ae8ce65cafe7f9c2f3ec4ec8e7", "score": "0.5596954", "text": "def parse(text, escape_html = true, additional_tags = {}, method = :disable, *tags)\n text = text.clone\n use_tags = determine_applicable_tags(additional_tags, method, *tags)\n\n @tag_sifter = TagSifter.new(text, use_tags, escape_html)\n @tag_sifter.process_text\n end", "title": "" }, { "docid": "1742d834db40a69c695ffd0c699ae82e", "score": "0.5563271", "text": "def default_text_filter\n # blog.text_filter.to_text_filter\n end", "title": "" }, { "docid": "7c435462f72f496d39387a6a2dff8ee6", "score": "0.55602014", "text": "def add_text(text); end", "title": "" }, { "docid": "9148f409480493cc8e67cb6066f53bd5", "score": "0.5558509", "text": "def set_text(text); end", "title": "" }, { "docid": "3681ff8b90f92fd593edef4de2fc49cc", "score": "0.5556019", "text": "def text(text)\n text = text.gsub(/['\\\\]/, '\\\\\\\\\\&')\n \"@output_buffer.safe_concat('#{text}'); \"\n end", "title": "" }, { "docid": "55fd51b296722d10bce4b22579723fbb", "score": "0.5544946", "text": "def add_text(text)\n return if text.empty?\n\n if text.frozen?\n text = text.gsub(/['\\\\]/, '\\\\\\\\\\&')\n else\n text.gsub!(/['\\\\]/, '\\\\\\\\\\&')\n end\n\n with_buffer{@src << \" << '\" << text << @text_end}\n end", "title": "" }, { "docid": "3a654de8330b3225eb1fcdd3d3012995", "score": "0.55411285", "text": "def substText(text,bodyStack)\n if(text.kind_of?(Text)) \n rawtext = text.string ;\n elsif(text.kind_of?(Attribute))\n rawtext = text.value ;\n elsif(text.kind_of?(String))\n rawtext = text ;\n else\n return ;\n end\n\n result = rawtext.clone() ;\n\n# result.gsub!(ArgFormat) {|dat| \n# getSubstText($1,bodyStack,dat) ;\n# }\n substTextBody(result,bodyStack) ;\n\n return result ;\n end", "title": "" }, { "docid": "d6f8ecaa5b5fc9510290f5e1810cdbe3", "score": "0.55204624", "text": "def call\n text\n .split\n .map { |token| convert_sym_to_punct(token) }\n .flat_map { |token| \n token = should_downcase(token)\n remove_symbols(token)\n }\n .flat_map { |token| token.split(Regex::COMMAS_OR_PUNCTUATION) }\n .flat_map { |token| token.split(Regex::VARIOUS) }\n .flat_map { |token| token.split(Regex::ENDS_WITH_PUNCTUATION2) }\n .flat_map { |token| split_dotted_email_or_digit(token) }\n .flat_map { |token| split_abbreviations(token) }\n .flat_map { |token| split_period_after_last_word(token) }\n .flat_map { |token| remove_slash_start_and_end(token) }\n end", "title": "" }, { "docid": "a50d1bb94075290ccac0ad8289d128f2", "score": "0.5514659", "text": "def text(text)\n # Ignore empty\n return if text =~ /\\A\\s*\\z/\n if @next_setting\n @stack.last.send(@next_setting, text)\n end\n @next_setting = nil\n end", "title": "" }, { "docid": "2a59b888484346bdfad3e4f7c287d572", "score": "0.5508109", "text": "def preprocess(content)\n content = process_wikiwords(content)\n #content = process_highlight(content)\n end", "title": "" }, { "docid": "84a6fc8cdabca62199393d132111200a", "score": "0.54983747", "text": "def hot_fixes(text)\n text\n end", "title": "" }, { "docid": "295307e8ee348641fd2306f58cd5f1a7", "score": "0.54899025", "text": "def escape(text)\n replacements.inject(text.to_s) do |corpus, (pattern, replacement)|\n corpus.gsub(pattern, replacement)\n end\n end", "title": "" }, { "docid": "6418b607433810425ef37fc7a94e6c9f", "score": "0.548353", "text": "def pre_tokenize(text)\n normalized_text = text.gsub(/^every\\s\\b/, '')\n normalized_text = text.gsub(/^each\\s\\b/, '')\n normalized_text = text.gsub(/^on the\\s\\b/, '')\n normalized_text.downcase\n end", "title": "" }, { "docid": "d4a782eb36897d049aec644d2b5fb81f", "score": "0.54668707", "text": "def pre_normalize(text); end", "title": "" }, { "docid": "c01052ec4cc7d64b38e2b2ea98a20708", "score": "0.54593813", "text": "def filter_single(text,args)\n Ritex::Parser.new.parse(args)\n end", "title": "" }, { "docid": "a18fac4ed3cfa8e0174bba6158cef53c", "score": "0.5449557", "text": "def sprint_process_text(doc)\n # there is at least one <pre> with MMS text if text has been included by\n # the user. (note) we'll have to verify that if they attach multiple texts \n # to the MMS then Sprint stacks it up in multiple <pre>'s. The only <pre> \n # tag in the document is for text from the user.\n doc.search(\"/html/body//pre\").each do |pre|\n type = 'text/plain'\n text = pre.inner_html.strip\n next if text.empty?\n type, text = transform_text(type, text)\n type, file = sprint_write_file(type, text.strip)\n add_file(type, file) unless type.nil? || file.nil?\n end\n end", "title": "" }, { "docid": "7bd77c2ab18aae1433fcfa585af65078", "score": "0.5447231", "text": "def code(text , method)\n text = text.dup\n TagList.each do |tag|\n if Tags.has_key?(tag)\n self.send(method, text, tag)\n else\n self.send(tag, text)\n end\n end\n text\n end", "title": "" }, { "docid": "a3c38648bda80c21150dc48b3cd3b28c", "score": "0.54432493", "text": "def modify_text(book_text, string_values)\n string_values.each do |search_string, change_string|\n regex = %r[#{search_string}]\n book_text = book_text.gsub(regex, change_string)\n end\n\n return book_text\nend", "title": "" }, { "docid": "263f6aa8e94ecb84553d469df9e036da", "score": "0.53889155", "text": "def trailer_filter(text)\n text.gsub(FILTER_REGEXP) do |author_match|\n label = $~[:label]\n \"#{label} #{parse_user($~[:author_name], $~[:author_email], label)}\"\n end\n end", "title": "" }, { "docid": "fafaedfaa7e0b5b7d3ec07657cad6ab5", "score": "0.53863454", "text": "def textilizable(text, options = {})\r\n return \"\" if text.blank?\r\n\r\n # different methods for formatting wiki links\r\n case options[:wiki_links]\r\n when :local\r\n # used for local links to html files\r\n format_wiki_link = Proc.new {|title| \"#{title}.html\" }\r\n when :anchor\r\n # used for single-file wiki export\r\n format_wiki_link = Proc.new {|title| \"##{title}\" }\r\n else\r\n if @project\r\n format_wiki_link = Proc.new {|title| url_for :controller => 'wiki', :action => 'index', :id => @project, :page => title }\r\n else\r\n format_wiki_link = Proc.new {|title| title }\r\n end\r\n end\r\n\r\n # turn wiki links into textile links:\r\n # example:\r\n # [[link]] -> \"link\":link\r\n # [[link|title]] -> \"title\":link\r\n text = text.gsub(/\\[\\[([^\\]\\|]+)(\\|([^\\]\\|]+))?\\]\\]/) {|m| \"\\\"#{$3 || $1}\\\":\" + format_wiki_link.call(Wiki.titleize($1)) }\r\n\r\n # turn issue ids into links\r\n # example:\r\n # #52 -> <a href=\"/issues/show/52\">#52</a>\r\n text = text.gsub(/#(\\d+)(?=\\b)/) {|m| link_to \"##{$1}\", :controller => 'issues', :action => 'show', :id => $1}\r\n\r\n # turn revision ids into links (@project needed)\r\n # example:\r\n # r52 -> <a href=\"/repositories/revision/6?rev=52\">r52</a> (@project.id is 6)\r\n text = text.gsub(/(?=\\b)r(\\d+)(?=\\b)/) {|m| link_to \"r#{$1}\", :controller => 'repositories', :action => 'revision', :id => @project.id, :rev => $1} if @project\r\n\r\n # when using an image link, try to use an attachment, if possible\r\n attachments = options[:attachments]\r\n if attachments\r\n text = text.gsub(/!([<>=]*)(\\S+\\.(gif|jpg|jpeg|png))!/) do |m|\r\n align = $1\r\n filename = $2\r\n rf = Regexp.new(filename, Regexp::IGNORECASE)\r\n # search for the picture in attachments\r\n if found = attachments.detect { |att| att.filename =~ rf }\r\n image_url = url_for :controller => 'attachments', :action => 'show', :id => found.id\r\n \"!#{align}#{image_url}!\"\r\n else\r\n \"!#{align}#{filename}!\"\r\n end\r\n end\r\n end\r\n\r\n # finally textilize text\r\n @do_textilize ||= (Setting.text_formatting == 'textile') && (ActionView::Helpers::TextHelper.method_defined? \"textilize\")\r\n text = @do_textilize ? auto_link(RedCloth.new(text, [:hard_breaks]).to_html) : simple_format(auto_link(h(text)))\r\n end", "title": "" }, { "docid": "0aaae63c027babc1141d93c06bb68c7e", "score": "0.5384862", "text": "def markup text\n document = parse text\n\n document.accept formatter\n end", "title": "" }, { "docid": "0df64b8b9d4ce9229377c072486bc747", "score": "0.537328", "text": "def text_filter=(filter)\n returning(filter.to_text_filter) { |tf| self.text_filter_id = tf.id }\n end", "title": "" }, { "docid": "bc6846e98035346e07bfee99a36a249a", "score": "0.53719336", "text": "def add_text\n return '' unless @selector.key?(:text)\n\n text = @selector.delete :text\n if !text.is_a?(Regexp)\n \"[normalize-space()='#{text}' or @value='#{text}']\"\n elsif simple_regexp?(text)\n \"[contains(text(), '#{text.source}') or contains(@value, '#{text.source}')]\"\n else\n @selector[:text] = text\n ''\n end\n end", "title": "" }, { "docid": "7d50f859406eceeaa2dc9406c0d1eacc", "score": "0.53690594", "text": "def mltify_text text\n \n coder = HTMLEntities.new\n text = coder.decode text\n text = sanitize( text, okTags = \"\" )\n text = coder.encode text\n words = text.downcase.gsub( /[^A-za-z0-9\\s'\\-#]/, \" \" ).split( /\\s/ )\n \n final_words = []\n words.each do |w|\n unless stop_words.include? w\n final_words << w\n end\n end\n RAILS_DEFAULT_LOGGER.info final_words.join( ' ' ).squish\n final_words.join( ' ' ).squish\n end", "title": "" }, { "docid": "5d491da719f7a7960198bd496841e98c", "score": "0.53612584", "text": "def preprocess_text(text)\n\n # Warn user if text exceeds max_length.\n if text.length > @max_length\n text = text[0..@max_length]\n warn(\"WARNING:: string cut length > #{@max_length}:\\n\")\n warn('text:: '+text)\n end\n\n text = @encoder.clean(text)\n text = remove_diacritics(text)\n\n # correct expected length for vectors with 0's\n @encoder.input_to_sequence(text)\n end", "title": "" }, { "docid": "7abb41c6dff5b3f51f308b689191bb4d", "score": "0.53482014", "text": "def parse(text)\n text = pre_proccess(text)\n text = pre_normalize(text)\n puts text.inspect if Chronic.debug\n\n tokens = Tokenizer::tokenize(' ' + text + ' ')\n tag(tokens, options)\n\n puts \"+#{'-' * 51}\\n| #{tokens}\\n+#{'-' * 51}\" if Chronic.debug\n\n token_group = TokenGroup.new(tokens, definitions(options), @now, options)\n span = token_group.to_span\n\n guess(span, options[:guess]) if span\n end", "title": "" }, { "docid": "0b32ced50afe67759395c1b50c382ae1", "score": "0.5339774", "text": "def inline_mark(text)\n # process simple inlines\n for inline in INLINES_MARK\n text.gsub!(/#{inline[0]}/m, inline[1]) if text.match(/#{inline[0]}/m)\n end\n # process note inlines\n if text.match(NOTES_REGEXP)\n text.gsub!(NOTES_REGEXP) do |string|\n match = string.match(NOTES_REGEXP)\n before = match[1]\n body = match[2]\n after = match[3]\n @document.notes << body\n index = @document.notes.length\n \"#{before}#{index}[#{body}]#{after}\"\n end\n end\n # process link inlines\n if text.match(LINKS_REGEXP)\n text.gsub!(LINKS_REGEXP) do |string|\n match = string.match(LINKS_REGEXP)\n before = match[1]\n body = match[2]\n after = match[3]\n parts = body.split(' ')\n if parts.length > 1\n url = parts.first\n link = parts[1..-1].join(' ')\n else\n url = body\n link = body\n end\n \"#{before}[#{link}](#{url})#{after}\"\n end\n end\n # process escapes (that is \\x is replaced with x)\n text.gsub!(/\\\\(.)/, \"\\\\1\") if text.match(/\\\\(.)/)\n text\n end", "title": "" }, { "docid": "14304ac0e8b2c8dd54091561edb91edc", "score": "0.53350645", "text": "def quotation_filter(text)\n text.gsub QuotationPattern do |w|\n wrap_result w.gsub('\"', '')\n end\n end", "title": "" }, { "docid": "9f64a1a2949b18f24cde9a854a5dd531", "score": "0.53339213", "text": "def process_text text, color = \"#000000\"\n end", "title": "" }, { "docid": "877052c79063f2720a0af72b1a6eb1f9", "score": "0.5332626", "text": "def parse(text); end", "title": "" }, { "docid": "873f57e6603cc885d120b030fd6a9d4d", "score": "0.532649", "text": "def tokenize(text)\n filtered_text = apply_char_filters(text)\n tokens = Tokenizer.tokenize(filtered_text, *tokenizer_regular_expressions)\n apply_token_filters(tokens)\n end", "title": "" }, { "docid": "d9978b3ef30db698efa6dd4177d937c6", "score": "0.52659035", "text": "def inject(text)\n\t\t\tcontext = create_context\n\t\t\tinterpreter = Glyph::Interpreter.new text, context\n\t\t\tsubtree = interpreter.parse\n\t\t\tsubtree[:source] = context[:source]\n\t\t\t@node << subtree\n\t\t\tinterpreter\n\t\tend", "title": "" }, { "docid": "c4aab3d893dcc372d7e18aa0f6619347", "score": "0.5255099", "text": "def add_translations_from_text(text)\n start_new_translation\n text.split(/$/).each_with_index do |line,index|\n @line_number = index + 1\n next if line.empty?\n if method_call? line\n parse_method_call line\n elsif comment? line\n add_comment line\n else\n add_string line\n end\n end\n start_new_translation #instance_variable has to be overwritten or errors can occur on next add\n translations\n end", "title": "" }, { "docid": "c4aab3d893dcc372d7e18aa0f6619347", "score": "0.5255099", "text": "def add_translations_from_text(text)\n start_new_translation\n text.split(/$/).each_with_index do |line,index|\n @line_number = index + 1\n next if line.empty?\n if method_call? line\n parse_method_call line\n elsif comment? line\n add_comment line\n else\n add_string line\n end\n end\n start_new_translation #instance_variable has to be overwritten or errors can occur on next add\n translations\n end", "title": "" }, { "docid": "714630483ea921e49f27238a201035b7", "score": "0.52471983", "text": "def html_markup_text(text); end", "title": "" }, { "docid": "59d3bbdc2220b1f69ff556f740d638dc", "score": "0.5238032", "text": "def text(string); end", "title": "" }, { "docid": "59d3bbdc2220b1f69ff556f740d638dc", "score": "0.5238032", "text": "def text(string); end", "title": "" }, { "docid": "0fd09c4bf21589fda0032b9de39ccb2a", "score": "0.52336884", "text": "def process_functions(text)\n begin\n results = Array.new\n # processing map function\n text.scan(/\\${i2x.map\\((.*?)\\)}/).each { |m|\n puts m\n results.push m\n } if text.include? 'i2x.map'\n\n # processing compare function\n text.scan(/\\${i2x.compare\\((.*?)\\)}/).each { |m|\n puts m\n results.push m\n } if text.include? 'i2x.compare'\n\n rescue Exception => e\n Services::Slog.exception e\n end\n results\n end", "title": "" }, { "docid": "04b3ba6622bb8db6a6d6aa87b1edb1ca", "score": "0.52280486", "text": "def push_flat_script(text)\n unless text.empty?\n push_script(text, true)\n else\n unless @block_opened\n raise SyntaxError.new('Filters must have nested text.')\n end\n start_flat(false)\n end\n end", "title": "" }, { "docid": "3ebfef151f644d0831385d30943b89fc", "score": "0.52182204", "text": "def process_text(raw, preserve = T.unsafe(nil)); end", "title": "" }, { "docid": "7459493e30d3980edb20b68476736f94", "score": "0.52103263", "text": "def sanitize(text)\n text.gsub(@filter) { |gotcha| 'x' * gotcha.length }\n end", "title": "" }, { "docid": "00b9980b8097cce86c6fd6367125e053", "score": "0.5206667", "text": "def beautify(txt)\n #txt.gsub!(/\\*(.*)\\*/, \"<span style=\\\"font-weight: bold;\\\">\\\\1</span>\")\n #txt.gsub!(/\\/(.*)\\//, \"<em>\\\\1</em>\") # Italic\n #txt.gsub!(/\\_(.*)\\_/, \"<span style=\\\"font-decoration: underline;\\\">\\\\1</span>\")\n #txt.gsub!(/\\-(.*)\\-/, \"<span style=\\\"font-decoration: line-through;\\\">\\\\1</span>\")\n # <span style=\"font-size: large;\">ok?</span>\n # <span style=\"color: #FF0000;\">ok?</span>\n txt\n end", "title": "" }, { "docid": "f8d896b5b9c79ca2e0c0eb0aa64faf28", "score": "0.5201445", "text": "def process(text, model)\n text = text.to_s.gsub(\"\\n\", \"<br>\").gsub(\"\\t\", \"&nbsp;\" * 2).gsub(\" \", \"&nbsp;\")\n model.process_output(text)\n end", "title": "" }, { "docid": "701df1844f7273e3bfd6e7863bb20a60", "score": "0.51979893", "text": "def handle text, code_object = nil, &block\n if RDoc::Comment === text then\n comment = text\n text = text.text\n end\n\n # regexp helper (square brackets for optional)\n # $1 $2 $3 $4 $5\n # [prefix][\\]:directive:[spaces][param]newline\n text = text.gsub(/^([ \\t]*(?:#|\\/?\\*)?[ \\t]*)(\\\\?):(\\w+):([ \\t]*)(.+)?(\\r?\\n|$)/) do\n # skip something like ':toto::'\n next $& if $4.empty? and $5 and $5[0, 1] == ':'\n\n # skip if escaped\n next \"#$1:#$3:#$4#$5\\n\" unless $2.empty?\n\n # This is not in handle_directive because I didn't want to pass another\n # argument into it\n if comment and $3 == 'markup' then\n next \"#{$1.strip}\\n\" unless $5\n comment.format = $5.downcase\n next \"#{$1.strip}\\n\"\n end\n\n handle_directive $1, $3, $5, code_object, text.encoding, &block\n end\n\n if comment then\n comment.text = text\n else\n comment = text\n end\n\n self.class.post_processors.each do |handler|\n handler.call comment, code_object\n end\n\n text\n end", "title": "" }, { "docid": "a7fcf86a262248154d81ce2401290521", "score": "0.5197943", "text": "def parse text\n text.gsub(/^%.*$/,'').split(/\\n\\n/).map do |s|\n s.chomp!\n s.gsub(/^#{$/}/,'') unless s.empty?\n end . compact\n end", "title": "" }, { "docid": "c96d806f84735a4acc9b3943e12e06f5", "score": "0.51975435", "text": "def text_to_html (text, args = {})\n args = { emotes: false, map_headings: 1 }.merge args\n \n html = Moredown.text_to_html(text, args)\n html.gsub!('src=\"media/', 'src=\"/media/')\n html.gsub!(/<pre><code>#! (.*?)\\n([^<]*?)<\\/code><\\/pre>/) { |match| \"<pre><code class=\\\"#{$1.downcase.strip}\\\">#{$2.strip}</code></pre>\" }\n \n html\n end", "title": "" }, { "docid": "07e96fcbdbd4b6b5a8d58aa43760cf20", "score": "0.51864827", "text": "def gsub_functions(text)\n\tlast_function_end = 0\n\n\tresult = text\n\tadjust = 0\n\n\tscan_ignore_comments(/((\\w+)::)?(\\w+)\\s*\\(([^\\)]*?)\\)\\s*\\{/m, text) do |match|\n\t\toffset = match.pre_match.length\n\n\t\tif offset > last_function_end\n\t\t\tclass_name = match[2]\n\t\t\tname = match[3]\n\t\t\tend_offset = find_block_end(text, offset) + 1\n\n\t\t\tblock = text[offset, end_offset - offset]\n\n\t\t\t# Get replacement text.\n\n\t\t\treplacement = yield class_name, name, block\n\n\t\t\t# Substitute old text for new text:\n\n\t\t\tbefore_text = result[0, offset + adjust]\n\t\t\tafter_text = result[end_offset + adjust,\n\t\t\t result.length]\n\t\t\tresult = before_text + replacement + after_text\n\t\t\tadjust += replacement.length - block.length\n\n\t\t\t# Save end position of function so that we won't\n\t\t\t# change anything in this block again.\n\n\t\t\tlast_function_end = end_offset\n\t\tend\n\tend\n\n\tresult\nend", "title": "" }, { "docid": "a8b5b288ab2efc238e227f0b7c8012f9", "score": "0.51828116", "text": "def initialize(text, *extensions)\n @text = text\n extensions.each { |e| send(\"#{e}=\", true) }\n @text = Math[@text].preprocess if preserve_math\n end", "title": "" }, { "docid": "f1995042a00d963c020179dcea6f57bc", "score": "0.5182633", "text": "def _test_text ; process_test_case(\"text\") ; end", "title": "" }, { "docid": "59e94917f9617ec71fe808490dcaef04", "score": "0.51824003", "text": "def repair(text); end", "title": "" }, { "docid": "3a9d811b56d56a0221589a30a2ad6651", "score": "0.5179119", "text": "def scan(text, pattern, &block)\n # convert tabs to spaces\n text.gsub!(/^(\\t+)/) {|tabs| ' ' * (8 * tabs.length)}\n\n text.scan(pattern).each do |matches|\n hash = Hash[pattern.names.zip(matches)]\n yield hash if block\n\n section = hash.delete('section')\n section ||= hash.delete('attach')\n\n if section\n hash['approved'] &&= hash['approved'].strip.split(/[ ,]+/)\n\n @sections[section] ||= {}\n next if hash['text'] and @sections[section]['text']\n @sections[section].merge!(hash)\n end\n end\n end", "title": "" }, { "docid": "deb04c7badda9e37976ecde87aa68726", "score": "0.51747423", "text": "def prep(text)\n text = text.gsub /(http[s]?:\\/\\/[^ \\t]+)[ \\t]?/, \"<a target=\\\"_BLANK\\\" href=\\\"\\\\1\\\">\\\\1</a> \"\n text = text.gsub /#([^ \\t<:\\.\\?!@#=\\-_]+)[ \\t]?/, \"<a target=\\\"_BLANK\\\" href=\\\"http://search.twitter.com/search?tag=\\\\1\\\">#\\\\1</a> \"\n text = text.gsub /@([^ \\t<:\\.\\?!@#=\\-_]+)[ \\t]?/, \"<a target=\\\"_BLANK\\\" href=\\\"http://twitter.com/\\\\1\\\">@\\\\1</a> \"\n end", "title": "" }, { "docid": "54e34ebdb72973916df6f7f778c9fa59", "score": "0.51651955", "text": "def preprocess(text, defines={})\n defines = defines.dup\n result = []\n active_stack = []\n active = true\n text.each_line do |line|\n case line\n when /^#\\s*define\\s+(\\w+)\\s+(\\w*)\\s*$/\n defines[$1] = $2 if active\n when /^#\\s*if\\s+(\\w+)\\s*$/\n active_stack.push active\n active = active &&\n case preprocessor_expand($1, defines)\n when '0': false \n when '1': true\n else raise \"Can't parse: #{line}\" end\n when /^#\\s*ifdef\\s+(\\w+)\\s*$/\n active_stack.push active\n active = active && defines.has_key?($1)\n when /^#\\s*ifndef\\s+(\\w+)\\s*$/\n active_stack.push active\n active = active && !defines.has_key?($1)\n when /^#\\s*if\\s+[vV][eE][rR]\\s+(<|>)=?\\s+0x[0-9a-zA-Z]{8}\\s*$/\n # Allow version checks, but always consider the version to be higher\n # than the version compared to.\n active_stack.push active\n active = active && ($1 == \">\")\n when /^#\\s*else\\s*$/\n # If we have a parent if, and it's inactive, we don't actually\n # want to do anything here.\n active = !active if active_stack.empty? || active_stack.last\n when /^#\\s*endif(\\s+(\\w+))?\\s*$/\n active = active_stack.pop\n when /^#\\s*error\\s+(.+)$/\n raise $1 if active\n when /^#.*$/\n raise \"Unknown preprocessor command: #{line}\"\n else\n result << line if active\n end\n end\n raise \"Missing #endif\" unless active_stack.empty?\n result.join\n end", "title": "" }, { "docid": "b5ff3b82867bdec6ac7c14f20b97cdc0", "score": "0.516047", "text": "def tokenize text\r\n m = text.match(@regexp)\r\n return nil if m.nil?\r\n arguments = []\r\n b = @verb.nil? ? 0 : 1\r\n xverb = @verb\r\n @replace.to_s.split_words[b..-1].each { |r|\r\n if r.match(/^\\{\\$[0-9]+\\}$/)\r\n arguments.push m[r[2..-2].to_i]\r\n elsif arguments.empty? && xverb.nil?\r\n xverb = r.to_sym\r\n else\r\n arguments.push r\r\n end\r\n }\r\n Command.new xverb, arguments\r\n end", "title": "" }, { "docid": "f9fd87494d6cd677ca26d88d3696d98e", "score": "0.5154087", "text": "def parse_text(text)\n ## Strip html\n Sanitize::clean!(text, :remove_contents => ['script','style'])\n text.gsub!(/[\\n\\t]+/, ' ')\n text\n end", "title": "" }, { "docid": "96ed32230691a60b031d04c55e6718f8", "score": "0.51537335", "text": "def bbcodeize(text)\n text = text.dup\n TagList.each do |tag|\n if Tags.has_key?(tag)\n apply_tag(text, tag)\n else\n self.send(tag, text)\n end\n # Replace the matching random ids for the following tags: spoiler, nsfw, mp3\n @random_id = random_string\n 2.times { text = text.sub('_RANDOM_ID_', @random_id) }\n end\n text\n end", "title": "" }, { "docid": "3f6552d42e91c9eb17cab18d6d818d50", "score": "0.5149004", "text": "def conv_markup(txt)\n txt.\n gsub(%r{<tt>(.*?)</tt>}) { \"+#$1+\" } .\n gsub(%r{<code>(.*?)</code>}) { \"+#$1+\" } .\n gsub(%r{<b>(.*?)</b>}) { \"*#$1*\" } .\n gsub(%r{<em>(.*?)</em>}) { \"_#$1_\" }\n end", "title": "" } ]