query
stringlengths
7
9.55k
document
stringlengths
10
363k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Use callbacks to share common setup or constraints between actions.
def set_trouble @variable_trouble = Trouble.find(params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "def action_hook; end", "def run_actions; end", "def define_action_hook; end", "def actions; end", "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end", "def add_actions; end", "def callbacks; end", "def callbacks; end", "def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end", "def define_action_helpers; end", "def post_setup\n end", "def action_methods; end", "def action_methods; end", "def action_methods; end", "def before_setup; end", "def action_run\n end", "def execute(setup)\n @action.call(setup)\n end", "def define_action_helpers?; end", "def set_actions\n actions :all\n end", "def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end", "def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end", "def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end", "def before_actions(*logic)\n self.before_actions = logic\n end", "def setup_handler\n end", "def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end", "def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end", "def action; end", "def action; end", "def action; end", "def action; end", "def action; end", "def workflow\n end", "def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end", "def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end", "def before(action)\n invoke_callbacks *self.class.send(action).before\n end", "def process_action(...)\n send_action(...)\n end", "def before_dispatch(env); end", "def after_actions(*logic)\n self.after_actions = logic\n end", "def setup\n # override and do something appropriate\n end", "def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end", "def setup(_context)\n end", "def setup(resources) ; end", "def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end", "def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end", "def determine_valid_action\n\n end", "def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end", "def startcompany(action)\n @done = true\n action.setup\n end", "def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end", "def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end", "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end", "def define_tasks\n define_weave_task\n connect_common_tasks\n end", "def setup(&block)\n define_method(:setup, &block)\n end", "def setup\n transition_to(:setup)\n end", "def setup\n transition_to(:setup)\n end", "def action\n end", "def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend", "def config(action, *args); end", "def setup\n @setup_proc.call(self) if @setup_proc\n end", "def before_action \n end", "def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end", "def action\n end", "def matt_custom_action_begin(label); end", "def setup\n # override this if needed\n end", "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end", "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end", "def after(action)\n invoke_callbacks *options_for(action).after\n end", "def pre_task\n end", "def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end", "def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end", "def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end", "def setup_signals; end", "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end", "def initialize(*args)\n super\n @action = :set\nend", "def after_set_callback; end", "def setup\n #implement in subclass;\n end", "def lookup_action; end", "def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end", "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "def release_actions; end", "def around_hooks; end", "def save_action; end", "def setup(easy)\n super\n easy.customrequest = @verb\n end", "def action_target()\n \n end", "def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end", "def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end", "def before_setup\n # do nothing by default\n end", "def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end", "def default_action; end", "def setup(&blk)\n @setup_block = blk\n end", "def callback_phase\n super\n end", "def advice\n end", "def _handle_action_missing(*args); end", "def duas1(action)\n action.call\n action.call\nend", "def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end", "def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end", "def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend" ]
[ "0.6163163", "0.6045976", "0.5946146", "0.591683", "0.5890051", "0.58349305", "0.5776858", "0.5703237", "0.5703237", "0.5652805", "0.5621621", "0.54210985", "0.5411113", "0.5411113", "0.5411113", "0.5391541", "0.53794575", "0.5357573", "0.53402257", "0.53394014", "0.53321576", "0.53124547", "0.529654", "0.5296262", "0.52952296", "0.52600986", "0.52442724", "0.52385926", "0.52385926", "0.52385926", "0.52385926", "0.52385926", "0.5232394", "0.523231", "0.5227454", "0.52226824", "0.52201617", "0.5212327", "0.52079266", "0.52050185", "0.51754695", "0.51726824", "0.51710224", "0.5166172", "0.5159343", "0.51578903", "0.51522785", "0.5152022", "0.51518047", "0.51456624", "0.51398855", "0.5133759", "0.5112076", "0.5111866", "0.5111866", "0.5110294", "0.5106169", "0.509231", "0.50873137", "0.5081088", "0.508059", "0.50677156", "0.50562143", "0.5050554", "0.50474834", "0.50474834", "0.5036181", "0.5026331", "0.5022976", "0.5015441", "0.50121695", "0.5000944", "0.5000019", "0.4996878", "0.4989888", "0.4989888", "0.49864885", "0.49797225", "0.49785787", "0.4976161", "0.49683493", "0.4965126", "0.4958034", "0.49559742", "0.4954353", "0.49535993", "0.4952725", "0.49467874", "0.49423352", "0.49325448", "0.49282882", "0.49269363", "0.49269104", "0.49252945", "0.4923091", "0.49194667", "0.49174926", "0.49173003", "0.49171105", "0.4915879", "0.49155936" ]
0.0
-1
Never trust parameters from the scary internet, only allow the white list through.
def trouble_params params.require(:trouble).permit(:name, :url, :solution, :status_id, :category_id, :user_id) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "def allow_params_authentication!; end", "def allowed_params\n ALLOWED_PARAMS\n end", "def default_param_whitelist\n [\"mode\"]\n end", "def param_whitelist\n [:role, :title]\n end", "def expected_permitted_parameter_names; end", "def safe_params\n params.except(:host, :port, :protocol).permit!\n end", "def strong_params\n params.require(:team_member).permit(param_whitelist)\n end", "def permitir_parametros\n \t\tparams.permit!\n \tend", "def strong_params\n params.require(:community).permit(param_whitelist)\n end", "def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end", "def strong_params\n params.require(:education).permit(param_whitelist)\n end", "def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end", "def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end", "def param_whitelist\n [:rating, :review]\n end", "def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end", "def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end", "def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end", "def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end", "def valid_params_request?; end", "def strong_params\n params.require(:experience).permit(param_whitelist)\n end", "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end", "def allowed_params\n params.require(:allowed).permit(:email)\n end", "def permitted_params\n []\n end", "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end", "def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend", "def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end", "def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end", "def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end", "def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end", "def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end", "def safe_params\n params.require(:user).permit(:name)\n end", "def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend", "def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end", "def check_params; true; end", "def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end", "def quote_params\n params.permit!\n end", "def valid_params?; end", "def paramunold_params\n params.require(:paramunold).permit!\n end", "def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend", "def filtered_parameters; end", "def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end", "def filtering_params\n params.permit(:email, :name)\n end", "def check_params\n true\n end", "def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend", "def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend", "def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end", "def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end", "def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end", "def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend", "def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end", "def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end", "def active_code_params\n params[:active_code].permit\n end", "def filtering_params\n params.permit(:email)\n end", "def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end", "def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end", "def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end", "def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end", "def post_params\n if current_user.admin? \n params.permit(:title, :body, :city, :country, :gps_location, :privacy, :visible, :latitude, :longitude, images: [], files: [])\n else \n params.permit(:title, :body, :city, :country, :gps_location, :privacy,:latitude, :longitude, images: [], files: [])\n end \n end", "def list_params\n params.permit(:name)\n end", "def filter_parameters; end", "def filter_parameters; end", "def vineyard_params\n params.permit(:vineyard_name, :email, :website_url, :phone, :address, :city, :region, :postcode, :country, :specialty, :description, :pet_friendly, :holiday, :tours, :events, :family_friendly, :cover_image, :image_one, :image_two, :image_three, :image_four, :user_id, :base64)\n end", "def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end", "def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end", "def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end", "def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end", "def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end", "def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end", "def url_whitelist; end", "def admin_social_network_params\n params.require(:social_network).permit!\n end", "def filter_params\n params.require(:filters).permit(:letters)\n end", "def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end", "def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end", "def sensitive_params=(params)\n @sensitive_params = params\n end", "def permit_request_params\n params.permit(:address)\n end", "def user_params\n # Ensure a user can't give themselves admin priveleges\n params.delete(:admin) if current_user.admin?\n params.require(:user).permit(:name, :email, :admin, :image)\n end", "def secure_params\n params.require(:location).permit(:name)\n end", "def strong_params\n params.require( :setting ).\n permit( :global_scan_limit, :per_user_scan_limit,\n :target_whitelist_patterns, :target_blacklist_patterns )\n end", "def question_params\n params.require(:survey_question).permit(question_whitelist)\n end", "def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end", "def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end", "def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end", "def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end", "def url_params\n params[:url].permit(:full)\n end", "def backend_user_params\n params.permit!\n end", "def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend", "def speed_measurement_params\n\n #fuckit, to lazy to deal with permit crap right now\n ActionController::Parameters.permit_all_parameters = true\n\n params[:speed_measurement]\n end", "def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end", "def get_params\r\n #params.require(:article).permit(:title, :permalink, :content, :source_site, :introtext, :type_id, :order_by, :searchable, :created_by, :edited_by, :published_by, :published_on, :user_id)\r\n params.require(:article).permit!\r\n\r\n end", "def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end", "def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end", "def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end", "def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end", "def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end" ]
[ "0.69792545", "0.6781151", "0.67419964", "0.674013", "0.6734356", "0.6591046", "0.6502396", "0.6496313", "0.6480641", "0.6477825", "0.64565", "0.6438387", "0.63791263", "0.63740575", "0.6364131", "0.63192815", "0.62991166", "0.62978333", "0.6292148", "0.6290449", "0.6290076", "0.62894756", "0.6283177", "0.6242471", "0.62382483", "0.6217549", "0.6214457", "0.6209053", "0.6193042", "0.6177802", "0.6174604", "0.61714715", "0.6161512", "0.6151757", "0.6150663", "0.61461", "0.61213595", "0.611406", "0.6106206", "0.6105114", "0.6089039", "0.6081015", "0.6071004", "0.60620916", "0.6019971", "0.601788", "0.6011056", "0.6010898", "0.6005122", "0.6005122", "0.6001556", "0.6001049", "0.59943926", "0.5992201", "0.59909594", "0.5990628", "0.5980841", "0.59669393", "0.59589154", "0.5958826", "0.5957911", "0.5957385", "0.5953072", "0.59526145", "0.5943361", "0.59386164", "0.59375334", "0.59375334", "0.5933856", "0.59292704", "0.59254247", "0.5924164", "0.59167904", "0.59088355", "0.5907542", "0.59064597", "0.5906243", "0.5898226", "0.589687", "0.5896091", "0.5894501", "0.5894289", "0.5891739", "0.58860534", "0.5882406", "0.587974", "0.58738774", "0.5869024", "0.58679986", "0.5867561", "0.5865932", "0.5864461", "0.58639693", "0.58617616", "0.5861436", "0.5860451", "0.58602303", "0.5854586", "0.58537364", "0.5850427", "0.5850199" ]
0.0
-1
vi: set ft=ruby :
def configure_node(node) node.vm.box = "debian/jessie64" node.vm.box_check_update = true node.vm.synced_folder "./data", "/data" node.vm.provider "virtualbox" do |v| v.gui = false v.memory = "2048" v.cpus = 2 v.customize ["modifyvm", :id, "--cpuexecutioncap", "100"] v.customize ["modifyvm", :id, "--hpet", "on"] v.default_nic_type = "82545EM" end node.vm.provision "shell", inline: <<-SHELL apt-get -y update apt-get -y install build-essential apt-get -y install cmake apt-get -y install emacs apt-get -y install ninja-build apt-get -y install git apt-get -y install htop apt-get -y install zsh apt-get -y upgrade SHELL end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def result_of_executing_the_commands\n @commands = \":set ft=ruby\r\" + @commands\n RobotVim::Runner.new.run(:input_file => @input, :commands => @commands)\nend", "def ruby\n unless @ruby\n @ruby = \"\"\n @body.each_line do |l|\n @commands << {:ruby => l}\n @ruby << l\n end\n end \n @ruby\n end", "def pygment_code_block(block)\n write_data block, 'code.rb', false\n system 'pygmentize -o block.html code.rb'\n File.open('block.html', 'r').read\n end", "def vi\n system \"vim ~/.scratchvim.rb\"\nend", "def vim_mappings\n { \n \"VI_SELECTED_TEXT\" => \"getreg()\",\n \"VI_FILENAME\" => \"@%\",\n \"VI_CURRENT_LINE\" => \"getline(\\\".\\\")\",\n \"VI_SOFT_TABS\" => \"&expandtab\"\n }\n end", "def format_code strip = true\n format_ruby self.code, strip\n end", "def convert_to_ruby (src)\n rb = \"\"\n # dunno how to deal with only leading declarations of ruby code,\n # so replace it with the other markings\n src.gsub!(/-%>/,\"%>\")\n while\tsrc.index(Embedded_ruby_line) != nil\n src.sub!(Embedded_ruby_line) { |match|\n match[match.index '%'] = \" \"\n \"<% \" + match + \" %>\"\n }\n end\n lines = src.split(Embedded_ruby_flag)\n\n is_ruby_line = false\n lines.each { |line|\n if (line.strip != \"\" and line.strip != nil)\n if is_ruby_line\n if line[0,1] == '='\n # line[0] = \" \"\n # rb += \"puts \" + line.strip\n rb+=\"gr_html_puts \"+line.strip\n else\n rb += line.strip\n end\n else\n rb += \"gr_html( \" + line.inspect + \" )\"\n end\n rb += \"\\n\"\n end\n is_ruby_line = (not is_ruby_line)\n }\n #puts rb\n return rb\n end", "def history_to_vi\n handling_jruby_bug do\n file = Tempfile.new(\"irb_tempfile\")\n get_lines(0..(Readline::HISTORY.size - 1)).each do |line|\n file << \"#{line}\\n\"\n end\n file.close\n system(\"vim #{file.path}\")\n end\nend", "def vietnamese_writing_instructions\n return '' unless CONF[:locale] == 'vi'\n <<-EOL\n<p>#{vietnamese_smart_questions}</p>\n<p>Nến tránh viết tắt. <b>Dấu câu nên viết vào sát chữ trước nó, dấu câu và chữ sau nó nên cách một khoảng trắng.</b></p>\n<ul>\n <li>\"Tôi là Hòa . Tôi là sinh viên.Bạn tên gì ?\" --> \"Tôi là Hòa. Tôi là sinh viên. Bạn tên gì?\"</li>\n <li>\"2 lựa chọn : bút , thước\" --> \"2 lựa chọn: bút, thước\"</li>\n</ul>\nEOL\n end", "def textile_ruby( tag, atts, cite, content )\n %(<pre><code class=\"ruby\">#{content}</pre></code>)\n end", "def rubyize!\n\n self.definition = Ruote::Reader.to_ruby(tree).strip\n end", "def set_up\n vim.command 'set number'\n vim.command 'hi Visual guifg=#FFFF00 guibg=#003322 gui=none'\n vim.edit filename\n vim.feedkeys '\\\\<esc>'\n sleep 2 if WITH_PAUSES\nend", "def highlight(code, lang, options = T.unsafe(nil), format = T.unsafe(nil)); end", "def vix\n Object.class_eval `cat ~/.scratchvim.rb`\nend", "def indent()\n file = Tempfile.new(\"out\")\n infile = Tempfile.new(\"in\")\n file.write(self.to_s)\n file.flush\n bufc = \"FOO\"\n\n tmppos = @pos\n\n message(\"Auto format #{@fname}\")\n\n if [\"chdr\", \"c\", \"cpp\"].include?(get_file_type())\n\n #C/C++/Java/JavaScript/Objective-C/Protobuf code\n system(\"clang-format -style='{BasedOnStyle: LLVM, ColumnLimit: 100, SortIncludes: false}' #{file.path} > #{infile.path}\")\n bufc = IO.read(infile.path)\n elsif get_file_type() == \"Javascript\"\n cmd = \"clang-format #{file.path} > #{infile.path}'\"\n debug cmd\n system(cmd)\n bufc = IO.read(infile.path)\n elsif get_file_type() == \"ruby\"\n cmd = \"rufo #{file.path}\"\n debug cmd\n system(cmd)\n bufc = IO.read(file.path)\n else\n return\n end\n self.update_content(bufc)\n center_on_current_line #TODO: needed?\n file.close; file.unlink\n infile.close; infile.unlink\n end", "def to_s # {{{\n c = wrap( self.content.to_s.chomp )\n t = wrap( self.title.to_s.chomp )\n\n<<EOS\n|^\\___________________ [ #{self.source.to_s } ] _________________________________/^|\n\n\\t'#{t}'\n\n\\t#{c}\n\n|/^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\\|\n\nEOS\n end", "def imitate_code(txt)\n \"%#{txt};;\"\n end", "def beautify; end", "def beautify; end", "def lines_of_code; end", "def lines_of_code; end", "def to_s_with_ruby(opt=nil)\n (opt != :ruby) ? to_s_without_ruby : begin\n @to_s ||= begin\n res = to_ruby\n res.gsub!(/\\Aproc \\{ /, \"def #{name}\") # Replace proc definition\n res.gsub!(/\\|([^\\|]*)\\|\\n/, \"(#{'\\1'})\\n\") # Use method param declaration\n res.gsub!(/\\}\\z/, 'end') # Replace proc end brace\n res\n end\n end\n end", "def highlight(code, options = T.unsafe(nil)); end", "def highlight(code, lang, options = T.unsafe(nil)); end", "def source_line=(_); end", "def highlight_code(text, lang, type, opts = T.unsafe(nil)); end", "def compile_to_ruby\n \"\"\n end", "def restore_cursor; puts \"\\e[u\" end", "def highlight_codes\n #@content.gsub!(/%(.*?){(.*?)}%/m) do # %{ some code }%\n @content.gsub!(/^```(.*?)\\n(.*?)\\n```/m) do # github like: http://github.github.com/github-flavored-markdown/\n lang = :text\n lang = $1 if $1 != \"\"\n Albino.colorize($2, lang)\n end\n end", "def change_quotemarks!\n local_copy.in_place :perl, \"s/\\\"/'/g\"\n end", "def my_name_is\n # and my code is here\n # two spaces for tabs in Ruby\nend", "def rubyify(sentence)\r\n\r\nend", "def source_line; end", "def parse_lang_for_codeblock(source); end", "def block_code(text, lang=\"\")\n lang ||= lang.to_s\n result = \"```#{lang}\\n\"\n if lang.match RUBY_LANG\n result << ColorCode::Ruby.new(text).colorize\n else\n result << ColorCode::Unknown.new(text).colorize\n end\n result << \"```\\n\"\n result\n end", "def formatted_source_file(source_file); end", "def ruby_code(obj); end", "def highlight_file(filename, options = T.unsafe(nil), format = T.unsafe(nil)); end", "def autofinish; end", "def rl_vi_editing_mode(count, key)\r\n 0\r\n end", "def vputs(text)\n puts text if $verbose\nend", "def code_start(language, caption)\n\n if language == 'console'\n column_style = 'columns=fixed,'\n else\n column_style = ''\n end\n\n if caption.nil?\n caption_command = ''\n else\n caption_command = \"title={#{caption}},aboveskip=-0.4 \\\\baselineskip,\"\n end\n\n @io << @templates[:code_start].result(binding)\n end", "def indentation; end", "def indentation; end", "def bf_to_your_syntax(file)\n dsl = read_dsl\n code = read_code(file)\n config = dsl.orenono\n convert(code, config.default_syntaxes, config.syntaxes)\n end", "def edit\n puts \"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"\n end", "def visit_script(node, &block)\n raw_first_line = @original_haml_lines[node.line - 1]\n\n # ==, !, !==, &, &== means interpolation (was needed before HAML 2.2... it's still supported)\n # =, !=, &= mean actual ruby code is coming\n # Anything else is interpolation\n # The regex lists the case for Ruby Code. The 3 cases and making sure they are not followed by another = sign\n\n match = raw_first_line.match(/\\A\\s*(=|!=|&=)(?!=)/)\n unless match\n # The line doesn't start with a - or a =, this is actually a \"plain\"\n # that contains interpolation.\n indent = raw_first_line.index(/\\S/)\n @ruby_chunks << PlaceholderMarkerChunk.new(node, 'interpolation', indent: indent)\n lines = extract_piped_plain_multilines(node.line - 1)\n add_interpolation_chunks(node, lines.join(\"\\n\"), node.line - 1, indent: indent)\n return\n end\n\n script_prefix = match[1]\n _first_line_offset, lines = extract_raw_ruby_lines(node.script, node.line - 1)\n # We want the actual indentation and prefix for the first line\n first_line = lines[0] = @original_haml_lines[node.line - 1].rstrip\n process_multiline!(first_line)\n\n lines[0] = lines[0].sub(/(#{script_prefix}[ \\t]?)/, '')\n line_indentation = Regexp.last_match(1).size\n\n raw_code = lines.join(\"\\n\")\n\n if lines[0][/\\S/] == '#'\n # a \"=\" script that only contains a comment... No need for the \"HL.out = \" prefix,\n # just treat it as comment which will turn into a \"-\" comment\n else\n lines[0] = HamlLint::Utils.insert_after_indentation(lines[0], script_output_prefix)\n end\n\n indent_delta = script_output_prefix.size - line_indentation\n HamlLint::Utils.map_after_first!(lines) do |line|\n HamlLint::Utils.indent(line, indent_delta)\n end\n\n prev_chunk = @ruby_chunks.last\n if prev_chunk.is_a?(ScriptChunk) &&\n prev_chunk.node.type == :script &&\n prev_chunk.node == node.parent\n # When an outputting script is nested under another outputting script,\n # we want to block them from being merged together by rubocop, because\n # this doesn't make sense in HAML.\n # Example:\n # = if this_is_short\n # = this_is_short_too\n # Could become (after RuboCop):\n # HL.out = (HL.out = this_is_short_too if this_is_short)\n # Or in (broken) HAML style:\n # = this_is_short_too = if this_is_short\n # By forcing this to start a chunk, there will be extra placeholders which\n # blocks rubocop from merging the lines.\n must_start_chunk = true\n elsif script_prefix != '='\n # In the few cases where &= and != are used to start the script,\n # We need to remember and put it back in the final HAML. Fusing scripts together\n # would make that basically impossible. Instead, a script has a \"first_output_prefix\"\n # field for this specific case\n must_start_chunk = true\n end\n\n finish_visit_any_script(node, lines, raw_code: raw_code, must_start_chunk: must_start_chunk,\n first_output_prefix: script_prefix, &block)\n end", "def codify(txt)\n enclose('code', txt)\n end", "def vprint(text)\n print text if $verbose\nend", "def lex_en_line_begin; end", "def lex_en_line_begin; end", "def lex_en_line_begin; end", "def write(io)\r\n if type == :code\r\n print text\r\n elsif type == :verbatim\r\n output = \" \"*pre_indent + $prefix + \" \"*first_post_indent + text + \"\\n\"\r\n output.entabify! if $retabify\r\n print output\r\n elsif type == :comment\r\n cur_post_indent = first_post_indent\r\n # special case of a line that is just $prefix\r\n if text.length == 0\r\n print \" \"*pre_indent + $prefix + \" \"*cur_post_indent + \"\\n\"\r\n end\r\n while text.length > 0\r\n width = $cols - pre_indent - $prefix.length - cur_post_indent\r\n if first_word.length > width\r\n STDERR.print \"Warning: #{first_word} is too long to fit in column.\"\r\n output = \" \"*pre_indent + $prefix + \" \"*cur_post_indent + \r\n first_word + \"\\n\"\r\n output.entabify! if $retabify\r\n print output\r\n trim(first_word.length)\r\n @text.lstrip!\r\n else\r\n out = words_to(width)\r\n output = \" \"*pre_indent + $prefix + \" \"*cur_post_indent + out + \"\\n\"\r\n output.entabify! if $retabify\r\n print output\r\n trim(out.length)\r\n @text.lstrip!\r\n end\r\n cur_post_indent = post_indent\r\n end\r\n else\r\n STDERR.print \"Confused, never determined block type.\"\r\n end\r\n end", "def tt; end", "def commands_for_vm\n [{:write_file => {:filename => @filename, :content => @code}},\n {:execute => {:command => \"#{VM_PYTHON} -c \\\"compile(open('#{@filename}').read(), '', 'exec')\\\" && echo success\",\n :stdout => 'syntaxchecksuccess',\n :stderr => 'syntaxcheckfail'}}]\n # in this case execution only triggers the initial syntax check, the rest is handled\n # in postprocess_print\n end", "def poem &block\n annotate block do |c|\n c.split(\"\\n\").join(\" \\n\")\n end\nend", "def file_mode(m)\n Cucumber::RUBY_1_9 ? \"#{m}:#{keyword_hash['encoding']}\" : m\n end", "def generate_ruby sexp\n ruby = Ruby2Ruby.new.process(sexp)\n ruby.sub!(/\\A(def \\S+)\\(([^\\)]*)\\)/, '\\1 |\\2|') # move args\n ruby.sub!(/\\Adef[^\\n\\|]+/, 'proc { ') # strip def name\n ruby.sub!(/end\\Z/, '}') # strip end\n ruby.gsub!(/\\s+$/, '') # trailing WS bugs me\n ruby\n end", "def line=(_); end", "def line=(_); end", "def current_snippets\n self[Vim.evaluate('&filetype')]\n end", "def to_ruby\n res = []\n res.push global_code unless global_code.empty?\n res.push \"control #{id.inspect} do\"\n res.push \" title #{title.inspect}\" unless title.to_s.empty?\n res.push \" desc #{descriptions[:default].inspect}\" unless descriptions[:default].to_s.empty?\n res.push \" impact #{impact}\" unless impact.nil?\n tags.each do |t|\n res.push(\" #{t.to_ruby}\")\n end\n res.push control_code unless control_code.empty?\n res.push 'end'\n res.join(\"\\n\")\n end", "def section_seperator\n puts <<EOF\n\n\n\n=========================\n=========================\nEOF\nend", "def transcode_script_header\n <<~HEREDOC\n #!/bin/sh\n\n # Check this file, make any changes, and save it. Execute it directly,\n # or execute it with the sh command if it's not executable.\n\n set -e\n\n HEREDOC\n end", "def putsv(string)\n puts string if $VERBOSE\nend", "def preamble\n \"// BEGIN METARUBY PREAMBLE\n#include <ruby.h>\n#define RB_COMPARE(x, y) (x) == (y) ? 0 : (x) < (y) ? -1 : 1\ntypedef char * str;\n#define case_equal_long(x, y) ((x) == (y))\n// END METARUBY PREAMBLE\n\" + self.prototypes.join('')\n end", "def source_lines; end", "def source_lines; end", "def source_lines; end", "def source_lines; end", "def language()\r\n\t\treturn \"java\" if (@file =~ /java\\Z/ )\r\n\t\treturn \"cpp\" if ( (@file =~ /cpp\\Z/) || (@file =~ /cc\\Z/) || (@file =~ /h\\Z/) || (@file =~ /hpp\\Z/) )\r\n\tend", "def newline; end", "def formatPreprocessor(theLines)\n\n\talignEndifs(\t\ttheLines);\n\talignUndefineDefine(theLines);\n\talignDefineValue(\ttheLines);\n\talignContinuations(\ttheLines);\n\n\treturn theLines;\n\nend", "def code_format_print(code)\n indent = 0\n l = 1\n code.each_line do |ln|\n ln = ln.strip\n if(ln.match(/^end/))\n indent -= 4\n end\n indent = 0 if indent < 0\n ll = \" \"\n if(l<10)\n ll = \"00#{l} \"\n elsif(l<100)\n ll = \"0#{l} \"\n else\n ll = \"#{l} \"\n end\n l += 1\n\n puts ll + \" \"*indent + ln\n\n if(ln.match(/^class/))\n indent += 4\n elsif(ln.match(/^def/))\n indent += 4\n elsif(ln.match(/do$/))\n indent += 4\n end\n\n if(ln.match(/end$/) && !ln.match(/^end/))\n indent -= 4\n end\n end\nend", "def get_filecode()\n \"__EMIT_#{ARGV[0].gsub(/[^\\w]/, \"_\").upcase}__\"\nend", "def format=(procedure); end", "def bleu\n \"\\033[0;96m#{self}\\033[0m\"\n # 96=bleu clair, 93 = jaune, 94/95=mauve, 92=vert\n end", "def tab\n write(9)\n end", "def defs(file, line, col); end", "def defs(file, line, col); end", "def save_as_ruby(file)\n if File.exist?(file)\n text = File.read(file)\n save_as_ruby_sub!(text, :version, 'VERSION')\n save_as_ruby_sub!(text, :released, 'RELEASED', 'DATE')\n save_as_ruby_sub!(text, :codename, 'CODENAME')\n else\n t = []\n t << %[module #{codename}]\n t << %[ VERSION = \"#{version}\"]\n t << %[ RELEASE = \"#{release}\"]\n t << %[ CODENAME = \"#{codename}\"]\n t << %[end]\n text = t.join(\"\\n\")\n end\n File.open(file, 'w'){ |f| f << text }\n end", "def inline_code; end", "def with_repl_like_sigint; end", "def make_vm_line(vm)\n \"${color2} #{vm}\\n\"\nend", "def backtick_codeblock(input)\n input.gsub /<p>`{3}\\s(\\w+)<\\/p>\\n\\n<pre><code>([^<]+)<\\/code><\\/pre>\\n\\n<p>`{3}<\\/p>/m do\n lang = $1\n str = $2.gsub('&lt;','<').gsub('&gt;','>')\n highlight(str, lang)\n end\n end", "def init_tags\n add_tag :BOLD, \"\\e[1m\", \"\\e[m\"\n add_tag :TT, \"\\e[7m\", \"\\e[m\"\n add_tag :EM, \"\\e[4m\", \"\\e[m\"\n end", "def yyerrok; end", "def yyerrok; end", "def convert_it_to_methods(file)\n @command.gsub_file(file, /(?<=\\bit ').*?(?=' do\\b)/) do |match|\n match.gsub(/\\W+/, '_').downcase\n end\n\n @command.gsub_file(file, /it '_?(.*)' do/, 'def test_\\1')\n end", "def compile_to_ruby\n statements.collect { |s| s.compile_to_ruby }.join(\"\\n\")\n end", "def exe(s)\n VIM.command s\nend", "def heredoc_indent_type(node)\n node.source[/^<<([~-])/, 1]\n end", "def erb(t)\n ERB.new( File.open(t).read, 0, '<>' ).result\nend", "def reduce_vtab(_production, _range, _tokens, _children)\n Regex::Character.new('\\v')\n end", "def initialize\n @emit_file_line_as_literals = true\n end", "def alignEndifs(theLines)\n\n\t# Collapse whitespace after #endif\n\t#\n\t# clang-format inserts IndentWidth spaces between a #endif\n\t# and its comment.\n\ttheLines.each do |theLine|\n\n\t\tif (theLine[:text] =~ /^(#endif\\s)\\s+/ && !theLine[:comment].empty?)\n\t\t\ttheLine[:text] = $1;\n\t\tend\n\n\tend\n\nend", "def interp\n rboutput = `ruby #{RB_FILE} #{RBTEX_OUT}`\n if rboutput == ''\n puts 'Your ruby file had no puts statments'.green\n end\n return 0\nend", "def convert_man_to_ansi file\n lines = file.split \"\\n\"\n l = nil\n lines.each_with_index do |line, ix|\n # convert underlined words to yellow or one color, these are usually params\n line.gsub!(/((_\b[^ ])+)/,'\u001b[4;33m\\1\u001b[0m')\n line.gsub!(/_\b/,'')\n # convert bold words to red or one color, these are usually headers and other words\n l= line.gsub(/(([^ ]\b[^ ])+)/,'\u001b[1;31m\\1\u001b[0m').gsub(/[^ ]\b/,'').gsub(/\b/,'')\n lines[ix] = l\n end\n lines\nend", "def lex_en_line_comment=(_arg0); end", "def lex_en_line_comment=(_arg0); end", "def lex_en_line_comment=(_arg0); end" ]
[ "0.5803009", "0.5457295", "0.544725", "0.5440447", "0.540047", "0.5387971", "0.53144646", "0.520739", "0.5160547", "0.5159978", "0.5159782", "0.5146485", "0.5083554", "0.50814515", "0.5080929", "0.5077087", "0.50639117", "0.50580174", "0.50580174", "0.50380445", "0.50380445", "0.4984468", "0.49724886", "0.4951048", "0.49466014", "0.4903131", "0.4898179", "0.48876643", "0.4886485", "0.48716843", "0.48706934", "0.4865756", "0.4842234", "0.48380756", "0.4824881", "0.48216367", "0.48167115", "0.47925276", "0.47732988", "0.47712642", "0.47588575", "0.47543994", "0.47535437", "0.47535437", "0.4751234", "0.47456008", "0.47312555", "0.47086927", "0.4707612", "0.46990514", "0.46990514", "0.46990514", "0.46928203", "0.46719205", "0.46706375", "0.46674216", "0.4666785", "0.4662625", "0.46609747", "0.46609747", "0.46445593", "0.4638591", "0.461708", "0.46070293", "0.46057227", "0.46017936", "0.4601192", "0.4601192", "0.4601192", "0.4601192", "0.45918658", "0.45862618", "0.45857868", "0.45839486", "0.45824283", "0.4574123", "0.4570657", "0.45680726", "0.45640016", "0.45640016", "0.4561444", "0.45584625", "0.45550445", "0.45549548", "0.45528772", "0.45481703", "0.4543232", "0.4543232", "0.45427603", "0.4541317", "0.45403168", "0.4529151", "0.4521391", "0.45182538", "0.4513595", "0.45101717", "0.45076784", "0.45076165", "0.45008513", "0.45008513", "0.45008513" ]
0.0
-1
Creates an instance of a Neuron
def initialize @id = self.class.uid @connections = Connections.new({}, {}, {}) @error = Error.new(0.0, 0.0, 0.0) @trace = Trace.new({}, {}, {}) @state = @old = @activation = 0.0 @selfconnection = Synaptical::Connection.new(self, self, 0.0) @squash = Synaptical::Squash::Logistic @neighbors = {} @bias = rand * 0.2 - 0.1 end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def prepare_network\n @neural_net = RubyFann::Standard.new(num_inputs: @nuerons_number,\n hidden_neurons: [(2 * @nuerons_number) / 3],\n num_outputs: @nuerons_number)\n end", "def initialize(neural_inputs: nil,\n neural_outputs: nil,\n neural_hidden: nil,\n parameters: NeatSettings.new,\n &block)\n super(self)\n @gaussian = Distribution::Normal.rng\n @population_history = []\n @evolver = Evolver.new self\n @expressor = Expressor.new self\n\n @neuron_catalog = Neuron::neuron_types.clone\n @neural_inputs = neural_inputs\n @neural_outputs = neural_outputs\n @neural_hidden = neural_hidden\n\n # Default classes for population and operators, etc.\n @population_class = NEAT::Population\n @evaluator_class = NEAT::Evaluator\n @expressor_class = NEAT::Expressor\n @evolver_class = NEAT::Evolver\n\n # Handle the parameters parameter. :-)\n @parms = unless parameters.kind_of? String\n parameters\n else # load it from a file\n open(parameters, 'r') { |fd| YAML::load fd.read }\n end\n block.(self) unless block.nil?\n end", "def add_neuron(n)\n neurons << n\n end", "def create\n neuron = Neuron.create! params\n render :json => neuron\n # @neuron = Neuron.new(params[:neuron])\n # \n # respond_to do |format|\n # if @neuron.save\n # format.html { redirect_to @neuron, notice: 'Neuron was successfully created.' }\n # format.json { render json: @neuron, status: :created, location: @neuron }\n # else\n # format.html { render action: \"new\" }\n # format.json { render json: @neuron.errors, status: :unprocessable_entity }\n # end\n # end\n end", "def add_neuron(neuron)\r\n\t\t@neurons.push(neuron)\r\n\tend", "def initialize(x, y)\n\t\t@neurons = Array.new\n\t\tx.times do\n\t\t\tneuron = Array.new(y)\n\t\t\t\n\t\t\t#create random weights\n\t\t\tneuron.each_index do |weight|\n\t\t\t\tneuron[weight] = rand * 2.0 - 1.0\n\t\t\tend\n\t\t\t@neurons << neuron\n\t\tend\n\tend", "def init_without_node\n @internal_node = Neo4j.instance.create_node\n self.classname = self.class.to_s\n Neo4j.instance.ref_node.connect(self) \n\n self.class.fire_event NodeCreatedEvent.new(self) \n $NEO_LOGGER.debug {\"created new node '#{self.class.to_s}' node id: #{@internal_node.getId()}\"} \n end", "def initialize(numInputs, numHidden, numNeuronsPerHiddenLayer, numOutputs, weightRange)\n\t\t@input_layer = Array.new\n\t\t@hidden_layers = Array.new\n\t\t@output_layer = Array.new\n\t\t@hidden_layer_neuron_count = numNeuronsPerHiddenLayer\n\n\t\tfor i in 0...numInputs do \n\t\t\t@input_layer << Node.new\n\t\t\t@input_layer[i].add_incoming_connection(Connection.new(0))\n\t\tend\n\n\t\t@hidden_layers << Array.new\n\n\t\toldlayer = hidden_layers[0]\n\n\t\tfor i in 0...numNeuronsPerHiddenLayer do\n\t\t\tn = Node.new\n\t\t\t@input_layer.each do |p|\n\t\t\t\tc = Connection.new(weightRange)\n\t\t\t\tc.previous = p\n\t\t\t\tc.next = n\n\t\t\t\tp.add_outgoing_connection(c)\n\t\t\t\tn.add_incoming_connection(c)\n\t\t\tend\n\t\t\toldlayer << n\n\t\tend\n\n\t\toldlayer = hidden_layers[0]\n\n\t\tfor i in 1...numHidden do \n\t\t\tl = Array.new\n\t\t\tfor j in 0...numNeuronsPerHiddenLayer do \n\t\t\t\tn = Node.new\n\t\t\t\t\n\t\t\t\toldlayer.each do |o|\n\t\t\t\t\tc = Connection.new(weightRange)\n\t\t\t\t\tc.previous = o\n\t\t\t\t\tc.next = n\n\t\t\t\t\to.add_outgoing_connection(c)\n\t\t\t\t\tn.add_incoming_connection(c)\n\t\t\t\tend\n\n\t\t\t\tl << n\n\t\t\tend\n\t\t\t@hidden_layers << l\n\t\t\toldlayer = l\n\t\tend\n\n\t\tfor i in 0...numOutputs do \n\t\t\tn = Node.new\n\t\t\toldlayer.each do |o|\n\t\t\t\t\tc = Connection.new(weightRange)\n\t\t\t\t\tc.previous = o\n\t\t\t\t\tc.next = n\n\t\t\t\t\to.add_outgoing_connection(c)\n\t\t\t\t\tn.add_incoming_connection(c)\n\t\t\t\tend\n\t\t\t@output_layer << n\n\t\tend\n\tend", "def initialize(network_structure)\n @structure = network_structure\n @initial_weight_function = lambda { |n, i, j| ((rand 2000)/1000.0) - 1}\n @propagation_function = lambda { |x| 1/(1+Math.exp(-1*(x))) } # lambda { |x| Math.tanh(x) } #\n @derivative_propagation_function = lambda { |y| y*(1-y) } # lambda { |y| 1.0 - y**2 } #\n @disable_bias = false\n @learning_rate = 0.25\n @momentum = 0.1\n end", "def initialize(config)\n require File.join(File.dirname(__FILE__), \"neural_net\")\n ActiveRecord::Base.establish_connection(config)\n Persistence.setup_database(ActiveRecord::Base.connection)\n @nn = Searching::SearchNet.new(config)\n @weights = [\n [1.0, :location_score ],\n [1.0, :frequency_score],\n [1.0, :page_rank_score],\n [1.0, :link_text_score]\n ]\n end", "def new\n @noticium = Noticium.new\n end", "def create_person\n Neography::Node.create(\"object_id\" => self.id, \"object_type\" => self.class.to_s)\n end", "def build_network()\r\n @layers = []\r\n # Create the hidden layers, num_per_hiddenX(num_inputs+1) matrices.\r\n # The +1 accounts for a bias vector that is horizontally concatenated\r\n # upon creation of the layer.\r\n @num_hidden_layers.times do\r\n # Add a new layer (bias vector is concatenated in the creation\r\n # method).\r\n @layers << build_layer(@max_weight, @num_per_hidden, @num_inputs)\r\n end\r\n # Create output layer, an num_outputsX(num_per_hidden+1) matrix\r\n # (again, +1 accounts for the bias).\r\n @layers << build_layer(@max_weight, @num_outputs, @num_per_hidden)\r\n # Calculate weights\r\n weights # produces attribute @weights upon first invocation\r\n @num_weights = @weights.size\r\n end", "def new\n @neuron = Neuron.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @neuron }\n end\n end", "def node(*args)\n Node.new(self, *args)\n end", "def node(*args)\n Node.new(self, *args)\n end", "def create\n @hidden_neuron_layer = HiddenNeuronLayer.new(params[:hidden_neuron_layer])\n\n respond_to do |format|\n if @hidden_neuron_layer.save\n format.html { redirect_to @hidden_neuron_layer, notice: 'Hidden neuron layer was successfully created.' }\n format.json { render json: @hidden_neuron_layer, status: :created, location: @hidden_neuron_layer }\n else\n format.html { render action: \"new\" }\n format.json { render json: @hidden_neuron_layer.errors, status: :unprocessable_entity }\n end\n end\n end", "def new_node(element)\n Node.new(element)\n end", "def new\n @fornecedor = Fornecedor.new\n \n end", "def newInstance( params={} )\n model.new( params ).extend( InstanceMethods )\n end", "def initialize(inputNodes, hiddenNodes, outputNodes, learningRate=0.3, momentum=0.2)\n # Make sure we add the bias node to the input\n @inputNodes = inputNodes + 1\n @hiddenNodes = hiddenNodes\n @outputNodes = outputNodes\n\n @learningRate = learningRate\n @momentum = momentum\n\n @w_1 = NeuralNetwork::create_matrix(@inputNodes, @hiddenNodes, 0.0)\n @w_2 = NeuralNetwork::create_matrix(@hiddenNodes, @outputNodes, 0.0)\n \n # Randomize the values of Nthe nodes [-0.5, 0.5]\n @w_1.map! { |arr| arr.map { |v| rand(-0.5..0.5) } }\n @w_2.map! { |arr| arr.map { |v| rand(-0.5..0.5) } }\n\n # It helps to store the current state of node activations\n @activation_input = [1.0] * @inputNodes\n @activation_hidden = [1.0] * @hiddenNodes\n @activation_output = [1.0] * @outputNodes\n\n @din = NeuralNetwork::create_matrix(@inputNodes, @hiddenNodes, 0.0)\n @dout = NeuralNetwork::create_matrix(@hiddenNodes, @outputNodes, 0.0)\n\n puts \"\\n================================================================================================\\n[+]Weights from input to hidden nodes [#{@inputNodes}x#{@hiddenNodes}] has been initialized with small random values\"\n puts \"[+]Weights from hidden to output nodes [#{@hiddenNodes}x#{@outputNodes}] has been nitialized to small random values\\n================================================================================================\\n\"\n\n puts \"Neural network initialized with values \\n \\t Input Nodes:[{#{@inputNodes}]\\t Hidden Nodes: [#{@hiddenNodes}]\\t Output Nodes: [#{@outputNodes}]} \\n--------------------------------------------------------------------------------\\n\"\n puts \"\"\n\n end", "def create_node(class_name, parent)\n Tree.const_get(class_name.to_s + 'Node')\n .new(parent)\n end", "def new\n @prediction = Prediction.new\n end", "def create\n Souffle::Log.info \"#{@node.log_prefix} Creating a new node...\"\n provider.create_node(@node)\n end", "def from_json(json)\n layers = { hidden: [] }\n\n attributes = %w[state old activation bias]\n neurons = json['neurons'].map do |config|\n Synaptical::Neuron.new.tap do |neuron|\n attributes.each { |a| neuron.send(\"#{a}=\", config[a]) }\n neuron.squash = const_get(config['squash'])\n layer_id = config['layer']\n layer = case layer_id\n when 'input', 'output'\n layers[layer_id.to_sym] ||= Synaptical::Layer.new(0)\n else\n layers[:hidden][layer_id] ||= Synaptical::Layer.new(0)\n end\n\n layer.add(neuron)\n end\n end\n\n json['connections'].each do |config|\n from, to = neurons.values_at(config['from'], config['to'])\n weight = config['weight']\n\n connection = from.project(to, weight)\n gater = neurons[config['gater']] if config['gater']\n gater&.gate(connection)\n end\n\n Synaptical::Network.new(layers)\n end", "def instantiate_node(node_type,*args)\n if node_type.respond_to? :new \n node_type.new(*args)\n else\n SyntaxNode.new(*args).extend(node_type)\n end\n end", "def clone\n\t\tnew_node = Node.new(@id, @type, @bias, @action)\n\tend", "def create params\n raise_start_server unless Server::node\n new params\n end", "def make_node(type, *args)\n elem = type.new self, *args\n @nodes << elem\n self.core_node ||= elem.id\n elem.expand\n elem\n end", "def new(*args)\n my = self.init\n my.connect(*args)\n end", "def build_node(*args)\n node_class.new(*args)\n end", "def create_network(network_hash)\n post(\"cloud-instances/#{guid}/networks\", network_hash.to_json)\n end", "def create_node(t)\n raise NotImplementedError\n end", "def post_network(request)\n # --- Create the new Instance ---\n network = VirtualNetworkOCCI.new(\n VirtualNetwork.build_xml,\n @client,\n request.body,\n @config[:template_location])\n\n # --- Generate the template and Allocate the new Instance ---\n template = network.to_one_template\n return template, 500 if OpenNebula.is_error?(template)\n\n rc = network.allocate(template, @config[:cluster_id]||ClusterPool::NONE_CLUSTER_ID)\n if OpenNebula.is_error?(rc)\n return rc, CloudServer::HTTP_ERROR_CODE[rc.errno]\n end\n\n # --- Prepare XML Response ---\n network.info\n return to_occi_xml(network, :code=>201)\n end", "def create_node(value)\n node = Node.new(value)\n end", "def create\n \t@title = \"Create Networks\"\n @network = Network.new(params[:network])\n respond_to do |format|\n if @network.save\n flash[:notice] = 'Network was successfully created.'\n format.html { redirect_to(@network) }\n format.xml { render :xml => @network, :status => :created, :location => @network }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @network.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @nano = Nano.new(params[:nano])\n\n respond_to do |format|\n if @nano.save\n flash[:notice] = 'Nano was successfully created.'\n format.html { redirect_to nano_url(@nano) }\n format.xml { head :created, :location => nano_url(@nano) }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @nano.errors.to_xml }\n end\n end\n end", "def initialize(controller = nil, name = nil)\n @name = unless name.nil?\n name.to_sym\n else\n NEAT::random_name_generator\n end\n unless controller.nil?\n @controller = controller\n else\n raise NeatException.new \"Controller Needed!\" unless self.is_a?(Controller) or self.is_a?(Controller::NeatSettings)\n @controller = self unless self.is_a? Controller::NeatSettings\n end\n end", "def create_node(value)\n Node.new(value)\n end", "def new\n @gossip = Gossip.new\n end", "def AddNode(type, xpos, ypos, numRadios = 0)\n\tname = NodeName(xpos, ypos)\n\tnode = Orbit::Topology::Node.new(@lastId, name, type)\n\tnode.SetPos(xpos,ypos)\n\t@lastId=@lastId+1\n\t#let OMF know we have created this node\n\tDefineGroup(node)\n\t@nodes_by_name[name]=node\n\treturn node\n end", "def create_node(l)\n node = Node.create(net_id: id, layer: l)\n # Unless L is first layer, generate upward connections\n unless l <= 0\n # For each parent node...\n loop_over_nodes(l - 1) do |i|\n parent = layer_n_nodes(l - 1)[i]\n # Generate a random connection weight between -1 and 1\n weight = rand * 2 - 1\n Connection.create(parent_id: parent.id,\n child_id: node.id,\n weight: weight.round(3))\n end\n end\n # Unless L is last layer, generate downward connections\n unless l >= num_layers - 1\n # For each child node...\n loop_over_nodes(l + 1) do |i|\n child = layer_n_nodes(l + 1)[i]\n # Generate a random connection weight between -1 and 1\n weight = rand * 2 - 1\n Connection.create(parent_id: node.id,\n child_id: child.id,\n weight: weight.round(3))\n end\n end\n end", "def initialize(params={})\n puts \"=== initialize ===\"\n @prefix = params[:prefix]\n @type = params[:type]\n\n @br_ope = BridgeOperator.create(@type)\n\n if params[:subnet].nil?\n @dhcpip = params[:dhcpip]\n @swip = params[:swip]\n @name = params[:name]\n @range = params[:range]\n else\n subnet = IPAddr.new(\"#{params[:subnet]}/#{@prefix}\")\n swip_ipaddr = subnet.to_host_range.last.proceed\n @dhcpip = subnet.to_host_range.last\n @swip = swip_ipaddr.to_s\n @name = params[:subnet].gsub(/\\./, \"_\")\n @range = \"#{subnet.to_host_range.first},#{swip_ipaddr.proceed}\"\n end\n end", "def new\n puts \"xxxxxxx NodesC a:new xxxxxxx\"\n # @node = Node.new # orig \n \n @node = Node.new\n #@node.build ==> this does not work as there is m\n #@node.node_attrbs.build\n #byebug\n end", "def initialize(priority, weight, port, target)\n @priority = priority.to_int\n @weight = weight.to_int\n @port = port.to_int\n @target = Name.create(target)\n end", "def new()\n trace(\"Instance #{index} created\")\n index += 1\n end", "def initialize network:\n super network[:type], network[:struct], act_fn: network[:act_fn]\n end", "def aws_internet_gateway_create(opts)\n opts[:vpc].internet_gateway = AWS::EC2.new.internet_gateways.create\n end", "def my_node(allow_caching = true)\n graph = SourceClass.class_graph(allow_caching)\n graph.get_node(@uri_s) || OntologyGraph::ClassNode.new(@uri_s)\n end", "def new\n @bond = Bond.new\n end", "def initialize width, height, cycle_detection = true, seed_network = nil\n \n @randomizer = proc {rand(2)}\n \n @cycle_detection_enabled = cycle_detection\n \n @width = width\n @height = height\n\n if seed_network\n self.network = seed_network\n else\n generate_network\n end\n \n reset_history\n \n end", "def factory(element_xml)\n OpenNebula::VirtualMachine.new(element_xml,@client)\n end", "def factory(element_xml)\n OpenNebula::VirtualMachine.new(element_xml,@client)\n end", "def create_node(props=nil, clazz = Neo4j::Node)\n props = {} if clazz != Neo4j::Node && props.nil?\n props['_classname'] = clazz.to_s if clazz != Neo4j::Node\n\n node = @batch_inserter.create_node(props)\n props && _index(node, props, clazz)\n @rule_inserter.node_added(node, props)\n node\n end", "def n(type, children = [])\n Parser::AST::Node.new(type, children)\n end", "def n(type, children = [])\n Parser::AST::Node.new(type, children)\n end", "def new\n # @gossip = Gossip.new\n\n end", "def index\n @neurons = Neuron.all\n end", "def create(name)\n object = new(name)\n @instances.push(object)\n object\n end", "def initialize(type, id = nil)\n client = OpenNebula::Client.new\n\n @type = type\n\n case type\n when 'Cluster'\n if !id\n xml = OpenNebula::Cluster.build_xml\n\n @one = OpenNebula::Cluster.new(xml, client)\n else\n @one = OpenNebula::Cluster.new_with_id(id, client)\n @one.info\n end\n\n @pool = OpenNebula::ClusterPool.new(client)\n when 'Datastore'\n xml = OpenNebula::Datastore.build_xml\n\n @one = OpenNebula::Datastore.new(xml, client)\n @pool = OpenNebula::DatastorePool.new(client)\n when 'Host'\n if !id\n xml = OpenNebula::Host.build_xml\n\n @one = OpenNebula::Host.new(xml, client)\n else\n @one = OpenNebula::Host.new_with_id(id, client)\n @one.info\n end\n\n @pool = OpenNebula::HostPool.new(client)\n when 'Vnet'\n xml = OpenNebula::VirtualNetwork.build_xml\n\n @one = OpenNebula::VirtualNetwork.new(xml, client)\n @pool = OpenNebula::VirtualNetworkPool.new(client)\n end\n end", "def create\n @network = Network.new(network_params)\n\n respond_to do |format|\n if @network.save\n format.html { redirect_to @network, notice: 'Network was successfully created.' }\n format.json { render :show, status: :created, location: @network }\n else\n format.html { render :new }\n format.json { render json: @network.errors, status: :unprocessable_entity }\n end\n end\n end", "def initialize(source_instance,transition) \n @number=0 \n @nodecost=0\n @passby=false\n @instance=source_instance\n @transition=transition\n @neighbours=[]\n \n @name = \"NODE \" +source_instance + \" - \" + transition.to_s \n \n end", "def natrule_create(network_id, name, source_ip)\n org_endpoint \"/network/#{network_id}/natrule\"\n xml_params(name: name, source_ip: source_ip)\n post\n end", "def new\n @element = @@model.new()\n end", "def new\n\t @rank = Rank.new\n end", "def initialize(target_proc: nil, input_proc: nil, bias_neuron: 2.0,\n number_of_medial_neurons: 40, learning_rate: 0.01)\n @input_proc = input_proc || -> { [rand, rand * 2 * Math::PI] }\n @target_proc = target_proc || -> (r, a) { Complex.polar(r, a).rectangular }\n\n @number_of_inputs = input_proc.call.length\n @number_of_inputs += 1 if bias_neuron != nil\n\n @number_of_outputs = target_proc.call(*input_proc.call).length\n\n @number_of_medial_neurons = number_of_medial_neurons\n\n @learning_rate = learning_rate\n @bias_neuron = bias_neuron\n @average_error = nil\n @training_iterations = 0\n\n # Initialize the synapse weightings using random numbers\n # `@synone` contains the synapse weights between every input neuron and every\n # medial neuron.\n # `@syntwo` contais the synapse weights between every medial neuron and every\n # output neuron.\n @synone = @number_of_inputs.times.map { @number_of_medial_neurons.times.map { 0.1 * rand } }\n @syntwo = @number_of_medial_neurons.times.map { @number_of_outputs.times.map { 0.1 * rand } }\n end", "def create_internal_network_node(network_config)\n builder = Nokogiri::XML::Builder.new do |xml|\n xml.Configuration {\n xml.IpScopes {\n xml.IpScope {\n xml.IsInherited(network_config[:is_inherited] || \"false\")\n xml.Gateway network_config[:gateway]\n xml.Netmask network_config[:netmask]\n xml.Dns1 network_config[:dns1] if network_config[:dns1]\n xml.Dns2 network_config[:dns2] if network_config[:dns2]\n xml.DnsSuffix network_config[:dns_suffix] if network_config[:dns_suffix]\n xml.IsEnabled(network_config[:is_enabled] || true)\n xml.IpRanges {\n xml.IpRange {\n xml.StartAddress network_config[:start_address]\n xml.EndAddress network_config[:end_address]\n }\n }\n }\n }\n xml.FenceMode 'isolated'\n xml.RetainNetInfoAcrossDeployments(network_config[:retain_info] || false)\n }\n end\n builder.doc\n end", "def create\n @network = current_user.networks.new(network_params)\n\n respond_to do |format|\n if @network.save\n format.html { redirect_to @network, notice: t(:nertwork_created_ok) }\n format.json { render action: 'show', status: :created, location: @network }\n else\n format.html { render action: 'new' }\n format.json { render json: @network.errors, status: :unprocessable_entity }\n end\n end\n end", "def initialize(params={})\n @network = params.fetch(:network,0)\n @members = params.fetch(:members,'NA')\n @kegg_path = annotate_kegg(ids=@members) #get KEGG pathways annotation of all the members in a network\n @go_terms = annotate_GO(ids=@members) #get GO biological processes annotation of all the members in a network\n @@num += 1 #every time a network object is initialized count it\n @@all_interactions << self #add all the objects to this list\n end", "def get_or_create_node(name, create_accessor)\r\n n = (@nodes[name] ||= self.class.new(name))\r\n # Define method on the singleton class of ourself. I.e it affects only\r\n if create_accessor\r\n sig = class << self; self; end\r\n sig.class_eval do\r\n define_method name do |*args|\r\n n\r\n end\r\n end\r\n end\r\n n\r\n end", "def initialize(id, msg, opts = {})\n @neuron_ids = []\n @instance_id = id\n @message = msg\n end", "def create(network_spec)\n\n #@logger = bosh::Clouds::Config.logger\n # Need to reset between each call so that this class is stateless between jobs\n @network = nil\n @vip_network = nil\n\n networks = []\n network_spec.each_pair do |name, spec|\n #raise bosh::Registry::ConfigError \"'#{spec['type']}' network spec provided is invalid\"\n network_type = spec['type'] || 'dynamic'\n case network_type\n when 'dynamic'\n next if (@network)\n @network = DynamicNetwork.new(@vnet_manager, spec['cloud_properties'])\n check_affinity_group(@network.affinity_group)\n networks << @network\n\n when 'vip'\n next if (@vip_network)\n @vip_network = VipNetwork.new(@vnet_manager, spec['cloud_properties'])\n networks << @vip_network\n\n else\n raise Bosh::Registry::ConfigError \"Invalid network type '#{network_type}' for Azure, \" \\\n \"can only handle 'dynamic' or 'vip' network types\"\n end\n\n # Create the network(s) if they dont exist\n networks.each do |network|\n network.provision\n end\n end\n end", "def init_without_node(props) # :nodoc:\n props[:_classname] = self.class.to_s\n @_java_node = Neo4j.create_node props\n update_index if props && !props.empty?\n @_java_node._wrapper = self\n Neo4j.event_handler.node_created(self)\n end", "def setup\r\n\t\t@ne = NExp.from_s(@@nexp, :single)\r\n\tend", "def create\n @network = Network.new(network_params)\n\n respond_to do |format|\n if @network.save\n format.html { redirect_to @network, notice: 'Network was successfully created.' }\n format.json { render action: 'show', status: :created, location: @network }\n else\n format.html { render action: 'new' }\n format.json { render json: @network.errors, status: :unprocessable_entity }\n end\n end\n end", "def create!\n Subnet.reserve(@subnet)\n super\n Address.mkdir(@id)\n PoolNode.mkdir(@id)\n create_address(gateway)\n end", "def initialize(ip, secret)\n @ip = ip\n @secret = secret\n \n @conn = SOAP::RPC::Driver.new(\"https://#{@ip}:17443\")\n @conn.add_method(\"neptune_start_job\", \"job_data\", \"secret\")\n @conn.add_method(\"neptune_put_input\", \"job_data\", \"secret\")\n @conn.add_method(\"neptune_get_output\", \"job_data\", \"secret\")\n @conn.add_method(\"neptune_get_acl\", \"job_data\", \"secret\")\n @conn.add_method(\"neptune_set_acl\", \"job_data\", \"secret\")\n @conn.add_method(\"neptune_compile_code\", \"job_data\", \"secret\")\n end", "def create\n @neural_population = NeuralPopulation.new(params[:neural_population])\n @quote_targets = QuoteTarget.find(:all)\n @neural_population.quote_target_id = params[:quote_target_id]\n respond_to do |format|\n if @neural_population.save\n @neural_population.initialize_population\n @neural_population.active = 1\n @neural_population.save\n flash[:notice] = 'NeuralPopulation was successfully created.'\n format.html { redirect_to(@neural_population) }\n format.xml { render :xml => @neural_population, :status => :created, :location => @neural_population }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @neural_population.errors, :status => :unprocessable_entity }\n end\n end\n end", "def initialize(id, type = :sigmoid, bias = 0, action = :+ )\n\t\t@id = id\n\t\t@type = type\n\t\t@bias = bias\n\t\t@action = action\n\tend", "def new_node\n\t\t\traise NotImplementedError.new('#new_node must be implemented')\n\t\tend", "def new\n @annonce = Annonce.new\n end", "def initialize(dag)\n vars = {}\n @net = Sbn::Net.new(title)\n \n vertices.each do |v|\n vars[v] = Sbn::Variable.new(@net, v.name.to_sym)\n end\n \n edges.each do |e|\n vars[e.source].add_child(vars[e.target])\n end\n end", "def create_nest(tree)\n Nest.new(self, tree)\n end", "def new_node\n id = @nodes.size\n node = Node.new(id: id)\n @nodes.push(node)\n id\n end", "def initialize( config={} )\n\t\t\t# Node Metadata\n\t\t\t@uuid = config[:uuid] || nil\n\t\t\t# Network Variables\n\t\t\t@host = config[:host] || '127.0.0.1'\n\t\t\t@port = config[:port] || '3333'\n\t\t\t@name = config[:name] || config[:host]\n\t\t\t@description = config[:description] || @name\n\n\t\t\t@socket = config[:socket] || nil\n\t\t\t@status = :disconnected\n\t\t\t@ssl_on = config[:ssl_on] || false\n\n\t\t\t# Storage values\n\t\t\t@hive_version\t= config[:hive_version]\n\t\t\t@created_at\t= config[:created_at]\n\t\t\t@updated_at\t= config[:updated_at]\n\t\t\t@latency\t= config[:latency]\n\t\t\t@known_peers\t= config[:known_peers]\n\n\t\t\t# Lists\n\t\t\t@networks = []\n\n\t\t\t# Runtime stats\n\t\t\t@stats = {\n\t\t\t\t:connect_attempt => nil,\n\t\t\t\t:connect_success => nil,\n\t\t\t\t:lastread => nil,\n\t\t\t\t:lastwrite => nil\n\t\t\t}\n\n\t\t\t# Log Iniitalization\n\t\t\t#\tswdebug \"Swarm node:#{uuid} initialized.\"\n\n\t\t\treturn self\n\t\tend", "def node(type, *args)\n AST.new(type, args)\n end", "def new\n @hidden_neuron_layer = HiddenNeuronLayer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @hidden_neuron_layer }\n end\n end", "def new\n \n end", "def new\n \n end", "def new\n \n end", "def new\n \n end", "def new\n \n end", "def initialize\n super\n # Default operators\n @evaluator = Evaluator.new self\n @expressor = Expressor.new self\n @evolver = Evolver.new self\n end", "def new\n if @network\n @membership = Membership.new(:user_id => current_user.id, :network_id => @network.id)\n else\n @membership = Membership.new(:user_id => current_user.id)\n end\n end", "def create!(*args, &block)\n instance = new(*args, &block)\n instance.create!\n instance\n end", "def new\n @trainer = Trainer.new\n end", "def create_tower(tower_class, position)\n tower = tower_class.new(position)\n @towers[position] = tower\n tower\n end", "def initialize(numNeuronas,numEntradas)\n @numEntradas = numEntradas\n @numNeuronas = numNeuronas\n initializeWeights\n @matrixMomentum = []\n for i in 0..@matrixWeights.length-1\n aux = []\n for j in 0..@matrixWeights[0].length-1\n aux << 0\n end\n @matrixMomentum << aux\n end\n @vectorUmbral = []\n for i in 0..@numNeuronas-1\n @vectorUmbral[i] = 0\n end\n end", "def create\n @network = Network.new(network_params)\n\n\n respond_to do |format|\n if @network.save\n format.html { redirect_to @network, notice: 'Network was successfully created.' }\n format.json { render action: 'show', status: :created, location: @network }\n else\n format.html { render action: 'new' }\n format.json { render json: @network.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_node(params)\n node = @tinkit_class.new(params)\n node.__save\n node\n #TODO: What if params includes attachments?\n end" ]
[ "0.6922735", "0.6798534", "0.6624502", "0.6372999", "0.63082767", "0.58965474", "0.58900154", "0.57446855", "0.5735965", "0.5689767", "0.5684622", "0.5626519", "0.5623773", "0.5618617", "0.56077605", "0.56077605", "0.5571133", "0.5557739", "0.54934824", "0.5460241", "0.5449406", "0.5387301", "0.5374525", "0.5372743", "0.5371074", "0.5355542", "0.5335219", "0.5294585", "0.5268476", "0.5253878", "0.5247221", "0.5244679", "0.52329874", "0.52233034", "0.5215491", "0.52116317", "0.5197522", "0.51962876", "0.51794946", "0.5174332", "0.51668626", "0.5154481", "0.5149025", "0.51305234", "0.51279205", "0.5126017", "0.51243865", "0.51227623", "0.51155996", "0.5112179", "0.5093605", "0.5087455", "0.5087455", "0.50859773", "0.5081666", "0.5081666", "0.5080689", "0.50779307", "0.5074321", "0.5071725", "0.5070822", "0.5070528", "0.50667465", "0.50641567", "0.505098", "0.5050522", "0.5046449", "0.50417745", "0.50414103", "0.50393814", "0.503309", "0.50327843", "0.5026534", "0.5024201", "0.5022715", "0.5019593", "0.4999475", "0.49952614", "0.49916923", "0.49841544", "0.49817082", "0.4979038", "0.4973595", "0.49700728", "0.49675965", "0.49578133", "0.49496534", "0.49485832", "0.49485832", "0.49485832", "0.49485832", "0.49485832", "0.49453074", "0.49429557", "0.4940659", "0.49394217", "0.49344656", "0.49341792", "0.49249306", "0.49219438" ]
0.50827587
54
Back propagate the error
def propagate(rate = 0.1, target = nil) error = 0.0 # Is neuron in output layer if !target.nil? # Eq. 10. @error.responsibility = @error.projected = target - @activation else # The rest of the neuron compute their error responsibilities by back- # propagation connections.projected.each_value do |connection| neuron = connection.to # Eq. 21. error += neuron.error.responsibility * connection.gain * connection.weight end # Projected error responsibility @error.projected = @derivative * error error = 0.0 # Error responsibilities from all the connections gated by this neuron trace.extended.each do |id, _| neuron = @neighbors[id] # gated neuron # If gated neuron's selfconnection is gated by this neuron influence = neuron.selfconnection.gater == self ? neuron.old : 0.0 # Index runs over all th econnections to the gated neuron that are # gated by this neuron trace.influences[id].each do |input, infl| # Captures the effect that the input connection of this neuron have, # on a neuron which its input/s is/are gated by this neuron influence += infl.weight * trace.influences[neuron.id][input].from.activation end # Eq. 22. error += neuron.error.responsibility * influence end # Gated error responsibility @error.gated = @derivative * error # Error responsibility - Eq. 23. @error.responsibility = @error.projected + @error.gated end connections.inputs.each_value do |input_neuron| # Eq. 24 gradient = @error.projected * trace.elegibility[input_neuron.id] trace.extended.each do |id, _| neuron = neighbors[id] gradient += neuron.error.responsibility * trace.extended[neuron.id][input_neuron.id] end # Adjust weights - aka. learn input_neuron.weight += rate * gradient end # Adjust bias @bias += rate * @error.responsibility end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def recover_from(_error); end", "def recover_from(_error)\n end", "def propagate\n @propagate_exceptions = true\n end", "def errback &block\n super\n end", "def errback &block\n super\n end", "def original_exception; end", "def original_error; end", "def original_error; end", "def continued_exception; end", "def original_exception=(_arg0); end", "def abort_on_exception(*) end", "def underlying_exception; end", "def pass_exception\n throw :next_exception_handler\n end", "def abort_on_exception=(*) end", "def wrapped_exception; end", "def continued_exception=(_arg0); end", "def abort_on_exception=(_arg0); end", "def rescue_action(e); raise e; end", "def rescue_action(e) raise e end", "def rescue_action(e) raise e end", "def rescue_action(e) raise e end", "def rescue_action(e) raise e end", "def handle_error(e)\n raise e\n end", "def error!\n throw :return, -1\n end", "def underlying_exception=(_arg0); end", "def handle_perform_error(_e); end", "def errback(&block)\n super do |*args|\n safe_deferrable_block(*args, &block)\n end\n end", "def raise(exception); end", "def rescue_from(exception); end", "def exit_exception; end", "def on_error error\n raise error\n end", "def back_propagate(errors)\n @layers.reverse_each do |layer|\n errors = layer.back_propagate(errors)\n end\n end", "def on_error_go_back(&block)\n begin\n block.call\n rescue => e\n Knj::Web.alert(e.message).back\n end\n end", "def catch_exceptions; end", "def error(exception) nil ; end", "def raise_exc\n raise\n rescue\n end", "def _catch_warden(&block); end", "def back\n raise NoMethodError\n end", "def failure\n @back.pop.call\n end", "def cause; end", "def cause; end", "def exception; end", "def exception; end", "def exception; end", "def exception; end", "def exception; end", "def fail\n\t\t# throw up this code and feed plezi your own lines :)\n\t\traise \"Plezi raising hell!\"\n\tend", "def fail\n # no-op\n end", "def on_error(err)\n raise err\n end", "def onerror(&blk); super; end", "def raise(*rest) end", "def raise(*rest) end", "def reraise\n raise $!.class, $!.message, caller[1..-1]\nend", "def rollback()\n #This is a stub, used for indexing\n end", "def propagate_errors\n propagate_errors_to_file if invite_by_file?\n end", "def propagate_errors\n propagate_errors_to_file if invite_by_file?\n end", "def propagate_errors\n propagate_errors_to_file if invite_by_file?\n end", "def on_error(error); @parent.on_error(@env, error); end", "def run_and_raise_on_failure\n # TODO ?\n end", "def error\n\t\t\traise 'Test'\n\t\tend", "def error!\n throw NotImplementedError\n end", "def exceptions; end", "def rollback\n # implement in subclasses\n end", "def on_error(exception)\n raise exception\n end", "def fail_to_parent(error)\n @__context__.executor << FlowFiber.new { @parent.fail(self, error) }\n end", "def storage_failure=(_arg0); end", "def error; end", "def error; end", "def error; end", "def error; end", "def error; end", "def error; end", "def error; end", "def error?; end", "def error?; end", "def error?; end", "def clear_error\n @exception = nil\n end", "def abort; end", "def abort; end", "def abort; end", "def fail(*args)\n super(*args)\n end", "def last_exception\n nil\n end", "def keep_it_in\n raise \"rawr\"\nrescue\n # ahem\nend", "def inject_error(e)\n handle_internal_close(e)\n end", "def error\n\t\traise StandardError\n\tend", "def handle_receiving_exception(e)\n end", "def re_raise_error(body)\n raise Unavailable, body.fetch(:message)\n end", "def errorhandling\n end", "def rollback\n raise TransactionRollback.new\n end", "def set_exit_exception; end", "def redirect_back_or(path)\nredirect_to :back\nrescue ActionController::RedirectBackError\nredirect_to path\nend", "def fail!\n @__result.fail!\n throw :fail\n end", "def retry\n super\n end", "def fail!\n @__result.fail!\n throw :fail\n end", "def raise_on_error(state=true)\n @raise = state ? true : false\n end", "def failure\n super\n end", "def raise!\n raise ReRaisedError.new(message, error_class)\n end", "def rollback\n sanity_check\n @handle.rollback\n end", "def do_failure; end", "def on_failure(object, *args); end", "def rollback; end" ]
[ "0.78358305", "0.7769815", "0.73721474", "0.7307578", "0.7307578", "0.7294966", "0.71287996", "0.71287996", "0.70360065", "0.693632", "0.6852727", "0.68255615", "0.68120587", "0.6798293", "0.6780801", "0.67698485", "0.67666113", "0.67588055", "0.67269343", "0.67269343", "0.67269343", "0.67269343", "0.67151445", "0.6710234", "0.6678324", "0.6645868", "0.6636376", "0.66068995", "0.6572225", "0.6521681", "0.6517078", "0.65098226", "0.6502636", "0.649891", "0.6472975", "0.6465077", "0.64637744", "0.6414774", "0.6388653", "0.6370038", "0.6370038", "0.6362466", "0.6362466", "0.6362466", "0.6362466", "0.6362466", "0.633195", "0.63156873", "0.63122237", "0.62954605", "0.62917763", "0.62917763", "0.62888914", "0.62368906", "0.6229663", "0.6229663", "0.6229663", "0.6213014", "0.6204056", "0.6196304", "0.6193131", "0.61760294", "0.6164543", "0.61579615", "0.6122859", "0.61135304", "0.6105311", "0.6105311", "0.6105311", "0.6105311", "0.6105311", "0.6105311", "0.6105311", "0.6101376", "0.6101376", "0.6101376", "0.60990494", "0.6085171", "0.6085171", "0.6085171", "0.6059625", "0.60556215", "0.6050218", "0.60336965", "0.60294336", "0.60269684", "0.60169935", "0.6010319", "0.59793776", "0.5976489", "0.59738064", "0.5960039", "0.59593385", "0.5956831", "0.59491956", "0.59328985", "0.5931072", "0.59192914", "0.5916482", "0.59050614", "0.5901661" ]
0.0
-1
Add connection to gated list
def gate(connection) connections.gated[connection.id] = connection neuron = connection.to unless trace.extended.key?(neuron.id) # Extended trace neighbors[neuron.id] = neuron xtrace = trace.extended[neuron.id] = {} connection.inputs.each_value do |input| xtrace[input.id] = 0 end end # Keep track if trace.influences.key?(neuron.id) trace.influences[neuron.id] << connection else trace.influences[neuron.id] = [connection] end # Set gater connection.gater = self end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add(name, connection)\n @connections.store(name, connection)\n end", "def join(c)\n connections << c\n end", "def add_connection(connection)\n self.connections[connection.id] = connection\n end", "def checkin_connection(conn)\n @available_connections << conn\n conn\n end", "def add(connection, config)\n config[:name] ||= \"#{@role}/#{@connections.length + 1}\"\n\n wrapper = Makara::ConnectionWrapper.new(connection, @proxy, config)\n wrapper._makara_weight.times{ @connections << wrapper }\n\n if should_shuffle?\n @connections.shuffle!\n @current_idx = rand(@connections.length)\n end\n\n wrapper\n end", "def add_connectionPoint! s\n _log { \"add_connectionPoint! #{s.inspect}\" }\n\n if @connectionPoint.find { | x | x.name == s.name }\n raise ArgumentError, \"connectionPoint named #{s.name.inspect} already exists\"\n end\n\n @connectionPoint << s\n s.state = self\n\n # Notify.\n s.connectionPoint_added! self\n\n s\n end", "def connections\n @connections ||= []\n end", "def push_connection(conn_key, spec, th = nil)\n conns = tconf(th).connections\n n_conn = new_conn(conn_key, spec)\n conns.push(n_conn)\n tconf(th).stack_size += 1\n conns.last\n end", "def add_connection(location)\n raise 'Error: input arguement to method add_connection' unless location.is_a? Location\n @neighbors << location\n end", "def use_connection(conn_key, spec, th = nil)\n # remove connection first\n de_conn(th)\n\n conns = tconf(th).connections\n n_conn = new_conn(conn_key, spec)\n conns.unshift(n_conn)\n n_conn\n end", "def add_to_pool\n return if closed? || outdated?\n conn_id = [@address, @port, @use_ssl,\n proxy_address, proxy_port, proxy_user]\n\n POOL_MUTEX[conn_id].synchronize do\n CONN_POOL[conn_id] << self\n end\n end", "def grab_connections\n connections = []\n connections << @host\n end", "def add_connectionPoint! s\n _log { \"add_connectionPoint! #{s.inspect}\" }\n\n if @connectionPoint.find { | x | x.name == s.name }\n raise ArgumentError, \"connectionPoint named #{s.name.inspect} already exists\"\n end\n\n @ownedMember << s # ownedElement?!?!\n @connectionPoint << s\n s.state = self\n\n # Notify.\n s.connectionPoint_added! self\n\n s\n end", "def add_replication conn\n if @schedule.has_key? conn.name\n return\n else\n @schedule[conn.name] = conn\n\n if !@active\n @active = true\n EM::add_timer(@interval) { run_replications }\n end\n end\n end", "def connections\n @mutex.synchronize do\n @connections.values.inject(0, &:+)\n end\n end", "def connect(*) end", "def connections\n @connections ||= {}\n end", "def add_connection(resource, connection)\n @data['powerConnections'] << {\n 'connectionUri' => resource['uri'],\n 'deviceConnection' => connection,\n 'sourceConnection' => connection\n }\n end", "def connect; end", "def connections\n @connections ||= {}\n end", "def add(user, connection)\n found = find(user.id)\n\n if found.nil?\n @users.push({ :user => user, :connections => [connection] })\n else\n @users[found[:index]][:connections].push connection\n end\n\n @chat.root_room.shout Chat::Message.system(\"#{user.name} connected to #{connection.room.identifier}\", user).to_json\n end", "def register_tunnel_connection(connection)\n @tunnel_connections[connection.connection_id] = connection\n control_connection = connection.control_connection\n @tunnel_connections_by_control[control_connection] ||= Set.new\n @tunnel_connections_by_control[control_connection] << connection\n end", "def post_init\n $connection_list << self\n @my_connection_index = $connection_list.length\n puts \"Connection Initialized #{@my_connection_index}) #{@my_address} - #{@signature}\"\n #\n # TODO: get access to the HostIP and HostPort associated with this connection\n # if it is the local control connection, do the following\n # * do not repeat other connection traffic to this connection\n # * consider any input a command to be processed\n end", "def push(conn)\n # No need to cache if the connection has already been closed.\n return if closed?(conn)\n\n connections.synchronize do\n connections.push([Time.now + idle_timeout, conn])\n end\n end", "def connect\n # Implement in subclass\n end", "def connect!\n payload = {}\n user.options.active.each do |option|\n hook = option.hook(@user)\n payload[option.code] = hook ? hook.connect : {}\n end\n user.connects.create!(server_id: server.id, option_attributes: payload)\n end", "def new_connection; end", "def add_friends( whose, conn, friends )\n friends[whose] = true\n links = conn.delete( whose )\n return unless links\n\n # We added the user; now add all of their connections. Tack them on to the\n # end of the list (dropping duplicates) as we run through it, so they will\n # be similarly processed in turn. We must continue to make passes through\n # the list until it stopped growing, at which point we know we've added\n # all the friends and friends of friends of the first user. \n count = 0\n until count == links.size\n count = links.size\n\n links.keys.each do |link|\n sublinks = conn.delete( link )\n links.merge!( sublinks ) if sublinks\n end\n end \n\n # Now that we have the definitive list of this user's connections (and\n # their connections), tag them all as friends of the PM.\n friends.merge!( links )\n end", "def add_connection(source, target, source_point, target_point, s_type, t_type, name, definition)\n\n line = Line2D::Double.new source_point, target_point\n\n source_intersecting_line = get_intersecting_line source, line\n target_intersecting_line = get_intersecting_line target, line\n\n source_intersecting_point = get_intersection_point line.get_p1,\n line.get_p2,\n source_intersecting_line.get_p1,\n source_intersecting_line.get_p2\n\n\n target_intersecting_point = get_intersection_point line.get_p1,\n line.get_p2,\n target_intersecting_line.get_p1,\n target_intersecting_line.get_p2\n\n sEP = add_endpoint s_type, source, source_intersecting_point.get_x, source_intersecting_point.get_y\n tEP = add_endpoint t_type, target, target_intersecting_point.get_x, target_intersecting_point.get_y\n\n connection = Connection.new sEP, tEP, name, definition\n\n [sEP,tEP].each {|ep| ep.connection = connection}\n\n label = JLabel.new name\n @panel.add label\n @cm.register_component label\n\n\n label.set_size label.get_preferred_size\n connection.label = label\n connection.reset_label_position\n\n @connections << connection\n connection\n end", "def connect!; end", "def connect!; end", "def connect(a, b, weight = 0.5)\n c = Connection.new a, b, weight\n a.join c\n # Also add the Connection here\n connections << c\n end", "def on_connect(client_id, ip_address)\n @client_manager.add(client_id, ip_address)\n end", "def add_client(client)\n clients.push(client)\n end", "def put_connection(conn)\n conn.close if !active?\n @connections.offer(conn)\n end", "def connect\n end", "def add_connection(pin, wire)\n @jcell.add_wire_conn(pin, wire.name)\n end", "def connections\n @_connections ||= {}\n end", "def connect(node0, node1)\n @connections << [node0, node1] unless @connections.include? [node0, node1]\n @connections << [node1, node0] unless @connections.include? [node1, node0]\n end", "def checkin(conn)\n synchronize do\n release conn\n @available.add conn\n end\n end", "def connect()\n\t\t\t# Check queen(s) for peer list\n\n\t\t\t# Connect to peers\n\t\tend", "def getConnections\n\t\tr = []\n\t\teditor.getModelCanvas.getItems(UONConnection).each do |c|\n\t\t\tif (c.srcItem == self) || (c.destItem == self) then r.push c end\n\t\tend\n\t\tr\n\tend", "def add_client(client, clients)\n\tclients << client\nend", "def add_tunnel( tunnel )\n\t\t\t@tunnels << tunnel\n\t\tend", "def propagate_connections(klass)\n connections.each { |n, o| klass.connection(n, o) }\n end", "def checkin_connection(conn)\n @queue.push(conn)\n conn\n end", "def add(client); end", "def connect edge\n self.add edge.src\n self.add edge.dst\n @nodes[edge.src] << edge\n edge\n end", "def connect_cells(cell)\n @connected_cells << cell\n cell.connected_cells << self\n end", "def all_active_connections\n super\n end", "def connect\n @connection.create\n end", "def establish_connections\n klass = Struct.new(:ip,:port)\n if t_servers = BackgrounDRb::BDRB_CONFIG[:client]\n connections = t_servers.split(',')\n connections.each do |conn_string|\n ip = conn_string.split(':')[0]\n port = conn_string.split(':')[1].to_i\n @bdrb_servers << klass.new(ip,port)\n end\n end\n @bdrb_servers << klass.new(BackgrounDRb::BDRB_CONFIG[:backgroundrb][:ip],BackgrounDRb::BDRB_CONFIG[:backgroundrb][:port].to_i)\n @bdrb_servers.each_with_index do |connection_info,index|\n next if @backend_connections.detect { |x| x.server_info == \"#{connection_info.ip}:#{connection_info.port}\" }\n @backend_connections << Connection.new(connection_info.ip,connection_info.port,self)\n end\n end", "def connect\n return if connected?\n self.adapters.each{|adapter| adapter.connect }\n self.connected = true\n end", "def add_client(client)\n @clients.push(client)\n end", "def connect\n super\n end", "def connect\n super\n end", "def connect(peer)\n return if @connections[peer]\n @connections[peer] = []\n peer.connections[self] = []\n\n Layout.parallel_links.times do\n local = add_link\n remote = peer.add_link\n @connections[peer].push([local, remote])\n peer.connections[self].push([remote, local])\n end\n end", "def bind_connections_as_friend\n connections.where(friend_id: nil).each {|fshp| bind_connection(fshp)}\n end", "def add_connections(start_cell, end_cell)\n start_cell.connected_cells.each do |cell|\n (@cells_to_visit << cell).sort_by! { |cell| cell.distance_to(end_cell) } unless cell_array_visited.include?(cell)\n end\n end", "def connect!\n sessions\n self\n end", "def connect\n\tend", "def accept_new_connection\n new_socket = @host.accept\n @connections << new_socket\n new_socket.write(\"Write QUIT to disconnect\\n\")\n end", "def connection(name, params = {})\n Celluloid::Logger.info \"Registering connection '#{name}'...\"\n self.connection_types << {:name => name}.merge(params)\n end", "def add_tunnel(tunnel)\n @tunnels << tunnel\n end", "def bind_connections_as_friend\n connections.where(friend_id: nil).find_each { |fshp| bind_connection(fshp) }\n end", "def connect!\n end", "def __connect__(node)\n raise \"Cannot connect to a node which is not on the same graph!\" if node.graph != @this.graph\n node.in.instance_exec(@this) { |n| @others << n }\n @graph.instance_eval { @changed = true }\n end", "def connecting(socket)\n add_client( socket.peeraddr[1], socket )\n super\n end", "def get_connections\n @connected_to.keys\n end", "def add_multiple\n @group = Group.find(params[:group_id])\n contacts = current_user.contacts.where(id: params[:contact_ids])\n contacts.each do |contact|\n contact.connections.create(group_id: params[:group_id])\n end\n @members_count = @group.reload.connections.size\n end", "def on_connect(&block)\n raise IrcError.new('wrong arity') if block.arity != 4\n self[:connect] << block\n end", "def remote_connections; end", "def checkout_new_connection\n c = new_connection\n @connections << c\n checkout_and_verify(c)\n end", "def start_connect\n # increment id to use as counter for each connections color\n if controller_store[:id] == 7\n controller_store[:id] = 0\n end \n controller_store[:id] += 1\n connection_store[:id] = controller_store[:id]\n\n # send the connection's color\n send_message :curColor, controller_store[:colors][connection_store[:id]]\n\n # sends array data used to display drawing\n send_message :Draw, [\n controller_store.collect_all(:x),\n controller_store.collect_all(:y),\n controller_store.collect_all(:drag),\n controller_store[:color]\n ]\n end", "def turn_on\n connections.each(&:disconnect)\n @connections = []\n end", "def gossip_list\n\n end", "def connect\n @connector.connect\n @p.set_connection @connector\n end", "def pending_connections\n\t\tredirect_to '/my_connections'\n\tend", "def add_connection_specific_endpoints(source, target, source_point, target_point, s_type, t_type, name, definition)\n\n sEP = add_endpoint s_type, source, source_point.get_x, source_point.get_y\n tEP = add_endpoint t_type, target, target_point.get_x, target_point.get_y\n\n connection = Connection.new sEP, tEP, name, definition\n\n [sEP,tEP].each {|ep| ep.connection = connection}\n\n label = JLabel.new name\n @panel.add label\n @cm.register_component label\n\n label.set_size label.get_preferred_size\n connection.label = label\n connection.reset_label_position\n\n @connections << connection\n connection\n end", "def append( ref, layer )\n idx = getidx( ref )\n @list.insert( idx+1, layer )\n end", "def add_to_list(url)\n @list_of_repos.push(url) # insert at the end\n # (we can use unshift if we want to simulate a LIFO structure)\n end", "def spawn_connection\n connect\n end", "def add client_id, socket\n @clients[client_id] = socket\n end", "def create_connection(name, connection)\n repo.add(name, connection)\n write \"Loaded a new round called #{name}.\"\n save!\n end", "def add_connection_details(user)\n @@connections.each do |person|\n # this takes a long time\n public_profile_url = Api.new.get_public_profile_url(person.linkedin_id) # need this bc oauth gives a diff url\n person.linkedin_url = public_profile_url\n # debugger\n @scrape = Scraper.new(public_profile_url)\n if @scrape.profile\n @scrape.educations.each do |school|\n this_school = School.find_or_create_by_name(school[:name])\n person.schools << this_school\n # regex out the kind and major\n match = (/([^,]*),? ?(.*)/).match(school[:description])\n if match\n education = Education.find_or_create_by_kind_and_major_and_grad_yr_and_school_id(\n match[1], match[2], school[:period], this_school.id)\n else\n education = Education.find_or_create_by_kind_and_grad_yr_and_school_id(\n school[:description], school[:period], this_school.id)\n end\n person.educations << education unless person.educations.include? education\n # Save this after shoveling\n person.save\n end\n\n @scrape.current_companies.each do |company|\n this_company = Company.find_or_create_by_name_and_url_and_address(\n company[:company], company[:website], company[:address])\n person.companies << this_company unless person.companies.include? this_company\n\n if this_company.address\n matchdata = this_company.address.match(/\\d{5}/)\n if matchdata\n this_location = Location.find_or_create_by_postalcode(matchdata[0].to_i)\n # self.city_state_lon_lat\n this_company.locations << this_location unless this_company.locations.include? this_location\n\n this_company.save\n end\n end\n\n this_industry = Industry.find_or_create_by_name(company[:industry])\n if this_company.industries\n this_company.industries << this_industry unless this_company.industries.include? this_industry\n # this_company.save\n end\n\n jobtitle = Jobtitle.find_or_create_by_title_and_start_date_and_end_date_and_company_id(\n company[:title], company[:start_date], company[:end_date], this_company.id)\n person.jobtitles << jobtitle unless person.jobtitles.include? jobtitle\n # Save this after shoveling\n # person.save\n end\n\n @scrape.past_companies.each do |company|\n # this_company = Company.find_or_create_by_name_and_url_and_address(\n # company[:company], company[:website], company[:address])\n this_company = Company.find_or_create_by_name(\n company[:company])\n if this_company.url.nil?\n this_company.update_attributes(:url=>company[:website],:address=>company[:address])\n end\n person.companies << this_company unless person.companies.include? this_company\n\n if this_company.address\n matchdata = this_company.address.match(/\\d{5}/)\n\n if matchdata \n this_location = Location.find_or_create_by_postalcode(matchdata[0].to_i)\n # self.city_state_lon_lat\n this_company.locations << this_location unless this_company.locations.include? this_location\n\n # this_company.save\n this_company.save\n end\n end\n\n this_industry = Industry.find_or_create_by_name(company[:industry])\n if this_company.industries\n this_company.industries << this_industry unless this_company.industries.include? this_industry\n # this_company.save\n end\n\n jobtitle = Jobtitle.find_or_create_by_title_and_start_date_and_end_date_and_company_id(\n company[:title], company[:start_date], company[:end_date], this_company.id)\n person.jobtitles << jobtitle unless person.jobtitles.include? jobtitle\n # Save this after shoveling\n # person.save\n end\n end\n end\n end", "def connect(p0) end", "def connection\n if conn = @reserved_connections[current_connection_id]\n conn\n else\n @reserved_connections[current_connection_id] = checkout\n end\n end", "def new_connection(handler)\n return unless Config.metrics\n unless handler.application.nil?\n # Get peer's IP and port\n peer = handler.peer_ip_port()\n # Update record\n work_data.update(\n {app_id: handler.application.app_id},\n {'$addToSet' => {connections: {slanger_id: Cluster.node_id, peer: peer}}, '$set' => {timestamp: Time.now.to_i}},\n {upsert: true}\n )\n end\n end", "def on_event event, *args_cond, &blk\n # in first call initialize @event_connections\n @event_connections = Hash.new(Set.new) if @event_connections.nil?\n new_conn = HH::EventConnection.new event, args_cond, &blk\n @event_connections[event] += [new_conn]\n #debug \"#{new_conn} added\"\n #emit :new_event_connection, new_conn\n new_conn\n end", "def connect_through_proxy; end", "def connect_new_clients\n begin\n socket = @server.accept_nonblock\n puts \"#{socket.remote_address.ip_address}: Connection attempt.\"\n x, y, w, h = read_frame(socket)\n puts \"|-> Connect: (#{x}, #{y}, #{w}, #{h})\"\n write_frame([@map.w, @map.h], socket)\n\n @clients << ServerStreamer.new(socket: socket, x: x, y: y, w: w, h: h)\n rescue IO::EAGAINWaitReadable\n # happens if the `accept_nonblock` call would block\n # not sure there's much to be done here, it's going\n # to happen a lot\n end\n end", "def on_connected(&block)\n @on_connected_procs << block\n end", "def add_connection(name, source_view_key, target_view_key)\n @parts[name] = PresentationPartConnection.new(self,\n source_view_key,\n target_view_key,\n nil)\n end", "def add_connection(uri) #:nodoc:\n publisher = SlaveProxy.new(@caller_id, uri)\n begin\n protocol, host, port = publisher.request_topic(@topic_name, [[\"TCPROS\"]])\n if protocol == \"TCPROS\"\n connection = TCPROS::Client.new(host, port, @caller_id, @topic_name, @topic_type, uri, @tcp_no_delay)\n connection.start\n else\n puts \"not support protocol: #{protocol}\"\n raise \"not support protocol: #{protocol}\"\n end\n connection.id = \"#{@topic_name}_in_#{@connection_id_number}\"\n @connection_id_number += 1\n @connections.push(connection)\n return connection\n rescue\n#\tputs \"request to #{uri} fail\"\n return false\n end\n end", "def add_client(person)\n @clients << person\n end", "def add_client(person)\n @clients << person\n end", "def add_client(client) # add client object\n @clients[client.name] = client\n end", "def connect\n raise NotImplementedError, \"#connect should be overridden by adapters\"\n end", "def connections_handler(id, ip)\n\t# show who connected\n\tputs \"[ID #{id}] connected from #{ip}\"\n\t# delete the hash entry if it already exists\n\t@clients.delete_if {|key, value| key == id }\n\t# add the new entry to the clients hash\n\t@clients[id] = { :ip => ip }\n\t#show how many clients we have\n\tputs \"Clients connected: #{@server.clients_count} of #{@server.max_clients}\"\nend", "def connected?; end", "def connected?; end" ]
[ "0.6710281", "0.6644192", "0.6618919", "0.63248587", "0.6299969", "0.6137364", "0.6130453", "0.61202246", "0.609378", "0.6069656", "0.60602605", "0.60501873", "0.5990621", "0.59905505", "0.5970015", "0.5866052", "0.58608943", "0.58341473", "0.578295", "0.57814914", "0.5767342", "0.5765954", "0.57559264", "0.57483554", "0.57082736", "0.57056606", "0.57027346", "0.56884617", "0.56857055", "0.56767184", "0.56767184", "0.5666359", "0.5661151", "0.5642016", "0.5626606", "0.5619157", "0.56094027", "0.5608483", "0.5607047", "0.5601941", "0.55962193", "0.5588624", "0.5575931", "0.55580217", "0.55378824", "0.55243343", "0.5498433", "0.5489776", "0.54830074", "0.54817206", "0.54683083", "0.54681826", "0.545792", "0.5451349", "0.54472935", "0.54472935", "0.5437525", "0.5436684", "0.5430149", "0.5409631", "0.540681", "0.5398737", "0.5393613", "0.53826207", "0.5376459", "0.53761226", "0.53695446", "0.53656113", "0.53426343", "0.5339246", "0.5338672", "0.5331405", "0.53208065", "0.5320474", "0.53182524", "0.53170806", "0.53093606", "0.5289777", "0.5273722", "0.52730817", "0.5256912", "0.5255103", "0.524069", "0.52402574", "0.52390504", "0.5235316", "0.5235254", "0.5224115", "0.5222177", "0.5220562", "0.52187616", "0.52150726", "0.5210018", "0.5209482", "0.52044064", "0.52044064", "0.5203395", "0.51791215", "0.51776975", "0.5170377", "0.5170377" ]
0.0
-1
Returns wheter the neuron is self connected
def selfconnected? !selfconnection.weight.zero? end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def connected?\n @neighbors.count.nonzero?\n end", "def connected?\n !!@connected_to\n end", "def connected?\n\t\treturn self.connected ? true : false\n\tend", "def connected?\n return @connected\n end", "def connected?\n @connected\n end", "def connected?\n @connected\n end", "def connected?\n @connected\n end", "def connected?\n @connected\n end", "def connected?\n @connected\n end", "def connected?\n @connected\n end", "def connected?\n @state == :connected\n end", "def connected?\n\t\t@connected\n\tend", "def connected?\n @connected\n end", "def connected?\n @connected\n end", "def connected?\n @connected\n end", "def connected?\n @connected\n end", "def connected?\n @connected\n end", "def connected?\n self.connected\n end", "def connected?\n\t\t\t\t@@connected\n\t\t\tend", "def connected?\n !!@connected\n end", "def connected?\n @cluster.connected?\n end", "def connected?\n !@connected.nil? && @connected\n end", "def connected\n\t\treturn @connected\n\tend", "def connected?\n @connected ||= false\n end", "def connected?\n raise NotImplementedError\n end", "def connected?\n status == CONNECTED\n end", "def connected?\n !closed?\n end", "def connected?\n !closed?\n end", "def isConnected()\r\n return @isConnected\r\n end", "def connected?\n @status == :connected\n end", "def connected?\n @connections.size > 0 # synchronize { @connections.any? }\n end", "def connected?\r\n\t\t\t\t\treturn false if (@connections.nil?)\r\n\t\t\t\t\treturn false if (@connections.empty?)\r\n\t\t\t\t\treturn true\r\n\t\t\t\tend", "def connected?\n not @sp.closed?\n end", "def connected?()\n (self.remote_address rescue nil) ? true : false\n end", "def connected?\n\t\treturn @conn ? true : false\n\tend", "def connected?\n @connections.any?\n end", "def connected?\n\t\t@conn.connected?\n\tend", "def connected?\n !!@session_id && !!@cluster\n end", "def established?\n @connected == true\n end", "def still_connected?\n true\n end", "def connected?\n !@connections.empty?\n end", "def connected?\n not @handle.nil?\n end", "def alone?\n @neighbors.count.zero?\n end", "def connected\n return @poco_data[:connected] unless @poco_data == nil\n str = pick_first_node(@poco.xpath('./poco:connected'))\n return nil if str == nil\n\n if str == \"true\"\n true\n elsif str == \"false\"\n false\n else\n nil\n end\n end", "def is_connected?\n\t\tif @connection == nil\n\t\t\treturn false\n\t\telse\n\t\t\treturn true\n\t\tend\n\tend", "def connected?\n\t\t\t\t\t\t@stream&.connected?\n\t\t\t\t\tend", "def is_connected?\n if @connection == nil\n return false\n else \n return true\n end\n end", "def connected?\n # FIXME: check if connection is connected\n not @connection.nil?\n end", "def connected?\n connection_handler.connected?(self)\n end", "def connected?\n synchronize { @connections.any? }\n end", "def connect?\n connect != false\n end", "def connected?\n @started\n end", "def connected?\n particle.connected?\n end", "def connected?\n !!@socket\n end", "def connected?\n !!@socket\n end", "def connected?\r\n @connection && @connection.connected?\r\n end", "def connected?\n (conn=self.conn) && conn.connected? && @pid == Process.pid || false\n end", "def connected?\n !connection.blank?\n end", "def connected_to?(person)\n current_person?(person) or Connection.connected?(person, current_person)\n end", "def connected_to?(person)\n current_person?(person) or Connection.connected?(person, current_person)\n end", "def connected?\n @connection.present?\n end", "def in_connection?\r\n self.aln_connection_id.nil? ? false : true\r\n end", "def connectable?\n true\n end", "def connected?\n return !@@connection.nil?\n end", "def connected?(relation_name, other_object)\n return Relation.connected?(relation_name, self.node, other_object.node)\n end", "def connected?\n if @ssh\n return true\n else\n return false\n end\n end", "def connected?\n client.is_connected?\n end", "def connected?\n @bot.connected?\n end", "def connected?\n @bot.connected?\n end", "def connected?; connection_state == :connected end", "def connected(neuron)\n result = Connection.new\n\n if self == neuron\n return unless selfconnected?\n\n result.type = :selfconnection\n result.connection = selfconnection\n return result\n end\n\n CONNECTION_TYPES\n .map { |ct| connections.send(ct).values }\n .flatten\n .each do |connection|\n next unless connection.to == neuron || connection.from == neuron\n\n result.type = type\n result.connection = type\n return result\n end\n\n nil\n end", "def connected?\n if @connected\n true\n else\n puts \"Drone is not yet connected. Run `connect` first.\"\n false\n end\n end", "def connected?\r\n !@conn.nil?\r\n end", "def connected?\n unless @server.nil?\n true\n else\n false\n end\n end", "def connected?\n @rwlock.read {\n __connected?\n }\n end", "def connected?(conn)\n conn && conn.active?\n end", "def connected?\n !@aborted\n end", "def connected?\n is_visited = []\n dfs(0) { |v,w| is_visited[w] = true }\n 0.upto(vertices-1) { |i| return false unless is_visited[i] }\n true\n end", "def connected?\n !!@socket && @socket.alive?\n end", "def connected?\n visited = Set.new\n on_pre = lambda do |v|\n visited.add(v)\n end\n\n dfs(graph: self, vertex: self.vertices().first, on_pre: on_pre)\n\n # need to reset vertex's state for next traversal\n self.reset()\n\n # puts \"visited.length: #{visited.length}\"\n # puts \"num_of_vertices: #{self.num_of_vertices}\"\n # puts \"num_of_edges: #{self.num_of_edges}\"\n return visited.length == self.num_of_vertices\n end", "def connected?; end", "def connected?; end", "def connected?; end", "def allowed?\n return self.connected_to_padma?\n end", "def mainnet?\n self.network.mainnet?\n end", "def connected?\n self.connected_cache ||= session_info.success?\n end", "def connected?\n connection_handler.connected?(connection_specification_name, role: current_role, shard: current_shard)\n end", "def has_network?\n Friend.has_network?(self)\n end", "def disconnected?\n !@connected\n end", "def connected?\n !socket.closed?\n end", "def connected!\n @connected = true\n\n @network.connected!\n end", "def connecting?\n\t\treturn @connection_thread\n\tend", "def auto_connecting?\n !!get_inherited_attribute(\"@auto_connecting\")\n end", "def connected?\n return false unless @connection\n return false unless @connection.started?\n true\n end", "def connected?\n return false if @connection.nil?\n return false if @connection.closed?\n return true\n end", "def test_connected_true\n \ttest_neighbor = Node.new(2, \"c\")\n \t@n.add_neighbor(test_neighbor)\n \tassert_equal @n.connected?, 1\n end", "def connectable?\n begin; ping; rescue; false; end\n end", "def activeConnections?\n if @connectedClients then do return true else return false end\n end", "def connections?\n @connections.any?\n end", "def connected?\n @conn.connected? && @channel.open?\n end" ]
[ "0.78612447", "0.7776261", "0.7687298", "0.7642318", "0.7621607", "0.7621607", "0.7621607", "0.7621607", "0.7621607", "0.7621607", "0.76180816", "0.75662637", "0.75356555", "0.75356555", "0.75356555", "0.75356555", "0.75356555", "0.7524124", "0.75167465", "0.7482601", "0.73879695", "0.7372552", "0.7326649", "0.73128796", "0.7189247", "0.71816033", "0.7158276", "0.7158276", "0.7141788", "0.713146", "0.7100008", "0.7093838", "0.7006712", "0.6955292", "0.6942504", "0.6932635", "0.69273216", "0.69108355", "0.6908145", "0.6903059", "0.6876346", "0.68551725", "0.6849918", "0.68060976", "0.6799156", "0.6756502", "0.6748758", "0.67402047", "0.6737641", "0.67232704", "0.67042065", "0.67034036", "0.67015016", "0.668589", "0.668589", "0.6662247", "0.6639302", "0.6636029", "0.662245", "0.662245", "0.6622441", "0.66011965", "0.66007876", "0.65993", "0.6594648", "0.65527546", "0.6550221", "0.6547747", "0.65015894", "0.6501226", "0.6494386", "0.64583343", "0.6457677", "0.6456806", "0.644778", "0.64473116", "0.6441071", "0.6425625", "0.641727", "0.64157194", "0.6408137", "0.6408137", "0.6408137", "0.6401955", "0.63875633", "0.6371767", "0.63619983", "0.63573736", "0.6342546", "0.6331286", "0.6319495", "0.6312899", "0.63114613", "0.63070315", "0.63037694", "0.6272809", "0.6268432", "0.62549114", "0.6254279", "0.62524486" ]
0.81044173
0
Returns whether the neuron is connected to another neuron
def connected(neuron) result = Connection.new if self == neuron return unless selfconnected? result.type = :selfconnection result.connection = selfconnection return result end CONNECTION_TYPES .map { |ct| connections.send(ct).values } .flatten .each do |connection| next unless connection.to == neuron || connection.from == neuron result.type = type result.connection = type return result end nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def connected?\n @neighbors.count.nonzero?\n end", "def connected?\n !!@connected_to\n end", "def connected?(relation_name, other_object)\n return Relation.connected?(relation_name, self.node, other_object.node)\n end", "def connected?\n @connected\n end", "def connected?\n @connected\n end", "def connected?\n @connected\n end", "def connected?\n @connected\n end", "def connected?\n @connected\n end", "def connected?\n @connected\n end", "def connected?\n return @connected\n end", "def connected?\n @connected\n end", "def connected?\n @connected\n end", "def connected?\n @connected\n end", "def connected?\n @connected\n end", "def connected?\n @connected\n end", "def connected?\n\t\treturn self.connected ? true : false\n\tend", "def connected?\n self.connected\n end", "def connected?\n\t\t@connected\n\tend", "def connected?\n @state == :connected\n end", "def connected?\n\t\t\t\t@@connected\n\t\t\tend", "def connected?\n !!@connected\n end", "def selfconnected?\n !selfconnection.weight.zero?\n end", "def connected?\n !@connected.nil? && @connected\n end", "def connected?\n @connections.any?\n end", "def connected?\n @connections.size > 0 # synchronize { @connections.any? }\n end", "def connected?\n @connected ||= false\n end", "def connected?\r\n\t\t\t\t\treturn false if (@connections.nil?)\r\n\t\t\t\t\treturn false if (@connections.empty?)\r\n\t\t\t\t\treturn true\r\n\t\t\t\tend", "def connected?\n @cluster.connected?\n end", "def connected?\n raise NotImplementedError\n end", "def connected?\n synchronize { @connections.any? }\n end", "def connected_to?(person)\n current_person?(person) or Connection.connected?(person, current_person)\n end", "def connected_to?(person)\n current_person?(person) or Connection.connected?(person, current_person)\n end", "def edge?(x, y)\n connected?(x, y)\n end", "def edge?(x, y)\n connected?(x, y)\n end", "def connected?()\n (self.remote_address rescue nil) ? true : false\n end", "def test_connections\n @doors.all? do |k, v|\n v[-1] ? v[-1].leads_to?(self.class, k): true\n end\n end", "def connected?\n status == CONNECTED\n end", "def connected?\n !@connections.empty?\n end", "def connected? p, q\n find(p) == find(q)\n end", "def connects?(other)\n other &&\n (self == other ||\n (suited? &&\n suit == other.suit &&\n (rank - other.rank).abs <= 2))\n end", "def connected?\n !closed?\n end", "def connected?\n !closed?\n end", "def connections?\n @connections.any?\n end", "def in_connection?\r\n self.aln_connection_id.nil? ? false : true\r\n end", "def connected_to?(dog)\n current_person?(dog.owner) or Connection.connected_with_person?(dog, current_person)\n end", "def eligible?()\n @networks.include? @remote_network\n end", "def connect?\n connect != false\n end", "def neighbors?(other_cell)\n @neighbors.include?(other_cell)\n end", "def connectable?\n true\n end", "def has_network?\n Friend.has_network?(self)\n end", "def connected?\n @status == :connected\n end", "def alone?\n @neighbors.count.zero?\n end", "def connected\n\t\treturn @connected\n\tend", "def connected?\n not @sp.closed?\n end", "def connected?\n !!@session_id && !!@cluster\n end", "def connected?\n particle.connected?\n end", "def isConnected()\r\n return @isConnected\r\n end", "def connected?\n not @handle.nil?\n end", "def connected(index1, index2)\n root(index1) == root(index2)\n end", "def connected?(rule_name, end_node)\n end_node.nodes(:incoming, rule_name).find { |n| n == rule_node }\n end", "def established?\n @connected == true\n end", "def mainnet?\n self.network.mainnet?\n end", "def reachable? other\n reachable.include? other\n end", "def follows? neighborhood\n neighborhood.in? neighborhoods\n end", "def activeConnections?\n if @connectedClients then do return true else return false end\n end", "def connected_with? nick\n @connection_cache.has_key? nick\n end", "def neighbours?(node1, node2, options = {:siblings => false})\n neighbours(node1, options).any? { |set| set.include? node2 }\n end", "def still_connected?\n true\n end", "def connected?\n\t\treturn @conn ? true : false\n\tend", "def allowed?\n return self.connected_to_padma?\n end", "def test_connected_true\n \ttest_neighbor = Node.new(2, \"c\")\n \t@n.add_neighbor(test_neighbor)\n \tassert_equal @n.connected?, 1\n end", "def connected_with?(user)\n friendshiped_with?(user)\n end", "def connected?\r\n @connection && @connection.connected?\r\n end", "def usable?\n [:connected, :connecting].include?(@status)\n end", "def connected?\n\t\t@conn.connected?\n\tend", "def connected?(graph)\n start = graph.vertices.keys[0]\n goal = graph.vertices.keys[graph.vertex_number - 1]\n pred = breadth_first_search?(graph, start, goal)\n graph.reverse!\n pred = pred and breadth_first_search?(graph, goal, start)\n graph.reverse!\n pred\n end", "def connected?\n connections = nil\n @lock.lock\n begin\n connections = @connections\n ensure\n @lock.unlock\n end\n connections.any?\n end", "def checkNode()\n source_set = []\n neighbor_set = []\n $networks.each do |s, nb|\n source_set << s\n nb[\"neighbors\"].each do |s_, dist|\n neighbor_set << s_\n end\n end\n source_set.sort!\n source_set.uniq!\n neighbor_set.sort!\n neighbor_set.uniq!\n return source_set == neighbor_set\nend", "def connected?\n is_visited = []\n dfs(0) { |v,w| is_visited[w] = true }\n 0.upto(vertices-1) { |i| return false unless is_visited[i] }\n true\n end", "def is_connected?\n\t\tif @connection == nil\n\t\t\treturn false\n\t\telse\n\t\t\treturn true\n\t\tend\n\tend", "def is_connected?\n if @connection == nil\n return false\n else \n return true\n end\n end", "def is_connected_south?\r\n return true if @connected_directions.include?(:south)\r\n return false\r\n end", "def edge_net?(network_name:)\n @networks_nodes[network_name].nil? || @networks_nodes[network_name].length == 1\n end", "def connected?(conn)\n conn && conn.active?\n end", "def oneway?\n !@graph.links.has_key?([@dest, @src])\n end", "def connected?\n visited = Set.new\n on_pre = lambda do |v|\n visited.add(v)\n end\n\n dfs(graph: self, vertex: self.vertices().first, on_pre: on_pre)\n\n # need to reset vertex's state for next traversal\n self.reset()\n\n # puts \"visited.length: #{visited.length}\"\n # puts \"num_of_vertices: #{self.num_of_vertices}\"\n # puts \"num_of_edges: #{self.num_of_edges}\"\n return visited.length == self.num_of_vertices\n end", "def connected?\n\t\t\t\t\t\t@stream&.connected?\n\t\t\t\t\tend", "def connected?\n @bot.connected?\n end", "def connected?\n # FIXME: check if connection is connected\n not @connection.nil?\n end", "def connected?\n if @connected\n true\n else\n puts \"Drone is not yet connected. Run `connect` first.\"\n false\n end\n end", "def is_connected_east?\r\n return true if @connected_directions.include?(:east)\r\n return false\r\n end", "def connected?\n @bot.connected?\n end", "def connected_with?(user)\n find_any_friendship_with(user).present?\n end", "def live?\n networks = self.class.all false\n network = networks.find { |net| net.name == name }\n network ? true : false\n end", "def has_bridge?\r\n not @bridges.empty?\r\n end", "def connected?\n if @ssh\n return true\n else\n return false\n end\n end", "def connected?\n connection_handler.connected?(self)\n end", "def connected?\n @connection.present?\n end", "def connected?\n !connection.blank?\n end", "def room_is_connected( rm )\n\t\tfor i in 0..2 do\n\t\t\tif @nearby_room[i] == rm\n\t\t\t\treturn true \n\t\t\tend\t \n\t\tend\n\t\treturn false\t\n\tend" ]
[ "0.7660644", "0.7226879", "0.7023916", "0.6970236", "0.6970236", "0.6970236", "0.6970236", "0.6970236", "0.6970236", "0.69097066", "0.6900309", "0.6900309", "0.6900309", "0.6900309", "0.6900309", "0.6851658", "0.6833169", "0.6833007", "0.6832464", "0.6817151", "0.67906076", "0.6768253", "0.67672944", "0.67465115", "0.67269826", "0.67052215", "0.66817844", "0.66107297", "0.65498793", "0.65430194", "0.65351033", "0.65351033", "0.65243375", "0.65243375", "0.6516775", "0.6498762", "0.64857364", "0.6476799", "0.64684767", "0.64660585", "0.6458368", "0.6458368", "0.64560086", "0.64495164", "0.6437453", "0.64308584", "0.6395492", "0.63764673", "0.6374199", "0.6372866", "0.6344209", "0.63258606", "0.6296259", "0.6288217", "0.6267576", "0.6253149", "0.62436", "0.624252", "0.62332404", "0.621938", "0.62164855", "0.6212629", "0.6202052", "0.6200073", "0.6187154", "0.61684227", "0.61627555", "0.6156095", "0.6151179", "0.6134199", "0.61281013", "0.612493", "0.61208206", "0.6107589", "0.60930216", "0.60881954", "0.6086566", "0.6077726", "0.60708076", "0.6069219", "0.6061058", "0.606074", "0.60544777", "0.60543317", "0.60539263", "0.60495937", "0.6049254", "0.6044149", "0.59912443", "0.5988548", "0.59885037", "0.59811765", "0.59807855", "0.5941661", "0.5937714", "0.59361666", "0.59307873", "0.5930594", "0.59211963", "0.59197176" ]
0.63998497
46
Clear the context of the neuron, but keeps connections
def clear trace.elegibility.transform_values { |_| 0 } trace.extended.each_value do |ext| ext.transform_values { |_| 0 } end error.responsibility = error.projected = error.gated = 0 end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reset\n clear\n CONNECTION_TYPES.map { |ct| connections.send(ct) }.each do |conn_group|\n conn_group.each_value { |conn| conn.weight = rand * 0.2 - 0.1 }\n end\n\n @bias = rand * 0.2 - 0.1\n @old = @state = @activation = 0\n end", "def clear_all_connections!\n disconnect_read_pool!\n @original_handler.clear_all_connections!\n end", "def delete_all_connections!\n @connections.each { |cnx| cnx.parent = nil }\n @connections = []\n end", "def clear_active_connections!\n clear_cache!(@@active_connections) do |name, conn|\n conn.disconnect!\n end\n end", "def reset\n @context = nil\n end", "def clear_active_connections!\n self.ensure_ready\n self.connection_pool_list.each(&:release_connection)\n end", "def reset_connection!\n @connection = nil\n end", "def clear!\n contexts.clear\n end", "def clear!\n contexts.clear\n end", "def reset_context\n @context = nil\n end", "def clear\n connections.synchronize do\n connections.map(&:last).each(&closer)\n connections.clear\n end\n end", "def reset\n @config = nil\n @client = nil\n end", "def on_remove\n @context.notifications.off(\"graph.start\", self)\n @context.notifications.off(\"graph.stop\", self)\n\n io.outputs.each { |k, o| @context.connections.delete(o.guid) }\n io.unregister_inputs\n var.unregister\n stop\n end", "def reset!\n @cached_descriptions = nil\n @nodes = nil\n @cloud_nodes = nil\n end", "def clear\n patch.stop\n patch.connections = []\n patch.start\nend", "def clear\n @nodes = Hash.new\n @ways = Hash.new\n @relations = Hash.new\n end", "def clear_context\n @current_context = nil\n end", "def disconnect_all\n @connections.clear\n @readers.clear\n end", "def disconnect!() @connections.each_value(&:disconnect) end", "def clear_towers\n Node.destroy_all\n OutConnector.destroy_all\n InConnector.destroy_all\n end", "def clear\n @adjacencies[:in].clear\n @adjacencies[:out].clear\n @vertex = nil\n end", "def reset_connection!\n @@socket = nil\n end", "def clear_reloadable_connections!\n @reserved_connections.clear\n @connections.each do |conn|\n checkin conn\n conn.disconnect! if conn.requires_reloading?\n end\n @connections.delete_if do |conn|\n conn.requires_reloading?\n end\n @available.clear\n @connections.each do |conn|\n @available.add conn\n end\n end", "def reset\n @config = nil\n end", "def delete_all_active_connections\n super\n end", "def reset\n if config.isRecurrent\n @nn.resetRecurrentStates\n else\n puts \"Warning not a recurrent network. This does nothing\"\n end\n end", "def clear_reloadable_connections!\n synchronize do\n @reserved_connections.clear\n @connections.each do |conn|\n checkin conn\n end\n\n @connections.delete_if(&:finished?)\n\n @available.clear\n @connections.each do |conn|\n @available.add conn\n end\n end\n end", "def reset!\n clear_cache!(new_connection: true)\n reset_transaction\n configure_connection\n end", "def clear_reloadable_connections!\n @reserved_connections.each do |name, conn|\n checkin conn\n end\n @reserved_connections = {}\n @connections.each do |conn|\n conn.disconnect! if conn.requires_reloading?\n end\n @connections = []\n end", "def reset\n @protocols = {}\n @servers = {}\n @routes = {}\n @subscribers = {}\n @agents = {}\n @channels = {}\n end", "def clear_reloadable_connections!\n self.ensure_ready\n self.connection_pool_list.each(&:clear_reloadable_connections!)\n end", "def clear_graph\n @g_inputs = []\n end", "def reset\n @instance = nil\n @local_env = nil\n end", "def reset\n @instance = nil\n @local_env = nil\n end", "def clear_reloadable_connections!\n if @@allow_concurrency\n # With concurrent connections @@active_connections is\n # a hash keyed by thread id.\n @@active_connections.each do |thread_id, conns|\n conns.each do |name, conn|\n if conn.requires_reloading?\n conn.disconnect!\n @@active_connections[thread_id].delete(name)\n end\n end\n end\n else\n @@active_connections.each do |name, conn|\n if conn.requires_reloading?\n conn.disconnect!\n @@active_connections.delete(name)\n end\n end\n end\n end", "def clear!\n context_manager.clear!\n end", "def drop\n self.class.contexts_by_connection.delete connection\n self.class.no_connection_contexts.delete self\n super\n end", "def reset\n @bridge.reset\n end", "def reset!\n @context = [context[0]]\n end", "def reset\n self.configuration = ({})\n config_contexts.values.each(&:reset)\n end", "def clear_reloadable_connections!\n synchronize do\n @reserved_connections.clear\n @connections.each do |conn|\n checkin conn\n conn.disconnect! if conn.requires_reloading?\n end\n @connections.delete_if do |conn|\n conn.requires_reloading?\n end\n @available.clear\n @connections.each do |conn|\n @available.add conn\n end\n end\n end", "def reset\n @@config_instance = nil\n end", "def clear\n @genePool.clear\n @size = 0\n end", "def clear\n \n @hook_contexts.clear if @hook_contexts\n @execution_contexts.clear if @execution_contexts\n @cascade_contexts.clear if @cascade_contexts\n \n self\n \n end", "def clear\n @server.clear_data\n end", "def clear\n context.clear if Thread.current[NAME]\n self\n end", "def clear\n context.clear if Thread.current[NAME]\n self\n end", "def reset!\n default_tags.clear\n adapters.clear\n groups.each_key { |group| singleton_class.send(:remove_method, group) if group && respond_to?(group) }\n @groups = nil\n metrics.each_key { |metric| singleton_class.send(:remove_method, metric) if respond_to?(metric) }\n @metrics = nil\n collectors.clear\n configurators.clear\n instance_variable_set(:@configured_by, nil)\n instance_variable_set(:@debug_was_enabled_by, nil)\n end", "def clear\n self.request = nil\n end", "def reset\n @config = empty_config\n end", "def empty_connection_pools!; end", "def reset!\n return unless @connection.started?\n\n @connection.stop\n perform_setup\n end", "def turn_on\n connections.each(&:disconnect)\n @connections = []\n end", "def clear\n current_state.clear\n end", "def reset!\n sync do\n @global_id = 0\n @channels = {}\n end\n end", "def wipe_state\r\n @modes = nil\r\n @online = false\r\n end", "def unbind\n #@node.notifiers.unsubscribe(@notify_sid) if @notify_sid\n @node.command_connections.delete(self)\n end", "def reset!\n reset_endpoints!\n reset_routes!\n reset_validations!\n end", "def clear_state\n @state.clear\n self\n end", "def clear_request\n @url = nil\n @options = nil\n end", "def reset\n cleanup(true)\n end", "def cleanup_connections\n @connections.keep_if do |thread, conns|\n thread.alive?\n end\n end", "def cleanup\n super\n disconnect\n end", "def clear_model\n @panel.remove_all\n @connections.clear\n @entities.clear\n end", "def reset\n initialize\n @log = nil\n @default_model = nil\n end", "def clear()\n shutdown()\n @flows = {}\n _clear()\n end", "def reset\n @equations = nil\n @results = nil\n end", "def reset!\n logs.remove\n features.remove\n users.remove\n end", "def reset_ctx(ctx)\n each_value {|x| x.reset_ctx(ctx) }\n end", "def clear_current\n all_contexts.delete(Thread.current.object_id)\n end", "def clear!\n @handlers = {}\n @environments = {}\n @requests = []\n end", "def reset!\n self.instance_variables.each { |variable| instance_variable_set(variable, nil) }\n self\n end", "def disconnect!\n @reserved_connections.clear\n @connections.each do |conn|\n checkin conn\n conn.disconnect!\n end\n @connections = []\n @available.clear\n end", "def ll_clear()\n @head = nil\n @tail = nil\n @num_nodes = 0\n end", "def reset\n @params = nil\n @logger = nil\n end", "def clear\n instance_variables.each do |instance_variable|\n instance_variable_set(instance_variable, nil)\n end\n end", "def clear_relations\n each_event { |ev| ev.clear_relations }\n\t super()\n self\n\tend", "def reset!\n reconnect!\n end", "def disconnect\n disconnect_all\n end", "def reset\n configure({})\n end", "def resetValues\n @@multinode = nil\n @@serverList = nil\n @@proxy = nil\n @@serviceList = {}\n end", "def disconnect!\n @reserved_connections.each do |name,conn|\n checkin conn\n end\n @reserved_connections = {}\n @connections.each do |conn|\n conn.disconnect!\n end\n @connections = []\n end", "def clear\n\t\tif @active\n\t\t\t@active.cleanup\n\t\t\t@active = nil\n\t\tend\n\tend", "def disconnect_all\n @cache.values.map(&:clear_all_connections!)\n end", "def reset! # :nodoc:\n @params = nil\n @request = nil\n @headers = nil\n end", "def clear_current!\n @master_state.current_listener_pid = nil\n end", "def reset_all_nodes\n nodes.where(net_id: id).each do |node|\n node.output = 0\n node.total_input = 0\n node.save\n end\n end", "def reset\n # Conditions are now stale, so clear them\n clear_conditions\n\n # Connection is also stale\n clear_connection\n end", "def prefork_action! # TODO : refactor\n ActiveRecord::Base.clear_all_connections! rescue nil\n end", "def reset\n @routes.clear\n end", "def reset\n reset_adapters\n reset_config\n reset_handlers\n reset_hooks\n end", "def clear(context: Context.current)\n context.set_value(CORRELATION_CONTEXT_KEY, EMPTY_CORRELATION_CONTEXT)\n end", "def clear\n store.clear\n end", "def clean\r\n if @conns\r\n @conns.objects.each do |data|\r\n data[:object].clean if data[:object].respond_to?(\"clean\")\r\n end\r\n elsif @conn\r\n @conn.clean if @conn.respond_to?(\"clean\")\r\n end\r\n end", "def clear_app\n\t\t@routers_locker.synchronize {GReactor.clear_listeners; @routers.clear}\n\tend", "def clear!\n @active = false\n end", "def reset\n\n @active_controller = @hovered_controller = nil\n\n end", "def clear\n instance.clear\n end", "def reset_connection\n #close if \n @socket_server = nil\n connect\n end", "def clear() end", "def clear() end" ]
[ "0.69750744", "0.68641007", "0.6859631", "0.68322355", "0.66762996", "0.6586585", "0.6547873", "0.6530158", "0.6530158", "0.65037745", "0.6487778", "0.6469523", "0.64575016", "0.64548844", "0.6441063", "0.6431822", "0.64028084", "0.63972294", "0.63754034", "0.6353571", "0.6340491", "0.63252836", "0.62801397", "0.6248131", "0.6244866", "0.62375367", "0.6213777", "0.6205605", "0.61948293", "0.6171541", "0.6162045", "0.6157787", "0.6152484", "0.6152484", "0.61516285", "0.6148133", "0.61456656", "0.61363107", "0.6132637", "0.6116071", "0.61002105", "0.6072284", "0.6052987", "0.6048634", "0.6040283", "0.60394037", "0.60394037", "0.60337967", "0.6008929", "0.6002919", "0.59818006", "0.5970482", "0.5970209", "0.596387", "0.5959012", "0.5950711", "0.5946184", "0.59417456", "0.59413373", "0.5928454", "0.59219867", "0.5918062", "0.5914224", "0.59088373", "0.588454", "0.5867733", "0.5866469", "0.5865154", "0.58608204", "0.5859175", "0.5854115", "0.5852526", "0.58474874", "0.5844651", "0.584349", "0.5837241", "0.5831568", "0.5830083", "0.5825563", "0.58254194", "0.5805721", "0.5802759", "0.57889444", "0.57781863", "0.57772964", "0.5770402", "0.5766712", "0.5755974", "0.5751159", "0.57489264", "0.57461774", "0.5740152", "0.5737896", "0.57323235", "0.5731337", "0.5729259", "0.57286537", "0.5727299", "0.5715406", "0.57132787", "0.57132787" ]
0.0
-1
Clears traces and randomizes connections
def reset clear CONNECTION_TYPES.map { |ct| connections.send(ct) }.each do |conn_group| conn_group.each_value { |conn| conn.weight = rand * 0.2 - 0.1 } end @bias = rand * 0.2 - 0.1 @old = @state = @activation = 0 end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reset_oneconnect_statistics\n super\n end", "def clear\n patch.stop\n patch.connections = []\n patch.start\nend", "def reset_trace\n @trace = Relations::BidirectionalDirectedAdjacencyGraph.new\n @trace.add_vertex(@origin)\n end", "def reset\n @discovered_clients = nil\n end", "def clear\n connections.synchronize do\n connections.map(&:last).each(&closer)\n connections.clear\n end\n end", "def clear()\n shutdown()\n @flows = {}\n _clear()\n end", "def reset!\n @hosts = nil\n end", "def reset!\n default_tags.clear\n adapters.clear\n groups.each_key { |group| singleton_class.send(:remove_method, group) if group && respond_to?(group) }\n @groups = nil\n metrics.each_key { |metric| singleton_class.send(:remove_method, metric) if respond_to?(metric) }\n @metrics = nil\n collectors.clear\n configurators.clear\n instance_variable_set(:@configured_by, nil)\n instance_variable_set(:@debug_was_enabled_by, nil)\n end", "def reset_tcp_statistics\n super\n end", "def reset_stats; reset!; end", "def reset\n @protocols = {}\n @servers = {}\n @routes = {}\n @subscribers = {}\n @agents = {}\n @channels = {}\n end", "def reset\n @endpoints = Concurrent::Map.new\n end", "def clear_towers\n Node.destroy_all\n OutConnector.destroy_all\n InConnector.destroy_all\n end", "def stats_reset\n @stats = nil\n end", "def clear\n @adapter.clear.map { |impression| impression.update(ip: @config.machine_ip) }\n end", "def clear\n @client ||= {}\n @client.clear\n @client[:timers] = []\n @client[:counters] = []\n end", "def reset\n @config = nil\n @client = nil\n end", "def clear_tracking\n ::ObjectSpace.trace_object_allocations_clear\n end", "def reset_statistics!; end", "def reset_statistics!; end", "def reset\n probe_sets.each(&:reset)\n end", "def cleanup_dfs\n # clean up vertices attributes set during dfs\n @vertices.values.each do |vertex|\n vertex.color = nil\n vertex.predecessor = nil\n vertex.discovery = nil\n vertex.finish = nil\n end\n @time = 0\n end", "def disconnect_all\n @connections.clear\n @readers.clear\n end", "def reset()\n @rand_count = 0\n @sideup = nil\n end", "def clear_all_connections!\n disconnect_read_pool!\n @original_handler.clear_all_connections!\n end", "def reset\n total_calls.clear\n total_success_calls.clear\n total_failed_calls.clear\n end", "def disconnect_all\n @cache.values.map(&:clear_all_connections!)\n end", "def drop_buffered_data\n @stats_engine.reset!\n @error_collector.drop_buffered_data\n @transaction_sampler.reset!\n @transaction_event_recorder.drop_buffered_data\n @custom_event_aggregator.reset!\n @span_event_aggregator.reset!\n @log_event_aggregator.reset!\n @sql_sampler.reset!\n\n if Agent.config[:clear_transaction_state_after_fork]\n Tracer.clear_state\n end\n end", "def clear_all_callbacks!\n disconnect!\n clear_callbacks!\n end", "def clear\n @genePool.clear\n @size = 0\n end", "def reset!\n @cached_descriptions = nil\n @nodes = nil\n @cloud_nodes = nil\n end", "def reset\n @registry = {}\n @logging = false\n @line_item_limit = 1000\n end", "def reset_timings\n @instrument_store = nil\n end", "def clear!\n @adapters = []\n end", "def reset_all_statistics\n super\n end", "def reset\n @callbacks = []\n @closebacks = []\n end", "def flush_routes\n _init\n\n # Remove each of the individual routes so the comms don't think they're\n # still routing after a flush.\n self.routes.each { |r|\n if r.comm.respond_to? :routes\n r.comm.routes.delete(\"#{r.subnet}/#{r.netmask}\")\n end\n }\n # Re-initialize to an empty array\n self.routes = Array.new\n end", "def clear\n # clear the lineage\n @lineage.clear\n # if the visited hash is not shared, then clear it\n @visited.clear unless @options.has_key?(:visited)\n end", "def reset_udp_statistics\n super\n end", "def clear_collect_data; @collect_data = Hash.new; @collect_module = Hash.new; end", "def reset!\n sync do\n @global_id = 0\n @channels = {}\n end\n end", "def reset() end", "def clear_stats\n reset!\n NewRelic::Agent::BusyCalculator.reset\n end", "def clear() end", "def clear() end", "def reset\n @enabled = proc { |_env| Rails.env.development? || Rails.env.test? }\n @flamegraph_enabled = true\n @flamegraph_sample_rate = 0.5\n @logger = RailsMiniProfiler::Logger.new(Rails.logger)\n @skip_paths = []\n @storage = Storage.new\n @ui = UserInterface.new\n @user_provider = proc { |env| Rack::Request.new(env).ip }\n end", "def clear\n @now.clear\n @next.clear\n end", "def clear\n 1.upto(@gsize) do |j|\n 1.upto(@gsize) do |i|\n stone = @ban[j][i]\n stone.group.clear if stone.group\n end\n end\n # Collect all the groups and put them into @garbage_groups\n @killed_groups.shift # removes @@sentinel\n @merged_groups.shift # removes @@sentinel\n @garbage_groups.concat(@killed_groups)\n @garbage_groups.concat(@merged_groups)\n @killed_groups.clear\n @killed_groups.push(@@sentinel)\n @merged_groups.clear\n @merged_groups.push(@@sentinel)\n @num_groups = 0\n @history.clear\n end", "def delete_all_connections!\n @connections.each { |cnx| cnx.parent = nil }\n @connections = []\n end", "def reset!\n _central_mwares.clear\n _mwares.clear\n _before.clear\n _after.clear\n end", "def clear\n Thread.current[AGGREGATES_KEY] = nil\n end", "def clear\n Thread.current[AGGREGATES_KEY] = nil\n end", "def reset\n cleanup(true)\n end", "def detect_random_calls_to_reject\n if GuiConfig.random_disconnect_enable\n max_length = GuiConfig.random_disconnect_length\n flatten_calls.each do |call|\n next if call[:duration].to_i <= max_length\n\n @terminate_calls.merge!(call[:local_tag] => call) if rand(100) < 10\n end\n end\n end", "def clear\n @nodes = Hash.new\n @ways = Hash.new\n @relations = Hash.new\n end", "def reset; end", "def reset; end", "def reset; end", "def reset; end", "def reset; end", "def reset; end", "def reset; end", "def reset; end", "def reset; end", "def reset; end", "def reset; end", "def reset; end", "def reset; end", "def reset; end", "def reset; end", "def reset; end", "def reset; end", "def reset; end", "def reset\n @pauses_manager = Connection::PausesManager.new\n @coordinators.clear\n end", "def reset\n @agents.clear\n end", "def reset\n @client = nil\n end", "def reset_adapters\n @adapters = nil\n end", "def clear\n channels = @channels.dup\n @channels.clear\n channels\n end", "def clear_heartbeats\n Record.with(collection: \"#{self.class.name.demodulize.downcase}_heartbeat\") do |m|\n m.where(proprietor: { \"#{self.class.name.demodulize.downcase}_id\".to_sym => id }).delete\n end\n end", "def clear\n @server.clear_data\n end", "def reset\n @lp.reset\n @lp.set_duty_cycle(1, 4)\n @lp.double_buffer = true\n @lp.offline_updates = true\n clear\n end", "def reset\n VALID_CONFIG_KEYS.each do |k, v|\n send(\"#{k}=\".to_sym, v)\n end\n determine_logger\n\n self.web_type_collectors = []\n end", "def reset()\n #This is a stub, used for indexing\n end", "def reset()\n #This is a stub, used for indexing\n end", "def reset\n reset_adapters\n reset_config\n reset_handlers\n reset_hooks\n end", "def reset\n @lists = {}\n @references = {}\n @serialized = {}\n @graphs = {}\n @subjects = {}\n end", "def reset\n writeln('reset')\n clearQueue()\n end", "def empty_connection_pools!; end", "def reset\n initialize\n setup\n end", "def clear_reloadable_connections!\n @reserved_connections.each do |name, conn|\n checkin conn\n end\n @reserved_connections = {}\n @connections.each do |conn|\n conn.disconnect! if conn.requires_reloading?\n end\n @connections = []\n end", "def reset_metrics_buffer\n @@metrics_buffer = []\n end", "def reset\n @routes.clear\n end", "def clear; end", "def clear; end", "def clear; end", "def clear; end", "def clear; end", "def clear; end", "def clear; end", "def clear\n @track = []\n home\n end" ]
[ "0.6664129", "0.65102226", "0.63363385", "0.6218926", "0.6154794", "0.60806596", "0.60603154", "0.6031783", "0.6021906", "0.59948826", "0.59909064", "0.5952977", "0.59525317", "0.59307057", "0.59063745", "0.5905051", "0.5899698", "0.5886654", "0.58753353", "0.58753353", "0.58374363", "0.58366185", "0.5831086", "0.5829748", "0.5816868", "0.5772271", "0.5765291", "0.5746879", "0.57451326", "0.5742498", "0.5728736", "0.5708384", "0.56923044", "0.56918925", "0.56873703", "0.56609154", "0.5660298", "0.5659828", "0.5651371", "0.56446946", "0.56310964", "0.5624803", "0.5624065", "0.561911", "0.561911", "0.5601895", "0.5597906", "0.5593458", "0.5582914", "0.55764747", "0.557625", "0.557625", "0.55647993", "0.55589396", "0.55560297", "0.5550779", "0.5550779", "0.5550779", "0.5550779", "0.5550779", "0.5550779", "0.5550779", "0.5550779", "0.5550779", "0.5550779", "0.5550779", "0.5550779", "0.5550779", "0.5550779", "0.5550779", "0.5550779", "0.5550779", "0.5550779", "0.5548457", "0.554422", "0.5516846", "0.55130917", "0.55091274", "0.5500597", "0.54974735", "0.54918456", "0.5489479", "0.54886365", "0.54886365", "0.54861885", "0.54853976", "0.5483946", "0.5479738", "0.5477197", "0.54743975", "0.54703873", "0.5469409", "0.5464577", "0.5464577", "0.5464577", "0.5464577", "0.5464577", "0.5464577", "0.5464577", "0.54632026" ]
0.63049114
3
Hard codes the behavior of the neuron into an optimized function
def optimize(_optimized, _layer) raise 'TODO' end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def optimize\n operand\n end", "def optimize\n operand\n end", "def optimize\n operation.class.call(operand)\n end", "def evaluate\n @output_value = Math.tanh(@input_value - @bias)\n #p \"output value #{@output_value}\"\n @forward_nodes.each do |node, weight|\n #p \"weight #{weight} old input #{node.input_value}\"\n node.input_value += @output_value * weight\n #p \"new input #{node.input_value}\"\n end\n @input_value = 0\n end", "def optimize_every=(_arg0); end", "def calculate(nn)\n val = lambda do |curr, net, x, y|\n curr * 0.95 + 0.05 * (net.feed_forward([x, y]) * 280.0 - 140.0)\n end\n @z = (0...cols).map do |i|\n (0...rows).map do |j|\n val.call(z[i][j], nn, i * 1.0 / cols, j * 1.0 / cols)\n end\n end\n end", "def activate x\n\t\tcase @type\n\n\t\t#perceptron types\n\t\twhen :sigmoid\n\t\t\tsigmoid(x)\n\t\twhen :threshold\n\t\t\tthreshold(x)\n\t\twhen :tanh\n\t\t\ttanh(x)\n\t\twhen :none\n\t\t\tnone(x)\n\t\twhen :rectified_liniar_unit\n\t\t\trectified_liniar_unit(x)\n\t\twhen :leaky_rectified_liniar_unit\n\t\t\tleaky_rectified_liniar_unit(x)\n\t\twhen :radial_basis\n\t\t\tradial_basis(x)\n\n\t\t#I/O\n\t\twhen :input #no params\n\t\t\tnone(x)\n\t\twhen :output #no params\t\t\t\n\t\t\tnone(x)\n\t\telse\n\t\t\traise \"unknown node type: #{@type}\"\n\t\tend\n\tend", "def optimize\n operation.class.new(operand)\n end", "def optimize_every; end", "def optimize\n operation.class.call(left, right)\n end", "def optimize_workflow\n end", "def sigmoidal(activation_value)\n\tneuron_value=1/(1 + 2.71828 ** activation_value)\n\treturn neuron_value\nend", "def optimize\n wrap_operand\n end", "def nn\n end", "def optimize\n right\n end", "def optimize\n right\n end", "def optimize\n wrap_operand(operand)\n end", "def optimize\n wrap_operand(operand)\n end", "def optimize\n right\n end", "def optimize\n right\n end", "def optimize\n operation.class.new(left, right)\n end", "def feedforward(val)\n @output = val * weight # Compute output\n @sender = a.origin # Start animation at originating neuron\n @sending = true # Turn on sending\n end", "def algorithm=(_); end", "def algorithm=(_); end", "def algorithm=(_); end", "def algorithm=(_); end", "def minimize; end", "def optimize!\n rsp = post(\"<optimize/>\")\n success?(rsp.body) or log_error(rsp.body)\n end", "def optimizer\n @optimizer ||= Optimizer.new\n end", "def optimize\n operand.class.new(wrap_left, wrap_right)\n end", "def action_for code\n output = net.activate code\n nans = output.isnan\n # this is a pretty reliable bug indicator\n raise \"\\n\\n\\tNaN network output!!\\n\\n\" if nans.any?\n # action = output[0...6].max_index # limit to 6 actions\n action = output.max_index\n end", "def activate\n @output = (1.0 / (1.0 + Math.exp(-1 * self.weightedsum - @bias)))\n @output\n end", "def initialize(*)\n super\n @operand = optimize_operand\n end", "def process_defn(exp)\n make_function exp\n end", "def _naive_forecast(components, horizon)\n #\n # Computing the forecast for the naive model\n #\n return _trivial_forecast(components, horizon)\n\nend", "def delegated_calculation(calculation, lossless = false, *args)\n value = rgt_node.query.public_send(calculation, *args)\n\n if value\n loss_comp = lossless ? rgt_node.query.loss_compensation_factor : 1.0\n value * (output.conversion * loss_comp) * @edge.parent_share\n end\n end", "def activation_function(value)\n Math.tanh(value)\n end", "def cost(state)\n return fungsi(state[0], state[1])\nend", "def action_for observation\n # TODO: continuous actions (checked at `init_env`)\n input = observation.tolist.to_a\n # TODO: probably a function generator here would be notably more efficient\n # TODO: the normalization range depends on the net's activation function!\n output = net.activate input\n begin # NaN outputs are pretty good bug indicators\n action = output.max_index\n rescue ArgumentError, Parallel::UndumpableException\n puts \"\\n\\nNaN NETWORK OUTPUT!\"\n output.map! { |out| out = -Float::INFINITY if out.nan? }\n action = output.index output.max\n end\n end", "def optimise(number_of_generations = 0)\n previous_best = best_fitness\n\n # optimise\n if number_of_generations > 0\n evolve_n_times(number_of_generations)\n else\n optimise_by_strategy\n end\n\n @best_fitness = @fitness_evaluator.fitness(best)\n\n @best_fitness > previous_best\n end", "def tune(&block)\n clone().tune!(&block)\n end", "def perform_operator_adaptation(msisdn)\n end", "def cost_function start_morph, to\n @cost_function ||\n ->(point) {\n @metric.zip(to, lowest(start_morph.size)).inject(0) {|memo, x|\n single_metric, target_distance, low_boundary = x\n distance = single_metric.call(start_morph, point)\n unless @boundaries.nil?\n start_to_lowest = single_metric.call(start_morph, low_boundary)\n current_to_lowest = single_metric.call(point, low_boundary)\n if start_to_lowest > current_to_lowest\n distance *= -1.0\n end\n end\n memo += (distance - target_distance) ** 2\n } ** 0.5\n }\n end", "def propagate(rate = 0.1, target = nil)\n error = 0.0\n\n # Is neuron in output layer\n if !target.nil?\n # Eq. 10.\n @error.responsibility = @error.projected = target - @activation\n else\n # The rest of the neuron compute their error responsibilities by back-\n # propagation\n connections.projected.each_value do |connection|\n neuron = connection.to\n\n # Eq. 21.\n error +=\n neuron.error.responsibility * connection.gain * connection.weight\n end\n\n # Projected error responsibility\n @error.projected = @derivative * error\n\n error = 0.0\n # Error responsibilities from all the connections gated by this neuron\n trace.extended.each do |id, _|\n neuron = @neighbors[id] # gated neuron\n # If gated neuron's selfconnection is gated by this neuron\n influence = neuron.selfconnection.gater == self ? neuron.old : 0.0\n\n # Index runs over all th econnections to the gated neuron that are\n # gated by this neuron\n trace.influences[id].each do |input, infl|\n # Captures the effect that the input connection of this neuron have,\n # on a neuron which its input/s is/are gated by this neuron\n influence +=\n infl.weight *\n trace.influences[neuron.id][input].from.activation\n end\n\n # Eq. 22.\n error += neuron.error.responsibility * influence\n end\n\n # Gated error responsibility\n @error.gated = @derivative * error\n\n # Error responsibility - Eq. 23.\n @error.responsibility = @error.projected + @error.gated\n end\n\n connections.inputs.each_value do |input_neuron|\n # Eq. 24\n gradient = @error.projected * trace.elegibility[input_neuron.id]\n trace.extended.each do |id, _|\n neuron = neighbors[id]\n gradient +=\n neuron.error.responsibility *\n trace.extended[neuron.id][input_neuron.id]\n end\n\n # Adjust weights - aka. learn\n input_neuron.weight += rate * gradient\n end\n\n # Adjust bias\n @bias += rate * @error.responsibility\n end", "def optimize(**options)\n operands.last.optimize(**options)\n end", "def initialize(target_proc: nil, input_proc: nil, bias_neuron: 2.0,\n number_of_medial_neurons: 40, learning_rate: 0.01)\n @input_proc = input_proc || -> { [rand, rand * 2 * Math::PI] }\n @target_proc = target_proc || -> (r, a) { Complex.polar(r, a).rectangular }\n\n @number_of_inputs = input_proc.call.length\n @number_of_inputs += 1 if bias_neuron != nil\n\n @number_of_outputs = target_proc.call(*input_proc.call).length\n\n @number_of_medial_neurons = number_of_medial_neurons\n\n @learning_rate = learning_rate\n @bias_neuron = bias_neuron\n @average_error = nil\n @training_iterations = 0\n\n # Initialize the synapse weightings using random numbers\n # `@synone` contains the synapse weights between every input neuron and every\n # medial neuron.\n # `@syntwo` contais the synapse weights between every medial neuron and every\n # output neuron.\n @synone = @number_of_inputs.times.map { @number_of_medial_neurons.times.map { 0.1 * rand } }\n @syntwo = @number_of_medial_neurons.times.map { @number_of_outputs.times.map { 0.1 * rand } }\n end", "def update_weight(target, ouput, weight)\n @eta * (target - output) * weight\n end", "def evaluate!(input_set)\n # FEED FORWARD\n # 1. Apply input vectors to input neurons\n input.each.with_index do |neuron, j|\n neuron.net_input = input_set[j]\n end\n\n # 2, 3, 4. Calculate the net input values to the hidden neurons\n # Calculate the outputs from the hidden layer neurons\n # Calculate the net input values for the output layer\n (hidden + [output]).each do |layer|\n layer.each do |neuron|\n sum = neuron.predecessors.inject(0) do |acc, pred|\n acc + pred.output * neuron.edge(pred)\n end\n neuron.net_input = neuron.bias_weight + sum\n end\n end\n\n # 5. Calculate the output values for the output layer\n output.map(&:output)\n end", "def optimize\n operation.class.reverse.new(right, left)\n end", "def smoothing=(_arg0); end", "def initialize(network_structure)\n @structure = network_structure\n @initial_weight_function = lambda { |n, i, j| ((rand 2000)/1000.0) - 1}\n @propagation_function = lambda { |x| 1/(1+Math.exp(-1*(x))) } # lambda { |x| Math.tanh(x) } #\n @derivative_propagation_function = lambda { |y| y*(1-y) } # lambda { |y| 1.0 - y**2 } #\n @disable_bias = false\n @learning_rate = 0.25\n @momentum = 0.1\n end", "def optimize\n left\n end", "def optimize\n left\n end", "def optimize\n left\n end", "def _nydp_callable src ; self ; end", "def backpropagate\n\t\t# calculate output errors\n\t\toutput_error = []\n\t\t@layers[2].neurons.each_with_index do |neuron, index|\n\t\t\terror = @expected_output[index] - neuron.value\n\t\t\toutput_error[index] = dtanh(neuron.value) * error\n\t\tend\n\n\t\t# calculate hidden errors\n\t\thidden_error = []\n\t\t@layers[1].neurons.each_with_index do |neuron, index|\n\t\t\terror = 0.0\n\t\t\tindex_helper = 0\n\t\t\tneuron.arrows.each do |arrow|\n\t\t\t\terror = error + output_error[index_helper] * arrow.weight\n\t\t\t\tindex_helper += 1\n\t\t\tend\n\t\t\thidden_error[index] = dtanh(neuron.value) * error\n\t\tend\n\n\t\t#update arrow weights going to outputs\n\t\t@layers[1].neurons.each do |neuron|\n\t\t\tneuron.arrows.each_with_index do |arrow, i|\n\t\t\t\tchange = output_error[i] * neuron.value\n\t\t\t\tarrow.weight = arrow.weight + change\n\t\t\tend\n\t\tend\n\t\t\n\t\t#update arrow weights going to hidden layer\n\t\t@layers[0].neurons.each do |neuron|\n\t\t\tneuron.arrows.each_with_index do |arrow, i|\n\t\t\t\tchange = hidden_error[i] * neuron.value\n\t\t\t\tarrow.weight = arrow.weight + change\n\t\t\tend\n\t\tend\n\tend", "def testFullFunctions\n @pn.makeNetworks()\n f = @pn.networks.first\n assert_equal( '-x2^2*x3^2+x2^2*x3+x1', f[0] )\n assert_equal( 'x2^2*x3^2-x2^2*x3+x2', f[1])\n assert_equal( '-x2^2*x3^2+x2^2*x3+x3', f[2])\n end", "def op; end", "def strategy=(_arg0); end", "def alg; end", "def prepare_network\n @neural_net = RubyFann::Standard.new(num_inputs: @nuerons_number,\n hidden_neurons: [(2 * @nuerons_number) / 3],\n num_outputs: @nuerons_number)\n end", "def throttle_discriminator_normalizer=(_arg0); end", "def propagation_fn(x) 1/(1+Math.exp(-x)) end", "def smoothing; end", "def process_iasgn exp\n exp = exp.dup\n exp.rhs = process exp.rhs\n exp\n end", "def train\n @weights.each_index do |i| \n # alter weight and apply momentum\n @weights[i] = @weights[i] + (@rate * inputs[i] * @gradient)\n @weights[i] = @weights[i] + @momentum * @lastchange\n \n @lastchange = @rate * inputs[i] * @gradient\n end\n @weights\n end", "def act_fun(pnum, jnum, signal, signal_hash, nodes, jokes)\n\talpha_decay = 1.5\n\tbegin\n\t\tsh = signal_hash[[jnum,pnum]]\n\t\tdiv_factor = signal.to_f ** alpha_decay\n\t\tnd = normdist(jokes[jnum],nodes[pnum])\n\t\tout = sh * ((nd * 2) / div_factor) / sh\n\t\tout\n\trescue\n\t\t0\n\tend\nend", "def standard_cost_code; end", "def simulatedAnnealing(is,cS,cC,bSolution,bCost,temp,final_temp,alpha)\n #membuat array untuk menampung setiap solusi\n solusiTemp = {}\n solusiBestSolution = {}\n solusiBestCost= {}\n j=1 #insisialisasi\n while temp > final_temp do\n\n for i in 1..100\n #memunculkan bilangan random untuk perbandingan sekarang dengan yang baru\n x11 = fungsiRandom()\n x22 = fungsiRandom()\n nS = [x11,x22] #state baru\n nC = cost(nS) #perhitungan fungsi dari state baru\n end\n if nC < cC then #membandingkan costBaru dengan costSekarang\n cS = nS\n cC = nC\n if cC < bCost then #jika costBaru lebih kecil dari costSekarang maka bandingkan dengan bestCost\n bSolution = cS\n bCost = cC\n end\n else #jika tidak maka diliat nilai probab\n #ilitasnya lalu bandignkan dengan nilai random(0,1)\n if (prob(nC,cC,temp) > fungsiRandom01()) then\n cS = nS\n cC = nC\n end\n #menampung solusi\n solusiTemp[j] = temp\n solusiBestSolution[j] = bSolution\n solusiBestCost[j] = bCost\n end\n j = j+1\n temp = temp * alpha #Menghitung penentu iterasi temperatur\n end\n xx = solusiTemp[solusiTemp.length]\n y = bSolution\n z = bCost\n #mengembalikan nilai solusi\n return solusiTemp,solusiBestSolution,solusiBestCost,xx,y,z\n\nend", "def optimize\n left\n end", "def optimize\n left\n end", "def set_objective(variables_with_weights)\n @objective = variables_with_weights\n end", "def execute_best_swap graph\n gain,swap = execute_swap graph\n compute_swap\nend", "def pedal_Faster\n current_Speed => 10\nend", "def apply()\n end", "def evaluate\n\n end", "def optimize_right\n Function.optimize_operand(operation.right)\n end", "def initialize(*)\n super\n @predicate = Function.optimize_operand(operation.predicate)\n end", "def camaleon_image_optimizer_on_active(plugin)\n end", "def fit=(_arg0); end", "def initialize(inputNodes, hiddenNodes, outputNodes, learningRate=0.3, momentum=0.2)\n # Make sure we add the bias node to the input\n @inputNodes = inputNodes + 1\n @hiddenNodes = hiddenNodes\n @outputNodes = outputNodes\n\n @learningRate = learningRate\n @momentum = momentum\n\n @w_1 = NeuralNetwork::create_matrix(@inputNodes, @hiddenNodes, 0.0)\n @w_2 = NeuralNetwork::create_matrix(@hiddenNodes, @outputNodes, 0.0)\n \n # Randomize the values of Nthe nodes [-0.5, 0.5]\n @w_1.map! { |arr| arr.map { |v| rand(-0.5..0.5) } }\n @w_2.map! { |arr| arr.map { |v| rand(-0.5..0.5) } }\n\n # It helps to store the current state of node activations\n @activation_input = [1.0] * @inputNodes\n @activation_hidden = [1.0] * @hiddenNodes\n @activation_output = [1.0] * @outputNodes\n\n @din = NeuralNetwork::create_matrix(@inputNodes, @hiddenNodes, 0.0)\n @dout = NeuralNetwork::create_matrix(@hiddenNodes, @outputNodes, 0.0)\n\n puts \"\\n================================================================================================\\n[+]Weights from input to hidden nodes [#{@inputNodes}x#{@hiddenNodes}] has been initialized with small random values\"\n puts \"[+]Weights from hidden to output nodes [#{@hiddenNodes}x#{@outputNodes}] has been nitialized to small random values\\n================================================================================================\\n\"\n\n puts \"Neural network initialized with values \\n \\t Input Nodes:[{#{@inputNodes}]\\t Hidden Nodes: [#{@hiddenNodes}]\\t Output Nodes: [#{@outputNodes}]} \\n--------------------------------------------------------------------------------\\n\"\n puts \"\"\n\n end", "def modeler_description\r\n return \"objective function\"\r\n end", "def modeler_description\r\n return \"objective function\"\r\n end", "def value(dendrites_array,num)\n\t\t\tx=activation(dendrites_array,num)\n\t\t\t@value=sigmoidal(x)\n\t\tend", "def value(dendrites_array,num)\n\t\t\tx=activation(dendrites_array,num)\n\t\t\t@value=sigmoidal(x)\n\t\tend", "def optimize(**options)\n if operand(0).is_a?(Variable) && operand(0).bound? && operand(0).eql?(operand(1))\n RDF::Literal::TRUE\n else\n super # @see Operator#optimize!\n end\n end", "def optimize\n raise Runtimeerror.new( 'only terminated workflows can be validated') unless @terminated\n @optimizations = 0\n puts\n puts \"Start optimization of Workflow '#{ label }'\"\n optimize_workflow\n puts \"No of optimized transition states: #{ @optimizations }\"\n puts\n end", "def run(number = 1)\n number.times do\n break if associated?\n update_next_neuron\n @associated = true if minimal_energy? or known_sample?\n end\n current\n end", "def optimize_left\n Function.optimize_operand(operation.left)\n end", "def fitness_one genotype, env: single_env, render: false, nsteps: max_nsteps, aggr_type: :last\n puts \"Evaluating one individual\" if debug\n puts \" Loading weights in network\" if debug\n net.deep_reset\n net.load_weights genotype\n observation = env.reset\n # require 'pry'; binding.pry unless observation == env.reset_obs # => check passed, add to tests\n env.render if render\n tot_reward = 0\n # # set of observations with highest novelty, representative of the ability of the individual\n # # to obtain novel observations from the environment => hence reaching novel env states\n # represent_obs = []\n\n puts \"IGNORING `nobs_per_ind=#{nobs_per_ind}` (random sampling obs)\" if nobs_per_ind\n represent_obs = observation\n nobs = 1\n\n puts \" Running (max_nsteps: #{max_nsteps})\" if debug\n runtime = nsteps.times do |i|\n code = compr.encode observation\n # print code.to_a\n selected_action = action_for code\n obs_lst, rew, done, info_lst = env.execute selected_action, skip_frames: skip_frames\n # puts \"#{obs_lst}, #{rew}, #{done}, #{info_lst}\" if debug\n observation = OBS_AGGR[aggr_type].call obs_lst\n tot_reward += rew\n ## NOTE: SWAP COMMENTS ON THE FOLLOWING to switch to novelty-based obs selection\n # # The same observation represents the state both for action selection and for individual novelty\n # # OPT: most obs will most likely have lower novelty, so place it first\n # # TODO: I could add here a check if obs is already in represent_obs; in fact\n # # though the probability is low (sequential markovian fully-observable env)\n # novelty = compr.novelty observation, code\n # represent_obs.unshift [observation, novelty]\n # represent_obs.sort_by! &:last\n # represent_obs.shift if represent_obs.size > nobs_per_ind\n\n # Random sampling for representative obs\n nobs += 1\n represent_obs = observation if rand < 1.0/nobs\n\n # Image selection by random sampling\n\n env.render if render\n break i if done\n end\n compr.train_set << represent_obs\n # for novelty:\n # represent_obs.each { |obs, _nov| compr.train_set << obs }\n puts \"=> Done! fitness: #{tot_reward}\" if debug\n # print tot_reward, ' ' # if debug\n print \"#{tot_reward}(#{runtime}) \"\n tot_reward\n end", "def tune(&block)\n deep_clone.tune!(&block)\n end", "def weight; end", "def optimize(image_path)\n print_status(\"Optimizing #{image_path}, this may take a while...\")\n ImageOptimizer.new(image_path, quiet: true).optimize\nend", "def apply\n\t\t\n\tend", "def apply\n\t\t\n\tend", "def converge(state) ; end", "def optimize\n\t\t@bio = Bio.where(:user_id => current_user.id).last \n\t\t@player_pool = params[:player_pool]\n\n\t\t#Call Python or R function to run linear programming optimiziation and return optimal team\n\t\t#Step is skipped for now\n\n\t\t# store team in database\n\t\t# enter transaction into database\n\n\t\trender(\"sports/optimize/\", :notice => \"Successfully optmized one team\")\n\tend", "def optimize=(value)\n set_attr(:optimize, value ? 2 : 1)\n @optimize = value\n end", "def minimize\n # create a new one, or modify the current one in place,\n # and return it\n FiniteAutomaton.new \n end", "def process_defn(exp)\n raise if @result_name\n method_name = exp.shift || raise\n exp = exp.shift || raise\n\n method_body = want_result do\n case exp.first\n when :ivar\n process(s(:block, exp))\n when :attrset\n process(s(:block, s(:args, :_), s(:iasgn, exp[1], s(:lvar, :_))))\n when :scope, :block, :fbody\n process(exp)\n else\n raise\n end\n end\n\n str = \"\"\n\n if @argument_variables.empty?\n str << \"function(){\"\n else\n args_str = ([block_name()] + @arguments_no_splat).join(\",\")\n str << \"function(#{args_str}){\"\n end\n\n raise if @local_variables.include?(@model.encode_self)\n raise if @argument_variables.include?(@model.encode_self)\n\n #\n # Add \"self\" to the local variables\n #\n @local_variables.add(@model.encode_self)\n @local_variables_need_no_initialization.add(@model.encode_self)\n\n #\n # declare local variables (except arguments)\n #\n to_declare = (@local_variables - @argument_variables).to_a\n to_declare << @result_name if @result_name\n unless to_declare.empty?\n str << \"var \" + to_declare.join(\",\") + sep()\n end\n\n #\n # initialize all local variables (that need initialization) to nil\n #\n to_initialize = (@local_variables - @argument_variables - @local_variables_need_no_initialization).to_a\n to_initialize << @result_name if @result_name\n unless to_initialize.empty?\n str << to_initialize.join(\"=\")\n str << \"=#{@model.encode_nil}#{sep()}\"\n end\n\n #\n # initialize \"self\"\n #\n str << \"#{@model.encode_self}=this#{sep()}\"\n\n #\n # If a block argument is given (&block) convert it to nil if it is\n # undefined. \n #\n if @block_arg_name\n str << \"#{@block_arg_name}=#{block_name()}==null?#{@model.encode_nil}:#{block_name()}#{sep()}\"\n end\n\n #\n # generate initialization code for each read instance variable\n #\n @read_instance_variables.each do |iv|\n str << \"if(#{@model.encode_self}.#{iv}==null)#{@model.encode_self}.#{iv}=#{@model.encode_nil}#{sep()}\"\n end\n\n # \n # Used in a zsuper call to refer to the methods \"arguments\"\n # \"arguments\" itself does not work due to iterators using functions.\n if @arguments_name\n str << \"var #{@arguments_name}=arguments#{sep()}\"\n end\n\n method_body << \"#{sep()}return #{@result_name}\" if @result_name\n\n if @iterators_used\n str << \"try{\" \n str << method_body \n\n #\n # Declare variable x?\n # No, catch introduced a new scope, so we don't have to\n # use a local or temporary variable here! \n #\n x = exception_name()\n iter_jump = @model.encode_globalattr(\"iter_jump\")\n return_value = @model.encode_attr(\"return_value\")\n scope = @model.encode_attr(\"scope\")\n uid = unique_method_scope()\n\n str << \"}catch(#{x}){\"\n # scope == null or scope == uid\n str << \"if(#{x} instanceof #{iter_jump} && (!#{x}.#{scope} || #{x}.#{scope}==#{uid}))return #{x}.#{return_value}#{sep()}\"\n str << \"throw(#{x})}\"\n else\n str << method_body\n end\n\n str << \"}\"\n\n return str\n end" ]
[ "0.6431355", "0.63889474", "0.63387406", "0.6284766", "0.61817074", "0.5959719", "0.58540237", "0.58300173", "0.5736978", "0.5664543", "0.5646727", "0.5642759", "0.56403196", "0.55940276", "0.5549522", "0.5549522", "0.55337155", "0.55337155", "0.54817295", "0.54817295", "0.54687726", "0.5443752", "0.54409903", "0.54409903", "0.54409903", "0.54409903", "0.5439739", "0.540532", "0.53725886", "0.53713775", "0.53571856", "0.5346795", "0.53437924", "0.53271216", "0.5327027", "0.5326473", "0.5325092", "0.52707267", "0.52635473", "0.52563757", "0.52509683", "0.523931", "0.52299106", "0.52163595", "0.520545", "0.5195625", "0.5183193", "0.5176327", "0.5162493", "0.5159316", "0.51571465", "0.51551795", "0.51551795", "0.51551795", "0.5152564", "0.51506394", "0.514345", "0.51224273", "0.51220125", "0.5112638", "0.51096565", "0.51062334", "0.50987875", "0.5095505", "0.5091484", "0.5087696", "0.506454", "0.50566864", "0.5047031", "0.5024607", "0.5024607", "0.50120384", "0.49986187", "0.49976516", "0.49871194", "0.4985573", "0.4962281", "0.49530223", "0.49509108", "0.4945231", "0.49388045", "0.49381927", "0.49381927", "0.49361745", "0.49361745", "0.49277717", "0.49179566", "0.49159026", "0.49131066", "0.49010122", "0.4899845", "0.48968542", "0.48960584", "0.48892832", "0.48892832", "0.4882297", "0.48705608", "0.4850122", "0.4849543", "0.48486975" ]
0.61065584
5
Returns the next id in the sequence
def uid @neurons += 1 end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def next_sequence_id\n last_sequence_id + 1\n end", "def next_id\n @id ||= 0\n @id += 1\n end", "def next_id\n id = nil\n MinterState.transaction do\n state = read\n minter = ::Noid::Minter.new(state)\n id = minter.mint\n write!(minter)\n end # transaction\n id\n end", "def next_id\n (@curr_id +=1).to_s\n end", "def next_id\n COUNTER_LOCK.synchronize do\n @@id_counter += 1\n end\n end", "def next_id\n self[:next_id]\n end", "def next_id\n @next_id = ((start...(start + size)).to_a - leases.map { |l| l.id }).first\n end", "def next_id\n (all.map(&:id).max || 0) + 1\n end", "def _next_id\n @@id -= 1\n @@id\n end", "def next_id\n next_id = \"sdc:\" + (current_id.to_i + 1).to_s\n next_id\n end", "def next_id(options = {})\n raise \"Needs implementation :-)\"\n end", "def next_id\n @imutex.synchronize do\n @mid += 1\n end\n end", "def next_id\n self.latest_id += 1\n end", "def next_sequence_value(sequence_name)\n select_one(\"select #{sequence_name}.nextval id from dual\")['id']\n end", "def get_next_id\n id = java.lang.System.nanoTime.to_s\n $log.info(\"*** get_next_id: \" + id)\n return id\n end", "def get_next_id\r\n id = java.lang.System.nanoTime.to_s\r\n $log.info(\"*** get_next_id: \" + id)\r\n return id\r\n end", "def read_next_id\n id = nil\n list = current_list\n\n if @co_index <= list.size\n id = list[@co_index - 1][:id]\n end\n\n @co_index += 1\n\n id\n end", "def next_sequence_number\n last_sequence_number ? last_sequence_number.next : 0\n end", "def next_number\n Sequence.next_val\n end", "def next_identifier\n if @identifier >= @max_identifier\n @identifier = 1\n else\n @identifier += 1\n end\n end", "def next_available_id\n last_id = all_ids.map do |key|\n key.sub(\"#{self.name}_\", \"\").to_i\n end.max.to_i\n\n last_id + 1\n end", "def next_id(items)\n max_id = items.map { |item| item[:id] }.max || 0\n max_id + 1\nend", "def next_seq\n @seq = (@seq + 1) & 0xffffffff\n end", "def get_next\n r = nil\n iterator_lock do\n if @iterator <= @last_id\n r = get(@iterator)\n @iterator += 1\n @iterator_file.write(\"#{@iterator.to_s(36)}\\n\")\n r\n else\n nil\n end\n end\n end", "def next_id\n next_chapter = Chapter.where(\"book_id=? and section_id=? and sequence>=? and id<>?\",self.book_id,self.section_id,self.sequence,self.id).order(\"sequence asc\").limit(1)\n if next_chapter.count==0\n next_chapter = Chapter.where(\"book_id=? and section_id>? \",self.book_id,self.section_id).order(\"sequence asc\").limit(1)\n end\n \n if next_chapter.count==1\n next_chapter.first.id\n else\n 0\n end\n \n end", "def next_id(obj)\n current_value = get_current_value(obj.class.name)\n new_value = current_value.next\n @id[obj.class.name] = new_value\n new_value\n end", "def next_journal_id\r\n id = journal_ids.max { |p,q| p <=> q }\r\n id.nil? ? 1 : id + 1\r\n end", "def generate_id\n id = @id\n @id += 1\n id\n end", "def next_id=(id)\n self[:next_id] = id\n end", "def getNextSequence(table,db)\n\t\tif db[table].count == 0\n\t\t\treturn 1\n\t\telse\n\t\t\tdb[table].find().sort(_id: -1).limit(1).each do |document|\n\t\t\t\treturn document[:_id]+1\n\t\t\tend\n\t\tend\n\tend", "def get_id\n @id ||= 0\n @id += 1\n @id\n end", "def next_id\n self.class.where(\"id > ? and quiz_id = ?\", self.id, self.quiz_id).pluck(:id).first\n end", "def next_job_id\n new_id = rand(10*5)\n get_job_status(new_id).nil? ? new_id : next_job_id\n end", "def next\n self.class.where('id > ?', id).first\n end", "def next_sequence_number!\n sequence_number && @sequence_number += 1\n end", "def next_output_id\n next_id = @last_output_id\n @last_output_id += 1\n next_id\n end", "def uid_next(sequence_name)\n uid_next_with_index(sequence_name).uid\n end", "def next\n\t\tself.class.where(\"id > ?\", id).first\n\tend", "def next_id(*args)\n with_redis { |redis| redis.incr(redis_id_seq_key(*args)) }\n end", "def next_todo_id(todos)\n max = todos.map { |todo| todo[:id] }.max || 0\n max + 1\nend", "def next\n \tself.class.where(\"id > ?\", id).first\n \tend", "def next_team_id\r\n id = team_ids.max { |p,q| p <=> q }\r\n id.nil? ? 1 : id + 1\r\n end", "def next_id!\n\t\t\t# Using sequential numbers for the query ID is generally a bad thing because over UDP they can be spoofed. 16-bits isn't hard to guess either, but over UDP we also use a random port, so this makes effectively 32-bits of entropy to guess per request.\n\t\t\tSecureRandom.random_number(2**16)\n\t\tend", "def next_serial_number\n serial = permute(permute(@offset % BOUNDARY))\n @offset += STEP\n serial\n end", "def next_sequence_value(sequence_name)\n @connection.query(\"SELECT NEXT VALUE FOR #{sequence_name} FROM RDB$DATABASE\")[0][0]\n end", "def generate_id\n @mutex.synchronize { @current_id += 1 }\n end", "def next_request_id\n @next_request_mutex.synchronize do\n request_id = @next_request_id\n @next_request_id += 1\n return request_id\n end\n end", "def get_next_childid\n\t\tStudySubject.maximum(:childid).to_i + 1\n\tend", "def next_messages_id\n messages.max{|a,b| a[:id] <=> b[:id]}[:id] + 1\nend", "def next_stream_id\n\t\t\t\tid = @local_stream_id\n\t\t\t\t\n\t\t\t\t@local_stream_id += 2\n\t\t\t\t\n\t\t\t\treturn id\n\t\t\tend", "def get_next_sub_id\n\n env = get_root_environment\n\n c = nil\n\n c = env.variables[:next_sub_id]\n n = if c\n c + 1\n else\n c = 0\n 1\n end\n env.variables[:next_sub_id] = n\n env.store_itself\n\n c\n end", "def get_next_id\n id = 0\n contacts = read_contacts\n contacts.each do |contact|\n if id < contact[:id]\n id = contact[:id]\n end\n end\n id + 1\nend", "def get_next_channel_id; end", "def next_group_id\n if @groups.empty?\n # Start each time from 1 to make sure groups get the same id's for the\n # same input data\n 1\n else\n id = @groups.last.id\n loop do\n id += 1\n break id if @groups.find { |g| g.id == id }.nil?\n end\n end\n end", "def next_list_id(lists)\n max = lists.map { |list| list[:id] }.max || 0\n max + 1\nend", "def get_next_patid\n\t\tStudySubject.maximum(:patid).to_i + 1\n#\n#\tWhat happens if/when this goes over 4 digits? \n#\tThe database field is only 4 chars.\n#\n\tend", "def next_uid()\n\t\t\treturn @metadata.attributes[:next_uid].to_i\n\t\tend", "def get_next_membership_number\n self.class.connection.execute(\"SELECT nextval('membership_number_seq')\").getvalue(0, 0).to_s\n end", "def next_message_id\n if not @message_id\n @message_id = 1\n else\n @message_id += 1\n end\n\n @message_id < (1 << (4*8)) ? @message_id : (@message_id = 1)\n end", "def nextSeqNum()\n $sequence_num = ($sequence_num + 1) % 256\n return $sequence_num\nend", "def next_sequence_value _sequence_name\n SecureRandom.uuid.gsub(\"-\", \"\").hex & 0x7FFFFFFFFFFFFFFF\n end", "def next\n return Question.find_by(id: self.id + 1)\n end", "def next_match_number\n # This returns a PGresult object\n # [http://rubydoc.info/github/ged/ruby-pg/master/PGresult]\n result = Match.connection.execute(\"SELECT nextval('match_number_seq')\")\n result[0]['nextval']\n end", "def increment_id!\n self.id = (self.id + 1) % 0x10000\n end", "def next\n self.class.where(\"id > ?\", id).where(:punto_venta_id => self.punto_venta_id).first\n end", "def next!\n id = @counter.next!\n id = @counter.next! while @map[id]\n register id\n end", "def next_message_id\n if max_message_id = redis.get('max_message_id')\n next_id = max_message_id.to_i + 1\n else\n next_id = 1\n end\n\n redis.set('max_message_id', next_id)\n next_id\n end", "def next_auto_increment\n if Visit.count > 0\n Visit.last.id + 1\n else\n tmp_visit = Visit.create(evid: \"00000000-0000-0000-0000-000000000000\")\n auto_increment = tmp_visit.id + 1\n tmp_visit.delete\n auto_increment\n end\n end", "def next_value_for_sequence(sequence_name)\n %{#{sequence_name}.nextval}\n end", "def get_sequence_id\n number = @sequence_id\n @sequence_id += 1\n [number, @client_id]\n end", "def generate_id\n id = @ids.first[:count]\n @ids.where(:id => 1).update(:count => id + 1)\n id\n end", "def new_id\n @last_id ||= 0\n @last_id += 1\n end", "def new_id\n @last_id ||= 0\n @last_id += 1\n end", "def next_key\n @next && @next.key\n end", "def next_message_id\n @message_id += 1\n end", "def next_message_id\n @message_id += 1\n end", "def next_temp_id\n @id ||= ASSET_GROUP_TEMPORARY_ID.to_i\n @id -= 1\nend", "def next_sequence_value(sequence_name)\n FireRuby::Generator.new(sequence_name, @connection).next(1)\n end", "def generate_message_id\n @@next_message_id += 1\n end", "def new_id\n @last_id ||= 0\n @last_id += 1\n end", "def next_uid\n LdapUser.all(limit: 1, sort_by: :uidnumber, order: :desc).first[:uidnumber]+1\n end", "def sequence_id\n object.sequence._id.to_s\n end", "def generate_new_id()\n\t\tbegin\n\t\t\t(id = rand(9000)+1000)\n\t\tend while @objects[id]\n\t\treturn id\n\tend", "def next\n \t\tNote.where([\"id > ?\", self.id]).first\n\tend", "def inc_seq_no!()\n @seq_no += 1\n return(nil)\n end", "def next?\n next_id != '0'\n end", "def next_expiration_id\n elems = handle.retrieve_elements('USER_TEMPLATE/SCHED_ACTION/ID')\n return 0 unless elems\n elems.to_a.max.to_i + 1\n end", "def next\n\t\tself + 1\n\tend", "def id\n Id.new(@head.fetch[2])\n end", "def make_id\n new_id = @id\n @id += 1\n new_id\n end", "def mint\n Mutex.new.synchronize do\n loop do\n pid = next_id\n return pid unless identifier_in_use?(pid)\n end\n end\n end", "def next_serial_number\n size + 1\n end", "def last_insert_id(sequence_name)\n r = exec_query(\"SELECT currval('#{sequence_name}')\", 'SQL')\n Integer(r.rows.first.first)\n end", "def next_phase\n next_phase = Phase.where(\"`order` > #{order}\").order(:order).limit(1).first\n next_phase_id = next_phase.id if next_phase\n next_phase_id\n end", "def new_id\n id = (@xid_next ||= 0)\n @xid_next += 1\n\n (id & @internal.resource_id_mask) | @internal.resource_id_base\n end", "def next\n last? ? nil : locate + 1\n end", "def make_next_seq_no\n if EdiHelper.current_out_is_cumulative || @return_a_string\n @out_seq = 1\n else\n @out_seq = MesControlFile.next_seq_edi(MesControlFile.const_get(\"EDI_#{@flow_type.upcase}\"))\n @seq_increased = true\n end\n @formatted_seq = sprintf('%03d', @out_seq)\n end", "def next\n @next ||= Changeset.where([\"id > ? AND repository_id = ?\", id, repository_id]).order('id ASC').first\n end", "def get_next()\n\t\t\treturn @next\n\t\tend", "def uid_next\n uid_last = execute(\"dscl . -list /Users UniqueID | sort -k 2 -g | tail -1 | awk '{print $2}'\")\n uid_last.to_i + 1\n end", "def next\n Expression.where('id > ? AND collection_id = ?', self.id, self.collection_id).order('id ASC').limit(1).first\n end" ]
[ "0.8540969", "0.84595925", "0.82897836", "0.8184852", "0.81038445", "0.8096222", "0.8070239", "0.8039157", "0.8003045", "0.7994515", "0.7992852", "0.79890484", "0.79658055", "0.79425377", "0.78331304", "0.78319293", "0.7675046", "0.7554967", "0.74976826", "0.74309576", "0.7343487", "0.7294217", "0.7240971", "0.71963984", "0.7183566", "0.7181295", "0.71071064", "0.7088103", "0.7082151", "0.7070384", "0.70664555", "0.7056692", "0.7040146", "0.7039732", "0.7030545", "0.70111406", "0.6995441", "0.69800633", "0.69572675", "0.69403636", "0.6910544", "0.6898395", "0.68966293", "0.6896034", "0.68859005", "0.68795484", "0.68787515", "0.68510485", "0.6828477", "0.68175626", "0.6815974", "0.6806584", "0.679411", "0.6771331", "0.6768862", "0.6739375", "0.6736736", "0.67308027", "0.67165303", "0.66863", "0.66659844", "0.6656497", "0.6641931", "0.66326964", "0.66245824", "0.6609797", "0.65939415", "0.65899754", "0.6584117", "0.65742195", "0.6573378", "0.6565633", "0.6565633", "0.65569514", "0.65548503", "0.65548503", "0.65521586", "0.6541871", "0.65362656", "0.6531715", "0.6502563", "0.6499703", "0.6440243", "0.6440167", "0.6431422", "0.63970584", "0.6395387", "0.6393602", "0.6389095", "0.6380035", "0.63714945", "0.6371178", "0.63583237", "0.6354924", "0.63446844", "0.63396543", "0.6325952", "0.6320652", "0.6301997", "0.6279098", "0.626965" ]
0.0
-1
Takes configuration and an arg that is expected to be key=value format. If c is empty, creates one and returns it
def add_to_configuration(c, arg) kv = arg.split('=') kv.length == 2 || (raise "Expected parameter #{kv} in key=value format") c = org.apache.hadoop.hbase.HBaseConfiguration.create if c.nil? c.set(kv[0], kv[1]) c end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def takes_hash(opts = {})\n c = opts[:c]\nend", "def create_key(arg = nil)\n set_or_return(\n :create_key,\n arg,\n kind_of: [ TrueClass, FalseClass ]\n )\n end", "def method_missing(name, *args, &block)\n if name.to_s[-1] == '='\n config[name[0..-2].to_s.upcase] = args[0]\n else\n config.fetch(name.to_s.upcase) {nil}\n end\n end", "def config c\n c.each do |key, value|\n case key\n when :pspid\n @pspid = value\n when :sha_in\n @sha_in = value\n when :sha_out\n @sha_out = value\n when :currency\n @currency = value unless value.nil?\n when :language\n @language = value unless value.nil?\n when :mode\n @mode = value unless value.nil?\n when :encoding\n @encoding = value unless value.nil?\n end\n end\n end", "def cat_builder(name_str, color_str, age_num)\n return {\"name\" => name_str, \"color\" => color_str, \"age\" => age_num}\nend", "def initialize(config_key, info)\n @config_key = config_key\n while arg = info.shift\n begin\n @return_type = Object.const_get(\"#{arg}\")\n next\n rescue NameError\n end\n if arg.start_with?(\"-\")\n if arg.start_with?(\"--\")\n @long = arg\n else\n @short = arg\n end\n next\n end\n @description = arg\n end\n end", "def config(args)\n old_config = Punch.config.clone\n\n args.each do |k, v|\n Punch.config.send \"#{k}=\", v\n end\n\n yield\n\nensure\n Punch.config = old_config\nend", "def generate_settings(cmdline, configuration)\n loaded = YAML::load(configuration)\n\n if loaded[:properties].nil?\n loaded[:properties] = {}\n end\n\n unless cmdline['--pattern'].nil? \n loaded[:vcs][:release_regex] = input['--pattern']\n end\n\n #User name override\n if cmdline['-c']\n (0..cmdline['-c']-1).each do |it|\n u = cmdline['<user>'][it]\n p = cmdline['<password>'][it]\n t = cmdline['<target>'][it]\n loaded[:task_systems].each do |ts|\n if ts[:name] == t\n ts[:usr] = u\n ts[:pw] = p\n end\n end\n end\n end\n \n unless cmdline['--properties'].nil? \n json_value = JSON.parse(cmdline['--properties'])\n loaded[:properties] = loaded[:properties].merge(json_value)\n end\n loaded[:verbosity] = Logging.calc_verbosity(cmdline)\n loaded \n end", "def load_conf(klass,args,single = false)\n if single\n klass.new(args)\n else\n Hash[*args.map do |key,val|\n [key,klass.new(val)]\n end.flatten]\n end\nend", "def load_conf(klass,args,single = false)\n if single\n klass.new(args)\n else\n Hash[*args.map do |key,val|\n [key,klass.new(val)]\n end.flatten]\n end\nend", "def setup_config(*args)\n args.first.is_a?(Hash) ? args.first : { default: args }\n end", "def load_conf(klass, args, single = false)\n if single\n klass.new(args)\n else\n Hash[*args.map do |key, val|\n [key, klass.new(val)]\n end.flatten]\n end\nend", "def config(arg)\n\t\tconfig = cookies[:\"conf\"] \n\t\tif config != nil \n\t\t\tconfig = config.split(\",\")\n\t\t\tresult = case arg\n\t\t\t\twhen \"cat\" : 0\n\t\t\t\twhen \"grm\" : 1\n\t\t\t\twhen \"font\": 2\n\t\t\t\twhen \"tib\" : 3\n\t\t\t\telse nil\n\t\t\tend \n\t\t\terg = config.at(result) == \"1\"\t\n\t\telse\n\t\t\terg = false\t\t\t\t\n\t\tend \t\n\t\treturn erg\n\tend", "def config=(_arg0); end", "def config=(_arg0); end", "def config=(_arg0); end", "def config=(_arg0); end", "def config=(_arg0); end", "def push_arg_if_present(key, arg, state)\n unless arg.nil?\n case state\n when \"yml\"\n download_path = \"config/locales/org/#{key}.yml\"\n TTY::File.download_file(arg, download_path)\n @args[key] = YAML.load(File.read(download_path))\n File.delete(download_path) if File.exist?(download_path)\n when \"boolean\"\n @args[key] = arg.to_s.downcase == \"true\"\n when \"integer\"\n @args[key] = arg.to_i\n else\n @args[key] = arg\n end\n end\nend", "def config=(*args); end", "def config=(*args); end", "def cat_builder(name, color, age)\n cat = {'name' => name, color: color, age: age}\nend", "def conf name, args = {}\n required = args[:required] ||= false\n default = args[:default] ||= nil\n if CONFIG[name]\n CONFIG[name]\n else\n if required && !default\n $stderr.puts \"#{name} not found - exiting\"\n exit\n else\n default\n end\n end\nend", "def configure(c)\n # passed config\n c.merge!(@passed_config)\n end", "def cli_args!(args)\n ChefBackup::Config.config = args\nend", "def initialize(arg=nil)\n set_from_config!(arg) if arg\n end", "def arg(key, default = nil)\n args.fetch(key.to_s, default)\n end", "def get_config(config_file) \n config = \"\"\n if !FileTest.exists?(config_file)\n print \"What is your api key for campfire?\\ndon't worry you only have to enter it once! :\"\n token = gets\n print \"What's the url you use for campfire chat? :\"\n url = gets\n url = url.strip #get rid of \\n\n url = url[0, url.length-1] if url[url.length-1, url.length] == \"/\" #make sure there isn't a trailing slash \n token = token[0..token.length-2].strip \n File.open(\"#{ENV['HOME']}/.campfirerc\", \"w\") { |writer|\n writer.write(\"campfire_config:\\n API_KEY: #{token}\")\n writer.write(\"\\n URL: #{url}\")\n }\n config = YAML::load_file(\"#{ENV['HOME']}/.campfirerc\")\n else \n config = YAML::load_file(config_file) \n end \nend", "def configure(c)\n c.merge!(@passed_config)\n end", "def load_conf(klass,args,single = false)\n if single\n klass.new(args)\n else\n Hash[*args.map do |key,val|\n [key,klass.new(val)]\n end.flatten]\n end\n end", "def parameters_to_cmvc_arg(parm=@parameters)\n cmd = \"\"\n parm.keys.each do |key|\n case parm[key].class.to_s\n when \"Hash\"\n cmd += \" -#{key}\"\n cmd += parameters_to_cmvc_arg(parm[key])\n when \"FalseClass\"\n # Do nothing\n when \"TrueClass\"\n cmd += \" -#{key}\"\n else\n cmd += \" -#{key}\"\n value = parm[key].to_s\n value = '\"' + value + '\"' if value =~ /\\s/\n cmd += \" \" + value\n end\n end\n cmd\n end", "def get_config(*arguments)\n \t\targs = arguments.clone\n \t\t@config ||= {}\n \t\topt = args.rfm_extract_options!\n \t\tstrings = opt[:strings].rfm_force_array || []\n \t\tsymbols = opt[:use].rfm_force_array || []\n \t\tobjects = opt[:objects].rfm_force_array || []\n \t\targs.each do |arg|\n \t\t\tcase true\n \t\t\twhen arg.is_a?(String) ; strings << arg\n \t\t\twhen arg.is_a?(Symbol) ; symbols << arg\n \t\t\telse objects.unshift arg\n \t\t\tend\n \t\tend\n\n\t\t\trslt = config_merge_with_parent(symbols).merge(opt)\n\t\t\t#using = rslt[:using].rfm_force_array\n\t\t\tsanitize_config(rslt, CONFIG_DONT_STORE, false)\n\t\t\trslt[:using].delete \"\"\n\t\t\trslt[:parents].delete \"\"\n\t\t\trslt.merge(:strings=>strings, :objects=>objects)\n \tend", "def new_hash(*args, &block)\n if block\n r = hash_class.new\n r.default = block\n r\n elsif args.size == 1\n value = args.first\n if value.is_a?(Hash) or value.is_a?(hash_class)\n r = hash_class.new\n r.putAll(value)\n r\n else\n r = hash_class.new\n r.default = value\n r\n end\n else\n r = hash_class.new\n args.each_slice(2) {|key,val| r.put(key,val)}\n r\n end\n end", "def method_missing(key_name, *args)\n key_name = key_name.to_s()\n if key_name =~ /=$/ then\n @options[key_name.chop()] = args[0]\n else\n return @options[key_name]\n end\n end", "def config\n @default_args || Surrealist::HashUtils::EMPTY_HASH\n end", "def default_configuration=(_arg0); end", "def my_hash_creator(key, value)\n # return a hash that includes the key and value parameters passed into this method\n {key => value}\nend", "def config(*args)\n \n raise \"config expects at least one argument\" if args.empty?\n \n # extract the arguments\n if args[0].is_a?(Hash)\n # we can't override when using hash'd arguments since\n # if > 1 hash keys are given, it's impossible to tell which\n # one is the name of the option, and which is the override flag.\n args[0].each { |key, value| _handle_config(key, value)}\n else\n _handle_config(*args)\n end\n end", "def initialize(arg = nil)\n parse_arg arg if arg\n parse_config\n end", "def initialize(arg='/etc/dansguardian/dansguardian.conf')\n h = {}\n if arg.respond_to? :[]\n h = arg\n else # String-like assumed\n h = {:mainfile => arg}\n end\n @mainfile = h[:mainfile] \n @mainconfig = nil\n @filtergroups = []\n end", "def process_argument(arg)\n case arg\n when *@mapping[:aggregate] then @parameters[:aggregate] = true\n when *@mapping[:date] then create_argument_entry(:date)\n when *@mapping[:default] then create_defaults\n when *@mapping[:json] then @parameters[:json] = true\n when *@mapping[:locale] then create_argument_entry(:locale)\n when *@mapping[:offset] then create_argument_entry(:offset)\n when *@mapping[:period] then create_argument_entry(:period)\n when *@mapping[:save] then create_argument_entry(:save)\n else\n raise_invalid_parameter(arg)\n end\n nil\n end", "def config(key, defval=nil, store=config_store)\n return store.transaction { store.fetch(key, defval) }\nend", "def generate_settings(cmdline, configuration)\n loaded = YAML::load(configuration)\n\n if loaded[:properties].nil?\n loaded[:properties] = {}\n end\n\n #User name override\n if cmdline['-c']\n (0..cmdline['-c']-1).each do |it|\n u = cmdline['<user>'][it]\n p = cmdline['<password>'][it]\n t = cmdline['<target>'][it]\n loaded[:task_systems].each do |ts|\n if ts[:name] == t\n ts[:usr] = u\n ts[:pw] = p\n end\n end\n end\n end\n\n unless cmdline['--properties'].nil?\n json_value = JSON.parse(cmdline['--properties'])\n loaded[:properties] = loaded[:properties].merge(json_value)\n end\n loaded[:verbosity] = Logging.calc_verbosity(cmdline)\n loaded\n end", "def initialize(*args)\n extend RsgeUtil\n\n yield self if block_given?\n\n if (args[0] != nil)\n conf = args[0]\n else\n conf = Hash.new\n end\n\n raise ArgumentError, \"Argument is not a hash! #{conf.class} #{conf}\" if conf.class != Hash\n\n # We're a valid job unless we run into some condition\n self.valid = true\n\n if conf.has_key?(:jobid)\n parse_job_by_id conf\n end\n end", "def construct_environment(envs)\n envs.each do |key, value|\n if value\n value = value.to_s\n value = nil if value.length == 0\n end\n ENV[key.to_s] = value\n end\nend", "def configure_args\n @args = {}\n OptionParser.new do |opt|\n opt.on('-c', '--configure STRING', String) { |arg| push_arg_if_present( \"configure\", arg, \"boolean\") }\n opt.on('-d', '--deploy STRING', String) { |arg| push_arg_if_present( \"deploy\", arg, \"boolean\") }\n opt.on('-on', '--org_name STRING', String) { |arg| push_arg_if_present( \"org_name\", arg, \"string\") }\n opt.on('-od', '--org_desc STRING', String) { |arg| push_arg_if_present( \"org_desc\", arg, \"string\") }\n opt.on('-cd', '--contact_desc STRING', String) { |arg| push_arg_if_present( \"contact_desc\", arg, \"string\") }\n opt.on('-odo', '--org_domain STRING', String) { |arg| push_arg_if_present( \"org_domain\", arg, \"string\") }\n opt.on('-oe', '--org_email STRING', String) { |arg| push_arg_if_present( \"org_email\", arg, \"string\") }\n opt.on('-op', '--org_phone STRING', String) { |arg| push_arg_if_present( \"org_phone\", arg, \"string\") }\n opt.on('-of', '--org_facebook STRING', String) { |arg| push_arg_if_present( \"org_facebook\", arg, \"string\") }\n opt.on('-ot', '--org_twitter STRING', String) { |arg| push_arg_if_present( \"org_twitter\", arg, \"string\") }\n opt.on('-oi', '--org_instagram STRING', String) { |arg| push_arg_if_present( \"org_instagram\", arg, \"string\") }\n opt.on('-ow', '--org_website STRING', String) { |arg| push_arg_if_present( \"org_website\", arg, \"string\") }\n opt.on('-cp', '--color_primary STRING', String) { |arg| push_arg_if_present( \"color_primary\", arg, \"string\") }\n opt.on('-cs', '--color_secondary STRING', String) { |arg| push_arg_if_present( \"color_secondary\", arg, \"string\") }\n opt.on('-l', '--logo STRING', String) { |arg| push_arg_if_present( \"logo\", arg, \"string\") }\n opt.on('-lo', '--logo_option STRING', String) { |arg| push_arg_if_present( \"logo_option\", arg, \"string\") }\n opt.on('-su', '--smtp_username STRING', String) { |arg| push_arg_if_present( \"smtp_username\", arg, \"string\") }\n opt.on('-sp', '--smtp_password STRING', String) { |arg| push_arg_if_present( \"smtp_password\", arg, \"string\") }\n opt.on('-sa', '--smtp_address STRING', String) { |arg| push_arg_if_present( \"smtp_address\", arg, \"string\") }\n opt.on('-so', '--smtp_port STRING', String) { |arg| push_arg_if_present( \"smtp_port\", arg, \"integer\") }\n opt.on('-as', '--account_sid STRING', String) { |arg| push_arg_if_present( \"account_sid\", arg, \"string\") }\n opt.on('-at', '--auth_token STRING', String) { |arg| push_arg_if_present( \"auth_token\", arg, \"string\") }\n opt.on('-ae', '--admin_email STRING', String) { |arg| push_arg_if_present( \"admin_email\", arg, \"string\") }\n opt.on('-ap', '--admin_password STRING', String) { |arg| push_arg_if_present( \"admin_password\", arg, \"string\") }\n opt.on('-af', '--admin_first_name STRING', String) { |arg| push_arg_if_present( \"admin_first_name\", arg, \"string\") }\n opt.on('-al', '--admin_last_name STRING', String) { |arg| push_arg_if_present( \"admin_last_name\", arg, \"string\") }\n opt.on('-hc', '--heroku_command STRING', String) { |arg| push_arg_if_present( \"heroku_command\", arg, \"string\") }\n opt.on('-ha', '--heroku_app_name STRING', String) { |arg| push_arg_if_present( \"heroku_app_name\", arg, \"string\") }\n opt.on('-sn', '--form_name STRING', String) { |arg| push_arg_if_present( \"form_name\", arg, \"string\") }\n opt.on('-f', '--faq STRING', String) { |arg| push_arg_if_present( \"faq\", arg, \"yml\") }\n opt.on('-s', '--form STRING', String) { |arg| push_arg_if_present( \"form\", arg, \"yml\") }\n end.parse!\nend", "def private_chef!(args = {})\n ChefBackup::Config.config = args\nend", "def c\n configuration\n end", "def Connie(argument, options={})\n case argument\n when String\n Connie::Parser.process(argument)\n when Symbol\n argument = argument.to_s.split('.').map &:to_sym\n \n dictionary = Connie[argument.first]\n \n if argument[1]\n dictionary.send argument[1], options\n else\n dictionary\n end\n when Array\n argument[rand(argument.size)]\n when Range\n rand(argument.max-argument.min+1) + argument.min\n else\n raise ArgumentError, 'Connie\\'s shorthand expects a string to parse or a symbol or an array'\n end\nend", "def cmd_create argv\n setup argv\n json = @hash['json']\n e = @hash['element']\n response = @api.create(json, e)\n msg response\n return response\n end", "def get_opt_ilab(o_arg = {})\n o = {}\n \n #Collection Parameter\n o[:bucket_size] = 100\n o.merge(o_arg)\nend", "def load_config\n if params[:config].given?\n @config = File.open(File.expand_path(params[:config].value)) { |f| JSON.load(f) }\n\n @config.each do |key, value|\n if params.has_key?(key) and params[key].values == params[key].defaults\n params[key].values = [*value]\n params[key].given = true\n end\n end\n\n end\n end", "def config_for(key, value)\n \"#{key}=#{value && value}\\n\"\n end", "def make_hash_repo_test_value(data = 'foo')\n data\n end", "def getConfig(theArgs)\n\n\t# Create the config directory\n\t#\n\t# clang-format looks for its configuration relative to the current\n\t# directory, so we invoke it within the temporary directory that\n\t# will store our config files.\n\tpathConfig = Dir.mktmpdir(\"rn-format\");\n\tDir.chdir(pathConfig);\n\n\ttheArgs[:config] = pathConfig;\n\n\n\n\t# Save the configs\n\tFile.write(\"#{pathConfig}/.clang-format\",\t\t\t\tCONFIG_CLANG_FORMAT);\n\tFile.write(\"#{pathConfig}/#{FILE_CONFIG_UNCRUSTIFY}\",\tCONFIG_UNCRUSTIFY);\n\n\treturn pathConfig;\n\nend", "def build(key_name, value={})\n kv = KeyValue.new(self, key_name)\n kv.value = value\n kv\n end", "def initialize(arg_list)\n @config_file_name = nil\n need_config_file_name = false\n\n arg_list = arg_list.map do |arg|\n if need_config_file_name then\n @config_file_name = arg\n need_config_file_name = false\n nil\n elsif arg =~ /^--config-file=(.*)/ then\n @config_file_name = $1\n nil\n elsif arg =~ /^--config-file$/ then\n need_config_file_name = true\n nil\n else\n arg\n end\n end.compact\n\n @backtrace = DEFAULT_BACKTRACE\n @benchmark = DEFAULT_BENCHMARK\n @verbose = DEFAULT_VERBOSITY\n\n operating_system_config = Marshal.load Marshal.dump(OPERATING_SYSTEM_DEFAULTS)\n platform_config = Marshal.load Marshal.dump(PLATFORM_DEFAULTS)\n system_config = load_file SYSTEM_WIDE_CONFIG_FILE\n user_config = load_file config_file_name.dup.untaint\n\n @hash = operating_system_config.merge platform_config\n @hash = @hash.merge system_config\n @hash = @hash.merge user_config\n @hash.stringify_keys!\n\n # HACK these override command-line args, which is bad\n @backtrace = @hash['backtrace'] if @hash.key? 'backtrace'\n @benchmark = @hash['benchmark'] if @hash.key? 'benchmark'\n @verbose = @hash['verbose'] if @hash.key? 'verbose'\n handle_arguments arg_list\n end", "def create_document(key, value, args={})\n return nil unless key\n CouchbaseDocStore.create_document(key, value, args) # => if !quiet, Generates Couchbase::Error::KeyExists if key already exists\n end", "def build_token(option_config, arg)\n case option_config.type\n when :boolean\n BooleanOptionToken.new(option_config.name, arg)\n else\n SingleValuedOptionToken.new(option_config.name, arg)\n end\n end", "def configName _args\n \"configName _args;\" \n end", "def _default_config_method(config_key, *args)\n if args.length.positive?\n # Set the value\n @settings[config_key].value = args[0]\n else\n # Get the value\n setting = @settings[config_key]\n if setting.default_proc && setting.value.nil?\n setting.value = setting.default_proc.call\n end\n setting.value\n end\n end", "def set_config(*args); end", "def set_config(*args); end", "def set_config(*args); end", "def set_config(*args); end", "def set_config(*args); end", "def create(arg, opt ={})\n t = new\n t.lm_response = arg[:lm_response]\n t.ntlm_response = arg[:ntlm_response]\n t.domain = arg[:domain]\n t.user = arg[:user]\n\n if arg[:workstation]\n t.workstation = arg[:workstation]\n end\n\n if arg[:session_key]\n t.enable(:session_key)\n t.session_key = arg[session_key]\n end\n\n if arg[:flag]\n t.enable(:session_key)\n t.enable(:flag)\n t.flag = arg[:flag]\n end\n t\n end", "def config(value,options)\n\n end", "def config(value,options)\n\n end", "def parse_string_argument(key)\n if @opts[key].nil? and s=@argv.shift\n @opts[key] = s.dup \n end\n end", "def initialize(*args)\n extend RSchedUtil\n\n yield self if block_given?\n\n if (args[0] != nil)\n conf = args[0]\n else\n conf = Hash.new\n end\n\n raise ArgumentError, \"Argument is not a hash! #{conf.class} #{conf}\" if conf.class != Hash\n\n # We're a valid job unless we run into some condition\n self.valid = true\n\n if conf.has_key?(:jobid)\n parse_job_by_id conf\n end\n end", "def method_missing(name, *args, &block)\n if @config.has_key? name.to_s\n @config[name.to_s]\n elsif name.to_s[-1] == '=' && @config.has_key?(name.to_s[0..-2])\n var = name.to_s[0..-2]\n @config[var] = args[0]\n elsif @topology.respond_to? name\n @topology.send name, *args, &block\n else\n super\n end\n end", "def initialize arg\n\t # self.merge arg\n\t super\n\t for k,v in arg\n\t self[k]=v\n\t end\n\n\t end", "def create_queries arg\n a = \"\"\n arg.each_key do |key|\n a << ((a.empty?) ? \"\" : \"&\") \n a << key.to_s << \"=\" << arg[key].to_s\n end\n a\n end", "def process_argument(arg)\n case arg\n when *@mapping[:all] then create_argument_entry(:all)\n when *@mapping[:coord] then create_two_argument_entry(:coord)\n when *@mapping[:delta] then create_two_argument_entry(:delta)\n when *@mapping[:extreme] then @parameters[:extreme] = true\n when *@mapping[:index] then create_argument_entry(:index)\n when *@mapping[:meta] then @parameters[:meta] = true\n when *@mapping[:option] then create_argument_entry(:option)\n when *@mapping[:range] then create_two_argument_entry(:range)\n when *@mapping[:section] then create_two_argument_entry(:section)\n when *@mapping[:time] then create_two_argument_entry(:time)\n else\n raise_invalid_parameter(arg)\n end\n end", "def CSVHash arg, columns=nil\n if arg.is_a?(File)\n CSVHash.from_file(arg.path)\n elsif arg.is_a?(String)\n CSVHash.from_file(arg)\n elsif arg.is_a?(Array) && columns.is_a?(Array)\n CSVHash.to_string(arg,columns)\n end\nend", "def build_config\n file = [options[:config_file], DEFAULT_CONFIG_FILE_LOCATION].\n compact.find {|f| File.exists?(f) }\n\n hash =\n if file\n YAML.load_file(file).each do |key, value|\n stderr.puts(\"Warn: Unknown key in config file: #{key}\") unless\n self.class.configs.find {|opt| opt.first.to_s == key.to_s }\n end\n else\n {}\n end\n\n options[:config_option].map {|str| str.split('=') }.\n inject(hash) {|m, (k,v)| m.merge(k.to_sym => v) }\n end", "def expand_config_args( args )\n ## todo/check: rename method?? e.g. check_config_args\n ## or auto_complete_config_ars similar? why? why not??\n\n if args.empty? ## no args? args.length == 0\n ['planet.ini'] # add default planet.ini for convenience\n else\n args # pass through as-is\n end\nend", "def load_config **kwargs\n project_id = kwargs[:project] || kwargs[:project_id]\n configuration.project_id = project_id unless project_id.nil?\n\n creds = kwargs[:credentials] || kwargs[:keyfile]\n configuration.credentials = creds unless creds.nil?\n\n service_name = kwargs[:service_name]\n configuration.service_name = service_name unless service_name.nil?\n\n service_vers = kwargs[:service_version]\n configuration.service_version = service_vers unless service_vers.nil?\n\n init_default_config\n end", "def factory( key, *args )\n details = fetch( key, nil )\n raise \"ConfigYaml: missing key when calling factory('#{key}')\" if details.nil?\n klass = details.fetch( 'class', nil )\n raise \"ConfigYaml: missing class when calling factory('#{key}')\" if klass.nil?\n\n requirement = details.fetch( 'require', nil )\n require requirement unless requirement.nil?\n\n unless @class_methods.include? klass\n @class_methods.add klass\n static_keys = details.keys.find_all { |k| k[0].chr == '_' } \n static_keys.each do |k|\n method = k.sub( /^_/, '' )\n text = \"#{klass}.#{method}( #{ details[k].inspect } )\"\n eval text \n end\n end\n \n if args.empty?\n text = \"#{klass}.new( #{ details.fetch( 'initialize', '' ) } )\" \n else\n text = \"#{klass}.new( \"\n args.each_index { |index| text += \"args[#{index}],\" }\n text = text[ 0...text.size-1 ] + ' )'\n end\n\n begin\n instance = eval text\n rescue => details\n raise \"ConfigYaml: cannot eval '#{text}' (missing require?)\\n\" + details.inspect\n end\n\n details.each_pair do |k,value|\n next if ['class','initialize', 'require'].include? k\n next if k[0].chr == '_' # no class methods, please\n eval \"instance.#{k} = #{value.inspect}\"\n end\n\n instance\n end", "def custom_config_path\n argv.each_with_index do |arg, index|\n if arg == \"--config-path\" || arg == \"-c\"\n next_arg = argv[index + 1]\n raise ConfigPathNotProvided.new if next_arg.nil?\n raise ConfigPathInvalid.new(next_arg) unless File.file?(next_arg) && File.readable?(next_arg)\n\n return next_arg\n end\n end\n nil\n end", "def config(action, *args); end", "def c\n configuration\n end", "def create_config\n self.config = {} if !self.config\n end", "def create_config\n self.config = {} if !self.config\n end", "def initialize(key: nil,\n env_name: nil,\n description: nil,\n short_option: nil,\n default_value: nil,\n default_value_dynamic: false,\n verify_block: nil,\n is_string: true,\n type: nil,\n skip_type_validation: false,\n optional: nil,\n conflicting_options: nil,\n conflict_block: nil,\n deprecated: nil,\n sensitive: nil,\n code_gen_sensitive: false,\n code_gen_default_value: nil,\n display_in_shell: true)\n UI.user_error!(\"key must be a symbol\") unless key.kind_of?(Symbol)\n UI.user_error!(\"env_name must be a String\") unless (env_name || '').kind_of?(String)\n\n if short_option\n UI.user_error!(\"short_option for key :#{key} must of type String\") unless short_option.kind_of?(String)\n UI.user_error!(\"short_option for key :#{key} must be a string of length 1\") unless short_option.delete('-').length == 1\n end\n\n if description\n UI.user_error!(\"Do not let descriptions end with a '.', since it's used for user inputs as well for key :#{key}\") if description[-1] == '.'\n end\n\n if conflicting_options\n conflicting_options.each do |conflicting_option_key|\n UI.user_error!(\"Conflicting option key must be a symbol\") unless conflicting_option_key.kind_of?(Symbol)\n end\n end\n\n if deprecated\n # deprecated options are automatically optional\n optional = true if optional.nil?\n UI.crash!(\"Deprecated option must be optional\") unless optional\n\n # deprecated options are marked deprecated in their description\n description = deprecated_description(description, deprecated)\n end\n\n optional = false if optional.nil?\n sensitive = false if sensitive.nil?\n\n @key = key\n @env_name = env_name\n @description = description\n @short_option = short_option\n @default_value = default_value\n @default_value_dynamic = default_value_dynamic\n @verify_block = verify_block\n @is_string = is_string\n @data_type = type\n @data_type = String if type == :shell_string\n @optional = optional\n @conflicting_options = conflicting_options\n @conflict_block = conflict_block\n @deprecated = deprecated\n @sensitive = sensitive\n @code_gen_sensitive = code_gen_sensitive || sensitive\n @allow_shell_conversion = (type == :shell_string)\n @display_in_shell = display_in_shell\n @skip_type_validation = skip_type_validation # sometimes we allow multiple types which causes type validation failures, e.g.: export_options in gym\n\n @code_gen_default_value = code_gen_default_value\n\n update_code_gen_default_value_if_able!\n end", "def vash_key_name(*args); 'option name'; end", "def generate_config\n # define email\n puts \"enter the email you use to log into Harvest:\"\n email = gets\n # define password\n puts \"enter the password for this Harvest account:\"\n password = gets\n # define subdomain\n puts \"enter the subdomain for your Harvest account:\"\n subdomain = gets\n\nstr = <<EOS\nclass HarvestConfig\ndef self.attrs(overwrite = {})\n{\n :email => \"#{email.chomp!}\", \n :password => \"#{password.chomp!}\", \n :subdomain => \"#{subdomain.chomp!}\",\n :has_ssl => false,\n :user_agent => \"Ruby/HarvestThings\"\n}.merge(overwrite)\nend\nend\nEOS\n \n File.open(CONFIG_PATH, 'w') {|f| f.write(str) }\n end", "def build_opts(hash, *args)\n opts = args\n hash.each do |key, value|\n case key\n when :secure, :soft\n value == :yes && opts << '--%s' % key\n when :appname, :appversion\n when :name\n else\n opts << '--%s' % key << value\n end\n end\n opts << hash[:appname]\n opts << hash[:appversion]\n opts.compact\n end", "def initialize(config_param, options_param = {})\n if options_param.is_a? String\n options = {:token_cache => options_param}\n else\n options = options_param\n end\n if config_param.is_a? String\n config = YAML.load_file(config_param)\n config = config[options[:environment]] if options.has_key? :environment\n else\n config = config_param\n end\n @api_key = config[:key] || config[\"key\"]\n @api_secret = config[:secret] || config[\"secret\"]\n @token_cache = options[:token_cache] || config[\"token_cache\"]\n @token = config[:token] || options[:token]\n raise 'config file must contain an api key and secret' unless @api_key and @api_secret\n raise 'you cannot specify both the token and token_cache' if @token and @token_cache\n end", "def initialize(args = {})\n args = args.dup\n @values = Hash[*FIELDS.collect do |field|\n [field, args.delete(field) || default(field)]\n end.flatten]\n raise ArgumentError, args.inspect unless args.empty?\n end", "def configure_default(defaults, key, *args)\n defaults[key] = args[0] unless args.empty?\n end", "def aws_access_key(arg = nil)\n if arg.nil? && @aws_access_key.nil?\n @aws_access_key_id\n else\n set_or_return(:aws_access_key, arg, kind_of: String)\n end\nend", "def initialize(stack, cnames, config)\n @stack = stack\n @cnames = cnames.split(',')\n @config = config.map { |c| Hash[c.map { |k, v| [k.to_sym,v]}] }\n end", "def filter_config(text)\n if text =~ /^---\\n(.*)^---\\n(.*)/m\n return YAML.load($1) || {}, $2\n else\n return nil, text\n end\n end", "def set_adhoc_config_value!(key, value, data_type='String')\n config = \"UniversalAr::Config#{data_type.to_s.titleize}\".classify.constantize.find_or_create_by(subject: self, key: key)\n config.update(value: value)\n end", "def value(arg1, arg2 = nil) # :nodoc:\n warn('Config#value is deprecated; use Config#get_value')\n if arg2.nil?\n section, key = 'default', arg1\n else\n section, key = arg1, arg2\n end\n section ||= 'default'\n section = 'default' if section.empty?\n get_key_string(section, key)\n end", "def get_param(name, value)\n Config::Param.new(name: name, value: value)\n end", "def make_opts(s)\r\n opts = {}\r\n s.split(';').each do |part|\r\n args = part.split('=')\r\n opts[args[0]] = args[1]\r\n end\r\n RIAPI::parse_params(opts)\r\nend", "def set_from_config!(arg)\n @config_data = \n if arg.include?(\"://\")\n open(arg) {|io| io.read }\n elsif File.exist?(arg)\n @config_filename = arg\n IO.read(arg)\n else\n url = \"https://raw.github.com/#{arg}/#{DEFAULT_CONFIG_GITHUB_REPO}/master/#{DEFAULT_CONFIG_GITHUB_PATH}\"\n begin\n open(url) {|io| io.read }\n rescue\n raise RuntimeError, \"assuming this is a github account name, but config file does not exist!: #{url}\"\n end\n end\n raise \"config file doesn't look like config file\" unless is_config?(@config_data)\n (@data, @repos) = read_config_data(@config_data, @config_filename)\n self\n end" ]
[ "0.58913434", "0.52278763", "0.51599497", "0.5076399", "0.5073432", "0.5073087", "0.5072594", "0.5065129", "0.5061468", "0.5061468", "0.5046907", "0.5040518", "0.50259733", "0.49905154", "0.49905154", "0.49905154", "0.49905154", "0.49905154", "0.4989487", "0.49871948", "0.49871948", "0.49871692", "0.49576387", "0.4939287", "0.49225852", "0.49196905", "0.49071613", "0.48972127", "0.48896107", "0.48154318", "0.48098186", "0.48075637", "0.4805848", "0.48044983", "0.48013434", "0.47447884", "0.47338745", "0.47313493", "0.47232348", "0.4702591", "0.4697834", "0.4659328", "0.46492913", "0.46294925", "0.46288946", "0.46193233", "0.45684105", "0.45547092", "0.45500475", "0.45488226", "0.45333305", "0.45231903", "0.45226523", "0.4522013", "0.4518286", "0.4516953", "0.45124134", "0.4509242", "0.4506672", "0.45056495", "0.45033878", "0.44985566", "0.44985566", "0.44985566", "0.44985566", "0.44985566", "0.44966516", "0.4490483", "0.4490483", "0.4489417", "0.44845775", "0.4482155", "0.44670552", "0.44640127", "0.44598326", "0.4459798", "0.44594315", "0.44539478", "0.44508588", "0.4439932", "0.44389206", "0.44199145", "0.4405935", "0.4396959", "0.4396959", "0.43954107", "0.43912226", "0.43882975", "0.43878534", "0.43872237", "0.43639022", "0.43625444", "0.43607536", "0.4343129", "0.43418047", "0.4341481", "0.4334713", "0.4334403", "0.43330798", "0.43229762" ]
0.67047644
0
Print whether debug is on or off
def debug? puts "Debug mode is #{@shell_debug ? 'ON' : 'OFF'}\n\n" nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def debug?\n true\n end", "def debug?\n true\n end", "def debug_on(debug=true)\n ap \"Debugging is ON\"\n @debug = debug\n end", "def debug?\n false\n end", "def debugging?\n Options[:debug]\n end", "def debug?\n !!@debug\n end", "def debug?\n self[:debug] == 'true'\n end", "def debug\n @@debug ||= false\n end", "def debug?\n @@debug\n end", "def debug?\n $DEBUG\n end", "def debug_mode\n @@debug_mode == 1\n end", "def debug?\n @@debug\n end", "def debug? ; $DEBUG ; end", "def debug?\n\t\t!!@debuggable_status\n\tend", "def debug?\n @debug || ENV['HATCHET_DEBUG'] || false\n end", "def toggle_debug\n @debug = @debug == false ? true : false\n end", "def debugging(debug_bool)\n Facter::Options[:debug] = debug_bool\n end", "def debug?; run_options[:debug]; end", "def debugging?\n\t\t(datastore['DEBUG'] || '') =~ /^(1|t|y)/i\n\tend", "def debug?; end", "def debug?; end", "def debug?\n debugging || !ENV['DEBUG'].nil?\n end", "def debug?\n @debug || to_bool( ENV['LAUNCHY_DEBUG'] )\n end", "def debug state=true\n @debug = state\n end", "def debug_mode\n @configuration[:debug_mode] = true\n end", "def debug?\n severity == :DEBUG\n end", "def debugging(bool)\n @@debug = bool\n end", "def debug?\n level <= DEBUG\n end", "def debug?\n !!@debug # rubocop:disable Style/DoubleNegation\n end", "def debug?\n @level <= 0\n end", "def debugging?\n ENV['DEBUG'] && ENV['DEBUG'] != ''\nend", "def debug?\n !!self.debug\n end", "def debug?\n instance.options[:debug]\n end", "def debug?\n instance.options[:debug]\n end", "def log_debug?\n @logger.debug?\n end", "def debug status=true\n\t\t@debuggable_status = !!status\n\tend", "def debug_msg msg\n puts msg if @options[:debug]\n end", "def debug(info)\n puts(info) if @debug\n end", "def debug! \n $DEBUG = true\n end", "def debug_mode?\n @@debug_mode\n end", "def debug string\n puts string if $DEBUG\nend", "def debug\n usb_set_indicator_as_debug_light wValue: 1\n self\n end", "def debug?; @logger.debug? end", "def http_debug?\n Options[:http_debug]\n end", "def debug\n Puppet::Util::Log.level = :debug\n end", "def debug!\n @client.debug_dev = STDOUT\n end", "def debug_msg( str )\n puts str if @debug == true\n end", "def debug?\n !production?\n end", "def debug?\n DEBUG == log_level\n end", "def dbgprint? bit\n ($debug & bit) > 0 if $debug\nend", "def dbgprint? bit\n ($debug & bit) > 0 if $debug\nend", "def debug?\n level >= ASL_LEVEL_DEBUG\n end", "def debug=(truthy=false)\n\t@debug=truthy\n end", "def debug_through?\r\n return false\r\n end", "def debug?; @level <= DEBUG; end", "def debug?; @level <= DEBUG; end", "def print_debug(s)\n config = BeEF::Core::Configuration.instance\n if config.get('beef.debug') || BeEF::Core::Console::CommandLine.parse[:verbose]\n puts Time.now.localtime.strftime(\"[%k:%M:%S]\")+'[>]'.yellow+' '+s.to_s\n end\nend", "def checkdebug\n begin\n if ENV['FACTER_DEBUG'] == 'true'\n Facter.debugging(true)\n end\n rescue\n end\nend", "def checkdebug\n begin\n if ENV['FACTER_DEBUG'] == 'true'\n Facter.debugging(true)\n end\n rescue\n end\nend", "def get_cli_debug\n if ENV.include?(\"debug\")\n if ENV[\"debug\"] == \"false\" || ENV[\"debug\"] == \"0\"\n $options[:verbose] = false\n else\n $options[:verbose] = true\n end\n else\n # default is on!\n $options[:verbose] = true\n end\n end", "def verbose?\n !!ENV[\"DEBUG\"]\nend", "def debug; end", "def debug; end", "def debug; end", "def debug; end", "def debug(s) if $DEBUG then $stderr.print(\"#{s}\\n\") end end", "def debug=(value); end", "def debug!(value = true)\n if options.key?(:trace) && options[:trace] != false\n Vedeu.log(\"Configuration::API debug: true\")\n\n options[:debug] = true\n\n else\n Vedeu.log(\"Configuration::API debug: #{value}\")\n\n options[:debug] = value\n\n end\n end", "def debug=(val)\n Handsoap::Service.logger = (val ? $stdout : nil)\n @@debug = val\n end", "def getDebugFlag()\n\t\t\treturn @_debug_flag\n\t\tend", "def debugging?\n debugging = ENV[\"DEBUG\"]\n if defined?(Rails) && Rails.respond_to?(:env)\n debugging = true if [\"development\", \"test\"].include? Rails.env\n end\n debugging\n end", "def debug(message)\n $stderr.puts(message) if @options[:debug]\nend", "def debug_mode=(flag)\r\n self.conf[:debug] = flag\r\n end", "def debug(msg)\n puts \"[watchr debug] #{msg}\" if options.debug\n end", "def toggle_debug!\n stream = @config[:debug]\n\n if stream.respond_to?(:<<)\n self.class.debug_output(stream)\n else\n self.class.debug_output\n end\n end", "def debug_print(returnedData, debug=\"false\")\n if debug == \"true\" then\n puts \"\\r\\n[DEBUG]\\r\\n\"\n pp(returnedData) \n end\nend", "def debug(msg)\n $stderr.puts(\"DEBUG: #{msg}\") if $options['verbose']\nend", "def debug(msg)\n $stderr.puts(\"DEBUG: #{msg}\") if $options['verbose']\nend", "def debug(msg)\n $stderr.puts(\"DEBUG: #{msg}\") if $options['verbose']\nend", "def show_command?\n ENV['DEBUG'] || ENV['SHOW_COMMAND']\n end", "def debug(arg=false)\n if arg.is_a?(Numeric)\n @@debug =( arg>0 ? true : false )\n else\n @@debug =( arg ? true : false )\n end\n @@debug_state =( @@debug ? MF_CHECKED : MF_UNCHECKED )\n end", "def do_debug\n # debugging = true\n debugging = false\n puts yield if debugging\n end", "def debug?\n return @debug_mode if defined?(@debug_mode)\n @debug_mode = ENV['MOLINILLO_DEBUG']\n end", "def http_debug(http_debug_bool)\n Facter::Options[:http_debug] = http_debug_bool\n end", "def debug_logging\n log.level == Logger::DEBUG\n end", "def print_debug(msg)\n puts msg if (@debug) \n STDOUT.flush\n end", "def debug?; @loggers.first.level <= DEBUG; end", "def debug(*info)\n puts(info) if debug_mode?\n end", "def dprint(s)\n print s if $DEBUG\nend", "def debug!\n self.severity = :DEBUG\n end", "def debugging?\n @debug_style.eql? \"NA_PRINT_DONT_PARSE\"\n end", "def netDebug\n NetDebug.Trace(nil)\n NetDebug.Trace(true)\n NetDebug.Trace(false)\n NetDebug.Trace(getString)\n NetDebug.Trace(getWackyString)\n NetDebug.Trace(getArray)\n NetDebug.Trace(getMixedArray)\n NetDebug.Trace(getHash)\n NetDebug.Trace(getFixNum)\n NetDebug.Trace(getBigNum)\n NetDebug.Trace(getFloat)\n NetDebug.Trace(getXML)\n return true\n\tend", "def debug(message)\n puts message if debug?\n end", "def debug(*args); puts(*args) if $test; end", "def debug_print(output, debug)\n\tif debug\n\t\tputs \"[*] #{output}\".red\n\tend\nend", "def debug(message)\n stdout.print(\"#{message}\\n\") if ENV['DEBUG']\n end", "def debug=(_)\n Nitro.mode = :debug\n end", "def debug (msg = \"\")\n if Object.const_defined?('Puppet')\n Puppet.debug 'facter(extra_modulepath):'+msg\n else\n if ENV['FACTER_DEBUG'] == 'true'\n $stdout.puts msg\n $stdout.flush\n end\n end\nend", "def debug(message)\n warn \"==== VLO DEBUG: \" + message if ENV[\"VLO_DEBUG\"] == 'true'\nend", "def debug (msg = \"\")\n if Object.const_defined?('Puppet')\n Puppet.debug msg\n else\n if ENV['FACTER_DEBUG'] == 'true'\n $stdout.puts msg\n $stdout.flush\n end\n end\nend" ]
[ "0.82126373", "0.82126373", "0.812736", "0.8045684", "0.80291826", "0.79650563", "0.7947702", "0.7944235", "0.7939422", "0.792468", "0.7893369", "0.7868979", "0.7812287", "0.7804585", "0.7800024", "0.77902657", "0.771115", "0.7667466", "0.7664416", "0.76447296", "0.76447296", "0.76397055", "0.763966", "0.76323915", "0.7605364", "0.75874513", "0.7569117", "0.7562648", "0.75594324", "0.7546495", "0.7504675", "0.7501086", "0.7500473", "0.7500473", "0.7499078", "0.7495104", "0.7448572", "0.7445383", "0.74375534", "0.7434781", "0.743228", "0.74137205", "0.73885995", "0.73717433", "0.7357643", "0.7333295", "0.7314106", "0.73026705", "0.73009694", "0.7257585", "0.7257585", "0.72565913", "0.72556126", "0.7254223", "0.72531193", "0.72531193", "0.7251575", "0.7248487", "0.7248487", "0.72270834", "0.72195643", "0.72116596", "0.72116596", "0.72116596", "0.72116596", "0.7183095", "0.70796204", "0.70483893", "0.7020386", "0.7018361", "0.7005764", "0.6992086", "0.6965397", "0.6957286", "0.6956516", "0.6956313", "0.6942573", "0.6942573", "0.6942573", "0.69388616", "0.6937664", "0.6919914", "0.6919773", "0.6912912", "0.69011354", "0.68856764", "0.68634623", "0.6862401", "0.6855497", "0.68522435", "0.68409836", "0.67991513", "0.67878294", "0.67722666", "0.67684567", "0.67669165", "0.6761782", "0.6761771", "0.67520356", "0.6751195" ]
0.81820065
2
TODO it 'Employee need to login to visit supplier page' do
def supplier_attrs phone_type = FactoryGirl.create :phone_type { organization_id: @employee.organization_id, supplier: FactoryGirl.attributes_for(:supplier, name: 'Test Abc') .merge({'addresses_attributes' => {'0' => FactoryGirl.attributes_for(:address, is_primary: true), '1' => FactoryGirl.attributes_for(:address, is_primary: false)}}) .merge({'phones_attributes' => {'0' => FactoryGirl.attributes_for(:phone, is_primary: true, phone_type_id: phone_type.id), '1' => FactoryGirl.attributes_for(:phone, is_primary: false, phone_type_id: phone_type.id) }}) .merge({'contacts_attributes' => {'0' => FactoryGirl.attributes_for(:contact, is_primary: true), '1' => FactoryGirl.attributes_for(:contact, is_primary: false)}}) } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n # supplier = Supplier.find_by :name =>\n # params[:name]\n @supplier = Supplier.find_by :email => params[:email]\n if @supplier.present? && @supplier.authenticate(params[:password])\n session[:supplier_id] = @supplier.id\n render :action => 'index.json'\n # redirect_to root_path\n else\n flash[:error] = \"Invalid email or password\"\n redirect_to login_path\n end\n end", "def test_page_security\n # A public page\n get '/home'\n assert_response :success\n # An administrator page\n get '/admin'\n assert_redirected_to_login\n\n form_login('admin', 'admin')\n \n get '/admin'\n assert_response :success\n end", "def test_action_security\n # A public action\n get '/goldberg/auth/login'\n assert_response :success\n # An administrator action\n get '/goldberg/users/list'\n assert_redirected_to_login\n\n form_login('admin', 'admin')\n\n get '/goldberg/users/list'\n assert_response :success\n end", "def login_user(user)\n visit '/employees/login?code=31202053297'\nend", "def it_should_collect_item(collectable_item_path, collectable_item)\n visit collectable_item_path\n click_link 'Add to a collection'\n if current_url.match /#{login_url}/\n page.fill_in 'session_username_or_email', with: @anon_user.username\n page.fill_in 'session_password', with: 'password'\n click_button 'Sign in'\n continue_collect(@anon_user, collectable_item_path)\n visit logout_url\n else\n continue_collect(@user, collectable_item_path)\n end\nend", "def login(user)\n if user == \"guest\"\n visit \"/log_out\"\n return\n end\n user = FactoryGirl.create(:user, role: user.to_s) unless user.instance_of?(User)\n visit \"/log_in\"\n page.fill_in \"Email\", with: user.email\n page.fill_in \"Password\", with: user.password\n click_button \"Log in\"\n user\nend", "def login\r\n print \"Logging in... \"\r\n login_page = @agent.get \"https://www.economist.com/user/login\"\r\n login_form = login_page.form_with(:id => \"user-login\")\r\n login_form[\"name\"] = @credentials['email']\r\n login_form[\"pass\"] = @credentials['password']\r\n user_page = @agent.submit login_form\r\n\r\n # we check for the email address on the page.\r\n #If not present, we assume login failed\r\n @login_success = user_page.body.include?(@credentials['email'])\r\n if (@login_success)\r\n print \"success\\n\"\r\n else\r\n print \"error\\nPlease check you credentials\"\r\n end\r\n @login_success\r\n end", "def login_test_details\n @pages.page_home.incorrent_login_test\n end", "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?('You are logged in as') \n assert last_response.body.include?(GOOD_USERNAME) \n end", "def test_grader_that_has_active_report_cant_take_on_another_report\n login_as :sean\n post :auto_assign\n assert_redirected_to :controller => :home, :action=>:index\n end", "def test_LogIn_ValidCredentials\n\n loginpage = Hudl_Login_Page.new @@driver\n\n loginpage.LogIn(@@validusername, @@validpassword)\n\n homepage = HUDL_home_page.new @@driver\n homepage.VerifyPage()\n\n end", "def do_login(name='admin', is_admin=true)\n u = user_create(name, is_admin)\n visit \"/dev/set_current_user?login=#{u.email_address}\"\n # raise \"do_login: Error login of #{name} with admin = #{is_admin}\" if page.status_code != 200\nend", "def test_pending_request\n get '/goldberg/users/list'\n assert_redirected_to_login\n\n form_login('admin', 'admin')\n assert_match /goldberg\\/users\\/list/, response.redirected_to\n end", "def login_page\n end", "def login; end", "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", "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", "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", "def test_good_login\r\n\t\tpost :home, :login => 'login', :email => 'god@example.com', :password => 'betterthanyou'\r\n\t\tassert_response :success\r\n\r\n\t\t# make sure the user_id is stored in the session\r\n\t\tassert_not_nil(session[:user_id])\r\n\t\tuser = User.find(session[:user_id])\r\n\t\tassert_equal 'deity.family', user.last_name\r\n\tend", "def login username, password\n @username = username\n\n @page = @page.form('Login') { |form|\n form['txtUserID'] = username\n form['txtPassword'] = password\n form['__EVENTTARGET'] = 'btnLogin'\n }.submit\n change_password password if @page.body =~ /Old Password/\n\n if @page.body =~ /Supervisor Services/ then\n warn \"switching to employee page\"\n option = @page.parser.css(\"select#Banner1_ddlServices\").children.find { |n| n[\"value\"] =~ /EmployeeServicesStart/ }\n @page = @agent.get option[\"value\"]\n end\n\n @page = @page.link_with(:text => 'Time Sheet').click\n end", "def login(email_id, pass_word)\n\t\n\tputs \"************** START : Log into 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 : Log into Razoo ****************\"\t\nend", "def loginpage\n end", "def test_12_login_while_donating()\n\t\t\n\t\tputs \"---------------------- START OF SCENARIO 12 ----------------------\"\n\t\tsearchOrg($new_orgname)\n\t\tgotoDonFormClickLogin($donation_amount, $normal2_emailId, $normal2_password)\n\t\tdonateUsingNewCard($donation_amount, $normal2_nameoncard, $street, $state, \n\t\t\t\t\t $city, $pin_code, $mastercard_number, $mastercard_seccode, $normal2don_emailId)\n\t\tpostComments(\"Give and be Blessed!!\")\n\t\tcheckMydonation($donation_amount)\n\t\tputs \"---------------------- END OF SCENARIO 12 --------------------------\"\n\tend", "def test_shold_not_show_to_non_admin\n sign_in Factory.create(:user)\n get :show\n assert_response :redirect\n end", "def happyTest(request)\n visit root_path\n submitServiceRequestPage (request)\n selectStudyPage(request)\n selectDatesAndArmsPage(request)\n serviceCalendarPage(request)\n documentsPage\n reviewPage(request)\n submissionConfirmationPage\n goToSparcProper\n\n if request.otfServices.length!=0 then \n adminPortal(request.study, request.otfServices[0]) \n end\n\n if request.ppServices.length!=0 then \n adminPortal(request.study, request.ppServices[0]) \n clinicalWorkFulfillment(request.study, request.ppServices[0])\n end\n\n userPortal(request)\n end", "def idt_login\n show do\n title \"Prepare to order primer\"\n \n check \"Go to the <a href='https://www.idtdna.com/site/account' target='_blank'>IDT website</a>, log in with the lab account. (Username: #{IDT_USER}, password is #{IDT_PASS}).\"\n warning \"Ensure that you are logged in to this exact username and password!\"\n end\n end", "def test_admin_can_show_user\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 user_id = User.find_by_username(NOBODY_USERNAME).id\n\n get \"/user/#{user_id}\"\n assert last_response.ok?\n assert last_response.body.include?(NOBODY_USERNAME)\n\n # ensure a request for unknown ID is bounced.\n get \"/user/153\"\n assert last_response.ok?\n assert last_response.body.include?(\"The user id supplied was not recognised\")\n\n end", "def check_redirect(proj)\n visit opening_path(proj)\n assert_text 'You must be logged in to view job openings.'\n assert page.has_css?('title', text: full_title('User Login'), visible: false)\n assert page.has_css?('h1', text: 'User Login')\n end", "def login_user\n visit landing_page_path\n click_on 'Login'\n fill_in 'Email', with: users(:tony).email\n fill_in 'Password', with: 'password'\n click_on 'Log in'\n end", "def test_admins_can_see_other_agents\n login_as :oleg\n get :show, :id => users(:jack).id\n assert_response :success\n end", "def test02_member_search_logged_in_TC_24435\n\t\tlogin $user_1_email, $master_password \n#\t\t$browser.cookies.clear\n\t\t$browser.goto($patch)\n\t\tsleep 4\n\t\t$search_text_field.set(\"Keelawn\")\n\t\t$search_button.click\n\t\t$search_result_keelawn.when_present.click\n\t\tsleep 2\n\t\t\n\t\tassert $browser.text.include? \"eelawn\"\n\tend", "def test_that_edit_requires_login\n assert_requires_login do |proxy|\n proxy.get :edit, :user_id => 11, :id => 1\n end\n end", "def staging_authentication \n page.driver.browser.manage.window.maximize #resize_to(1920, 1080)\n visit 'http://qa-workshop.staging.devguru.co/' \n fill_in 'code', with: 'biedronka'\n find_button('Sign in').click\nend", "def assert_rep!\n authenticate_user!\n if current_user.is_rep?\n return true\n else\n flash[:error] = 'Oops, you must be democratically elected to view that page.'\n redirect_to session[:last_clean_url]\n end\n end", "def test_reviewer_home\n\n post('index', {}, {})\n assert_response(:success)\n assert_template('tracker/index')\n \n post('index', {}, lee_hweng_session)\n assert_response(:success)\n assert_template('tracker/reviewer_home')\n\n #follow_redirect\n #assert_no_tag :content => \"POST Placement Review\"\n\n end", "def loginToSalesforce()\n #puts \"in AccountAssignmentFromLead:loginToSalesforce\"\n @driver.get \"https://test.salesforce.com/login.jsp?pw=#{@mapCredentials['Staging']['WeWork NMD User']['password']}&un=#{@mapCredentials['Staging']['WeWork NMD User']['username']}\"\n #switchToClassic(@driver)\n #EnziUIUtility.wait(@driver,:id, \"phHeaderLogoImage\",@timeSettingMap['Wait']['Environment']['Lightening']['Max'])\n return true\n #EnziUIUtility.wait(@driver,:id, \"phHeaderLogoImage\",60)\n rescue Exception => e\n puts e\n return false\n end", "def loginuser\n user = $helpers.register 'test@websyn.ca', 'testboop'\n visit '/login?/settings'\n fill_login\n user\nend", "def require_login\n end", "def register_mentee(first, sur, username, gender, yos, email)\n visit \"/mentee-form\"\n fill_in \"first_name\", with: first\n fill_in \"surname\", with: sur\n fill_in \"username\", with: username\n fill_in \"course\", with: \"COM1001\"\n select gender, from: \"gender\"\n select yos, from: \"year_of_study\"\n fill_in \"email\", with: email\n fill_in \"password\", with: \"Testpass\"\n click_button \"mentee_submit\"\n log_in \"Mentee1\"\nend", "def loginToSalesforce()\n #puts \"in AccountAssignmentFromLead:loginToSalesforce\"\n @driver.get \"https://test.salesforce.com/login.jsp?pw=#{@mapCredentials['Staging']['WeWork System Administrator']['password']}&un=#{@mapCredentials['Staging']['WeWork System Administrator']['username']}\"\n switchToClassic(@driver)\n #EnziUIUtility.wait(@driver,:id, \"phHeaderLogoImage\",@timeSettingMap['Wait']['Environment']['Lightening']['Max'])\n return true\n #EnziUIUtility.wait(@driver,:id, \"phHeaderLogoImage\",60)\n rescue Exception => e\n puts e\n return false\n end", "def test_should_get_edit\n login_as(:john)\n get :edit, :id => 1\n assert_response :redirect\n end", "def test_should_get_edit\n login_as(:john)\n get :edit, :id => 1\n assert_response :redirect\n end", "def test_designer_home\n\n post('index', {}, {})\n assert_response(:success)\n assert_template('tracker/index')\n\n post('index', {}, bob_designer_session)\n assert_response(:success)\n assert_template('tracker/designer_home')\n\n end", "def login_user_with_interface(username, password)\n activate_authlogic \n visit login_path\n click_link \"Connexion | Inscription\"\n fill_in 'user_session_username', :with => username\n fill_in 'user_session_password', :with => password\n click_button \"Connexion\"\n wait_for_ajax \nend", "def valid_signin(user)\n fill_in 'Email', with: user.email\n fill_in 'Password', with: user.password\n click_button 'Sign in', match: :first\n # print page\nend", "def test02_member_search_logged_in_TC_24435\n\t\tloginGroup \n\t\t$browser.cookies.clear\n\t\t$browser.goto($patch)\n\t\tsleep 4\n\t\t$search_text_field.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 \"GS3_T2: FAILED! Logged out user unable to find user.\"\n\t\tend\n\tend", "def test_login\n get \"my/page\"\n assert_redirected_to \"account/login\"\n log_user('jsmith', 'jsmith')\n \n get \"my/account\"\n assert_response :success\n assert_template \"my/account\" \n end", "def can_enter_mentee(name:, email:)\n click_link 'Add New Mentee'\n\n expect(body).not_to include(email)\n\n fill_in 'Email', with: email\n fill_in 'Name', with: name\n click_button('Save')\n\n visit current_path # reload\n\n expect(body).to include(email)\n end", "def test_auth_to_edit\n\n @request.session[:return_to] = \"/bogus/location\"\n\n # Log in as a designer and try to edit a user record.\n post(:login,\n { :user_login => \"richm\", :user_password => \"designer\" },\n {})\n assert_equal('Login successful', flash['notice'])\n \n post(:edit, { :id => @cathy_m.id }, rich_designer_session)\n assert_redirected_to( :action => \"index\", :controller => \"tracker\" )\n #assert_equal(Pcbtr::MESSAGES[:admin_only], flash['notice'])\n\n # Log in as a manager and try to edit a user record.\n post(:login,\n { :user_login => \"jim_l\", :user_password => \"test\" },\n {})\n\n #assert_equal('Login successful', flash['notice'])\n \n post(:edit, { :id => @cathy_m.id }, jim_manager_session)\n assert_redirected_to( :action => \"index\", :controller => \"tracker\" )\n #assert_equal(Pcbtr::MESSAGES[:admin_only], flash['notice'])\n\n end", "def test_redirect_logged_in\n # log in\n admin = users(:olm_admin_1)\n post :login, :user_login => admin.user_name, :user_password => 'asfd'\n assert_redirected_to :action => \"index\"\n\n # try to go to login page when logged in\n get :login\n assert_redirected_to :action => \"index\"\n end", "def login\n end", "def login\n end", "def login\n end", "def login\n end", "def login\n end", "def login\n end", "def login\n end", "def login\n end", "def login\n end", "def log_in_with(email, password, admin = nil)\n visit new_user_session_path(admin: admin)\n find('#login_email').set(email)\n find('#login_password').set(password)\n click_button 'Access Courses'\nend", "def login\n\tend", "def test_create_naming_get\n obs = observations(:coprinus_comatus_obs)\n params = {\n :id => obs.id.to_s\n }\n requires_login(:create_naming, params)\n assert_form_action(:action => 'create_naming', :approved_name => '')\n end", "def login_into_alchemy\n visit '/alchemy/admin/login'\n fill_in('alchemy_user_session_login', :with => 'jdoe')\n fill_in('alchemy_user_session_password', :with => 's3cr3t')\n click_on('Login')\n end", "def login_admin(administrator)\n visit new_administrator_session_path\n fill_in \"Email\", :with => administrator.email\n fill_in \"Password\", :with => administrator.password\n click_button \"Sign in\"\n end", "def feature_login_admin\n before(:each) do\n admin = create(:attached_admin)\n\n visit admin_root_path\n fill_in('user_email', with: admin.email)\n fill_in('user_password', with: admin.password)\n click_button 'Login'\n end\n end", "def login\n end", "def login\n\n end", "def login\n\n end", "def test_shall_list_briefcase_items\n login_as :administrator\n get :list\n assert :success\n end", "def logged_in_employee\n unless employee_logged_in?\n store_location\n flash[:danger] = \"Please log in.\"\n redirect_to employee_login_url\n end\n end", "def test_list\n\n # Try editing from a non-Admin account.\n # VERIFY: The user is redirected.\n get(:list, {}, rich_designer_session)\n assert_redirected_to(:controller => 'tracker', :action => 'index')\n assert_equal(Pcbtr::MESSAGES[:admin_only], flash['notice'])\n\n # Try listing from an Admin account\n # VERIFY: The project list data is retrieved\n get(:list, {:page => 1}, cathy_admin_session)\n assert_equal(8, assigns(:fab_houses).size)\n \n end", "def free_user_verify(partner)\n go_to_referrals(partner) # referrals page, they have a free plan\n go_to_upgrade(partner) # this page takes them into phoenix\n go_to_devices(partner) # devices\n go_to_downloads(partner)\n go_to_stash(partner)\n go_to_acct(partner) # default is to load this page w/o a 'go to account' link\n end", "def setup_user\n login_as(User.where(email: 'masterchef@cookbook.com').first, scope: :user)\n end", "def test_00070_add_feild_as_show_feild\n first_name = @c.users[user_for_test].name.split(' ')[0]\n # set first name feild as not show\n @admin_profile_page.navigate_in\n @admin_profile_page.custom_profile_feild \"First Name\", {0 => false }\n # admin can't see first name feild\n @profile_page.goto_profile\n url = @browser.url\n @browser.wait_until { @profile_page.profile_page_author_name_betaon.present? }\n assert !(@profile_page.profile_page_author_name_betaon.text.include? first_name)\n # user2 can't see first name feild\n @login_page.about_login(\"regular_user2\", \"logged\")\n @browser.goto url\n @browser.wait_until { @profile_page.profile_page_author_name_betaon.present? }\n assert !(@profile_page.profile_page_author_name_betaon.text.include? first_name)\n\n # set first name feild as show\n @login_page.about_login(\"network_admin\",\"logged\")\n @admin_profile_page.navigate_in\n @admin_profile_page.custom_profile_feild \"First Name\", {0 => true, 2 => false }\n # admin can't see first name feild]\n @browser.goto url\n @browser.wait_until { @profile_page.profile_page_author_name_betaon.present? }\n assert (@profile_page.profile_page_author_name_betaon.text.include? first_name)\n # user2 can't see first name feild\n @login_page.about_login(\"regular_user2\", \"logged\")\n @browser.goto url\n @browser.wait_until { @profile_page.profile_page_author_name_betaon.present? }\n assert (!@profile_page.profile_page_author_name_betaon.text.include? first_name)\n\n # set first name feild as public\n @login_page.about_login(\"network_admin\",\"logged\")\n @admin_profile_page.navigate_in\n @admin_profile_page.custom_profile_feild \"First Name\", {0 => true, 2 => true }\n # admin can see first name feild\n @browser.goto url\n @browser.wait_until { @profile_page.profile_page_author_name_betaon.present? }\n assert (@profile_page.profile_page_author_name_betaon.text.include? first_name)\n # user2 can see first name feild\n @browser.goto url\n @browser.wait_until { @profile_page.profile_page_author_name_betaon.present? }\n assert (@profile_page.profile_page_author_name_betaon.text.include? first_name)\n ensure\n # set first name feild as public\n @login_page.about_login(\"network_admin\",\"logged\")\n @admin_profile_page.navigate_in\n @admin_profile_page.custom_profile_feild \"First Name\", {2 => true }\n end", "def login\n visit '/users/new'\n # puts page.body\n fill_in 'user_name', :with=>'Bruce'\n fill_in 'user_email', :with=>'bruce@bruce.com'\n fill_in 'user_password', :with=>'bruce123'\n fill_in 'user_password_confirmation', :with=>'bruce123'\n click_button 'Create User'\n # puts page.body\n expect(page).to have_content('Please log in')\n visit '/'\n # puts page.body\n fill_in 'session[email]', :with=>'bruce@bruce.com'\n fill_in 'session[password]', :with=>'bruce123'\n click_button 'commit'\n # puts page.body\n expect(page).to have_content('Bruce')\nend", "def test_non_admin_user_cant_list_users\n # first log in\n get '/login' # need to do this to set up the form container.\n post '/login', { :username => NOBODY_USERNAME, :password => GOOD_PASSWORD }\n\n get '/users'\n assert last_response.redirect?\n end", "def log_user_in(user)\n visit new_user_session_path\n fill_in \"Email\", :with => user.email\n fill_in \"Password\", :with => user.password\n click_button\n controller.user_signed_in?.should be_true\nend", "def grantOrgAdminRights(admin_url, email_id, ein_number)\n\t\n\tputs \"************** START : Grant ORG Admin rights ****************\"\t\n\t$browser.open admin_url\n\t$browser.click \"link=Manage Org Admins\"\n\t$browser.wait_for_page_to_load \n\t$browser.type \"email\", email_id\n\t$browser.type \"ein\", ein_number\n\t$browser.click \"commit\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"Org Admin successfully created!\")\n\t\tputs \"Passed. Org Admin successfully created for #{email_id} user\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Failed. Org Admin has not created successfully for #{email_id} user\"\n\tend\n\t\n\tputs \"************** END : Grant ORG Admin rights ****************\"\t\n\t\nend", "def grantOrgAdminRights(admin_url, email_id, ein_number)\n\t\n\tputs \"************** START : Grant ORG Admin rights ****************\"\t\n\t$browser.open admin_url\n\t$browser.click \"link=Manage Org Admins\"\n\t$browser.wait_for_page_to_load \n\t$browser.type \"email\", email_id\n\t$browser.type \"ein\", ein_number\n\t$browser.click \"commit\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"Org Admin successfully created!\")\n\t\tputs \"Passed. Org Admin successfully created for #{email_id} user\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Failed. Org Admin has not created successfully for #{email_id} user\"\n\tend\n\t\n\tputs \"************** END : Grant ORG Admin rights ****************\"\t\n\t\nend", "def do_login_ui(name='admin', is_admin=true)\n email = \"#{name}@concord.org\"\n pass = \"#{name}pAsS\"\n u = User.find_or_create_by_name(name) do |u|\n u.email_address = email\n u.password = u.password_confirmation = pass\n u.state = 'active'\n u.administrator = is_admin\n end\n u.save!\n\n visit '/logout'\n visit '/login'\n fill_in \"login\", :with => email\n fill_in \"password\", :with => pass\n click_button 'Login'\nend", "def correct_emp\n @emp=Enterprise.find(params[:id])\n redirect_to(current_emp) unless current_emp.id==@emp.id || current_user.role>3\n end", "def login_user_for_feature(user)\n visit new_user_session_path\n close_cookies_alert\n fill_in 'Email', with: user.email\n fill_in 'Password', with: user.password\n click_on 'Log in'\n user_should_be_logged_in\n page_should_finish_loading\nend", "def test_003\n open_pu_management_page\n assert is_element_present(xpath[\"pu_management\"][\"search_box\"])\n assert is_element_present(xpath[\"pu_management\"][\"pu_table\"])\n logout\n end", "def log_in_as(login, plaintext_password = 'password')\n visit '/'\n fill_in 'username_or_email', with: login\n fill_in 'password', with: plaintext_password\n click_on 'Login'\nend", "def logged_in_employee\n unless employee_logged_in?\n flash[:danger] = \"You do not have Access\"\n redirect_to employee_login_url\n end\n end", "def register_mentee\n visit \"/index\"\n click_button \"mentee-signup\"\n fill_in \"first_name\", with: \"First\"\n fill_in \"surname\", with: \"Surname\"\n fill_in \"course\", with: \"COM1001\"\n select 'Male', from: \"gender\"\n select '1st', from: \"year_of_study\"\n fill_in \"email\", with: \"test@test.com\"\n fill_in \"password\", with: \"Testpass\"\n click_button \"mentee_submit\"\nend", "def login(email='', password='')\n visit(new_user_session_path)\n fill_in(\"user_email\", with: email.empty? ? @user.email : email)\n fill_in(\"user_password\", with: password.empty? ? @user.password : password)\n click_on(\"login_main\")\nend", "def login\n visit login_path\n click_link 'Create an account'\n fill_in 'identity_name', with: 'alice'\n fill_in 'identity_email', with: 'alice@example.com'\n fill_in 'identity_password', with: '1234567'\n fill_in 'identity_password_confirmation', with: '1234567'\n click_button 'Sign up'\n page.should have_content('Signed in')\n end", "def login_instructions\n end", "def grantOrgAdminRights(admin_url, email_id, ein_number)\n\t\n\tputs \"************** START : Grant ORG Admin rights ****************\"\t\n\t$browser.open admin_url\n\t$browser.open \"admin/org_admins\"\n\t$browser.wait_for_page_to_load \n\t$browser.type \"email\", email_id\n\t$browser.type \"ein\", ein_number\n\t$browser.click \"commit\"\n\t$browser.wait_for_page_to_load \n\tbegin\n\t\tassert $browser.is_text_present(\"Org Admin successfully created!\")\n\t\tputs \"Passed. Org Admin successfully created for #{email_id} user\"\n\trescue Test::Unit::AssertionFailedError\n\t\tputs \"Failed. Org Admin has not created successfully for #{email_id} user\"\n\tend\n\t\n\tputs \"************** END : Grant ORG Admin rights ****************\"\t\n\t\nend", "def test_logged_in_admin_can_list_users\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 '/users'\n assert last_response.ok?\n assert last_response.body.include?('There are 2 users')\n end", "def test_private_method_actually_logging_in\n test_private_method\n login :index, 'ferret', 'REVOLUTION'\n assert_response :success\n login :index, 'ferret', 'WRONGPASSWORD'\n assert_protected\n end", "def test_LogIn_InvalidCredentials\n\n loginpage = Hudl_Login_Page.new @@driver\n\n loginpage.LogIn(@@invalidusername, @@invalidpassword)\n\n loginpage.VerifyPage()\n\n end", "def test05_LI2_repost_review\n\t\t$browser.goto($patch_login)\n\t\tloginDirectory\n\t\t$browser.goto($patch_directory_listing)\n\t\t\n\t\t\n\t\t\n\tend", "def login_rave\n @session = Capybara::Session.new(:selenium)\n @session.visit \"https://conlabtesting93.mdsol.com/\"\n @session.find('#UserLoginBox').set 'defuser'\n @session.find('#UserPasswordBox').set 'password'\n @session.find('#LoginButton').click\n end", "def logged_in\n found_florist = Florist.where(status: \"Active\").where(company_id: params[\"company_id\"]).first \n if found_florist != nil\n found_user = Employee.where(status: \"Active\").where(florist_id: found_florist.id).where(username: params[\"username\"]).first\n if found_user && found_user.authenticate(params[\"password\"])\n session[\"found_user_id\"] = found_user.id\n session[\"found_florist_id\"] = found_florist.id\n redirect_to home_path and return\n else # do nothing\n end\n end\n render(:login, layout:false) and return\n end", "def test_ID_25843_edit_profile_what_i_love_about_your_town\n login_as_user1\n go_to_edit_profile_page\n verify_little_more_about_my_community\n verify_text_can_be_entered_saved_on_about_my_community\n end", "def test_ID_25843_edit_profile_what_i_love_about_your_town\n login_as_user1\n go_to_edit_profile_page\n verify_little_more_about_my_community\n verify_text_can_be_entered_saved_on_about_my_community\n end", "def displayLoginPage()\n\t# User Name: \n\t# Password:\n\t# Forgot Password?\tNew User?\n\treturn\nend", "def logged_in_employer\n\t unless logged_employer_in?\n\t flash[:danger] = \"Proszę się zalogować.\"\n\t redirect_to url_for(controller: 'employers', action: 'create')\n\t end\n\tend", "def test_login_page\n get :login\n title = assigns(:title)\n\n assert_equal \"Login Page\", title\n assert_response :success\n assert_template \"login\"\n assert_form_tag \"/user/login\"\n assert_screen_name_field\n assert_password_field\n assert_tag \"input\", :attributes => { :name => \"user[remember_me]\",\n :type => \"checkbox\"\n }\n assert_submit_button \"Login!\"\n end" ]
[ "0.6632423", "0.6550143", "0.6488614", "0.6418471", "0.639867", "0.6398366", "0.6381315", "0.6364478", "0.6362796", "0.6346718", "0.63345975", "0.63100624", "0.63077956", "0.6236504", "0.6210347", "0.6204072", "0.6204072", "0.6204072", "0.61961454", "0.61869633", "0.61864126", "0.6162615", "0.61403525", "0.6133942", "0.6123712", "0.6114553", "0.6112725", "0.60986155", "0.609329", "0.6086375", "0.60689884", "0.60620517", "0.6054896", "0.6054874", "0.6047469", "0.60433096", "0.60432684", "0.60424626", "0.603771", "0.6031325", "0.6022678", "0.6022678", "0.6022408", "0.6015927", "0.60071725", "0.6004576", "0.59996647", "0.5966089", "0.5962908", "0.59610933", "0.59568787", "0.59568787", "0.59568787", "0.59568787", "0.59568787", "0.59568787", "0.59568787", "0.59568787", "0.59568787", "0.5955433", "0.59542924", "0.5940205", "0.5937536", "0.5936565", "0.5928868", "0.59250426", "0.592402", "0.592402", "0.59160024", "0.5913992", "0.59122103", "0.5910536", "0.59022653", "0.58891296", "0.5888626", "0.58826005", "0.58819276", "0.58806837", "0.58806837", "0.5877256", "0.5873762", "0.5862411", "0.58519655", "0.5846901", "0.58424175", "0.5840384", "0.5837243", "0.58311737", "0.5828482", "0.5826772", "0.5821812", "0.58210135", "0.5812437", "0.5812105", "0.58036065", "0.5801337", "0.5797081", "0.5797081", "0.57958347", "0.5792906", "0.57895476" ]
0.0
-1
Object :source_link Link link between source and target
def initialize(owner, name) @owner, @name, @source_link = owner, name.to_s, nil reset_value end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _link # :nodoc:\n #that=self\n l=Mark.new().\n mark_extend(@node).\n data(lambda {|d| [d.source_node, d.target_node] }).\n fill_style(nil).\n line_width(lambda {|d,_p| _p.link_value * 1.5 }).\n stroke_style(\"rgba(0,0,0,.2)\")\n l\n end", "def link(kind, source, target_location, target_kind, attributes=Occi::Core::Attributes.new, mixins=[])\n link = Occi::Core::Link.new(kind)\n link.mixins = mixins\n link.attributes = attributes\n link.target = (target_location.kind_of? URI::Generic) ? target_location.path : target_location.to_s\n link.rel = target_kind\n\n jj link\n link.check @model\n source.links << link\n\n link\n end", "def make_link(source:, link:)\n @output.item @i18n.t('setup.ln', target: link, source: source)\n FileUtils::rm link if (File::symlink? link and not File::exist? link)\n FileUtils::ln_s source, link unless File::exist? link\n end", "def links\n @source._links\n end", "def link\n Dir.mkdir @target unless Dir.exists? @target\n \n # When we find a directory, create it in the target area\n create_directory = lambda do |path|\n directory = \"#{@target}/#{path}\"\n Dir.mkdir directory unless Dir.exists? directory\n end\n \n # When we find a file, symlink it in the target area\n create_symlink = lambda do |path|\n source = \"#{@source}/#{path}\"\n target = \"#{@target}/#{path}\"\n if File.exists?(target)\n if File.symlink?(target)\n if File.readlink(target) == source\n return\n end\n else\n message = \"#{target} exists and is not a symlink\"\n puts message if @args[:verbose]\n raise message if @raise\n return\n end\n end\n puts \"Creating #{target} -> #{source}\" if @args[:verbose]\n File.unlink(target) if File.exists?(target)\n File.symlink(source, target)\n end\n \n Xo::Directory::Walk.new(@source, dir_cb: create_directory, file_cb: create_symlink).process\n end", "def link_standard_from_code(to, from)\n to.source = from.container.url\n to.id = from.id\n to.uri = from.uri\n to.prefix = from.container.id\n to.title = from.title\n to.description = from.description\n to.pattern = from.pattern\nend", "def link_from(src)\n swap(src)\n end", "def link\n @link\n end", "def linked\n ret = []\n self.links.inject(ret){|arr , link| arr << link.target}\n self.incomming_links.inject(ret){|arr , link| arr << link.source}\n ret\n end", "def link\n object[\"link\"]\n end", "def relationship_links(source)\n {}\n end", "def link(*link_params)\n raise \"link takes 1/2 params, not: #{link_params}\" unless (1..2).cover? link_params.size\n\n link_def = if link_params.size == 1 && link_params.first.is_a?(Hash)\n link_params.first\n else\n keys = %i[key path]\n link_params.each_with_index.map { |p, idx| [keys[idx], p] }.to_h\n end\n\n raise 'link to an endpoint apart from :self needs a path' unless link_def[:key] == :self || link_def[:path]\n\n link_def[:link_source_vars] = @current_source.clone\n @link_stack.last << link_def\n end", "def link(other)\n self.class.graph.join(nil, vertex, other.vertex)\n end", "def add_link(target)\n link = Link.new\n link.target_type = target.class.to_s\n link.target_id = target.id\n #adding a link to the link collection should set the polymorphic assosication\n links << link\n link\n end", "def link(object)\n actor = object.kind_of?(Actor) ? object : object.actor\n actor.send(:_link, self)\n object\n end", "def link(src, dest, w=1, add=:add)\n if (!@directed) \n begin\n src, dest = dest, src if (src > dest)\n rescue ArgumentError\n src, dest = dest, src if (src.object_id > dest.object_id)\n end\n end\n key = [src,dest]\n unless l = @links[key]\n l = Link.new(self, src, dest)\n @sourcelinks[src] << l\n @destlinks[dest] << l\n @links[key] = l\n end\n\n case add\n when :max, false\n l.maxweight(w)\n when :min\n l.minweight(w)\n else # add\n l.addweight(w)\n end\n l\n end", "def link_object(obj, title = T.unsafe(nil), anchor = T.unsafe(nil), relative = T.unsafe(nil)); end", "def link_file(source, *args)\n config = args.last.is_a?(Hash) ? args.pop : {}\n destination = args.first || source\n source = File.expand_path(find_in_source_paths(source.to_s))\n\n create_link destination, source, config\n end", "def msg_LINKS(source, args)\n return \":#{@server.sid} NOTICE #{source} :We don't support LINKS. Please kindly die in a fire.\"\n end", "def link(from,to,tag)\n if(to.local?)\n raise JiakResourceException, \"Can't link to a local resource\"\n end\n\n link = JiakLink.new(to.jiak.object.bucket, to.jiak.object.key, tag)\n unless from.jiak.object.links.include?(link)\n from.jiak.object.links << link\n do_auto_update(from)\n end\n from\n end", "def add_source(object)\n\t\t\tif validate_source_destination(object)\n\t\t\t\t@source = object\n\t\t\t\tobject.add_output(self)\n\t\t\telse\n\t\t\t\traise \"Invalid arc source object: #{object.class}\"\n\t\t\tend\n\t\tend", "def link(**opt)\n opt[:path] = show_path(id: object.identifier)\n super(**opt)\n end", "def conditional_link(source, target = source)\n source_dir = @onabase + \"/www/local/plugins/cfg_archive/bin/\"\n target_dir = @onabase + \"/bin/\"\n\n source_file = source_dir + source\n target_link = target_dir + target\n\n FileUtils.ln_sf(source_file, target_link)\nend", "def link_self; end", "def link(text, target, attributes = {})\n if target.is_a? Fixnum\n attributes[:rel] = rel_value(target)\n target = url(target)\n end\n @template.link_to(text, target, attributes)\n end", "def link uri\n self.apply_hyperlink java.net.URI.new(uri)\n end", "def links\n linked_to.map{|to|[self,to]}\n end", "def link(node_link)\n @node_link = node_link\n self\n end", "def convert_link link\n TraceProtos::Span::Link.new \\\n trace_id: link.trace_id,\n span_id: link.span_id,\n type: link.type,\n attributes:\n convert_attributes(link.attributes,\n link.dropped_attributes_count)\n end", "def linkItem _obj, _args\n \"_obj linkItem _args;\" \n end", "def link!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 25 )\n\n type = LINK\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 159:8: 'link'\n match( \"link\" )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 25 )\n\n end", "def path\n @link.TargetPath\n end", "def link() url; end", "def link() url; end", "def link(*args)\n Restfulie::Common::Builder::Rules::Link.new(*args)\n end", "def create_symlink(source = nil, dest = nil)\n end", "def linkable\n\t\tself\n\tend", "def linkable\n\t\tself\n\tend", "def link(label, target, op, flow_name=nil)\n label = label.to_sym unless label.nil?\n op = op.to_sym unless op.nil?\n flow_name = flow_name.to_sym unless flow_name.nil?\n raise ConfigError.new(\"Link #{label} already exists.\") unless @links[label].nil?\n @links[label] = Link.new(flow_name, target.to_sym, op)\n end", "def link(obj)\n return \"<a href='#{R(obj, self.id)}'>#{self.name}</a>\"\n end", "def link(text, target, attributes = {})\n if target.is_a? Fixnum\n attributes[:rel] = rel_value(target)\n target = url(target)\n end\n @template.link_to(text, target, attributes.merge(:remote => true))\n end", "def hyperlink\n @hyperlink_rel ? @hyperlink_rel.target : ''\n end", "def attach(source); end", "def links; end", "def links; end", "def link(dry = false)\n @links.each do |l|\n report \"Linking: #{l.dst} -> #{l.src}\"\n\n l.link unless dry\n end\n end", "def resource_link=(value)\n @resource_link = value\n end", "def text_link(label,options={})\n options[:label]=label\n set RGhost::TextLinkIn.new(options)\n end", "def relation(*args)\n source_node.join(target_node, *args)\n end", "def link *a, &b; app.link *a, &b end", "def _Link\n\n _save = self.pos\n while true # choice\n _tmp = apply(:_ExplicitLink)\n break if _tmp\n self.pos = _save\n _tmp = apply(:_ReferenceLink)\n break if _tmp\n self.pos = _save\n _tmp = apply(:_AutoLink)\n break if _tmp\n self.pos = _save\n break\n end # end choice\n\n set_failed_rule :_Link unless _tmp\n return _tmp\n end", "def link(resource,tag)\n self.class.link(self,resource,tag)\n end", "def linked\n request('linked')\n end", "def link(old)\n warn 'Path::Name#link is obsoleted. Use Path::Name#make_link.'\n File.link(old, path)\n end", "def parse_link\n start_line_number = @src.current_line_number\n result = @src.scan(LINK_START)\n cur_pos = @src.pos\n saved_pos = @src.save_pos\n\n link_type = (result =~ /^!/ ? :img : :a)\n\n # no nested links allowed\n if link_type == :a && (@tree.type == :img || @tree.type == :a ||\n @stack.any? {|t, _| t && (t.type == :img || t.type == :a) })\n add_text(result)\n return\n end\n el = Element.new(link_type, nil, nil, location: start_line_number)\n\n count = 1\n found = parse_spans(el, LINK_BRACKET_STOP_RE) do\n count += (@src[1] ? -1 : 1)\n count - el.children.select {|c| c.type == :img }.size == 0\n end\n unless found\n @src.revert_pos(saved_pos)\n add_text(result)\n return\n end\n alt_text = extract_string(cur_pos...@src.pos, @src).gsub(ESCAPED_CHARS, '\\1')\n @src.scan(LINK_BRACKET_STOP_RE)\n\n # reference style link or no link url\n if @src.scan(LINK_INLINE_ID_RE) || !@src.check(/\\(/)\n emit_warning = !@src[1]\n link_id = normalize_link_id(@src[1] || alt_text)\n if @link_defs.key?(link_id)\n link_def = @link_defs[link_id]\n add_link(el, link_def[0], link_def[1], alt_text,\n link_def[2] && link_def[2].options[:ial])\n else\n if emit_warning\n warning(\"No link definition for link ID '#{link_id}' found on line #{start_line_number}\")\n end\n @src.revert_pos(saved_pos)\n add_text(result)\n end\n return\n end\n\n # link url in parentheses\n if @src.scan(/\\(<(.*?)>/)\n link_url = @src[1]\n if @src.scan(/\\)/)\n add_link(el, link_url, nil, alt_text)\n return\n end\n else\n link_url = +''\n nr_of_brackets = 0\n while (temp = @src.scan_until(LINK_PAREN_STOP_RE))\n link_url << temp\n if @src[2]\n nr_of_brackets -= 1\n break if nr_of_brackets == 0\n elsif @src[1]\n nr_of_brackets += 1\n else\n break\n end\n end\n link_url = link_url[1..-2]\n link_url.strip!\n\n if nr_of_brackets == 0\n add_link(el, link_url, nil, alt_text)\n return\n end\n end\n\n if @src.scan(LINK_INLINE_TITLE_RE)\n add_link(el, link_url, @src[2], alt_text)\n else\n @src.revert_pos(saved_pos)\n add_text(result)\n end\n end", "def link( index )\n\t\tLink.new( \n\t\t\tself.words[ self.link_lword(index) ],\n\t\t\tself.words[ self.link_rword(index) ],\n\t\t\tself.link_length(index),\n\t\t\tself.link_label(index),\n\t\t\tself.link_llabel(index),\n\t\t\tself.link_rlabel(index),\n\t\t\tLinkTypes[ self.link_label(index).gsub(/[^A-Z]+/, '').to_sym ]\n\t\t)\n\tend", "def latex_link_target(el, add_label = T.unsafe(nil)); end", "def link(from, to)\n to.parent = from.parent unless to.parent # HACK: to.parent may be nil\n href = from.parent.aref_to(to.path)\n to_parent = to.parent.full_name.dup\n if @options.show_hash\n text = from.parent.full_name == to_parent ? '' : to_parent\n text << (to.singleton ? '::' : '#') << to.name\n elsif from.parent.full_name == to_parent\n text = to.name.dup\n else\n text = to_parent\n text << (to.singleton ? '::' : '#') << to.name\n end\n %Q(<a href=\"#{href}\">#{h(text)}</a>)\n end", "def link\n\t\t\t@data['link']\n\t\tend", "def link_target=(link_target)\n self.raw_data = nil\n @link_target = link_target\n end", "def set_symlink(source,target)\n fail \"Original path doesn't exist or isn't a directory.\" unless File.directory?(source)\n fail \"Target already exists.\" unless File.directory?(target) == false\n puts \"creating a symlink from #{source} => #{target}.\"\n FileUtils.ln_s(source,target,:verbose => true)\n end", "def create_links\n end", "def create_links\n end", "def link\n @link ||= uri.to_s\n end", "def link *a; app.link *a end", "def link\n node.at(\"link\").text\n end", "def set_link\n @link = Link.find(params[:id])\n end", "def set_link\n @link = Link.find(params[:id])\n end", "def initialize(a, b)\n @source, @target = a, b\n end", "def link *args\n self.destination_and_options( args ) do |lnk, opts|\n symlink_requested = self.directory? || opts[:symbolic] || opts[:sym] || opts[:soft]\n \n if symlink_requested\n self.symlink lnk, opts\n else\n FileUtils.ln self, lnk, ** Utils::Opts.narrow_file_utils_options( opts, :ln )\n end\n \n lnk.fwf_filepath\n end\n end", "def attach!(target:raise, edge:raise, source:self)\n target = add!(target)\n\n connect!(target: target, edge: edge, source: source)\n end", "def link association_name, src_end, src, trg_end, trg\n trg_setter= \"#{trg_end}=\".to_sym\n if src_end\n src_setter= \"#{src_end}=\".to_sym\n trg.each do |t| \n old_src= t.send src_end\n old_src= old_src - src if old_src\n t.send src_setter, src\n end\n end\n src.each do |s|\n old_trg= s.send trg_end\n old_trg= old_trg - trg if old_trg\n s.send trg_setter, trg\n end\n end", "def link(link, title, content)\n\t \"<u><link href='#{link}'>#{content}</link></u>\"\n\t end", "def linkgen\n\n LinkGenerator.new(request)\n end", "def link\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 11 )\n hash = nil\n link_value16 = nil\n\n begin\n # at line 97:4: 'Link' ':' link_value\n match(T__21, TOKENS_FOLLOWING_T__21_IN_link_499)\n match(T__10, TOKENS_FOLLOWING_T__10_IN_link_501)\n @state.following.push(TOKENS_FOLLOWING_link_value_IN_link_503)\n link_value16 = link_value\n @state.following.pop\n # --> action\n hash = link_value16\n # <-- action\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 11 )\n\n end\n\n return hash\n end", "def set_link\n @link = Link.find(params[:id])\n end", "def set_link\n @link = Link.find(params[:id])\n end", "def set_link\n @link = Link.find(params[:id])\n end", "def set_link\n @link = @campaign.links.find(params[:id])\n end", "def hyperlink=(val)\n @hyperlink_rel ||= @parent.create_relationship(\"hyperlink\")\n @hyperlink_rel.target = val\n @hyperlink_rel.target_mode = \"External\"\n self.value = val if @value.nil?\n end", "def external_link(link_label, url, options={})\n attributes = options[:attributes] || {}\n children = options[:children] || {}\n image = options[:image] || {}\n\n img =\"\"\n unless image.empty?\n img = self.external_image(image[:url], image, true) \n end\n\n child_elements = self.children_list(children) << img\n link_label = self.tag('label', link_label)\n url = self.tag('url', url)\n link = self.tag('externalLink', url << link_label << child_elements, attributes)\n\n cell = options[:cell] || {}\n row = options[:row] || {}\n self.row_cell(link, cell, row)\n end", "def link_entry(src, dest, dereference_root = false, remove_destination = false)\n Entry_.new(src, nil, dereference_root).traverse do |ent|\n destent = Entry_.new(dest, ent.rel, false)\n File.unlink destent.path if remove_destination && File.file?(destent.path)\n ent.link destent.path\n end\n end", "def process_links!(source)\r\n links.each{ |l| source.gsub!(\"[[#{l}]]\", link(l)) }\r\n end", "def set_link\n @link = Link.find(params[:id])\n end", "def set_link\n @link = Link.find(params[:id])\n end", "def set_link\n @link = Link.find(params[:id])\n end", "def set_link\n @link = Link.find(params[:id])\n end", "def set_link\n @link = Link.find(params[:id])\n end", "def set_link\n @link = Link.find(params[:id])\n end", "def set_link\n @link = Link.find(params[:id])\n end", "def set_link\n @link = Link.find(params[:id])\n end", "def set_link\n @link = Link.find(params[:id])\n end", "def set_link\n @link = Link.find(params[:id])\n end", "def set_link\n @link = Link.find(params[:id])\n end", "def set_link\n @link = Link.find(params[:id])\n end", "def set_link\n @link = Link.find(params[:id])\n end", "def set_link\n @link = Link.find(params[:id])\n end", "def set_link\n @link = Link.find(params[:id])\n end", "def set_link\n @link = Link.find(params[:id])\n end", "def set_link\n @link = Link.find(params[:id])\n end", "def set_link\n @link = Link.find(params[:id])\n end" ]
[ "0.7172718", "0.70488435", "0.7004372", "0.6687922", "0.6650446", "0.64533055", "0.64459884", "0.6442934", "0.6436069", "0.6425707", "0.63875926", "0.6365366", "0.6346967", "0.6344824", "0.63323754", "0.6253767", "0.6220664", "0.6207665", "0.6202209", "0.61936206", "0.6177848", "0.6148829", "0.61316776", "0.6115691", "0.60537434", "0.60493386", "0.60391045", "0.6032827", "0.6027499", "0.6021585", "0.60215294", "0.6021326", "0.6006141", "0.6006141", "0.5972725", "0.596585", "0.59520954", "0.59520954", "0.5935634", "0.5916688", "0.5900076", "0.58879757", "0.58728355", "0.58656025", "0.58656025", "0.585802", "0.58422387", "0.58328605", "0.5806328", "0.57970995", "0.578675", "0.5781587", "0.57683814", "0.5763464", "0.5747555", "0.5742971", "0.57343715", "0.57201546", "0.5719869", "0.57143605", "0.5710966", "0.5710384", "0.5710384", "0.56990075", "0.56928396", "0.56866556", "0.56848305", "0.56848305", "0.5677526", "0.567719", "0.56768847", "0.5674456", "0.56704706", "0.56703275", "0.5665219", "0.5660956", "0.5660956", "0.5660956", "0.56547976", "0.5651919", "0.5645181", "0.5638751", "0.56359243", "0.5631714", "0.5631714", "0.5631714", "0.5631714", "0.5631714", "0.5631714", "0.5631714", "0.5631714", "0.5631714", "0.5631714", "0.5631714", "0.5631714", "0.5631714", "0.5631714", "0.5631714", "0.5631714", "0.5631714", "0.5631714" ]
0.0
-1
After unbinding the source the value can be reset, or kept. The default is to reset the target's (self) value.
def remove_source(reset = true) return unless @source_link src, @source_link = @source_link, nil src.unbind reset_value if reset src.binding_source end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reset\n @source.each_value(&:reset)\n nil\n end", "def reset\n @value = nil\n end", "def reset_change!\n @_changed = false\n self\n end", "def internal_reset(initial_value); end", "def m_clear\n a = source \"a\"\n a.clear\n sink a\nend", "def reset_observable\n @observable_value = nil\n\n notify_observers\n end", "def reset(value=0)\n @value = value\n end", "def reset()\n @value = self.min\n end", "def unbind(old_target, options = {})\n binding(old_target).unbind(options)\n if base.persisted? && !old_target.destroyed? && !options[:binding]\n old_target.delete\n end\n end", "def reset!\n @delegate_instance = nil\n end", "def reset\n @loaded = false\n @target = nil\n @stale_state = nil\n end", "def reset\n @loaded = false\n @target = nil\n @stale_state = nil\n end", "def __component_will_update__\r\n ref(\"#{self}\").value = \"\" if props.reset_value == true\r\n super\r\n end", "def reset\n @value = nil\n @count = 0\n end", "def reset\n dup.reset!\n end", "def reset!\n instance.reset!\n end", "def reset!\n instance.reset!\n end", "def reset!\n self.instance.reset!\n end", "def reset!\n self.instance.reset!\n end", "def unhook\n Nest.get(base_module).remove(self)\n Agency.instance.retire(self)\n\n and_return(@original_value) if previously_defined?\n\n @original_value = @previously_defined = nil\n self\n end", "def __component_will_update__\n ref(\"#{self}\").value = \"\" if props.reset_value == true\n super\n end", "def change!\n @instance = nil\n end", "def unbind\n unless _binding?\n _binding do\n if base.embedded_many?\n target.do_or_do_not(metadata.inverse(target)).delete(base)\n else\n target.do_or_do_not(metadata.inverse_setter(target), nil)\n end\n end\n end\n end", "def lost_value(connector)\n ([c,f]-[connector]).each { |connector| connector.forget_value(self) }\n end", "def nullify\n criteria.update_all(foreign_key => nil)\n _target.clear do |doc|\n unbind_one(doc)\n doc.changed_attributes.delete(foreign_key)\n end\n end", "def reset_assignment_value\n @assignment_value = nil\n end", "def unbind(key)\n\t\t@bindings[key] = nil\n\tend", "def unbind; end", "def unuse\n @use = nil\n end", "def lost_value(connector)\n ([a,b,out]-[connector]).each { |connector| connector.forget_value(self) }\n end", "def revalue\n @value = nil\n @ops.each do |v|\n v[1].revalue\n end\n end", "def unbind() end", "def value=(new_value, unbind = true)\n self.unbind if unbind\n unless value == new_value\n super(new_value)\n changed.emit(new_value)\n end\n new_value\n end", "def change!\n @_changed = true\n unsend!\n self\n end", "def reset_data(value = nil)\n # This method was originally setup to set the reset value by passing an argument\n if value\n shift_out_with_index { |bit, i| bit.reset_val = value[i] }\n self\n else\n data = 0\n shift_out_with_index do |bit, i|\n return bit.reset_data if bit.reset_data.is_a?(Symbol)\n\n data |= bit.reset_data << i\n end\n data\n end\n end", "def unbind\n logdebug \"unbind\"\n end", "def reset\n synchronized do\n old = @value\n @value = 0\n return old\n end\n end", "def unbind\n if bound?\n configs.each_pair do |key, config|\n store[key] = config.get(receiver)\n end\n @receiver = nil\n end\n self\n end", "def reset\n @active = true\n each_parent_object(EventStructure::Signal) do |source|\n if source.respond_to?(:reset)\n source.reset\n end\n end\n end", "def unbind\n\t\tif @conn.bound?\n\t\t\told_conn = @conn\n\t\t\t@conn = old_conn.dup\n\t\t\told_conn.unbind\n\t\tend\n\tend", "def reset!\n # this should be overridden by concrete adapters\n end", "def unbind\n finalize_and_stop_dataflow\n EM.stop\n end", "def reset(resource)\n reset_value(resource)\n end", "def clear\n @val = 0\n self\n end", "def lost_value(connector)\n ([a, b, out] - [connector]).each { |connector| connector.forget_value(self) }\n end", "def reset(_object); end", "def unbind_one(doc, options = {})\n base.do_or_do_not(metadata.foreign_key).delete(doc.id)\n if options[:continue]\n inverse = metadata.inverse(target)\n if inverse\n doc.do_or_do_not(\n inverse, false, OPTIONS\n ).delete(base, :binding => true, :continue => false)\n end\n end\n end", "def reset!\n @callers = @default.dup\n self\n end", "def reset()\n @x\n \n end", "def reset_and_clear_bindings!\n reset!\n @stmt_api.clear_bindings!\n end", "def reset\n super\n end", "def unbind\n self.close\n @master.unbind(@name)\n end", "def unbind\n\tend", "def unbind\r\n debug [@name, :unbind]\r\n @plexer.unbind_backend(@name)\r\n end", "def reset\n @assigned = false\n end", "def unbind_one(doc)\n binding do\n base.send(metadata.foreign_key).delete_one(doc.id)\n inverse_keys = doc.you_must(metadata.inverse_foreign_key)\n if inverse_keys\n inverse_keys.delete_one(base.id)\n doc.reset_relation_criteria(metadata.inverse)\n end\n base.synced[metadata.foreign_key] = true\n doc.synced[metadata.inverse_foreign_key] = true\n end\n end", "def unbind(options = {})\n target.each { |doc| unbind_one(doc, options) }\n end", "def reset\n @data = nil\n end", "def reset\n # Empty, but subclasses will override this.\n end", "def reset\n @number = nil\n end", "def unaltered(value)\n value\n end", "def unaltered(value)\n value\n end", "def reset!\n self.user_values = {}\n\n # @inputs have to be nil, not an empty hash. otherwise\n # the memoized inputs will not pick up the changes.\n @inputs = nil\n end", "def restore_default()\n @is_explicit = false\n @value = @default_value\n end", "def reset_state\n @hidden.data = @hidden.data.fill(0) if @hidden.data\n end", "def reset\n @bridge.reset\n end", "def reset\n unapply\n apply\n end", "def reset_state\n @state = nil\n end", "def reset_ability\n @ability = @original.ability\n end", "def clear\r\n self.value = \"\"\r\n end", "def munge(value)\n self.shadow.munge(value) if self.shadow\n\n super\n end", "def reset!\n defaults = Settler.config[self.key]\n self.label = defaults['label']\n self.value = defaults['value']\n self.editable = defaults['editable']\n self.deletable = defaults['deletable']\n self.deleted = false\n save(:validate => false)\n end", "def reset\n self\n end", "def old_value=(_arg0); end", "def reset\n raise \"Not implemented\"\n end", "def reset!; end", "def reset!; end", "def reset!; end", "def reset!; end", "def unref\n UV.unref(@pointer)\n\n self\n end", "def unref\n UV.unref(@pointer)\n\n self\n end", "def reset\n @active = options[:active]\n @operator = options[:operator]\n @value = options[:value]\n @condition = nil\n @error = nil\n end", "def reset!\n tap { set_defaults }\n end", "def disassociate_target(object)\n case target_class.associations[target_association][:type]\n when :has_one, :belongs_to\n object.update_attribute(target_attribute, nil)\n when :has_many, :has_and_belongs_to_many\n object.update_attribute(target_attribute, object.send(target_attribute) - Array(source.id))\n end\n end", "def clean_binding\n binding\n end", "def reset\n @pointer = 0\n self\n end", "def nullify\n target.send(metadata.foreign_key_setter, nil)\n target.send(:remove_instance_variable, \"@#{metadata.inverse(target)}\")\n base.send(:remove_instance_variable, \"@#{metadata.name}\")\n target.save\n end", "def target=(new_value)\n @target = new_value unless const_defined?(:Target)\n end", "def unbind\n @connected = false\n @network.disconnected!\n\n super\n end", "def clear\n load_target\n delete(@target)\n self\n end", "def unref\n UV.unref(@handle)\n end", "def reset() end", "def reset\n clear\n CONNECTION_TYPES.map { |ct| connections.send(ct) }.each do |conn_group|\n conn_group.each_value { |conn| conn.weight = rand * 0.2 - 0.1 }\n end\n\n @bias = rand * 0.2 - 0.1\n @old = @state = @activation = 0\n end", "def reset\n @cur_energy = @max_energy\n end", "def reset\n self.base_currency = nil\n self.currency_rates = nil\n end", "def reset(other)\n self.url = other.url\n self.attributes.replace(other.attributes)\n self\n end", "def set!(value)\n @mutex.synchronize do\n old_value = @value\n @value = value\n @full_condition.signal\n apply_deref_options(old_value)\n end\n end", "def reload\n reset\n load_target\n self unless target.nil?\n end", "def reset()\n #This is a stub, used for indexing\n end", "def reset()\n #This is a stub, used for indexing\n end" ]
[ "0.6716273", "0.6616443", "0.6249946", "0.62473464", "0.61636245", "0.6107335", "0.6066144", "0.6055263", "0.6054127", "0.6020813", "0.595989", "0.595989", "0.58536696", "0.5828215", "0.58160824", "0.5810968", "0.5810968", "0.5803173", "0.5803173", "0.5768993", "0.57497364", "0.57453305", "0.57430357", "0.5730923", "0.5718409", "0.5704373", "0.56780076", "0.566475", "0.5659862", "0.5641416", "0.56320024", "0.56232774", "0.55974704", "0.55937326", "0.55852264", "0.5568568", "0.5558368", "0.55556285", "0.5543596", "0.5541791", "0.5514774", "0.55041337", "0.55035514", "0.5492608", "0.5479077", "0.5475586", "0.5465712", "0.54636174", "0.54611933", "0.5455395", "0.54553723", "0.54550576", "0.5435536", "0.54336554", "0.5431447", "0.53788024", "0.5372328", "0.53720534", "0.5367004", "0.53666645", "0.5366373", "0.5366373", "0.5356072", "0.53499746", "0.53412014", "0.53400224", "0.5330646", "0.5326339", "0.53094655", "0.53061897", "0.5300497", "0.5296344", "0.52898335", "0.52737343", "0.52705187", "0.52674055", "0.52674055", "0.52674055", "0.52674055", "0.5260964", "0.5260964", "0.52578104", "0.52571917", "0.5249617", "0.52462083", "0.52273816", "0.52270603", "0.52213895", "0.52074575", "0.51969373", "0.519525", "0.51830816", "0.5179186", "0.51671124", "0.5164002", "0.515591", "0.5154994", "0.51544017", "0.51518387", "0.51518387" ]
0.6499401
2
number of appeals ClaimReviewAsyncStatsReporter established within 7 days (count + %), plus total,cancelled,processed
def run appeals_this_period = count_appeals_this_period async_stats = ClaimReviewAsyncStatsReporter.new(start_date: start_date, end_date: end_date) certification_metric = Metrics::CertificationUsage.new(Metrics::DateRange.new(start_date, end_date)) send_report(appeals: appeals_this_period, async_stats: async_stats, certification_metric: certification_metric) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def summate_activity_counts\n activity_count = 0\n all_user_projects_subscriptions.find_each do |subscription|\n next if subscription.empty_summary?\n if count = subscription.summary.values.first[:count].to_i\n activity_count += count\n end\n end\n activity_count\n end", "def availability_summary #This should be changed to availability_summary_count\n unavailable = 0\n available = 0\n awaiting = 0\n\n self.cached_teamsheet_entries.each do |tse|\n if tse.response_status == 0\n unavailable += 1\n elsif tse.response_status == 1\n available += 1\n elsif tse.response_status == 2\n awaiting += 1\n end\n end\n\n { unavailable: unavailable, available: available, awaiting: awaiting }\n end", "def calc_stats\n #puts \"bad_biz = #{@bad_business_records.length}\"\n #puts \"bad_user = #{@bad_user_records.length}\"\n #puts \"good_biz = #{@good_business_records.length}\"\n #puts \"good_user = #{@good_user_records.length}\"\n \n @total_rec_cnt = @bad_business_records.length + @bad_user_records.length +\n\t @good_business_records.length + @good_user_records.length\n @well_formed_rec_cnt = @good_business_records.length + @good_user_records.length\n @malformed_rec_cnt = @bad_business_records.length + @bad_user_records.length\n @biz_rec_cnt = @businesses.length\n @user_rec_cnt = @users.length\n end", "def ticket_status_count\n @ticket_status_count ||= begin\n counts = { \"a\" => 0, \"t\" => 0, \"f\" => 0 }\n counts.merge! assigned_tickets.joins(:status).sum(1, group: 'ticket_statuses.open')\n counts.each{ |k,v| counts[k] = v.to_i; counts[\"a\"] += counts[k] }\n end\n end", "def avarage_calories_burned\n total_workout_calories / set_sport_by_user.count\n rescue\n 0\n end", "def total\n count = 0\n self.total_time_exercise_workouts.each do |ex|\n count += ex.duration\n end\n count\n end", "def recalculate_activity\n activity = Task.recent_count(self.id)\n activity += ClientRequest.recent_count(self.milestones)\n activity += Message.recent_count(self)\n # TODO Count recent timesheet entries\n return activity\n end", "def offense_counts; end", "def offense_counts; end", "def number_of_completed_responses\n if statistics && !statistics.empty? && (completed_data = statistics.find {|a| a[0] == 'Complete'})\n completed_data[1]\n else\n 0\n end\n end", "def number_of_events_expressed_at(login=nil)\n count_by_frbr(login, :presented_at, :how_many_events?) \n end", "def total_unpaid_visits\n next_cutoff_date = Claim.order(date_paid: :desc).limit(1).pluck(:date_paid).first + 3.days rescue Date.today \n prev_cutoff_date = next_cutoff_date - 45.days \n @total_unpaid = Visit.where(status: BILLED).where(\"entry_ts > ?\", prev_cutoff_date).where(\"entry_ts <?\", next_cutoff_date).sum{|v| v.total_fee}\n flash[:info] = \"Current total of billed claims for all doctors for period ending #{next_cutoff_date} is: #{ sprintf \"$%.0f\", @total_unpaid}\"\n end", "def total_backlogs\n self.backlog_payments.count\n end", "def user_count_in_last_90_days\n return if ga_tracking_code.blank?\n\n ga_reporting_api = GoogleAnalytics::Reporting.new(ga_tracking_code)\n\n updated_user_count = ga_reporting_api.send_request\n\n update(google_analytics_user_count: updated_user_count)\n rescue GoogleAnalytics::BadResponseError => e\n errors.add(:base, e.message)\n false\n rescue Google::Apis::ClientError => e\n errors.add(:base, 'Check your product tracking code - is it correct?')\n false\n end", "def total_event_count(count_informational = false)\n if count_informational\n host_stats[:all].to_i + informational_severity_count\n else\n host_stats[:all].to_i\n end\n end", "def planned_duration\n planned_value_by_week.count - 1 \n end", "def task_count_instances\n #ex_count = find_exception_count\n if self.occurrence_type.eql?(\"count\")\n count = self.count.to_i\n return count\n elsif self.occurrence_type.eql?(\"until\")\n if self.start_date and self.until\n case(self.repeat)\n when \"DAI\" then daily_count\n when \"WEE\" then weekly_count\n when \"MON\" then monthly_count\n when \"YEA\" then yearly_count\n end\n end\n else\n 1 \n end\n end", "def workflow_counts\n render json: {\n exposure: current_user.viewable_patients.where(isolation: false, purged: false).size,\n isolation: current_user.viewable_patients.where(isolation: true, purged: false).size\n }\n end", "def workflow_counts\n render json: {\n exposure: current_user.viewable_patients.where(isolation: false, purged: false).size,\n isolation: current_user.viewable_patients.where(isolation: true, purged: false).size\n }\n end", "def perform\n @start_date = Time.zone.today.prev_month.at_beginning_of_month\n @end_date = Time.zone.today.prev_month.at_end_of_month.end_of_day\n\n appeals_this_month = count_appeals_this_month\n async_stats = ClaimReviewAsyncStatsReporter.new(start_date: start_date, end_date: end_date)\n certification_metric = Metrics::CertificationUsage.new(Metrics::DateRange.new(start_date, end_date))\n\n send_report(appeals: appeals_this_month, async_stats: async_stats, certification_metric: certification_metric)\n end", "def total_activity_count\n return self.timeline_events.find(:all, :conditions => {:event_type => \"document_item_changed\"}).length + \n self.questions.count +\n self.questions.answered.count\n end", "def count_pending_actions\n # count actions pour navbar\n # les created dans le cas ou qqun a fait une résa sur ma pool\n # les accepted dans le cas ou j'ai fait une résa\n\n count = 0\n count += Booking.all.where('user_id = ? AND status = \"accepted\"', self.id).size unless @bookings.nil?\n\n Booking.all.each do |booking|\n count += 1 if booking.pool.user_id == self.id && booking.status == \"created\"\n end\n\n return count\n end", "def service_level_agreement_percentage(time_limit)\n all = num_answered_calls + num_missed_calls\n return 100.0 if all == 0\n answered_in_time = answered_contacts.select(\"EXTRACT(EPOCH FROM contacts.answered - contacts.arrived) AS duration\")\n .select { |c| c if c['duration'] < time_limit }\n .count\n (answered_in_time.to_f / all * 100).round(1)\n end", "def pass_count(days=30)\n latest_executions(days).where(success: true).count\n end", "def find_res_count\n res_count = 0\n self.listings.each do |listing|\n res_count += listing.reservations.where(:status => \"accepted\").count\n end\n return res_count\n end", "def total_workouts\n set_sport_by_user.count || 0\n end", "def total_num_team_reviews\n team_review_counts.inject(:+)\n end", "def pax_count_tally\n get_tally_by_flight_column_name(\"pax_count\")\n end", "def total_count\n raw_history['total_results']\n end", "def total_workout_calories\n set_sport_by_user.sum(:burned_calories) || 0\n end", "def total_flights\n approved_flights.count\n end", "def res_score\n return 0 if report.users.size == 0\n ((report.unique_recipient_count / report.users.size.to_f) * 100).round(2)\n end", "def res_score\n return 0 if report.users.size == 0\n ((report.unique_recipient_count / report.users.size.to_f) * 100).round(2)\n end", "def show\n @active_team_users = @team.users.where.not(last_sign_in_at: nil)\n\n @prospects = 0\n @active_team_users.each do |user|\n @prospects += user.prospects.count\n end\n @statements = 0\n @active_team_users.each do |user|\n user.prospects.each do |prospect|\n @statements += prospect.statements.count\n end\n end\n @today_tasks = 0\n @active_team_users.each do |user|\n user.prospects.each do |prospect|\n prospect.tasks.each do |task|\n if task.finish_date.strftime(\"%m/%d/%Y\") == Time.now.strftime(\"%m/%d/%Y\")\n @today_tasks += 1\n end\n end\n end\n end\n @active_users = 0\n @inactive_users = 0\n @active_team_users.each do |user|\n if user.last_sign_in_at.strftime(\"%m/%d/%Y\") >= 7.days.ago.strftime(\"%m/%d/%Y\")\n @active_users += 1\n else\n @inactive_users += 1\n end\n end\n\n @six_days_ago_prospects = 0\n @five_days_ago_prospects = 0\n @four_days_ago_prospects = 0\n @three_days_ago_prospects = 0\n @two_days_ago_prospects = 0\n @one_day_ago_prospects = 0\n @todays_prospects = 0\n\n @active_team_users.each do |user|\n user.prospects.each do |prospect|\n if prospect.created_at.localtime.strftime(\"%m/%d/%Y\") == 6.days.ago.localtime.strftime(\"%m/%d/%Y\")\n @six_days_ago_prospects += 1\n elsif prospect.created_at.localtime.strftime(\"%m/%d/%Y\") == 5.days.ago.localtime.strftime(\"%m/%d/%Y\")\n @five_days_ago_prospects += 1\n elsif prospect.created_at.localtime.strftime(\"%m/%d/%Y\") == 4.days.ago.localtime.strftime(\"%m/%d/%Y\")\n @four_days_ago_prospects += 1\n elsif prospect.created_at.localtime.strftime(\"%m/%d/%Y\") == 3.days.ago.localtime.strftime(\"%m/%d/%Y\")\n @three_days_ago_prospects += 1\n elsif prospect.created_at.localtime.strftime(\"%m/%d/%Y\") == 2.days.ago.localtime.strftime(\"%m/%d/%Y\")\n @two_days_ago_prospects += 1\n elsif prospect.created_at.localtime.strftime(\"%m/%d/%Y\") == 1.day.ago.localtime.strftime(\"%m/%d/%Y\")\n @one_day_ago_prospects += 1\n elsif prospect.created_at.localtime.strftime(\"%m/%d/%Y\") == Time.now.localtime.strftime(\"%m/%d/%Y\")\n @todays_prospects += 1\n end\n end\n end\n\n @six_days_ago = (Time.now.localtime - 6.days).localtime.strftime(\"%d\")\n @five_days_ago = (Time.now.localtime - 5.days).localtime.strftime(\"%d\")\n @four_days_ago = (Time.now.localtime - 4.days).localtime.strftime(\"%d\")\n @three_days_ago = (Time.now.localtime - 3.days).localtime.strftime(\"%d\")\n @two_days_ago = (Time.now.localtime - 2.days).localtime.strftime(\"%d\")\n @one_day_ago = (Time.now.localtime - 1.day).localtime.strftime(\"%d\")\n @today = Time.now.localtime.strftime(\"%d\")\n\n end", "def total_download_count\n sum(:api_download_count) + sum(:web_download_count)\n end", "def expected_submissions\n deliverables.count * course.students.count\n end", "def completed_check_count\n \n count = { :self => 0, :peer => 0 }\n \n self.checklist.each_check do |check|\n design_check = self.design_checks.detect { |dc| dc.check_id == check.id }\n next if !design_check\n count[:self] += 1 if design_check.self_auditor_checked?\n count[:peer] += 1 if design_check.peer_auditor_checked?\n end\n \n count\n \n end", "def userAvgCalculator\n\t\t\ttotal = 0\t\t\t\t\t\t\t\t\t# Initial total prayers\n\t\t\t# Loop through each all the Day prayers\n\t\t\t@rawData.each do |day|\n\t\t\t\ttotal += 1 if day[:fajr] == 2\t\t\t# Add one to total if prayer performed\n\t\t\t\ttotal += 1 if day[:zuhr] == 2\t\t\t# Add one to total if prayer performed\n\t\t\t\ttotal += 1 if day[:asr] == 2\t\t\t# Add one to total if prayer performed\n\t\t\t\ttotal += 1 if day[:maghrib] == 2\t\t# Add one to total if prayer performed\n\t\t\t\ttotal += 1 if day[:isha] == 2\t\t\t# Add one to total if prayer performed\n\t\t\tend\n\t\t\t# Calculate how many days the user was requested for a response,\n\t\t\t# and the user responded and or the email was deactivated\n\t\t\tavg = (total / @timesRequestSent.to_f).round(2) # Calculate the average\n\t\tend", "def score_factor_count\n com_count = self.complaints.finished.count\n dep_review_count = count_scorable_department_reviews\n city_review_count = count_scorable_city_reviews\n petition_count = self.petitions.finished.count\n return score_count = com_count + dep_review_count + city_review_count + petition_count\n end", "def impressions_total\n receiver.impressionist_count filter(unique_filter)\n end", "def completion_stats\n \n stats = { :self => \"0.0\", :peer => \"0.0\" }\n total_checks = self.check_count\n \n if total_checks[:designer] > 0\n stats[:self] = self.designer_completed_checks * 100.0 / total_checks[:designer]\n end\n if total_checks[:peer] > 0\n stats[:peer] = self.auditor_completed_checks * 100.0 / total_checks[:peer]\n end\n\n stats\n \n end", "def achievements_count\n completed_count = Bet.where('owner = ? AND status = ?', params[:id], \"won\").to_a.count\n invs = Invite.where(invitee: params[:id], status: \"accepted\").to_a\n won_count = completed_count\n # count all the bets that user accepted, and then the owner failed on\n invs.each do |i|\n won_count += 1 if i.bet.status == 'lost'\n end\n render json: {completed: completed_count, won: won_count}\n end", "def impressions_total\n receiver.impressionist_count filter\n end", "def number_of_events_commissioned_at(login=nil)\n count_by_frbr(login, :is_commissioned_for, :how_many_events?) \n end", "def total_num_assignment_teams\n assignment_team_counts.inject(:+)\n end", "def number_of_happening_expressions(login=nil)\n count_by_frbr(login, :has_happening, :how_many_expressions?) \n end", "def get_number_of_incidents(status)\n return -1 unless [nil, \"resolved\", \"acknowledged\", \"triggered\"].include? status\n\n root_ca = '/etc/ssl/certs'\n uri = URI.parse \"#{@pagerduty_url}/api/v1/incidents/count\"\n http = Net::HTTP.new(uri.host, uri.port)\n http.use_ssl = (uri.scheme == 'https')\n request = Net::HTTP::Get.new(uri.request_uri)\n request.add_field('Authorization', \"Token token=#{@pagerduty_api_token}\")\n request.set_form_data({\"status\" => status})\n\n if(File.directory?(root_ca) && http.use_ssl?)\n http.ca_path = root_ca\n http.verify_mode = OpenSSL::SSL::VERIFY_PEER\n http.verify_depth = 5\n else\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n end\n\n response = http.request(request)\n json = JSON.parse(response.body)\n\n json[\"total\"].to_i\nend", "def percentage_complete\n percent =\n if required_approver_count > 0\n (required_approved_count / required_approver_count) * 100\n else\n 0\n end\n \"#{percent}%\"\n end", "def num_clicks\n count = 0\n self.visits.each { |user| count += user.visits }\n count\n end", "def total_visit\n pet_histories.count\n end", "def calculate_open_weeks\n @timeline_week_count - blackout_weeks_count - @course.weeks.count\n end", "def user_reputation\n tally = []\n answers.each do |answer|\n tally.push(answer.answer_votes_total)\n end\n questions.each do |question|\n tally.push(question.question_votes_total)\n end\n tally = tally.inject(:+)\n return tally\n end", "def get_office365_activation_counts()\n return MicrosoftGraph::Reports::GetOffice365ActivationCounts::GetOffice365ActivationCountsRequestBuilder.new(@path_parameters, @request_adapter)\n end", "def event_count\n ((low_severity_events.to_i) + (medium_severity_events.to_i) + (high_severity_events.to_i) + (critical_severity_events.to_i)).to_i\n end", "def num_funding_rounds\n self.funding_rounds.count\n end", "def num_funding_rounds\n self.funding_rounds.count\n end", "def approvals_count\n return 0 if self.id.nil?\n return RequestSearch.approvals_for(self, show: 'pending', per_page: 1000).count\n end", "def smoking_progress\n Smoke.by_user(self.id).where(:counted => 0, created_at: 3.days.ago..Time.now).count\n\n # TODO\n #return ['smoked', 3]\n #return ['smoked', 7]\n #return ['smoked', 30]\n #return ['stopped', 3]\n #return ['stopped', 7]\n #return ['stopped', 30]\n\n end", "def referrals_needed_per_month\n 5 * monthly_transaction_goal\n end", "def aging_weeks__c\n if %w(1 true).include?(is_closed.to_s.downcase)\n (last_modified_date.to_i-created_date.to_i)/(60*60*24*7)\n else\n (Time.now.to_i - created_date.to_i)/(60*60*24*7)\n end\n end", "def total_weeks\n ((self.deadline - self.start_date) / 7).to_i\n end", "def upvotes_received\n reports.inject(0){|sum, report| sum + report.get_vote_difference }\n end", "def totalcount\n @totalcount\n end", "def pending_driver_verification_count\n count = User.needing_driver_verification.count\n render :json => count, root: false, status: 200\n end", "def submission_count\n if current_course_user&.manager_or_owner?\n my_students_pending_submissions_count > 0 ? my_students_pending_submissions_count : pending_submissions_count\n elsif current_course_user&.staff?\n my_students_pending_submissions_count\n else\n 0\n end\n end", "def total\n @total ||= (\n tally = 0\n each do |b|\n tally += b.count\n end\n tally\n )\n end", "def ab_counts(_experiment, _alternative)\n raise \"Not implemented\"\n end", "def execution_count(days=30)\n latest_executions(days).count\n end", "def get_attending_counts(event)\n attending_count = 0\n event.users.each do |user|\n status = EventStatus.find_by(user_id: user.id, event_id: event.id)\n if !status.blank? && status.attending?\n attending_count += 1\n end\n end\n attending_count\n end", "def recent_status_score\n recent_status[:ok] / recent_status[:count]\n end", "def activity_level\n\t (self.results.count + self.events.count)\n end", "def number_of_related_events(login=nil)\n count_by_frbr(login, :is_related_to, :how_many_events?) \n end", "def total\n @total ||= (\n tally = 0\n each do |w|\n tally += w.count\n end\n tally\n )\n end", "def success_rate_stats\n hits = Float(self.quizzes.where(:result => true).length)\n total_quizzes = Float(self.quizzes.length)\n rate = hits / total_quizzes\n rate.round(2) * 100\n end", "def calculate_views_count\n self.visits.count.to_i\n end", "def calculate_timeline_week_count\n ((@course.timeline_end.to_date - @beginning_of_first_week).to_f / 7).ceil\n end", "def number_of_event_commissions(login=nil)\n count_by_frbr(login, :is_commissioned_for, :how_many_events?) \n end", "def resource_count_stats\n klass = klass_from_controller(controller_name)\n full_total = klass.count\n visible_total = if klass.authorization_supported?\n klass.all_authorized_for('view').count\n elsif klass.is_a?(Person) && Seek::Config.is_virtualliver && User.current_user.nil?\n 0\n else\n klass.count\n end\n [visible_total, full_total]\n end", "def counter_stat\n super || build_counter_stat(citation_count: 0, unique_investigation_count: 0, unique_request_count: 0,\n created_at: Time.new.utc - 7.days, updated_at: Time.new.utc - 7.days)\n end", "def counters\n {\n files: files_count,\n apps: apps_count,\n workflows: workflows_count,\n jobs: jobs_count,\n members: members_count,\n }\n end", "def requests_per_day\n group_by_day.map { |date, ents|\n [date, ents.size]\n }.sort { |a,b|\n a[0] <=> b[0]\n }\n end", "def number_of_events_happening_at(login=nil)\n count_by_frbr(login, :happens_at, :how_many_events?) \n end", "def how_many_active_announcements\n return announcements.where('expires_at >= ?', Date.today).count\n end", "def perform\n archived_count = 0\n expired_users_with_email.find_each do |user|\n archived_count += 1 if archive_user(user)\n end\n expired_users_with_accounts.find_each do |user|\n archived_count += 1 if archive_user(user)\n end\n archived_count\n end", "def rate_per_day_overall_of_videos\n ( video_count / account_age_in_days.to_f ).round(1)\n end", "def progress day\n activities_completed = ActivityEntry.\n where(day: day).\n where(activity_id: activities).\n distinct.\n where(user_id: user_id).\n count(:activity_id)\n return [activities_completed, activities.count]\n end", "def total_count\n nil\n end", "def total_count\n nil\n end", "def summary(args)\n out = {'known'=> {}, 'forwarded'=>{},'unknown'=>{} }\n args[:end] ||= Time.now\n args[:start] ||= args[:end] - 10*86400 # 10 days\n get_all_reports_by_date(args[:start],args[:end]).each do |r|\n get_all_records_filtered(\"report_metadata_id\",r.id).each do |record|\n # if record.source_ip is part of authorized_senders\n out['known']['count'] += record.count\n end\n end\n return out\n end", "def tally\n\t\t\treturn if completed?\n\t\t\tcomplete if consensus?\n\t\tend", "def get_sum_defender_facilities\n all_facilities = 0\n @defender_facilities.each do |instance|\n all_facilities = all_facilities + instance.count\n end\n return all_facilities\n end", "def countPresents(days)\n\tcount = sum = 0\n\tdays.times do\n\t\tcount += 1\n\t\tcountdown = count\n\t\tcount.times do\n\t\t\t#puts \"Adding #{countdown} to #{sum}\"\n\t\t\tsum += countdown\n\t\t\tcountdown -= 1\n\t\tend\n\tend\n\tputs \"after #{days} days of christmas you'd receive #{sum.to_s} presents!\"\nend", "def count_user\n count = 0\n @f_net.each do |followees|\n count += 1 unless !followees or followees.empty?\n end\n count\n end", "def calculate_progress\n result = self.progress_status\n (100 * result.values.count(true) / result.values.compact.count).to_s\n end", "def number_of_tickets_bought() # working in terminal - console (eg.: customer1.number_of_tickets_bought)\n return films.count\n end", "def tickets_purchased\n return film().count\n end", "def calculate_probability(useful_results, reroll_count)\n return 100.0 * useful_results / ( 6 ** reroll_count )\n end", "def counts\r\n @counts\r\n end", "def followers_history; counter_per_day(:followers); end", "def target_number_of_ama_hearings(time_period)\n decisions_in_days = (time_period.to_f / 1.year) * nonpriority_decisions_per_year\n (decisions_in_days * docket_proportions[:hearing]).round\n end" ]
[ "0.6553856", "0.6552795", "0.64260584", "0.6407644", "0.6370114", "0.6277535", "0.6213574", "0.61942023", "0.61942023", "0.6183292", "0.6158177", "0.6081236", "0.6081073", "0.60461265", "0.60155684", "0.60077083", "0.5994214", "0.59864664", "0.59864664", "0.59852785", "0.5964608", "0.5960648", "0.5957168", "0.5954804", "0.5952493", "0.59513575", "0.59364045", "0.59285337", "0.5899743", "0.58920354", "0.5886143", "0.58740145", "0.58740145", "0.5865893", "0.58592504", "0.58526486", "0.58509374", "0.5849437", "0.58434373", "0.5842298", "0.5839761", "0.5836501", "0.58344626", "0.5824621", "0.5814809", "0.58038944", "0.57984877", "0.5790837", "0.5770929", "0.57630515", "0.575531", "0.5754002", "0.57524997", "0.5751571", "0.57254577", "0.57254577", "0.571857", "0.57171047", "0.5713294", "0.57104445", "0.57090664", "0.5707318", "0.5704871", "0.57027155", "0.5701694", "0.56897867", "0.5688026", "0.56871784", "0.5687036", "0.56816375", "0.56784374", "0.56764054", "0.56749356", "0.56673723", "0.56636125", "0.56611097", "0.56592304", "0.5648585", "0.56468594", "0.5641416", "0.56405526", "0.5630279", "0.56247485", "0.56190395", "0.5619005", "0.5608158", "0.55926037", "0.55926037", "0.5587961", "0.5583815", "0.55835915", "0.5573084", "0.55677545", "0.5561825", "0.5561786", "0.5553177", "0.55528617", "0.55503356", "0.55497867", "0.55492646" ]
0.61094403
11
Override this in the subclasses that provide additional metrics.
def additional_metrics [] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def metrics\n @metrics ||= parent_klass.metrics.dup\n end", "def cpu_metrics\n super\n end", "def custom_metrics\n @custom_metrics ||= {}\n end", "def collect_metrics(*)\n raise NotImplementedError, 'Must implement collect_metrics'\n end", "def setup_metrics\n end", "def setup_metrics\n end", "def setup_metrics\n end", "def fan_metrics\n super\n end", "def temperature_metrics\n super\n end", "def statistics\n super\n end", "def statistics\n super\n end", "def statistics\n super\n end", "def statistics\n super\n end", "def statistics\n super\n end", "def statistics\n super\n end", "def statistics\n super\n end", "def statistics\n super\n end", "def statistics\n super\n end", "def statistics\n super\n end", "def statistics\n super\n end", "def statistics\n super\n end", "def power_supply_metrics\n super\n end", "def metrics\n @metrics ||= collect_metrics\n end", "def build_metrics\n {}\n end", "def initialize\n @metrics = { processed: 0, skipped: 0, failed: 0, updated: 0,\n unchanged: 0, start_time: 0, failed_list: [],\n warning: 0 }\n end", "def get_metrics\n {\n method: \"Performance.getMetrics\"\n }\n end", "def initialize(...)\n @metrics = {}\n register(...)\n end", "def all_cpu_usage_extended_information\n super\n end", "def global_cpu_usage_extended_information\n super\n end", "def global_statistics\n super\n end", "def all_statistics\n super\n end", "def all_statistics\n super\n end", "def all_statistics\n super\n end", "def all_statistics\n super\n end", "def all_statistics\n super\n end", "def all_statistics\n super\n end", "def all_statistics\n super\n end", "def all_statistics\n super\n end", "def all_statistics\n super\n end", "def all_statistics\n super\n end", "def all_statistics\n super\n end", "def all_statistics\n super\n end", "def calculate_score\n raise \"Override and return the metric's score\"\n end", "def metrics\n with_stats_lock do\n @stats_hash.keys.map { |spec| spec.to_s }\n end\n end", "def iiop_statistics\n super\n end", "def get_metric(key)\n metrics[key] || meta[key]\n end", "def basic_metrics\n basic = {\n :length => length,\n :prop_gc => prop_gc,\n :orf_length => orf_length\n }\n end", "def metrics\n @metrics ||= []\n end", "def cpu_usage_information\n super\n end", "def extract_line_metrics(ln)\n raise('Subclass must define extract_line_metrics method')\n end", "def metric(data={})\n if @@metrics_buffer.empty?\n @@metrics_buffer = [data]\n else\n @@metrics_buffer << data\n end\n end", "def metrics\n standard.unit.convert_to_metric imperials\n end", "def all_tmm_statistics\n super\n end", "def measure; end", "def metrics_with_methods\n {metrics: @metrics, methods: @methods}\n end", "def metrics_with_methods\n {metrics: @metrics, methods: @methods}\n end", "def http_statistics\n super\n end", "def cpu_usage_trend(&_block)\n raise(NotImplementedError, \"#{self.class}##{__method__} implementation not found.\")\n end", "def summary_metrics\n []\n end", "def metrics\n manager_instance(MetricManager)\n end", "def update_metrics!(*args)\n self.class.metrics.each do |metric, options|\n send(metric, *args)\n end\n end", "def metric(name,type,value)\n @metrics[name] = {\n :type => type,\n :value => value\n }\nend", "def global_tmm_statistics\n super\n end", "def register_metrics!\n return if @registered\n @registered = true\n with_instance do |t|\n # Worker related\n t.add_gauge :dynflow_active_workers, 'The number of currently busy workers',\n [:queue, :world]\n t.add_counter :dynflow_worker_events, 'The number of processed events',\n [:queue, :world, :worker]\n\n # Execution plan related\n t.add_gauge :dynflow_active_execution_plans, 'The number of active execution plans',\n [:action, :world, :state]\n t.add_gauge :dynflow_queue_size, 'Number of items in queue',\n [:queue, :world]\n t.add_counter :dynflow_finished_execution_plans, 'The number of execution plans',\n [:action, :world, :result]\n\n # Step related\n # TODO: Configure buckets in a sane manner\n t.add_histogram :dynflow_step_real_time, 'The time between the start end end of the step',\n [:action, :phase]\n t.add_histogram :dynflow_step_execution_time, 'The time spent executing a step',\n [:action, :phase]\n\n # Connector related\n t.add_counter :dynflow_connector_envelopes, 'The number of envelopes handled by a connector',\n [:world, :direction]\n\n # Persistence related\n t.add_histogram :dynflow_persistence, 'The time spent communicating with the database',\n [:world, :method]\n end\n end", "def statsd_measure(method, name, deprecated_sample_rate_arg = nil, deprecated_tags_arg = nil, as_dist: false,\n sample_rate: deprecated_sample_rate_arg, tags: deprecated_tags_arg, prefix: nil, no_prefix: false)\n\n add_to_method(method, name, :measure) do\n define_method(method) do |*args, &block|\n key = StatsD::Instrument.generate_metric_name(name, self, *args)\n prefix ||= StatsD.prefix\n StatsD.measure( # rubocop:disable StatsD/MeasureAsDistArgument, StatsD/MetricPrefixArgument\n key, sample_rate: sample_rate, tags: tags, prefix: prefix, no_prefix: no_prefix, as_dist: as_dist\n ) do\n super(*args, &block)\n end\n end\n end\n end", "def measure\n Measure.new(1, self)\n end", "def statistics; end", "def set_metrics\n if rails?\n @metrics = MetricFu::AVAILABLE_METRICS + [:stats, :rails_best_practices]\n else\n @metrics = MetricFu::AVAILABLE_METRICS\n end\n end", "def meters \n metrics(Meter)\n end", "def stats; end", "def stats; end", "def rate_class\n super\n end", "def rate_class\n super\n end", "def memory_usage_information\n super\n end", "def counters\n metrics(Counter)\n end", "def metrics=(new_metrics)\n @metrics = new_metrics\n @metrics[:missing] = @metrics.first[1] unless @metrics[:missing]\n end", "def base_metric_name\n nil\n end", "def tags\n @meta.merge(@metrics)\n end", "def gtm_memory_usage_statistics\n super\n end", "def collect_metrics(data: {}, labels: {})\n metric(:pool_jobs_waiting_total)&.observe(data['pool_jobs_waiting_total'].to_i, labels)\n metric(:pool_ready_workers_total)&.observe(data['pool_ready_workers_total'].to_i, labels)\n metric(:pool_workers_total)&.observe(data['pool_workers_total'].to_i, labels)\n metric(:pool_initial_size)&.observe(data['pool_initial_size'].to_i, labels)\n metric(:poll_period)&.observe(data['poll_period'].to_i, labels)\n metric(:thread_pool_exhausted)&.observe(data['thread_pool_exhausted'].to_i, labels)\n end", "def stats\n end", "def stats\n end", "def method_metrics\n metrics.find_by(system_name: 'hits')&.children || metrics.none\n end", "def [](key)\n @metrics[key]\n end", "def radius_statistics\n super\n end", "def gauges\n metrics(Gauge)\n end", "def to_metric\n Metric.new(\n Instrumentation.series,\n {\n duration: real_time.in_milliseconds.to_i,\n cpu_duration: cpu_time.in_milliseconds.to_i,\n call_count: call_count\n },\n method: @name\n )\n end", "def to_metric\n Metric.new(\n Instrumentation.series,\n {\n duration: real_time,\n cpu_duration: cpu_time,\n call_count: call_count\n },\n method: @name\n )\n end", "def metric_as_json(meta, stat, child_metrics={})\n { \"bucket\" => meta.type,\n \"name\" => meta.name, # No scope values needed here, since it's implied by the nesting.\n\n \"count\" => stat.call_count,\n \"total_call_time\" => stat.total_call_time,\n \"total_exclusive_time\" => stat.total_exclusive_time,\n \"min_call_time\" => stat.min_call_time,\n \"max_call_time\" => stat.max_call_time,\n\n # Pretty unsure how to synthesize histograms out of what we store now\n \"total_histogram\" => [\n [stat.total_exclusive_time / stat.call_count, stat.call_count],\n ],\n \"exclusive_histogram\" => [\n [stat.total_exclusive_time / stat.call_count, stat.call_count]\n ],\n\n \"metrics\" => transform_child_metrics(child_metrics),\n\n # Will later hold the exact SQL, or URL or whatever other detail\n # about this query is necessary\n \"detail\" => { :desc => meta.desc }.merge(meta.extra || {}),\n }\n end", "def measure\n\t\t1\n\tend", "def medical_use; end", "def dns_statistics\n super\n end", "def method_missing(m, *args)\n if m.to_s[/count_(.+)_raters/]\n raters_by_type_count($1.singularize.classify)\n elsif m.to_s[/(.+)_raters/]\n raters_by_type($1.singularize.classify)\n else\n super\n end\n end", "def record_metrics_internal(metric_specs, value, aux)\n tsh = transaction_stats_hash\n if tsh\n tsh.record(metric_specs, value, aux)\n else\n with_stats_lock do\n @stats_hash.record(metric_specs, value, aux)\n end\n end\n end", "def gtm_global_statistics\n super\n end", "def each(&block)\n # delegate to the @metrics hash until we need something fancier\n @metrics_lock.synchronize do\n @metrics.each(&block)\n end\n end", "def all_pva_statistics\n super\n end", "def stats\n ## TODO:\n end", "def set_metrics(metrics, batch)\n _this_ts, label, latency, error, threads, http_code = metrics\n ['ALL', label].each do |key|\n # load test worker threads are recorded at the start of the interval\n batch[key]['threads'] = threads unless batch[key]['threads']\n batch[key]['requests'] += 1\n batch[key]['errors'] += error\n batch[key]['http_code_distribution'][http_code] += 1\n # latency samples are not counted for failed requests\n unless error == 1\n batch[key]['latency_distribution'][latency] += 1\n batch[key]['latency_sum'] += latency\n end\n end\n end", "def Metric(metric_name, &class_body)\n metric_collector = Class.new(::Critical::MetricBase)\n metric_class_name = Critical::Metrics.const_set(metric_name.to_s.capitalize, metric_collector)\n metric_collector.metric_name = metric_name\n log.debug { \"Defining metric '#{metric_name}' as '#{metric_class_name}'\"}\n metric_collector.class_eval(&class_body) if block_given?\n MonitorDSL.define_metric(metric_name, metric_collector)\n metric_collector\n end" ]
[ "0.77207696", "0.7709614", "0.74785024", "0.7438503", "0.7288709", "0.7288709", "0.7288709", "0.7040408", "0.70399463", "0.70215666", "0.70215666", "0.70215666", "0.70215666", "0.70215666", "0.70215666", "0.70215666", "0.70215666", "0.70215666", "0.70215666", "0.70215666", "0.70215666", "0.6939125", "0.6906441", "0.67096806", "0.6697548", "0.6525829", "0.6509435", "0.6509049", "0.65066683", "0.6505875", "0.6503537", "0.6503537", "0.6503537", "0.6503537", "0.6503537", "0.6503537", "0.6503537", "0.6503537", "0.6503537", "0.6503537", "0.6503537", "0.6503537", "0.64302784", "0.6425857", "0.6402378", "0.6382405", "0.6365214", "0.635856", "0.62801164", "0.6265321", "0.6258156", "0.6249455", "0.62452155", "0.62230283", "0.62170243", "0.62170243", "0.6192803", "0.61901176", "0.61673635", "0.6129242", "0.612748", "0.6094888", "0.60913014", "0.60540444", "0.6051626", "0.60347635", "0.5997317", "0.5971156", "0.596546", "0.5951629", "0.5951629", "0.5930246", "0.5930246", "0.5898607", "0.58964497", "0.58933127", "0.58893037", "0.58886856", "0.5881709", "0.5862893", "0.58494085", "0.58494085", "0.58423805", "0.58194727", "0.5808505", "0.5808063", "0.580429", "0.5787533", "0.5773736", "0.5772348", "0.5771701", "0.5768297", "0.57530206", "0.575258", "0.5749497", "0.57379514", "0.5710951", "0.570939", "0.57079315", "0.5707354" ]
0.7249552
7
Give protocol name for this class
def protocol_name 'SMB::Blocks' end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def protocol_name\n self.class.protocol_name\n end", "def protocol_name\n self.class.to_s\n end", "def protocol_name\n PROTOCOLS[protocol.to_s]\n end", "def protocol; end", "def protocol; end", "def protocol; end", "def protocol; end", "def method_name\n return @method_name if defined? @method_name\n\n @method_name = protocol_name.downcase.sub(/::/, '_')\n end", "def protocol\n raise NotImplementedError\n end", "def protocol\n super\n end", "def name\n \"#{self[:interface]} #{self[:sid]}\"\n end", "def protocol\n raise TypeError, 'no type on this reply' unless\n instance_variable_defined? :@type\n\n @type.split('.').last.sub '_', ''\n end", "def protocol\n @context.registers[:protocol]\n end", "def protocol=(_arg0); end", "def protocol\n m = @properties['METHOD']\n m ? m.upcase : m\n end", "def nombre sym\n Object.const_set sym, self #Se crea una constante para referir al trait\n end", "def name\n raise 'Not implemented'\n end", "def name\n raise 'Not implemented'\n end", "def protocol_name\n rc, name = Cproton.pn_ssl_get_protocol_name(@impl, 128)\n name if rc\n end", "def name\n raise NotImplementedError\n end", "def name\n raise NotImplementedError\n end", "def name\n\t\t\"Interface Fingerprinter\"\n\tend", "def name\n method_descriptor_proto.name\n end", "def name\n \"#{self[:interface]} #{self[:vni]}\"\n end", "def name\n raise \"unimplemented\"\n end", "def algorithm_name\n raise NotImplementedError\n end", "def name(*) end", "def name(*) end", "def connection_name\n raise \"You must override `connection_name' in your class\"\n end", "def resourceType\n 'Protocol'\n end", "def name\n grpc.name\n end", "def name\n end", "def proto\n \"def\"\n end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end" ]
[ "0.80247045", "0.79989266", "0.72159964", "0.7043649", "0.7043649", "0.7043649", "0.7043649", "0.6793753", "0.66835433", "0.6679379", "0.65549195", "0.63206524", "0.6294309", "0.6271764", "0.62333184", "0.6210549", "0.61958146", "0.61958146", "0.6156332", "0.6121943", "0.6121943", "0.6117128", "0.6099564", "0.6062216", "0.5995801", "0.5959386", "0.59543437", "0.59543437", "0.5934715", "0.59192514", "0.5915116", "0.59119236", "0.5872958", "0.58544064", "0.58544064", "0.58544064", "0.58544064", "0.58544064", "0.58544064", "0.58544064", "0.58544064", "0.58544064", "0.58544064", "0.58544064", "0.58544064", "0.58544064", "0.58544064", "0.58544064", "0.58544064", "0.58544064", "0.58544064", "0.58544064", "0.58544064", "0.58544064", "0.58544064", "0.58544064", "0.58544064", "0.58544064", "0.58544064", "0.58544064", "0.58544064", "0.58544064", "0.58544064", "0.58544064", "0.58544064", "0.58544064", "0.58544064", "0.58544064", "0.58544064", "0.58544064", "0.58544064", "0.58544064", "0.58544064", "0.58544064", "0.58544064", "0.58544064", "0.58544064", "0.58544064", "0.58544064", "0.58544064", "0.58544064", "0.58544064", "0.58544064", "0.58544064", "0.58544064", "0.58544064", "0.58544064", "0.58544064", "0.58544064", "0.58544064", "0.58544064", "0.58544064", "0.58544064", "0.58544064", "0.58544064", "0.58544064", "0.58544064", "0.58544064", "0.58544064", "0.58544064", "0.58544064" ]
0.0
-1
Usage: git alias The second parameter is optional, if so, it will show the current value of the alias.
def git_alias(args) # check if the alias exists right now system("git config --global alias.#{args[0]} #{args[1]}") end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def git_alias(name,action)\n system 'git', 'config', '--global', '--replace-all', \"alias.#{name}\", action\n end", "def aliases\n\t\t\twith_dir do\n\t\t\t\t%x/git config --get-regexp 'alias.*'/.each_line.map do |l|\n\t\t\t\t\tputs l.sub(/^alias\\./,\"\").sub(/ /,\" = \")\n\t\t\t\tend\n\t\t\tend\n\t\tend", "def alias(builder)\n repo = builder.repo\n aliased_repo = builder.aliased_repo\n msg = Simple::Ansi.green(\"Aliasing #{repo} -> #{aliased_repo}\")\n $stderr.puts msg\n end", "def alias(a)\n Registry.alias_command(self, a)\n end", "def name_alias(arg=nil)\n\t\t\t\tset_or_return(:name_alias, arg, :kind_of => String)\n\t\t\tend", "def alias(an_alias)\n { alias: an_alias }\n end", "def alias(alias_name)\n clone.alias! alias_name\n end", "def formatted_alias_or_alias_with_host\n alias_with_host.nil? ? VirtualHearing.formatted_alias(alias_name) : alias_with_host\n end", "def update!(**args)\n @alias = args[:alias] if args.key?(:alias)\n end", "def print_alias(*) end", "def to_alias\n \"-#{@alias}\"\n end", "def is_alias?; end", "def set_alias(aliass)\n @alias = aliass\n end", "def add_alias as\n @display.print_alias as\n end", "def alias?\r\n show_alias_flg == 'yes'\r\n end", "def alias\n\t\tmodule_info['Alias']\n\tend", "def alias=(new_alias)\n @alias = new_alias[0..512]\n end", "def alias_cmd(key, value)\n @aliases[key] = value\n end", "def git_project_name\n Pkg::Util.in_project_root do\n stdout, _, _ = Pkg::Util::Execution.capture3(\"#{GIT} config --get remote.origin.url\")\n stdout.split('/')[-1].chomp(\".git\").chomp\n end\n end", "def showAlias\n puts \"showAlias.\"\nend", "def cmux_alias?(arg)\n Commands::CMDS.values.map { |e| e[:alias] }.include?(arg)\n end", "def configure_git\n run_simple 'git config user.name Cucumber'\n run_simple 'git config user.email cucumber@`hostname --fqdn`'\nend", "def exchange_alias=(value)\n @exchange_alias = value\n end", "def gitrepo(repo, name, ref = 'master')\n mod name.split('/').join('-'),\n :git => \"https://#{repo}/#{name}.git\",\n :ref => ref\nend", "def alias?(uri)\n @conf.alias?(uri)\n end", "def alias?\n false\nend", "def handle_alias_command(text, bot)\n blocked_alias_names = %w[depth ids notes completed top bottom]\n bot.logger.info(text.nil?)\n if text.nil?\n verb = 'list'\n else\n verb, name, id = text.split(' ')\n end\n\n case verb\n when 'add'\n # /alias add <name> <id>\n if blocked_alias_names.include?(name) || name.scan(/\\D/).empty?\n return 'Please choose an alias that is not a bot keyword or a number'\n end\n\n call_wf(\"alias add --name=#{name} --id=#{id}\", bot)\n when 'list'\n # /alias list\n call_wf('alias list', bot)\n when 'rm'\n # /alias rm <name>\n call_wf(\"alias remove --name=#{name}\", bot)\n else\n \"Please call the alias command with either 'add <name> <id>', 'list' or 'rm <name>'\"\n end\nend", "def merge_info_alias(info, val)\n\t\tmerge_info_string(info, 'Alias', val, '_')\n\tend", "def usage\n puts <<End\nUsage: #{File.basename($0)} [<path>]\n\nGets the root or base directory of a repository.\n\nIf <path> is omitted, assumes you are in a git repository and operates on that repository.\nIf <path> is supplied, operates on the repository which contains that file/dir.\nEnd\n exit 1\nend", "def add_alias(event)\n assert_permissions(event) # Only the botmaster can execute this\n\n msg = event.content\n aka = parse_term(msg)\n raise OutteError.new \"You need to provide an alias in quotes.\" if aka.nil?\n\n msg.remove!(aka)\n type = !!msg[/\\blevel\\b/i] ? 'level' : (!!msg[/\\bplayer\\b/i] ? 'player' : nil)\n raise OutteError.new \"You need to provide an alias type: level, player.\" if type.nil?\n\n entry = type == 'level' ? parse_highscoreable(msg) : parse_player(msg, event.user.name)\n entry.add_alias(aka)\n event << \"Added alias \\\"#{aka}\\\" to #{type} #{entry.name}.\"\nrescue => e\n lex(e, \"Error adding alias.\", event: event)\nend", "def git_tag\n return @git_tag if @git_tag\n @git_tag = `git rev-parse --short HEAD 2>&1`.chomp\n if $? != 0\n raise Athlete::BuildFailedException, \"Could not determine git hash of HEAD, output was: #{@git_tag}\"\n end\n @git_tag\n end", "def giturl(project_name, repo_name) ; end", "def git_ref\n `git rev-parse --short HEAD`.strip\nend", "def commandalias(command, a)\r\n\t$gamemode.commandalias(command, a)\r\nend", "def add_alias(gear, server_alias)\n args = build_base_gear_args(gear)\n args['--with-alias-name']=server_alias\n result = execute_direct(@@C_CONTROLLER, 'add-alias', args)\n parse_result(result)\n end", "def removeCommandAliases(repo)\n config = repo.config(true, '--list').lines.each do |line|\n next unless line.start_with? 'alias.' and line.match /\\!_git\\-bpf/\n a = /alias\\.([a-zA-Z0-9\\-_]+)\\=(.)*/.match(line)[1]\n repo.config(true, '--unset', \"alias.#{a}\")\n end\n end", "def aliases(s)\n command.aliases(s)\n end", "def prompt_git_branch\n if !is_git?\n return \"\"\n end\n stat = `git status`\n \"[#{stat.split(\"\\n\")[0].split(\" \")[-1]}]\".yellow\nend", "def git(*args)\n cmd(*['git'] + args)\n end", "def git(*args)\n cmd(*['git'] + args)\n end", "def add_alias(aka)\n aliases << aka unless aliases.include?(aka)\n end", "def set_alias(index)\n @alias = \"b#{index}\"\n end", "def account_alias\n # Do not execute IAM API call unless the -s/--show_account_alias flag is specified\n # (to prevent excess API calls *and* errors if IAM rights are not allowed)\n return nil unless config[:show_account_alias]\n\n begin\n iam_account_alias = iam_client.list_account_aliases[:account_aliases].first\n\n return '<no alias>' if iam_account_alias.empty? || iam_account_alias.nil?\n return iam_account_alias\n rescue StandardError => e\n unknown \"An error occured while using AWS IAM to collect the account alias: #{e.message}\"\n end\n end", "def aliases\n\n end", "def alias2cmd(cmd_alias)\n Commands::CMDS.find { |_, v| v[:alias] == cmd_alias }.first\n end", "def resolve_alias(group_alias)\n ALIASES[group_alias]\n end", "def alias_change(al)\n obj_change al, Alias\n end", "def aliases\n end", "def store_alias(myAlias, fact)\n @bot.debug \"parsing and storing alias #{myAlias}\"\n query = config[:dbh].prepare \"SELECT id FROM aliases WHERE alias = ?\"\n query.execute myAlias\n if row = query.fetch\n query = config[:dbh].prepare \"UPDATE aliases SET original=? WHERE alias=?\";\n query.execute(fact, myAlias)\n else\n query = config[:dbh].prepare \"INSERT INTO aliases (original, alias) values(?, ?)\";\n query.execute(fact, myAlias)\n end\n return \"Aliasing #{myAlias} to #{fact}\"\n end", "def help\n puts \"Usage: git file-history filename\"\n puts \" Show blame history for a file\"\n exit 1\nend", "def git(command)\n there { `git #{command} 2>&1`.strip }\n end", "def gem_git(name, options) # :nodoc:\n if gist = options.delete(:gist)\n options[:git] = \"https://gist.github.com/#{gist}.git\"\n end\n\n return unless repository = options.delete(:git)\n\n pin_gem_source name, :git, repository\n\n reference = gem_git_reference options\n\n submodules = options.delete :submodules\n\n @git_set.add_git_gem name, repository, reference, submodules\n\n true\n end", "def aliases; end", "def aliases; end", "def aliases; end", "def git_command(cmd, opt_str, dir)\n run_in_shell(\"git #{cmd} #{opt_str}\", dir)\n end", "def git(*args)\n system \"git \" + args.join(\" \")\nend", "def alias(new_name, old_name)\n registry.alias(new_name, old_name) or\n raise NameError.new(\"Undefined artifact name: #{old_name}\")\n end", "def git_ref_type\n Pkg::Util.in_project_root do\n stdout, _, _ = Pkg::Util::Execution.capture3(\"#{GIT} cat-file -t #{git_describe}\")\n stdout.strip\n end\n end", "def alias(name, alias_to)\n params = { :_n => alias_to, :_p => name }\n request('a', params)\n end", "def aliases=(_arg0); end", "def aliases=(_arg0); end", "def alias_processing\n self.alias = Russian.translit(self.alias.strip.gsub(' ', '_').gsub(/[\\W\\d]/, '')).downcase\n end", "def git(path, cmd, log=true)\n $stdout.puts(\"#{path.sub(ROOT_PATH, '')}: git #{cmd}\") if log\n git_path = path / '.git'\n git_index = git_path / 'index'\n\n # The env can become polluted; breaking git. This will avoid that.\n %x[GIT_DIR=#{git_path}; GIT_WORK_TREE=#{path}; GIT_INDEX_FILE=#{git_index}; git #{cmd}]\nend", "def warn_about_aliases\n Backdat::Log.warn \"*****************************************\"\n Backdat::Log.warn \"The #{@cmd} command is aliased to #{@first}.\"\n Backdat::Log.warn \"Please be explicit with SOURCES and TARGETS.\"\n Backdat::Log.warn \" Ex: #{$0} ./source /path/to/target\"\n Backdat::Log.warn \"*****************************************\"\n exit 0\n end", "def dir_alias= name\n #This is a stub, used for indexing\n end", "def call\n if git_remote_command =~ /git@github.com:(.+).git/\n \"https://github.com/#{Regexp.last_match(1)}\"\n else\n git_remote_command.sub('.git', '').chomp\n end\n end", "def git command, *args\n run 'git', command.to_s, *args\nend", "def git\n\tend", "def parse_alias(context, single, tk, comment)\n line_no = tk[:line_no]\n\n skip_tkspace\n\n if :on_lparen === peek_tk[:kind] then\n get_tk\n skip_tkspace\n end\n\n new_name = get_symbol_or_name\n\n skip_tkspace\n if :on_comma === peek_tk[:kind] then\n get_tk\n skip_tkspace\n end\n\n begin\n old_name = get_symbol_or_name\n rescue RDoc::Error\n return\n end\n\n al = RDoc::Alias.new(get_tkread, old_name, new_name, comment,\n single == SINGLE)\n record_location al\n al.line = line_no\n\n read_documentation_modifiers al, RDoc::ATTR_MODIFIERS\n context.add_alias al\n @stats.add_alias al\n\n al\n end", "def git(name)\n path = locate(name)\n\n Git.open(path)\n end", "def canonicalize_repo(repo)\n # if they fully-qualified it, we're good\n return repo if repo.start_with?('http', 'git@')\n\n # otherwise, ti's a shortname\n cr = \"git@#{@ghhost || 'github.com'}:#{repo}.git\"\n SugarJar::Log.debug(\"canonicalized #{repo} to #{cr}\")\n cr\n end", "def run(alias_name, options)\n puts options\n exec \"ssh #{alias_name}\"\n end", "def git_label(flags=nil)\n isunique = (flags ? flags[:assume_unique] : self.class.repo_ident_unique?)\n if identifier.blank?\n # Should only happen with one repo/project (the default)\n project.identifier\n elsif isunique\n identifier\n else\n mylabel = \"#{project.identifier}/#{identifier}\"\n end\n end", "def content\n \"alias #{@name}=#{@val}\"\n end", "def github(name, ref = 'master')\n gitrepo \"github.com\", name, ref\nend", "def add_alias(an_alias, context)\n raise NotImplementedError\n end", "def git_dir; end", "def add_alias!(aka)\n @aliases << aka if !@aliases.include?(aka)\n self\n end", "def add_alias!(aka)\n @aliases << aka if !@aliases.include?(aka)\n self\n end", "def aliases(cmd)\n COMMAND_ALIASES.each { |k,v| return k if v.include?(cmd) }\n nil\n end", "def alias_names; end", "def prompt_git_status\n if !is_git?\n return \"\"\n end\n stat = `git status`\n res = \"\"\n res += ( stat.include?(\"ahead\") ? \"^\" : \"\" )\n res += ( stat.include?(\"modified\") ? \"*\" : \"\" )\n res += ( stat.include?(\"untracked\") ? \"+\" : \"\" )\n res += ( stat.include?(\"deleted\") ? \"-\" : \"\" )\n res!=\"\" ? \"[#{res}]\".magenta : \"\"\nend", "def cmd\n \"git checkout #{other_branch}\"\n end", "def git_on(host, git_sub_command, git_repo_path, opts = {})\n git_command = \"git --git-dir=#{git_repo_path}/.git --work-tree=#{git_repo_path} #{git_sub_command}\"\n\n on(host, git_command, opts)\nend", "def config(key)\n %x[git config #{key}].chomp\nend", "def aliases\n short ? [name, short] : [name]\n end", "def git_name\n (!GitHosting.multi_repos? || identifier.blank?) ? project.identifier : identifier\n end", "def aref\n type = singleton ? 'c' : 'i'\n \"#alias-#{type}-#{html_name}\"\n end", "def alias(name)\n @aliases << convert(name)\n end", "def alias(name)\n @aliases << convert(name)\n end", "def realname\n alias? ? aliasof.name : name\n end", "def exchange_alias\n return @exchange_alias\n end", "def git(*args)\n cd { run(*['git'] + args) }\n end", "def add_alias(alias_name)\n $logger.info(\"Adding alias #{alias_name} to gear #{@uuid} of application #{@app.name}\")\n\n frontend = OpenShift::Runtime::FrontendHttpServer.new(OpenShift::Runtime::ApplicationContainer.from_uuid(@uuid))\n frontend.add_alias(alias_name)\n end", "def which_with_aliases(name)\n zsh_commands = [\n 'source ~/.oroshi/config/zsh/require.zsh',\n 'source ~/.oroshi/config/zsh/aliases.zsh',\n \"which #{name}\"\n ]\n command = \"zsh -c '#{zsh_commands.join('; ')}'\"\n `#{command}`.strip\n end", "def git_project()\n \"\"\nend", "def private_gem(name)\n gem name, '0.3.0', git: \"https://#{ENV['GITHUB_TOKEN']}:x-oauth-basic@github.com/mharris717/#{name}.git\", branch: :master\nend", "def alias(name)\n @aliases << normalize(name)\n nil\n end", "def update_account_alias_by_alias(account_alias:, new_alias:)\n params = {\n account_alias: account_alias,\n new_alias: new_alias\n }\n client.make_request('/update-account-alias', 'post', params: params)\n end" ]
[ "0.78487843", "0.66856784", "0.65222716", "0.6034868", "0.59449106", "0.5941758", "0.59098595", "0.5900271", "0.5846719", "0.57826656", "0.5763688", "0.57502395", "0.5745002", "0.571841", "0.56848145", "0.56157255", "0.5571074", "0.55693054", "0.5543564", "0.5538096", "0.55123234", "0.55046284", "0.5487037", "0.5446615", "0.5438506", "0.5429453", "0.5419098", "0.5415077", "0.5411719", "0.54082316", "0.54082066", "0.5404429", "0.5402933", "0.5396347", "0.53798234", "0.5374175", "0.5359788", "0.5344172", "0.53191364", "0.53191364", "0.5305328", "0.52922004", "0.5273445", "0.52720946", "0.52647114", "0.52646285", "0.525871", "0.52531534", "0.52392817", "0.5239155", "0.52243596", "0.5216623", "0.5210856", "0.5210856", "0.5210856", "0.5207792", "0.5204811", "0.52039754", "0.52033174", "0.5195902", "0.5189123", "0.5189123", "0.5186974", "0.5178734", "0.5151454", "0.51414573", "0.5139905", "0.5136728", "0.5133109", "0.513128", "0.51241726", "0.5111649", "0.51109916", "0.5108253", "0.5108125", "0.51065004", "0.5101627", "0.50993353", "0.5098254", "0.5098254", "0.5083084", "0.50815004", "0.5079758", "0.5079641", "0.5069651", "0.50632995", "0.5062183", "0.5051529", "0.5037665", "0.5034421", "0.5034421", "0.5033702", "0.50334597", "0.50229603", "0.5022228", "0.50110394", "0.5011018", "0.5007525", "0.5006759", "0.4997242" ]
0.8415596
0
before_action :authenticate_user! Rails image_url helper requires to setup host to generate the absolute url needed to load images from the external world (Facebook, Twitter, ...)
def default_url_options { host: ENV["HOST"] || "localhost:3000" } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def default_url\n ActionController::Base.helpers.image_path('user.png')\n end", "def logo_url\n if user_signed_in?\n current_user\n elsif admin_signed_in?\n current_admin_user\n else\n root_url\n end\n end", "def user_img_URL\n self.user.image_url\n end", "def image_url\n image.presence or (email.present? and gravatar_url) or Guest::IMAGE_URL\n end", "def default_url\n ActionController::Base.helpers.asset_path(\"missing_avatar_thumb.png\")\n end", "def user_image_url # return the user image\n ((self.user_image.present?)?(self.user_image.url.to_s):nil) || self.photo_url || \"/assets/no-image.png\"\n end", "def images_path\n \tmain_app.send(Auth::OmniAuth::Path.create_or_index_path(Auth.configuration.image_class))\n end", "def og_image\n if @user && @user.image?\n @user.image.url\n elsif @person && @person.image?\n @person.image\n else\n root_url.chomp('/') + image_path('logo.png')\n end\n end", "def display_profile_image\n if self.picture.present? && self.picture.url(:small).present?\n self.picture.url(:small)\n else\n ActionController::Base.helpers.asset_path('user.png')\n end\n end", "def show\n if @current_user.nil? and (!params[:id].to_i.zero? or User.find_by_username(params[:id]).nil?)\n redirect_to '/login' \n else\n if !params[:id].to_i.zero? and !@current_user.nil? and @current_user.image_ids.include? params[:id].to_i\n @image=Image.find params[:id]\n user=@current_user\n else\n user=User.find_by_username params[:id]\n @image=user.images.random\n end\n @image.text=user.quotes.random\n send_data(@image.to_img(request),\n :type => 'image/png',\n :disposition => 'inline')\n end\n end", "def user_avatar_url(user = nil, variant:)\n if user.nil? || Rails.application.show_dummy_image?\n UsersHelper.no_avatar_path\n else\n user.avatar_image_location(variant: variant) || UsersHelper.no_avatar_path\n end.to_s\n end", "def avatar_url\n root = Rails.application.routes.url_helpers.url_for(:root)\n uri = URI(root)\n uri.path = avatar_path\n uri.to_s\n end", "def image\n if File.exist?(\"public/images/profile_images/#{self.username}.jpg\")\n img_path = \"/images/profile_images/#{self.username}.jpg\"\n else\n img_path = \"/images/default.jpg\"\n end\n return img_path\n end", "def image_url\n url_for(object.profile_pic)\n end", "def get_image\n\n user = @login_user\n\n if user.nil?\n user = DesktopsHelper.get_user_before_login\n end\n\n desktop = Desktop.get_for(user, true)\n\n if desktop.nil?\n render(:text => '')\n return\n end\n\n response.headers[\"Content-Type\"] = desktop.img_content_type\n response.headers[\"Content-Disposition\"] = \"inline\"\n render(:text => desktop.img_content)\n end", "def path_to_image(source)\n path = super(source)\n if @generate_urls_with_host\n protocol = request.protocol()\n path = protocol + request.host_with_port() + path\n end\n return path\n end", "def default_url\n return '' #ActionController::Base.helpers.asset_path('common/no-image.png')\n end", "def image_url\n # It's just stored in public/data/slug.jpg or whatever the relevant file\n # extension is\n image = Dir[\"public/data/#{slug}.*\"].first.split(\"/\").last\n # That's accessed publicly over the website as /data/slug.jpg or whatever\n \"/data/#{image}\"\n end", "def default_url\n ActionController::Base.helpers.asset_path(\"integral/defaults/post_image.jpg\")\n end", "def avatar_url(user)\n if user.avatar_url.present?\n user.avatar_url\n else\n default_url = \"#{root_url}images/guest.png\"\n gravatar_id = Digest::MD5.hexdigest(user.email.downcase)\n \"http://gravatar.com/avatar/#{gravatar_id}.png?s=48&d=#{CGI.escape(default_url)}\"\n end\n end", "def avatar_url(user)\n if user.avatar_url.present?\n user.avatar_url\n else\n default_url = \"#{root_url}images/guest.png\"\n gravatar_id = Digest::MD5.hexdigest(user.email.downcase)\n \"http://gravatar.com/avatar/#{gravatar_id}.png?s=48&d=#{CGI.escape(default_url)}\"\n end\n end", "def author_picture_url\n @author_picture_url ||= begin\n if self.author_screenname\n \"http://twitter.com/api/users/profile_image/#{self.author_screenname}\"\n else\n image_path(\"default-avatar.png\")\n end\n end\n end", "def image_url\n model.image_url.presence || h.asset_path('face.jpg')\n end", "def avatar_url(user)\n default_url = \"#{root_url}images/guest.jpg\"\n # BUG: Don't use gravatar as you can get someone else's gravatar with your name.\n # eg. Try signing up with name \"test meme\" ... it's some dude's distorted face\n # if user.profile\n # if user.profile.avatar_url.present?\n # user.profile.avatar_url\n # else\n # gravatar_id = Digest::MD5.hexdigest(user.email.downcase)\n # \"http://gravatar.com/avatar/#{gravatar_id}?s=200&d=#{CGI.escape(default_url)}\"\n # end\n # else\n # default_url\n # end\n end", "def get_user_image(user,size)\n if img=user.image\n img.photo.url(size)\n else\n '/images/default-user-image-'+size.to_s+'.jpg'\n end\n end", "def avatar_url(avatar_size=\"small\")\n if self.has_shelby_avatar\n return self.shelby_avatar_url(avatar_size)\n else\n return self.user_image_original || self.user_image || \"#{Settings::ShelbyAPI.web_root}/images/assets/avatar.png\"\n end\n end", "def thumbnail_url\n # Just show defaults for now\n ActionController::Base.helpers.image_url 'default.png', host: public_site_url\n\n # Actual thumbnails are ready to go below.\n #if self.thumbnail.present?\n # Rails.application.routes.url_helpers.download_url(self.thumbnail.id, file: 'thumbnail')\n #else\n # ActionController::Base.helpers.image_url 'default.png'\n #end\n end", "def thumbnail_url\n # Just show defaults for now\n ActionController::Base.helpers.image_url 'default.png', host: public_site_url\n\n # Actual thumbnails are ready to go below.\n #if self.thumbnail.present?\n # Rails.application.routes.url_helpers.download_url(self.thumbnail.id, file: 'thumbnail')\n #else\n # ActionController::Base.helpers.image_url 'default.png'\n #end\n end", "def default_url\n # ActionController::Base.helpers.asset_path(\"fallback/\" + [version_name, \"anonymous_avatar.gif\"].compact.join('_'))\n\n 'anonymous_avatar.gif'\n #\"/images/\" + [version_name, \"anonymous.jpg\"].compact.join('_')\n end", "def logo_url\n logo? ? logo.url : profile_img\n end", "def image_url(style='original')\n ENV[\"domain\"] + self.picture.image.url(:original) if self.picture.present?\n end", "def site_image_url(src)\n rewrite_asset_path(src.expand_url(\"#{account_site_assets_url}/images/\"))\n end", "def cms_image_url(img_key)\n cms_host = 'http://local.amaysim2.com.au/' #TODO load from compass.yml\n \"#{cms_host}#{CMS_IMAGES[img_key]}\"\n end", "def change_image_url_path\n if request.protocol == \"https://\"\n configatron.root_image_path = configatron.root_image_path.gsub(\"http://\", \"https://\")\n configatron.root_image_url = configatron.root_image_url.gsub(\"http://\", \"https://\")\n configatron.hostname = configatron.hostname.gsub(\"http://\", \"https://\")\n elsif request.protocol == \"http://\"\n configatron.root_image_path = configatron.root_image_path.gsub(\"https://\", \"http://\")\n configatron.root_image_url = configatron.root_image_url.gsub(\"https://\", \"http://\")\n configatron.hostname = configatron.hostname.gsub(\"https://\", \"http://\")\n end\n end", "def image_url\n image_uri\n end", "def image_url\n \"http://graph.facebook.com/#{third_party_id}/picture?type=square\"\n end", "def default_url\n file_path = [\n 'fallbacks',\n ([model.class.to_s.underscore, mounted_as, version_name].compact.join('_') + '.png')\n ].join '/'\n\n 'http://' + ENV['HOST'] + ActionController::Base.helpers.image_path(file_path)\n end", "def set_image_path\n case provider\n when 'facebook' then self.path = set_facebook_url\n when 'gravatar' then self.path = set_gravatar_url\n else\n self.path = set_gravatar_url\n self.provider = 'gravatar'\n end\n\n self.is_active = true if Avatar.where(user: user).count == 0\n end", "def hero_image_url\n safe_image_url( :hero )\n end", "def gravatar_img_src\n # Não usa facebook\n if self.uid.nil?\n # include MD5 gem, should be part of standard ruby install\n require 'digest/md5'\n # create the md5 hash\n hash = Digest::MD5.hexdigest(self.email.downcase)\n # compile URL which can be used in <img src=\"RIGHT_HERE\"...\n self.image = \"http://www.gravatar.com/avatar/#{hash}\"\n end\n end", "def user_image(user, options={})\n # get the email from URL-parameters or what have you and make lowercase\n email_address = user.email.downcase\n \n # create the md5 hash\n hash = Digest::MD5.hexdigest(email_address)\n\n query_string = hash_to_query_string(options.reverse_merge({\n :size => 100,\n :default => 'identicon'\n }))\n\n # compile URL which can be used in <img src=\"RIGHT_HERE\"...\n \"http://www.gravatar.com/avatar/#{hash}#{query_string}\"\n end", "def avatar_path\n if ENV[\"FALLBACK_ICONS_DEBUG\"]\n return ActionController::Base.helpers.asset_path(self.class.image_files(:robot).sample)\n end\n\n if avatar.attached?\n # ▼Activestorrage service_url missing default_url_options[:host] · Issue #32866 · rails/rails\n # https://github.com/rails/rails/issues/32866\n Rails.application.routes.url_helpers.rails_blob_path(avatar, only_path: true)\n else\n list = self.class.image_files(race_info.key)\n file = list[(id || self.class.count.next).modulo(list.size)]\n ActionController::Base.helpers.asset_path(file) # asset_url にしてもURLにならないのはなぜ?\n end\n end", "def default_url\n \"/images/user/avatar/\" + [version_name, \"default.png\"].compact.join('_')\n end", "def passthrough\n # We only want this to be for Newscoop\n # Nevermind, we want it for CINS too\n # Screw it, we'll generalize it out to an environment variable\n\n if(ENV['proxy_images'].blank? || ENV['proxy_images'].downcase != 'true')\n render plain: \"Proxy images not enabled for this installation: proxy_images=#{ENV['proxy_images']}\"\n return\n end\n\n url = params['url']\n \n # For Newscoop, the images are returned as an API call, not a permalink. It's not smart, but it's what they do.\n if ENV['cms_mode'] == \"newscoop\"\n url += \"&ImageHeight=#{params['ImageHeight']}\" if !params['ImageHeight'].nil?\n url += \"&ImageWidth=#{params['ImageWidth']}\" if !params['ImageWidth'].nil?\n url += \"&ImageId=#{params['ImageId']}\" if !params['ImageId'].nil?\n end\n \n link_uri = Addressable::URI.parse(url)\n base_uri = Addressable::URI.parse(cms_url)\n\n if(link_uri.host.nil?) \n link_uri.host = base_uri.host\n link_uri.scheme = base_uri.scheme\n url = link_uri.to_s\n end\n\n link_host = link_uri.host.gsub('www.', '')\n base_host = base_uri.host.gsub('www.', '')\n \n logger.info(\"Checking for valid image proxy request #{link_host} vs. #{base_host}\")\n if(link_host == base_host)\n image_response = Rails.cache.fetch(url, expires_in: 5.minutes) do\n logger.info(\"URL requested not cached: #{url}\")\n logger.info(\"Fetching #{url}\")\n raw_response = HTTParty.get(link_uri.normalize)\n image_response = {body: raw_response.body, content_type: raw_response.headers['content-type']}\n image_response\n end\n \n send_data image_response[:body], type: image_response[:content_type], disposition: 'inline', layout: false\n else\n render plain: \"Error retreiving #{url}, #{link_uri.host.gsub('www.', '')} does not match #{base_uri.host.gsub('www.', '')}\"\n return\n end\n \n end", "def sanitize_image_url\n if self.image_url \n if self.image_url.first != \"h\"\n self.image_url = \"http://#{self.image_url}\"\n end\n end\n end", "def image_url\n return \"\" if @path.nil? || @path.empty?\n \"#{images_scheme}://#{images_host}/\" << if m = /^(pv4|pfk|p7s|p6o|p3w|p7s|p)\\/(.*)$/.match(@path)\n \"p/\" << m[2]\n else\n @path\n end\n end", "def avatar_url\r\n return @user.avatar_url\r\n end", "def set_image\n # @image = Image.find_by(id: params[:id],site_id: @site.id)\n @image = Image.find(params[:id])\n redirect_to admin_errors_url(error_template: '403') unless @image\n end", "def default_url\n ActionController::Base.helpers.asset_path(\"logos/\" + [version_name, \"missing.png\"].compact.join('/'))\n end", "def picture_url\n if avatar\n image_path(\"speakers/#{avatar}\")\n else\n image_path(\"default-avatar.png\")\n end\n end", "def avatar_url\n uploaded ? avatar.url : \"/assets/no_avatar.png\"\n end", "def default_url\n Settings.image.default_avatar\n end", "def default_url\n Settings.image.default_avatar\n end", "def default_url\n Settings.image.default_avatar\n end", "def image_url\n image.url\n end", "def image_url\n# Somehow the picture field returns false for 'nil?' regardless of wether it's set or not\n# So we'll have to check if the size of the url is 0 to see if it exists\n# There should be a better way to do this, probably?\nif self.picture.size == 0\n\tself.profile_picture.nil? ? 'image-unknown.jpg' : self.profile_picture\nelse \n\tself.picture.ava\nend\nend", "def blank_url\n asset_host = Rails.configuration.action_controller[:asset_host]\n if asset_host\n \"http://#{asset_host}/assets/default/#{blank_image}\"\n else\n \"/assets/default/#{blank_image}\"\n end\n end", "def image_url\n return unless image.attached?\n\n url_for(image)\n end", "def index\n # Get user\n host = AuthorizeApiRequest.call(params).result\n\n # Get image uri\n if host\n render json: { profile: host[:profileImage] }, status: :ok\n else\n render json: { status: 'error' }, status: :unprocessable_entity\n end\n end", "def image_url\n if image.present?\n image\n else\n \"http://loremflickr.com/320/240/#{CGI.escape name}\"\n end\n end", "def image\n return unless resource.avatar\n \"#{Seek::Config.site_base_host}/#{resource.class.table_name}\" \\\n \"/#{resource.id}/avatars/#{resource.avatar.id}?size=250\"\n end", "def image\n require 'digest/md5'\n \"http://www.gravatar.com/avatar/#{Digest::MD5.hexdigest(author_email.downcase)}\"\n end", "def avatar_url(type = :small)\n \"#{authentications.first.avatar_url}?type=#{type}\"\n end", "def find_avatar!\n @avatar = @user.avatar!\n authorize @avatar\n end", "def image\n if user_signed_in?\n send_file 'public/img/goblin.png', type: 'image/png', disposition: 'inline'\n else\n send_file 'public/img/ogre.png', type: 'image/png', disposition: 'inline'\n end\n end", "def add_photos_from_site\n if(params[:photo_url])\n @url = params[:photo_url]\n @album = Album.find(:all,:conditions=>[\"user_id=?\",@login_user.id])\n render :action=>\"add_photos_from_site\", :layout=>false\n end\n \n end", "def avatar_url\n\t\t\"http://zombitar.com/#{id}.jpg\"\n\tend", "def show_myimage\n if signed_in?\n @menu = \"mytemplate\" \n @board = \"myimage\"\n @section = \"show\"\n \n @sharedimage = Sharedimage.get(params[:id].to_i)\n \n render '/sharedimages/myimage_show', :layout => 'ajax-load-page'\n\n else\n redirect_to '/login'\n end\n end", "def avatar_url(user)\n default_url = \"#{root_url}images/user-img.gif\"\n gravatar_id = Digest::MD5.hexdigest(user.email.downcase)\n \"http://gravatar.com/avatar/#{gravatar_id}.png?s=48&d=#{CGI.escape(default_url)}\"\n end", "def default_url\n ActionController::Base.helpers.asset_path('mails/bigimage.jpg', type: :image).to_s\n end", "def user_logo(user)\n image_tag(user.avatar_url)\n end", "def image_url\n rails_blob_url(object.image)\n # This helper gets the URL from the file we pass to it\n end", "def 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 # \"/images/fallback/\" + [version_name, \"default.png\"].compact.join('_')\n # 'default_avatar.png' #rails will look at 'app/assets/images/default_avatar.png'\n end", "def thumbnail_path_for_user(user)\n (photo = photo_for_user(user)) && occasion_thumbnail(photo)\n end", "def avatar_url\n self.avatar.attachment.nil? ? '' :\n \"#{Rails.configuration.api_url}#{Rails.application.routes.url_helpers.rails_blob_path(self.avatar, only_path: true)}\"\n end", "def avatar_url\n self.avatar.attachment.nil? ? '' :\n \"#{Rails.configuration.api_url}#{Rails.application.routes.url_helpers.rails_blob_path(self.avatar, only_path: true)}\"\n end", "def result_image_url\n safe_image_url( :searchresult )\n end", "def image_url\n is_processed ?\n FileSystem.url(image_path) : \n orig_image_url\n end", "def image_url\n is_processed ?\n FileSystem.url(image_path) : \n orig_image_url\n end", "def image_path\n \"#{File.dirname(__FILE__).gsub('spec/strategies', 'public')}#{@upload.avatar.url(:big)}\"\n end", "def avatar\n \t\t# get the email from URL-parameters or what have you and make lowercase\n\t\temail_address = self.email.downcase\n\t\t \n\t\t# create the md5 hash\n\t\thash = Digest::MD5.hexdigest(email_address)\n\t\t \n\t\t# compile URL which can be used in <img src=\"RIGHT_HERE\"...\n\t\timage_src = \"http://www.gravatar.com/avatar/#{hash}\"\n \tend", "def image_url(options = {})\n base_url = options[:base_url] || self.base_url || Configuration.DEFAULT_BASE_URL\n base_url << \"/\" if base_url[-1,1] != \"/\"\n base_url << image_path(options)\n end", "def gravatar_url\n hash = Digest::MD5.hexdigest(self.email)\n\n image_src = \"//www.gravatar.com/avatar/#{hash}?d=identicon\"\n end", "def thumbnail\n if user_signed_in?\n send_thumbnail\n else\n evaluate_thumbnail_visibility\n end\n end", "def author_avatar\n anonymous? ? Avatar.default.url : user.profile.avatar.url\n end", "def default_url\n ActionController::Base.helpers.asset_path(\"images/\" + [version_name, \"missing.png\"].compact.join('/'))\n end", "def image_url(source)\n URI.join(root_url, image_path(source))\n end", "def configureImages()\n #Fetch the server configuration\n config = fetchServerConfig()\n #Used the gathered configuration information to build a URL for accessing images\n $imageBase = config['images']['base_url']+config['images']['poster_sizes'][5]\nend", "def photo_url\n gravatar_id = Digest::MD5.hexdigest(email.downcase)\n \"https://gravatar.com/avatar/#{gravatar_id}.png\"\n end", "def render_avatar(request)\n if !request.after_photo_url.blank?\n render partial: \"avatar\", locals: { link: request.after_photo_url_url(:thumb) }\n else\n if current_user && current_user.id == request.requestor_id && request.current_status >= 10\n render partial: \"upload_photo\", locals: { request: request }\n else\n if !request.before_photo_url.blank?\n render partial: \"avatar\", locals: { link: request.before_photo_url_url(:thumb) }\n else\n render partial: \"avatar\", locals: { link: \"profile.png\" }\n end\n end\n end\n end", "def avatar_url\n return image_url if image_url\n return DEFAULT_AVATAR if email.nil?\n\n gravatar_url\n end", "def image_url\n image.url.split('?').first if image\n end", "def image_url\n image.url.split('?').first if image\n end", "def current_avatar\n logged_in? ? \n image_tag(\"/avatar/show?secret_code=#{session[:secret_code]}&\", :alt => current_user.login) : # The '&' is a hack to prevent the appended .png from spoiling the call\n image_tag('id_image.gif', :alt => \"ID Image\", :size => '70x70')\n end", "def image_url\n image.present? ? image.url : ''\n end", "def default_url\n ActionController::Base.helpers.asset_path(\"fallback/#{model.class.to_s.underscore}_#{mounted_as}/\" + [version_name, \"default.jpg\"].compact.join('_'))\n end", "def raster_profile_picture(user)\n if user.authentications.where(:provider == \"Facebook\").any?\n fb_picture(user)\n elsif user.authentications.where(:provider == \"Twitter\").any?\n twitter_picture(user, type: \"normal\") \n else\n image_tag user.avatar.url(:raster), class: \"img-circle small_profile_picture\"\n end\n end", "def avatar_url\n \"http://robohash.org/#{email}?gravatar=yes\"\n end", "def display_picture_url\n\t\tdisplay_picture.url(:original)\n\tend", "def default_url(*args)\n \"/site_assets/_shared/avatars/\" + [\"empty_avatar\", version_name].compact.join('_') + '.png'\n end", "def image_url(source)\n abs_path = image_path(source)\n unless abs_path =~ /^http/\n abs_path = \"#{request.protocol}#{request.host_with_port}#{abs_path}\"\n end\n abs_path\n end" ]
[ "0.6856503", "0.6596456", "0.65430766", "0.65305066", "0.64984775", "0.64625835", "0.6437273", "0.6402746", "0.6319955", "0.6289878", "0.6278521", "0.6190018", "0.61811256", "0.6170953", "0.61488456", "0.6125756", "0.61238515", "0.61193967", "0.61163116", "0.6116228", "0.611566", "0.611427", "0.6112794", "0.606789", "0.60636044", "0.6060623", "0.60516304", "0.60516304", "0.6049515", "0.60433495", "0.60349536", "0.60326636", "0.6027876", "0.6017863", "0.600698", "0.5996731", "0.59804046", "0.5967363", "0.5950953", "0.5947343", "0.59465903", "0.59262663", "0.5925247", "0.59247446", "0.59234834", "0.59234023", "0.5920926", "0.58997136", "0.5893264", "0.58918536", "0.58781123", "0.58742416", "0.58742416", "0.58742416", "0.5865609", "0.58562714", "0.58557254", "0.5854551", "0.5838054", "0.5836204", "0.5835526", "0.58343136", "0.5820325", "0.5817078", "0.5812378", "0.58103937", "0.5810364", "0.5807761", "0.57866853", "0.5784708", "0.578147", "0.5776591", "0.5768156", "0.57675755", "0.57645047", "0.5759639", "0.57586676", "0.5756343", "0.5756343", "0.5754483", "0.5742874", "0.574026", "0.57369286", "0.5727633", "0.57270545", "0.5726129", "0.5725837", "0.5725791", "0.57239264", "0.5715672", "0.57088834", "0.5703678", "0.5703678", "0.569975", "0.5698626", "0.56962854", "0.56919307", "0.5675868", "0.5674783", "0.5672963", "0.5671574" ]
0.0
-1
Check whether the request made to the API call is valid. Raises an error if the response code is 500
def valid_request? # 400 - Error with input # 403 - Key related error # 500 -Unknown error # Check http://www.mapquestapi.com/geocoding/status_codes.html for more details @valid = case status[:code] when 500 raise InvalidRequest when 400, 403 false else true end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_request\n if @req.code.to_i.between?(400, 499)\n raise Exceptions::SlicingDiceHTTPError, \"Client Error \"\\\n \"#{@req.code} (#{@req.message}).\"\n elsif @req.code.to_i.between?(500, 600)\n raise Exceptions::SlicingDiceHTTPError, \"Server Error \"\\\n \"#{@req.code} (#{@req.message}).\"\n else\n true\n end\n end", "def check_for_errors\n info = MultiJson.load(self.body).first\n\n if info['result'] && info['result'] != 0\n if info['result'] == 500\n raise Webceo::Api::ServerError.new(self.status.to_i, self.body)\n else\n raise Webceo::Api::ClientError.new(self.status.to_i, self.body)\n end\n end\n end", "def check_response\n unless (res = get).valid?\n raise BadResponse, \"#{res.code} #{res['Code'].first}\"\n end\n\n res\n end", "def is_client_error?\n @code.in? 400..499\n end", "def client_error?\n 400 <= code && code < 500\n end", "def client_error?\n (400..499).cover?(code)\n end", "def check_response\n errors.add(:base, :invalid) unless response.present? && response[\"res\"] == 1\n end", "def client_error?\n (400...500).include?(@status_code)\n end", "def error?\n http_status >= 400 && http_status <= 599\n end", "def client_error?\n (400..499).cover?(code)\n end", "def invalid_request?\n EXTERNAL_RESPONSE_CODES[:invalid_request] == @code\n end", "def invalid_request?\n EXTERNAL_RESPONSE_CODES[:invalid_request] == @code\n end", "def invalid_request?\n EXTERNAL_RESPONSE_CODES[:invalid_request] == @code\n end", "def valid?\n code == 200\n end", "def validate_http_status\n return true if @http.code.to_i == 200\n DomainTools::Exceptions::raise_by_code(@http.code)\n end", "def valid?\n status == 200\n end", "def validate(response)\n unless response.code == 200\n message = response.parsed_response\n message = message['error'] if message.respond_to?(:has_key?) and message.has_key?('error')\n message = message['message'] if message.respond_to?(:has_key?) and message.has_key?('message')\n raise RequestError.new(message, response.code)\n end\n\n response\n end", "def failed_or_invalid?\n invalid_request? || failed_request?\n end", "def failed_or_invalid?\n invalid_request? || failed_request?\n end", "def failed_or_invalid?\n invalid_request? || failed_request?\n end", "def client_error?\n @status.between?(400, 499) if @status\n end", "def check_response!\n body[:stat] == 'ok' || fail(ClientError, \"#{ body.inspect }\")\n end", "def error?\n (400...600).include?(@status_code)\n end", "def error?\n (500..599).include?(status)\n end", "def http_error?\n !(200..299).include?(http_code)\n end", "def is_client_error?\n code.to_i >= 400 && code.to_i <= 499\n end", "def valid_request?\n signature = github_signature\n my_signature = 'sha1=' + OpenSSL::HMAC.hexdigest(\n OpenSSL::Digest.new('sha1'),\n ENV['GITHUB_WEBHOOK_SECRET'],\n github_payload_raw\n )\n\n json_response(json_access_denied, :unauthorized) unless Rack::Utils.secure_compare(my_signature, signature)\n rescue StandardError => e\n msg = \"#{self.class}##{__method__} An error occurred while determine if request is valid\"\n Rails.logger.error(\n message: msg,\n exception: e\n )\n\n json_response(json_access_denied(errors: { message: \"#{msg}, exception: #{e.message}\" }), :unauthorized)\n end", "def validate_response(response) # :nodoc:\n code = response.code.to_i\n raise HttpError, \"#{code} #{response.msg}\" if code < 200 || code > 299\n end", "def error?\n response.is_a?(Hash) ? response.has_key?(:status) : false\n end", "def successful_request?\n raise RequestError, @exception_detail[\"InnerException\"][\"Message\"] if @exception_detail\n raise RequestError, @error_message.join(\"; \") unless @is_success == true\n end", "def respond_to?(api_method, *args) # :nodoc:\n call(api_method, *args)\n @response.code == 500 ? false : true\n end", "def request_succeeded?\n @errors.blank? && [200,0].member?(@response_code)\n end", "def server_error?\n (500..599).cover?(code)\n end", "def is_server_error?\n code.to_i >= 500 && code.to_i <= 599\n end", "def halt_using_if_invalid(request)\n unless request.valid?\n halt 422, json({ message: request.reason })\n end\n end", "def bad_request_status\n status_message(400)\n end", "def is_server_error?\n @code.in? 500..599\n end", "def connection_valid?\n client('v1').api_valid?\n rescue StandardError\n false\n end", "def server_error?\n (500...600).include?(@status_code)\n end", "def http_error?\n http_error.present?\n end", "def failed_request?\n EXTERNAL_RESPONSE_CODES[:failure] == @code\n end", "def failed_request?\n EXTERNAL_RESPONSE_CODES[:failure] == @code\n end", "def failed_request?\n EXTERNAL_RESPONSE_CODES[:failure] == @code\n end", "def validate_response!(response)\n raise \"empty response\" unless response\n\n status = response[\"stat\"]\n if status and status != \"ok\"\n error = response[\"err\"]\n if error\n raise RequestFailed, \"#{error[\"code\"]}: #{error[\"msg\"]}, explanation: #{error[\"expl\"]}\"\n else\n raise RequestFailed, \"Error: #{status}, no error message\"\n end\n end\n end", "def error?\n response = RequestResponse.new\n err_resp = get_last_error\n err_resp.callback do |doc|\n response.succeed doc['err'] != nil\n end\n err_resp.errback do |err|\n response.fail err\n end\n response\n end", "def check_errors_or_500(object)\n \n if(object.errors.messages)\n render json: object.errors.messages.to_json, status: 400\n else\n render json: {error: \"Internal server error\"}.to_json, status: 500\n end\n\n end", "def check_error(response)\n raise NotImplementedError\n end", "def server_error?\n @status.between?(500, 599) if @status\n end", "def check_requests\n if requests.empty?\n errors.add('requests', 'there were no requests')\n return\n end\n\n requests.each do |request|\n next if request.valid?\n\n request.errors.each do |k, v|\n errors.add(k, v)\n end\n end\n end", "def expect_server_error_status\n is_expected.to respond_with 500\n end", "def verify_access_with_api_key\n api_key = request.headers[\"HTTP_API_KEY\"] || params[:api_key]\n andrew_id = request.headers[\"HTTP_ANDREW_ID\"] || params[:andrew_id]\n if (api_key.nil? || andrew_id.nil?)\n render json: {error: \"Error, bad request\"}, status: 400\n elsif !(key_matches?(api_key, andrew_id))\n render json: {error: \"Error, unauthorized user or API key\"}, status: 401\n # Inactive users are not allowed to use their keys for any reason.\n elsif !@cur_user.active\n render json: {error: \"Error, the account associated with this andrew ID has been suspended\"}, status: 401\n end\n end", "def error?\n # 4xx and 5xx are errors\n return @status >= 400 && @status < 600\n end", "def check_response\n if @res.blank? || @res.error\n flash[:error] = t \"errors.api\"\n end\n end", "def respond_bad_request; make_response(nil, false, 400, \"Bad Request\") end", "def success?\n status < 400\n end", "def ok?\n\n if @http_raw_response.kind_of? Net::HTTPNoContent\n #if there is no content expected, use HTTP code\n 204 == @http_status_code\n else\n # otherwise use API status\n @http_raw_response.kind_of? Net::HTTPOK and 0 == @api_status.to_i\n end\n end", "def valid?\n @http_response.is_a?(Net::HTTPSuccess) && @errors.blank?\n end", "def check_for_error(res)\n body = res.parsed_response\n raise ValidationError.new(body), \"Authentication failed\\n status code: \\\"#{res.code}\\\"\\n message: \\\"#{body['error']}\\\"\" if res.code != 200\n end", "def ok?\n @result.code.to_i != 200\n end", "def request_not_found(response)\n response.code == 404 ||\n response['status'] == 'Bad Request' ||\n response.parsed_response['Results']['state'].size == 0\n end", "def valid_http_code_returned?(http_client, url)\n rubygems_valid_response?(http_client, url) || shields_io_valid_response?(http_client, url)\n end", "def valid?\n core_client.api_valid?\n end", "def expect_unprocessable_status\n is_expected.to respond_with 422\n end", "def validate_endpoint_response\n begin\n return if response.nil?\n res = JSON.parse(response)\n \n if res[\"code\"].present?\n errors.add(:response, 'response code must have value of data type integer') if !res[\"code\"].is_a? Integer\n else\n errors.add(:response, \"response code can't be blank\") \n end\n\n if res[\"headers\"].present?\n isValid = true\n res[\"headers\"].each do | key, value |\n isValid = (value.instance_of? String)? true : false\n errors.add(:response, \"response headers attributes: #{key} must have value of data type string\") if !isValid\n end\n end\n\n if res[\"body\"].present?\n isValid = true\n isValid = (res[\"body\"].instance_of? String)? true : false\n errors.add(:response, \"response body value must be of data type string\") if !isValid \n end\n rescue JSON::ParserError => e\n errors[response.to_s] << \"is not valid JSON\" \n end\n end", "def handle_bad_request\n make_response(400, 'Bad request (invalid input)')\nend", "def handle_bad_request\n make_response(400, 'Bad request (invalid input)')\nend", "def handle_bad_request\n make_response(400, {message: 'Bad request (invalid input)'})\nend", "def validate\n unless (e = errors).empty?\n raise InvalidRequestError, e.first\n end\n end", "def error_response?(response, _parsed_response)\n !(200..299).cover?(response.code)\n end", "def cannot_access_api?\n !request.env[\"REQUEST_METHOD\"].eql?(\"GET\") &&\n !request.headers['mw-token'].eql?(ENV[\"api_access_token\"])\n end", "def ensure_json_request\n return render_message({status:ERR_STATUS,responseMessage: NOT_ACCEPTABLE_MESSAGE, responseCode: NOT_ACCEPTABLE }) unless request.format == :json\n end", "def bad_request\n render status: :bad_request, json: {\n errors: ['Invalid Request', 'Missing one or more required fields.'],\n }\n end", "def check_failure(code)\n assert_response code\n body = JSON.parse(response.body)\n body['error'].should_not == nil\nend", "def bad_request\n render :json => {:success=>false, :error_code=> 400, :error_msg=>\"Bad Request\"}\n end", "def error?(res)\n res.code >= 400 || JSON.parse(res.body)[\"error\"]\n end", "def server_error?\n 500 <= code && code < 600\n end", "def http_error?(code)\n http_status?(:error, code)\n end", "def common_solutions\n if @response.code.to_i == 406\n \"Check the Content-Type and makes sure it's the correct type (usually application/json or application/xml), ensure url has .xml or .json at the end, check 'Accept' header to allow xml or json ('*/*' for anything)\"\n elsif @response.code.to_i == 401\n \"Check your credentials and make sure they are correct and not expired\"\n elsif @response.code.to_i >= 500 && @response.code.to_i < 600\n \"Check the format of your xml or json\"\n end\n end", "def validate!\n raise BadRequestError.new(self.errors.full_messages.uniq.join(', ')) unless valid?\n end", "def validate!\n raise BadRequestError.new(self.errors.full_messages.uniq.join(', ')) unless valid?\n end", "def server_error?\n response.is_a?(Net::HTTPInternalServerError)\n end", "def rubygems_valid_response?(http, url)\n url.include?(RubygemsApi::BASE_URL) && http_valid_status_code?(http, [200, 404])\n end", "def validate_request\n if @parsing_error\n return [400, \"Parsing error: #{@parsing_error}\"]\n elsif !@request_body || @request_body.empty?\n return [400, 'Request body is empty.']\n end\n\n return []\n end", "def failed?\n request_sent? && !response.success?\n end", "def check_error(response) #:nodoc:\n case response.code\n when 200 then # ignore, ok\n when 500 then\n raise Error, 'server error'\n when 601 then\n raise AddressError, 'missing address'\n when 602 then\n raise AddressError, 'unknown address'\n when 603 then\n raise AddressError, 'unavailable address'\n when 610 then\n raise CredentialsError, 'invalid key'\n when 620 then\n raise CredentialsError, 'too many queries'\n else\n raise Error, \"unknown error #{response.code}\"\n end\n end", "def bad_request(object)\n render json: object, status: 400\n end", "def error?(response)\n response.key?('errorcode')\n end", "def call\n resource.errors.any?\n end", "def status_bad_request\n respond_to do |format|\n format.any { head :bad_request }\n end\n end", "def check_access\n @response = Response.new\n \n check_hash()\n \n if @response.error?\n access_denied\n return\n end\n end", "def relaunch?\n errors.present? && ![\n 400, # Bad Request\n 401, # Unauthorized\n 403, # Forbidden\n # 404, Not Found\n 414, # URI Too Long\n # 500 Internal Server Error\n ].include?(http_status)\n end", "def verify_api_key\n # Confirm that it's a json request. This is irrelevant otherwise.\n if request.format && request.format.symbol && request.format.symbol == :json\n # We must have a key, either way. If no key, pass forbidden response.\n if params[:key].nil? && (request.env['HTTP_REFERER'] =~ Regexp.new(request.env['HTTP_HOST'])).nil?\n render :json => { :errors => \"Invalid API key.\" }, :status => :forbidden\n else\n if (request.env['HTTP_REFERER'] =~ Regexp.new(request.env['HTTP_HOST'])).nil?\n # Find by key\n @key = ApiKey.find_by_key(params[:key])\n if @key.nil?\n # Throw error if no key found.\n render :json => { :errors => \"Invalid API key.\" }, :status => :forbidden\n end\n end\n end\n end\n end", "def failure(response)\n catch_throttling_error(response)\n parsed_response = JSON.parse(response.body.to_s)\n raise RequestError, parsed_response['detail']\n rescue JSON::ParserError\n raise RequestError, response.status\n end", "def check_error(response) #:nodoc:\n case response.status\n when \"OK\" then # ignore, ok\n when \"ZERO_RESULTS\" then\n raise AddressError, 'unknown address'\n when \"OVER_QUERY_LIMIT\"\n raise CredentialsError, 'over query limit'\n when \"REQUEST_DENIED\"\n raise CredentialsError, 'request denied'\n when \"INVALID_REQUEST\"\n raise AddressError, 'missing address'\n when \"UNKNOWN_ERROR\"\n raise Error, \"unknown server error. Try again.\"\n else\n raise Error, \"unkown error #{response.status}\"\n end\n end", "def api_error\n dm_data.first.first == \"errors\"\n end", "def valid_status?(response)\n response.is_a?(Net::HTTPSuccess)\n end", "def is_request_status_ok\n get_request_status == MA500Functions::MA500::ILV_OK.hex\n end", "def bad_request_response(env)\n if head_request?(env)\n [ 400, { \"content-type\" => \"text/plain\", \"content-length\" => \"0\" }, [] ]\n else\n [ 400, { \"content-type\" => \"text/plain\", \"content-length\" => \"11\" }, [ \"Bad Request\" ] ]\n end\n end", "def http_client_error?(code)\n http_status?(:client_error, code)\n end", "def bad_request(error)\n json_response({ message: error.message }, :bad_request)\n end" ]
[ "0.74857956", "0.74276817", "0.74186575", "0.7180426", "0.714546", "0.70981413", "0.70233935", "0.70077634", "0.70068353", "0.6943511", "0.6911704", "0.6911704", "0.6911704", "0.6875084", "0.6865005", "0.6826477", "0.6757708", "0.67451006", "0.67451006", "0.67451006", "0.6721872", "0.66919696", "0.6687609", "0.66788787", "0.66711783", "0.6649704", "0.6638759", "0.6620092", "0.65566695", "0.65541446", "0.6550754", "0.6537738", "0.6536979", "0.6519255", "0.6489901", "0.647225", "0.64577484", "0.64537257", "0.645335", "0.64497966", "0.64469224", "0.64469224", "0.64469224", "0.6437451", "0.64231753", "0.64107215", "0.64085066", "0.6400852", "0.6397963", "0.63930416", "0.6382338", "0.6379607", "0.63603497", "0.63494927", "0.6331834", "0.6321467", "0.6316536", "0.63135874", "0.63109744", "0.6308766", "0.6298437", "0.62814003", "0.6277982", "0.6265664", "0.6255477", "0.6255477", "0.6255196", "0.62482506", "0.62453294", "0.62412065", "0.62346905", "0.6231143", "0.6221779", "0.62172073", "0.62154967", "0.62085646", "0.6205951", "0.6203383", "0.61976117", "0.61976117", "0.6191388", "0.61605716", "0.6154696", "0.61492217", "0.6145255", "0.61352634", "0.61301935", "0.6129547", "0.61212355", "0.6114378", "0.61084676", "0.6089176", "0.60867465", "0.60844296", "0.60828143", "0.6074019", "0.60728234", "0.6068417", "0.6068047", "0.60545874" ]
0.7272601
3
Returns information about the response. :code is an integer return value. See :messages subfield is an array of error messages which describe the status.
def status return :code => info[:statuscode].to_i, :messages => info[:messages] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def status_code\n response_value(:code)\n end", "def code\n @response.code\n end", "def response_code_message(response_code)\n case response_code\n when 1\n \"Success\"\n when 2\n \"Error\"\n when 3\n \"Server Too Busy\"\n when 4\n \"Protocol Error\"\n when 5\n \"Operation Not Supported\"\n when 6\n \"Recursion Count Too High\"\n when 7\n \"Server Read-only\"\n when 100\n \"Handle Not Found\"\n when 101\n \"Handle Already Exists\"\n when 102\n \"Invalid Handle\"\n when 200\n \"Values Not Found\"\n when 201\n \"Value Already Exists\"\n when 202\n \"Invalid Value\"\n when 300\n \"Out of Date Site Info\"\n when 301\n \"Server Not Responsible\"\n when 302\n \"Service Referral\"\n when 303\n \"Prefix Referral\"\n when 400\n \"Invalid Admin\"\n when 401\n \"Insufficient Permissions\"\n when 402\n \"Authentication Needed\"\n when 403\n \"Authentication Failed\"\n when 404\n \"Invalid Credential\"\n when 405\n \"Authentication Timed Out\"\n when 406\n \"Authentication Error\"\n when 500\n \"Session Timeout\"\n when 501\n \"Session Failed\"\n when 502\n \"Invalid Session Key\"\n when 504\n \"Invalid Session Setup Request\"\n when 505\n \"Session Duplicate Msg Rejected\"\n else\n \"Response Code Message Missing!\"\n end\n end", "def response_code\n @response.code\n end", "def code\n self.response_code # .to_s\n end", "def response_code; end", "def response_code; end", "def response_code; end", "def response_code; end", "def code\n @response.code.to_i\n end", "def code\n @response.code.to_i\n end", "def code\n @raw_response.code\n end", "def code\n response&.code\n end", "def status_code\n @response.status\n end", "def response_message message, code\n render json: {message: message, code: code}\n end", "def response_status\n @response[:status]\n end", "def code\n @http_response.code.to_i\n end", "def api_response(*args) # :nodoc:\n code = args.first\n args.shift\n\n err = @@ERROR_CODES[code] || @@ERROR_CODES[:unknown]\n render :json => {\n :error => {\n :code => err[0],\n :message => err[1],\n },\n :content => args.first,\n }, :status => err[2]\n end", "def inspect\n \"<Response(#{status})>\"\n end", "def get_response()\n if has_errors?\n return get_error_response()\n end\n @values[\"RESPONSE\"]\n end", "def status_code\n data.status_code\n end", "def extract_error_code response\n return unless response\n return unless response['data'] && response['data'].class == Hash\n return unless response['data']['errorCode']\n\n response['data']['errorCode'].to_i\n end", "def status_code; end", "def challenge_response(challenge_code)\n {\n :body => challenge_code,\n :status => 200\n }\n end", "def code\n if !@values.has_key? 'RESPONSE'\n if has_errors? \n raise PayTrace::Exceptions::ValidationError, get_error_response\n else\n raise PayTrace::Exceptions::ValidationError, \"missing response field\"\n end\n end\n code = parse_code(@values[\"RESPONSE\"])\n code.first\n end", "def status_code\n STATUS_CODE\n end", "def status_code\n @parser.status_code\n end", "def code\n @response_attributes['Code'];\n end", "def get_http_response_code\n raise 'To be implemented in child classes'\n end", "def status(code)\n response.status = code\n end", "def status\n response.status\n end", "def status\n response.status\n end", "def error_msg(code=ErrorCodes::INTERNAL_SERVER_ERROR, detail=\"Unspecified error\", errors = nil, data = nil)\n @response[:errors] = {\n code: code[:code],\n detail: detail,\n errors: errors,\n data: data\n }\n end", "def type\n case code\n when 100..199 then :informational_response\n when 200..299 then :success\n when 300..399 then :redirection\n when 400..499 then :client_error\n when 500..599 then :server_error\n else :unknown\n end\n end", "def get_response_status\n @response_status\n end", "def status_message\n data.status_message\n end", "def status\n response.status\n end", "def response\n result = {}\n res_xml.blank? ? xml = '' : xml = res_xml\n doc = Hpricot.XML(xml)\n case status\n when 'REQUEST'\n result[:status] = 'BEGIN'\n when 'UPDATE'\n result[:status] = 'NORMAL'\n when 'EXCEPTION'\n result[:status] = 'ERROR'\n end\n result[:xml] = ErpHelper.xml2html(doc.to_s)\n case (doc/:IAVSResult).inner_text\n when 'Y'\n result[:avsresult] = 'Match'\n when 'N'\n result[:avsresult] = 'No Match'\n when 'X'\n result[:avsresult] = 'No Provide'\n end\n result[:zipmatch] = (doc/:AVSResult/:ZipMatch).inner_text\n result[:streetmatch] = (doc/:AVSResult/:StreetMatch).inner_text\n pfp_res_code_msg = open(RAILS_ROOT+\"/db/pfp_transaction_result_code_and_message.yml\") {|f| YAML.load(f)}\n pfp_res_code_msg[res_code].blank? ? result[:pfp_res_code_msg] = 'Credit Card Processing Gateway Error.' : result[:pfp_res_code_msg] = pfp_res_code_msg[res_code]\n return result\n end", "def response_message(response)\n @last_response = response\n 'HTTP Response status: [' + response.code.to_s + '] ' + reason_phrase(response.code)\n end", "def response_message(response)\n @last_response = response\n 'HTTP Response status: [' + response.code.to_s + '] ' + reason_phrase(response.code)\n end", "def generate_response(code, format)\n @message = \"Returning code #{code} in #{format} format\"\n response_data = case format\n when \"txt\"\n content_type 'text/plain'\n @message\n when \"json\"\n content_type 'application/json'\n { message: @message }.to_json\n when \"xml\"\n content_type 'application/xml'\n erb :'status.xml', layout: false\n else\n erb :status\n end\n [code.to_i, response_data]\nend", "def response_code\n if @response.code.to_i != 404 && is_fake_404?\n return \"#{@response.code.to_s} Possible fake 404\"\n else\n return @response.code.to_s\n end\n end", "def http_status\n self[:status_code]\n end", "def code\n @error['code']\n end", "def respond(message, code: :ok)\n code = Rack::Utils::SYMBOL_TO_STATUS_CODE[code] || code\n [code, { 'Content-Type' => 'application/json' }, [Oj.dump('result' => message)]]\n end", "def check_response\n unless (res = get).valid?\n raise BadResponse, \"#{res.code} #{res['Code'].first}\"\n end\n\n res\n end", "def response_message response\n \"%s %s: %s %s (%f)\\n%s\" % [\n *response[:_response_meta].slice(\n :request_method, :request_url, :status_code, :status_message, :total_time\n ).values,\n Yajl::Encoder.encode(response.except(:_response_meta))\n ]\n end", "def status_code\n @data[:status_code].to_i\n end", "def response_message\n parsed_response['message']\nend", "def reply_code\n return \"No response.\" if response.nil?\n return (not response.first.last.kind_of?(Hash) or response.first.last[\"reply_code\"].nil?) ? \"Unexpected response hash.\" : response.first.last[\"reply_code\"] if response.instance_of?(Hash)\n response_match = response.match(/\\<reply-code\\>(.+)\\<\\/reply-code\\>/) if response.instance_of?(String)\n return (response_match.nil?) ? \"Unexpected response string.\" : response_match[1] if response.instance_of?(String)\n return \"Unexpected response type.\"\n end", "def http_error(code, message = nil, headers = {})\n [code, {'Content-Type' => 'text/plain; charset=utf-8'}.merge(headers),\n [http_status(code) + (message.nil? ? \"\\n\" : \" (#{message})\\n\")]]\n end", "def status_message\n @data[:status_message]\n end", "def return_error_infos(status, error_message, error_code, values)\n if values.nil?\n render :status => status, :json => { :error => { :message => error_message, :code => error_code }}\n else\n render :status => status, :json => { :error => { :message => error_message, :values => values, :code => error_code }}\n end\n end", "def response_message(response)\n @last_response = response\n \"HTTP Response status: [#{response.code.to_s}] #{reason_phrase(response.code)}\"\n end", "def http_response_code(status = nil)\n if status\n @status = status\n else\n @status\n end\n end", "def guess_status(response)\n result = {}\n # response status code returned by php-simple-proxy and php-json-proxy\n if response =~ /\"status\":{\"http_code\":([\\d]+)}/\n result['code'] = $1\n result['message'] = ''\n # generic page titles containing HTTP status\n elsif response =~ />301 Moved</ || response =~ />Document Moved</ || response =~ />Object Moved</ || response =~ />301 Moved Permanently</\n result['code'] = 301\n result['message'] = 'Document Moved'\n elsif response =~ />302 Found</ || response =~ />302 Moved Temporarily</\n result['code'] = 302\n result['message'] = 'Found'\n elsif response =~ />400 Bad Request</\n result['code'] = 400\n result['message'] = 'Bad Request'\n elsif response =~ />401 Unauthorized</\n result['code'] = 401\n result['message'] = 'Unauthorized'\n elsif response =~ />403 Forbidden</\n result['code'] = 403\n result['message'] = 'Forbidden'\n elsif response =~ />404 Not Found</\n result['code'] = 404\n result['message'] = 'Not Found'\n elsif response =~ />The page is not found</\n result['code'] = 404\n result['message'] = 'Not Found'\n elsif response =~ />413 Request Entity Too Large</\n result['code'] = 413\n result['message'] = 'Request Entity Too Large'\n elsif response =~ />500 Internal Server Error</\n result['code'] = 500\n result['message'] = 'Internal Server Error'\n elsif response =~ />503 Service Unavailable</\n result['code'] = 503\n result['message'] = 'Service Unavailable'\n # getaddrinfo() errors\n elsif response =~ /getaddrinfo: /\n if response =~ /getaddrinfo: nodename nor servname provided/\n result['code'] = 502\n result['message'] = 'Bad Gateway'\n elsif response =~ /getaddrinfo: Name or service not known/\n result['code'] = 502\n result['message'] = 'Bad Gateway'\n end\n # getnameinfo() errors\n elsif response =~ /getnameinfo failed: /\n result['code'] = 502\n result['message'] = 'Bad Gateway'\n # PHP 'failed to open stream' errors\n elsif response =~ /failed to open stream: /\n # HTTP request failed! HTTP/[version] [code] [message]\n if response =~ %r{failed to open stream: HTTP request failed! HTTP\\/(0\\.9|1\\.0|1\\.1) ([\\d]+) }\n result['code'] = $2.to_s\n result['message'] = ''\n if response =~ %r{failed to open stream: HTTP request failed! HTTP/(0\\.9|1\\.0|1\\.1) [\\d]+ ([a-zA-Z ]+)}\n result['message'] = $2.to_s\n end\n # No route to host\n elsif response =~ /failed to open stream: No route to host in/\n result['code'] = 502\n result['message'] = 'Bad Gateway'\n # Connection refused\n elsif response =~ /failed to open stream: Connection refused in/\n result['code'] = 502\n result['message'] = 'Bad Gateway'\n # Connection timed out\n elsif response =~ /failed to open stream: Connection timed out/\n result['code'] = 504\n result['message'] = 'Timeout'\n # Success - This likely indicates an SSL/TLS connection failure\n elsif response =~ /failed to open stream: Success in/\n result['code'] = 502\n result['message'] = 'Bad Gateway'\n end\n # Java 'java.net' exceptions\n elsif response =~ /java\\.net\\.[^\\s]*Exception: /\n if response =~ /java\\.net\\.ConnectException: No route to host/\n result['code'] = 502\n result['message'] = 'Bad Gateway'\n elsif response =~ /java\\.net\\.ConnectException: Connection refused/\n result['code'] = 502\n result['message'] = 'Bad Gateway'\n elsif response =~ /java\\.net\\.ConnectException: Connection timed out/\n result['code'] = 504\n result['message'] = 'Timeout'\n elsif response =~ /java\\.net\\.UnknownHostException: Invalid hostname/\n result['code'] = 502\n result['message'] = 'Bad Gateway'\n elsif response =~ /java\\.net\\.SocketException: Network is unreachable/\n result['code'] = 502\n result['message'] = 'Bad Gateway'\n elsif response =~ /java\\.net\\.SocketException: Connection reset/\n result['code'] = 502\n result['message'] = 'Bad Gateway'\n elsif response =~ /java\\.net\\.SocketTimeoutException: Connection timed out/\n result['code'] = 504\n result['message'] = 'Timeout'\n end\n # C errno\n elsif response =~ /\\[Errno -?[\\d]{1,5}\\]/\n if response =~ /\\[Errno -2\\] Name or service not known/\n result['code'] = 502\n result['message'] = 'Bad Gateway'\n elsif response =~ /\\[Errno 101\\] Network is unreachable/\n result['code'] = 502\n result['message'] = 'Bad Gateway'\n elsif response =~ /\\[Errno 104\\] Connection reset by peer/\n result['code'] = 502\n result['message'] = 'Bad Gateway'\n elsif response =~ /\\[Errno 110\\] Connection timed out/\n result['code'] = 504\n result['message'] = 'Timeout'\n elsif response =~ /\\[Errno 111\\] Connection refused/\n result['code'] = 502\n result['message'] = 'Bad Gateway'\n elsif response =~ /\\[Errno 113\\] No route to host/\n result['code'] = 502\n result['message'] = 'Bad Gateway'\n elsif response =~ /\\[Errno 11004\\] getaddrinfo failed/\n result['code'] = 502\n result['message'] = 'Bad Gateway'\n elsif response =~ /\\[Errno 10053\\] An established connection was aborted/\n result['code'] = 502\n result['message'] = 'Bad Gateway'\n elsif response =~ /\\[Errno 10054\\] An existing connection was forcibly closed/\n result['code'] = 502\n result['message'] = 'Bad Gateway'\n elsif response =~ /\\[Errno 10055\\] An operation on a socket could not be performed/\n result['code'] = 502\n result['message'] = 'Bad Gateway'\n elsif response =~ /\\[Errno 10060\\] A connection attempt failed/\n result['code'] = 502\n result['message'] = 'Bad Gateway'\n elsif response =~ /\\[Errno 10061\\] No connection could be made/\n result['code'] = 502\n result['message'] = 'Bad Gateway'\n end\n # Python urllib errors\n elsif response =~ /HTTPError: HTTP Error \\d+/\n if response =~ /HTTPError: HTTP Error 400: Bad Request/\n result['code'] = 400\n result['message'] = 'Bad Request'\n elsif response =~ /HTTPError: HTTP Error 401: Unauthorized/\n result['code'] = 401\n result['message'] = 'Unauthorized'\n elsif response =~ /HTTPError: HTTP Error 402: Payment Required/\n result['code'] = 402\n result['message'] = 'Payment Required'\n elsif response =~ /HTTPError: HTTP Error 403: Forbidden/\n result['code'] = 403\n result['message'] = 'Forbidden'\n elsif response =~ /HTTPError: HTTP Error 404: Not Found/\n result['code'] = 404\n result['message'] = 'Not Found'\n elsif response =~ /HTTPError: HTTP Error 405: Method Not Allowed/\n result['code'] = 405\n result['message'] = 'Method Not Allowed'\n elsif response =~ /HTTPError: HTTP Error 410: Gone/\n result['code'] = 410\n result['message'] = 'Gone'\n elsif response =~ /HTTPError: HTTP Error 500: Internal Server Error/\n result['code'] = 500\n result['message'] = 'Internal Server Error'\n elsif response =~ /HTTPError: HTTP Error 502: Bad Gateway/\n result['code'] = 502\n result['message'] = 'Bad Gateway'\n elsif response =~ /HTTPError: HTTP Error 503: Service Unavailable/\n result['code'] = 503\n result['message'] = 'Service Unavailable'\n elsif response =~ /HTTPError: HTTP Error 504: Gateway Time-?out/\n result['code'] = 504\n result['message'] = 'Timeout'\n end\n # Ruby exceptions\n elsif response =~ /Errno::[A-Z]+/\n # Connection refused\n if response =~ /Errno::ECONNREFUSED/\n result['code'] = 502\n result['message'] = 'Bad Gateway'\n # No route to host\n elsif response =~ /Errno::EHOSTUNREACH/\n result['code'] = 502\n result['message'] = 'Bad Gateway'\n # Connection timed out\n elsif response =~ /Errno::ETIMEDOUT/\n result['code'] = 504\n result['message'] = 'Timeout'\n end\n # ASP.NET System.Net.WebClient errors\n elsif response =~ /System\\.Net\\.WebClient/\n # The remote server returned an error: ([code]) [message].\n if response =~ /WebException: The remote server returned an error: \\(([\\d+])\\) /\n result['code'] = $1.to_s\n result['message'] = ''\n if response =~ /WebException: The remote server returned an error: \\(([\\d+])\\) ([a-zA-Z ]+)\\./\n result['message'] = $2.to_s\n end\n # Could not resolve hostname\n elsif response =~ /WebException: The remote name could not be resolved/\n result['code'] = 502\n result['message'] = 'Bad Gateway'\n # Remote server denied connection (port closed)\n elsif response =~ /WebException: Unable to connect to the remote server/\n result['code'] = 502\n result['message'] = 'Bad Gateway'\n # This likely indicates a plain-text connection to a HTTPS or non-HTTP service\n elsif response =~ /WebException: The underlying connection was closed: An unexpected error occurred on a receive/\n result['code'] = 502\n result['message'] = 'Bad Gateway'\n # This likely indicates a HTTPS connection to a plain-text HTTP or non-HTTP service\n elsif response =~ /WebException: The underlying connection was closed: An unexpected error occurred on a send/\n result['code'] = 502\n result['message'] = 'Bad Gateway'\n # The operation has timed out\n elsif response =~ /WebException: The operation has timed out/\n result['code'] = 504\n result['message'] = 'Timeout'\n end\n # Generic error messages\n elsif response =~ /(Connection refused|No route to host|Connection timed out) - connect\\(\\d\\)/\n # Connection refused\n if response =~ /Connection refused - connect\\(\\d\\)/\n result['code'] = 502\n result['message'] = 'Bad Gateway'\n # No route to host\n elsif response =~ /No route to host - connect\\(\\d\\)/\n result['code'] = 502\n result['message'] = 'Bad Gateway'\n # Connection timed out\n elsif response =~ /Connection timed out - connect\\(\\d\\)/\n result['code'] = 504\n result['message'] = 'Timeout'\n end\n end\n result\n end", "def status(code)\n @response.status = code\n end", "def error_response(code, message)\n render :json => {:success=>false,:error_code => code,:error_msg => message}\n end", "def message_from(response)\n if not response.has_key?(:ErrInfo)\n return 'Success'\n end\n\n # The ErrInfo key can contain a | separated string of multiple error\n # codes. By default we start at the end and work our way backwards to\n # try and find the highest-level one we can.\n if response[:ErrInfo].index('|')\n error_codes = response[:ErrInfo].split('|')\n else\n error_codes = [response[:ErrInfo]]\n end\n\n error_codes.reverse.each do |code|\n if ERROR_CODES.has_key?(code)\n return ERROR_CODES[code]\n end\n end\n\n \"Error #{error_codes[-1]}\"\n end", "def response\n @response ||=\n begin\n m = { response_code: response_code, response_msg: response_msg }\n m.merge!(rpc_error: rpc_error) if rpc_error\n m\n end\n end", "def message_from(response)\n case response[:response_code]\n when 0\n return \"OK\"\n when 2000\n return \"ERROR 2000: Invalid Connection Ticket\"\n when 10303\n return \"ERROR 10303: TransRequestID is empty\"\n when 10305\n return \"ERROR 10305: An error occurred when validating the supplied payment data\"\n when 10309\n return \"ERROR 10309: The credit card number is formatted incorrectly\"\n when 10312\n return \"ERROR 10312: The credit card Transaction ID was not found\"\n when 10409\n return CVVResult.messages[ response[:card_code] ] if CARD_CODE_ERRORS.include?(response[:card_code])\n end\n end", "def http_code\n '000'\n end", "def status_code\n wrapper.status_code.to_i\n end", "def generic(code)\n {}.tap do |data|\n data[:errors] = { code: code, message: status.fetch(code.to_s.to_sym) }\n end\n end", "def to_response\n\t\t\t\t@details.merge(:code => @code)\n\t\t\tend", "def response_code\n @log.debug \"Retreiving HTTP Code for website '#{@url}'\"\n\n begin\n result = Net::HTTP.get_response(@fqdn, @path).code\n @log.debug \"Received HTTP Code #{result} for website '#{@url}'\"\n rescue SocketError\n @log.error \"Communication problem with '#{@fqdn}'--possibly a DNS error. Cannot check status!\"\n result = \"200\"\n end\n\n return result\n end", "def extract_error_details response\n if\n (response.http_response.status >= 300 ||\n response.request_type == :complete_multipart_upload) and\n body = response.http_response.body and\n error = Core::XML::Parser.parse(body) and\n error[:code]\n then\n [error[:code], error[:message]]\n end\n end", "def status_message; end", "def parse_result(code, body, message, nfg_method)\n return_value = Hash.new\n if code == '200'\n parsed = REXML::Document.new(body)\n # Build return hash parsing XML response\n if parsed.root.nil?\n return_value['StatusCode'] = 'MissingParameter'\n return_value['Message'] = body\n return_value['ErrorDetails'] = nil\n else\n return_value = parsed.root.elements['soap:Body'].elements[\"#{nfg_method}Response\"].elements[\"#{nfg_method}Result\"]\n end\n else\n return_value['StatusCode'] = 'UnexpectedError'\n return_value['Message'] = message\n return_value['ErrorDetails'] = body\n end\n return_value\n end", "def getStatusCode\n @_statusCode\n end", "def response\n @search = RestClient.get @url\n @status_code = @search.code\n return output\n end", "def exception_response\n { ok: false, message: 'Error processing request' }\n end", "def get_status\n @reply['status']\n end", "def http_err_code\n http_codes[@http_err]\n end", "def status code=nil\n @response.status = code if code\n @response.status\n end", "def json_response (status, data, message)\n\t\t{\n\t\t\t\tstatus: status,\n\t\t\t\tdata: data,\n\t\t\t\tmessage: message\n\t\t}\n\tend", "def compute_response_code_to_return(j, response)\n # default to the restClient value\n rc = response.code\n if Hash.try_convert(j)\n # if the whole thing in an error response then pull out the contents\n # of the error response.\n if j.has_key?('ErrorResponse')\n j=j['ErrorResponse']\n end\n # if there is a nested response code then use that.\n if j.has_key?('responseCode')\n rc = j['responseCode']\n end\n end\n logger.debug \"#{self.class.to_s}:#{__method__}:#{__LINE__}: use response code: [#{rc}]\"\n rc\n end", "def status_codes\n STATUS_CODES\n end", "def check_response(code = :success, expected_msg = nil, line = nil)\n line = line ? \" [*_test:\" + line.to_s + \"]\" : \"\"\n assert_response code, \"expected \" + code.to_s + \", server response: \" + response.body.to_s + line\n if (code.class == Symbol)\n # Not sure why this list isn't the right one: (has :ok instead). Should fix once...\n Rack::Utils::SYMBOL_TO_STATUS_CODE[:success] = 200\n Rack::Utils::SYMBOL_TO_STATUS_CODE[:redirect] = 302\n code = Rack::Utils::SYMBOL_TO_STATUS_CODE[code]\n end\n return if (code == 302) # redirect, html body\n\n body = JSON.parse(response.body)\n #Success payloads should contain one of these.\n assert (body[0] && body[0][\"server_time\"]) ||\n body[\"status\"] == code ||\n body[\"status\"] == \"destroyed\" ||\n body[\"server_time\"] ||\n body[\"device_id\"] ||\n body[\"key_data\"] ||\n body[\"authtoken\"], \"success payload not one of the usual patterns\" + line\n return if ! expected_msg\n\n if expected_msg.class == Symbol\n expected_msg = ApplicationController.MESSAGES[expected_msg]\n assert expected_msg != nil, \"oops, your check_response passed a non-existant expected message symbol!\" + line\n end\n\n if (code == 200)\n return assert body[\"message\"] = expected_msg, \"wrong message\" + line\n end\n\n # Simple generic check against message template to see that we got\n # the right one - there will be at least 12 chars without a\n # substitution at either start or end in all our MESSAGES strings.\n # Or a whole string without formatting anywhere (when array of validation errors is stringified).\n len = 12\n ret_msg = body[\"error\"]\n # Handle short expected strings (INVALID_PARAM)\n assert ret_msg.start_with?(expected_msg.first(len)) ||\n ret_msg.end_with?(expected_msg.last(len)) ||\n ret_msg.include?(expected_msg),\n \"reply error message doesn't match:\\\"\" + ret_msg + \"\\\"!=\\\"\"+ expected_msg + \"\\\"\" + line\n end", "def response code=nil, body=nil, headers=nil\n args = [code, body, headers].compact\n\n headers = {'Content-Type' => DEFAULT_CONTENT_TYPE}\n code = 200\n body = \"\"\n\n args.each do |arg|\n case arg\n when Hash then headers.merge!(arg)\n when String then body = arg\n when Integer then code = arg\n end\n end\n\n [code, headers, body]\n end", "def error(message, code)\n error_response = {\n message: message\n }\n render :json => error_response, :status => code\n end", "def return_msg\n case return_code\n when 0x00\n 'Connection Accepted'\n when 0x01\n 'Connection refused: unacceptable protocol version'\n when 0x02\n 'Connection refused: client identifier rejected'\n when 0x03\n 'Connection refused: server unavailable'\n when 0x04\n 'Connection refused: bad user name or password'\n when 0x05\n 'Connection refused: not authorised'\n else\n \"Connection refused: error code #{return_code}\"\n end\n end", "def base_response(custom_response={})\n resp = {\n message: nil\n }\n resp.merge!(custom_response)\n status = 200\n [resp, status]\n end", "def http_status_line(code = 200)\n \"#{HTTP_VERSION} #{code} #{Shelf::Utils::HTTP_STATUS_CODES[code]}\"\n end", "def status_code\n return manual_status_code if manual_status_code\n return 422 if errors.present?\n return 200 if result\n return 400\n end", "def code\n @code ||= @net_http_res.code.to_i\n end", "def process_response(response)\n case response.code.to_i\n when 200, 404\n parse_message response.body\n when 401, 500\n error_message = parse_message response.body\n raise \"Unauthorized: #{error_message['error']['message']}\"\n else\n raise \"Response code #{response.code} not recognized\"\n end\n end", "def status\n @status ||= raw_response['responseHeader']['status']\n end", "def informational_response?\n (100..199).cover?(code)\n end", "def error_message\n @response.reason_phrase\n end", "def response_line\n \"#{Protocol::NAME}/#{@version} #{@code} #{@message}#{Protocol::CRLF}\"\n end", "def index\n head params[:response_status]\n end", "def http_status(code)\n [code, Rack::Utils::HTTP_STATUS_CODES[code]].join(' ')\n end", "def http_status(code)\n [code, Rack::Utils::HTTP_STATUS_CODES[code]].join(' ')\n end", "def http_status(code)\n [code, Rack::Utils::HTTP_STATUS_CODES[code]].join(' ')\n end", "def response\n get_header_and_body\n end", "def ok_status_code\n _undefined\n end", "def structureResponse(code, codeMessage, file, contentType)\n # grab file contents\n data = getFileContents(file);\n\n # Return response\n \"HTTP/1.1 #{code}\\r\\n\" +\n \"Content-Length: #{data.size}\\r\\n\" +\n \"\\r\\n\" +\n \"#{data}\\r\\n\";\nend", "def status_code\n params[:code] || 500\n end", "def status_code\n params[:code] || 500\n end" ]
[ "0.7427587", "0.7386521", "0.7339554", "0.7272692", "0.7203265", "0.71380115", "0.71380115", "0.71380115", "0.71380115", "0.71356744", "0.71356744", "0.7121814", "0.71010655", "0.7060349", "0.70587444", "0.7052067", "0.7047583", "0.6975951", "0.69748366", "0.692607", "0.68583286", "0.6700468", "0.6680163", "0.6667632", "0.66566026", "0.6653694", "0.66529953", "0.6602719", "0.65686136", "0.6564622", "0.6560934", "0.6560934", "0.6555831", "0.65490305", "0.6531599", "0.6520373", "0.65201485", "0.65180814", "0.65166414", "0.65166414", "0.6511573", "0.6495752", "0.64833623", "0.6469512", "0.6461609", "0.645832", "0.6444242", "0.643567", "0.6406864", "0.6404922", "0.6388242", "0.63749665", "0.63668674", "0.63662106", "0.63589406", "0.6348534", "0.63363343", "0.6333292", "0.6328675", "0.63275725", "0.6324883", "0.63236284", "0.6317932", "0.6308613", "0.6301038", "0.6295463", "0.628352", "0.6276353", "0.6274409", "0.6268426", "0.6260484", "0.6259766", "0.62522", "0.6248658", "0.6247144", "0.62430143", "0.62289685", "0.6226918", "0.6225995", "0.62254244", "0.62253946", "0.62207764", "0.6220106", "0.62184286", "0.6206724", "0.6199007", "0.61989474", "0.61922896", "0.61826086", "0.6177535", "0.6175219", "0.61746526", "0.6162841", "0.6162841", "0.6162841", "0.6160446", "0.61603993", "0.6156717", "0.61472774", "0.61472774" ]
0.7208075
4
GET /animalcontrols GET /animalcontrols.json
def index @animalcontrols = Animalcontrol.all.paginate(:per_page =>15, :page => params[:page]).where("address ILIKE ?","%#{params[:address_search]}%").where("name ILIKE ?","%#{params[:name_search]}%").where("callback ILIKE ?","%#{params[:phone_search]}%").where("unitassigned ILIKE ?","%#{params[:unit_search]}%") end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getControls\n controls = {}\n response = self.class.get(\"/rest/items\",:basic_auth => @auth)\n JSON.parse(response.body).each do |r|\n if r[\"category\"] == \"Controls\" || r[\"category\"] == \"Lamps\"\n controls[r[\"id\"]] = r[\"name\"]\n end\n end\n return controls\n end", "def set_animalcontrol\n @animalcontrol = Animalcontrol.find(params[:id])\n end", "def index\n @controls = Control.all\n\n respond_with @controls\n end", "def show\n @cvi = Cvi.find(params[:id])\n @animals = @cvi.animals\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cvi }\n end\n end", "def index\n render json: @owner.cats\n end", "def show\n @adotando_animal = AdotandoAnimal.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @adotando_animal }\n end\n end", "def show\n render json: @dog\n end", "def index\n @controls = @device.controls\n end", "def index\n response = HTTParty.get('http://okta-api:8080/pets/v1/cats', {headers: {\"X-Token\"=> session[:oktastate][:credentials][:token]}})\n if response.code == 200\n @cats = JSON.parse(response.body)\n else\n @cats = []\n end\n end", "def show\n @status_animal = StatusAnimal.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @status_animal }\n end\n end", "def control \n @movies = Movie.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @movies }\n end\n end", "def index\n @adocao_animals = AdocaoAnimal.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @adocao_animals }\n end\n end", "def show\n @adocao_animal = AdocaoAnimal.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @adocao_animal }\n end\n end", "def show\n animal = Animal.find(params[:id])\n render json: animal.as_json(include: :sightings) \n end", "def get_authcontrols_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: AuthControlsApi.get_authcontrols ...'\n end\n # resource path\n local_var_path = '/authcontrols'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'card_product'] = opts[:'card_product'] if !opts[:'card_product'].nil?\n query_params[:'user'] = opts[:'user'] if !opts[:'user'].nil?\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[:'fields'] = opts[:'fields'] if !opts[:'fields'].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] || 'AuthControlListResponse'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || []\n\n new_options = opts.merge(\n :operation => :\"AuthControlsApi.get_authcontrols\",\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: AuthControlsApi#get_authcontrols\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def show\n render json: @verb\n end", "def show\n @level_container = LevelContainer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @level_container }\n end\n end", "def show\n @doador_animal = DoadorAnimal.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @doador_animal }\n end\n end", "def index\n @microroles = Microrole.includes(:verb_coding_frame_microroles).readonly(false).all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @microroles }\n end\n end", "def show\n animal_id = params[:id]\n # Find that animal (by id) in the database\n @animal = Animal.find(animal_id)\n \n #Give back JSON details of that animal\n render json: @animal\n end", "def show\n animal = Animal.find(params[:id])\n #return all the sightings for the animal\n render json: animal.to_json(include: :sightings)\nend", "def index\n @choices = Choice.all\n\n render json: @choices\n end", "def show\n @experiment_control = ExperimentControl.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @experiment_control }\n end\n end", "def show\n @control_tower = ControlTower.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @control_tower }\n end\n end", "def show\n render json: @choice\n end", "def index\n @objectives = @goal.objectives.all \n render json: @objectives \n end", "def show\n @cut = Cut.find(params[:id])\n @animal_name = Animal.find(@cut.animal_id).animal_name\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cut }\n end\n end", "def index\n @client = Client.find params[:client_id]\n @pets = @client.pets\n end", "def show\n render json: @diet, status: 200, root: true\n end", "def demo\n render json: Cat.all\n end", "def show\n @irregular_verb = IrregularVerb.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @irregular_verb }\n end\n end", "def index\n @animals = @person.animals\n end", "def show\n render json: @bike_type\n end", "def show\n respond_to do | format |\n format.html #show.html.erb\n format.json { render json: @pet_breed }\n end\n end", "def show\n render json: @vehicle\n end", "def index\n @mpg_controls = MpgControl.all\n end", "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @representante_athlete }\n end\n end", "def show\n @animal = Animal.find(params[:id])\n \n @zoo = Zoo.find(params[:zoo_id])\n @father = @animal.father\n @mother = @animal.mother\n @children = @animal.children\n @siblings = @animal.siblings\n \n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @animal }\n end\n end", "def show\n render json: @accessory_category\n end", "def show\n render json: @given_circumstance\n end", "def show\n render json: @pet\n end", "def index\n @tunes = Tune.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tunes }\n end\n end", "def show\n render json: @dice\n end", "def show\n @control = @device.controls.find(params[:id])\n end", "def index\n pet_type = PetType.find(params[:pet_type_id])\n @pet_breeds = pet_type.pet_breeds.select { | match | match.published }\n\n respond_to do | format |\n format.html #index.html.erb\n format.json { render json: @pet_breeds }\n end\n end", "def new\n @adotando_animal = AdotandoAnimal.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @adotando_animal }\n end\n end", "def show\n @advocacy = Advocacy.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @advocacy }\n end\n end", "def show\n @bubble_tea = BubbleTea.find(params[:id])\n render json: @bubble_tea\n end", "def index\n @verbs = Verb.all\n\n render json: @verbs\n end", "def abilities\n get('/ability/')\n end", "def index\n # Retrieve kpis templates from impac api.\n # TODO: improve request params to work for strong parameters\n attrs = params.slice('metadata', 'opts')\n auth = { username: MnoEnterprise.tenant_id, password: MnoEnterprise.tenant_key }\n\n response = begin\n MnoEnterprise::ImpacClient.send_get('/api/v2/kpis', attrs, basic_auth: auth)\n rescue => e\n return render json: { message: \"Unable to retrieve kpis from Impac API | Error #{e}\" }\n end\n\n # customise available kpis\n kpis = (response['kpis'] || []).map do |kpi|\n kpi = kpi.with_indifferent_access\n kpi[:watchables].map do |watchable|\n kpi.merge(\n name: \"#{kpi[:name]} #{watchable.capitalize unless kpi[:name].downcase.index(watchable)}\".strip,\n watchables: [watchable],\n target_placeholders: {watchable => kpi[:target_placeholders][watchable]},\n )\n end\n end\n .flatten\n\n render json: { kpis: kpis }\n end", "def manage\n @cats = Cat.page(params[:page] || 1).per(50)\n breadcrumbs.add \"manage\",manage_cats_url\n breadcrumbs.add \"preview\",preview_cats_url\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @cats }\n end\n end", "def index\n @tunning_diagrams = TunningDiagram.accessible_by(current_ability).search(params[:search]).page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tunning_diagrams }\n format.xml { render xml: @tunning_diagrams }\n end\n end", "def show\n @animal = Animal.find(params[:id])\n end", "def index\n @caption_votes = CaptionVote.all\n render json: @caption_votes\n end", "def show\n pet = BattlePet.find(params[:id])\n render json: pet, status: :ok\n end", "def index\n @plants = Plant.all\n\n respond_to do |format|\n format.html\n format.json { render :json => @plants }\n end\n end", "def new\n @bemap = Bemap.new\n @show_controls = false\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bemap }\n end\n end", "def new\n @status_animal = StatusAnimal.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @status_animal }\n end\n end", "def accessories\n render json: { collections: Collection.published_accessories }\n end", "def create\n @animalcontrol = Animalcontrol.new(animalcontrol_params)\n\n respond_to do |format|\n if @animalcontrol.save\n format.html { redirect_to @animalcontrol, notice: 'Animal Control Call-Out was successfully created.' }\n format.json { render :show, status: :created, location: @animalcontrol }\n else\n format.html { render :new }\n format.json { render json: @animalcontrol.errors, status: :unprocessable_entity }\n end\n end\n end", "def show\n @vocalium = Vocalium.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @vocalium }\n end\n end", "def show\n @orthodb_level = OrthodbLevel.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @orthodb_level }\n end\n end", "def show\n @client = Client.find(params[:id])\n @pets = @client.pets\n @json = @client.to_gmaps4rails\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @client }\n end\n end", "def show\n @pet = Pet.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pet }\n end\n end", "def show\n @pet = Pet.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pet }\n end\n end", "def show\n @tinymap = Tinymap.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tinymap }\n end\n end", "def view\n res = @client.get(path)\n @attributes = res.json if res.success?\n end", "def index\n @animals = Animal.all\n end", "def index\n canonical_url(\"/animals\")\n \n @animals = Animal.includes(:animal_color, :animal_sex, :species, :status, :organization, :spay_neuter).\n where('public' => 1).\n paginate(:page => params[:page], :per_page => 10).\n order(\"updated_at DESC\").shuffle!\n \n @animals.select! {|animal| animal.organization.has_info? }\n respond_with(@animals)\n end", "def index\n @tailors = Tailor.all\n respond_to do |format|\n format.html\n format.json { render json: @tailors}\n end\n end", "def new\n @animal = Animal.new\n @zoo = Zoo.find(params[:zoo_id])\n @species = ['Lion', 'Koala', 'Panda']\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @animal }\n end\n end", "def index\n @objectives = current_user.objectives.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @objectives }\n end\n end", "def index\n @dogs = Dog.all\n # render erb: 'dogs/index'\n render json: @dogs\n end", "def index\n @pets = Pet.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pets }\n end\n end", "def index\n @client = Client.find params[:client_id]\n @pet = Pet.find params[:pet_id]\n @pet_histories = @pet.pet_histories\n end", "def index\n @breeds = Breed.all\n\n render json: @breeds\n end", "def interesting(options = {})\n response = Typhoeus::Request.get(\"#{DARKSKY_API_URL}/interesting/#{@api_key}\", DEFAULT_OPTIONS.dup.merge(options))\n JSON.parse(response.body) if response.code == 200 \n end", "def client_choose(offset = 10, limit = 20)\n response = Net::HTTP.get(\n URI(\"https://pokeapi.co/api/v2/pokemon/?offset=#{offset}&limit=#{limit}\")\n )\n \n JSON.parse(response)\nend", "def show\n render json: @adopter\n end", "def index\n @dog_walks = DogWalk.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @dog_walks }\n end\n \n end", "def show\n @pictures_of_cat = PicturesOfCat.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pictures_of_cat }\n end\n end", "def index\n @categories = Category.all\n @categories.each do |category|\n authorize! :read, category\n end\n render json: @categories\n end", "def index \n render json: Tuning.all\n end", "def show\n @controlpersona = Controlpersona.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @controlpersona }\n end\n end", "def show\n @voc = Voc.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @voc }\n end\n end", "def show\n @appliance_type = ApplianceType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @appliance_type }\n end\n end", "def index\n\n get_collections\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @temples }\n format.js {}\n end\n end", "def show\n @virus_characteristic = VirusCharacteristic.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @virus_characteristic }\n end\n end", "def show\n @mood = Mood.find(params[:id])\n respond_to do |format|\n format.any { render :json => @mood }\n end\n end", "def show\n @konfig = Konfig.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @konfig }\n end\n end", "def index\n @dogs = Dog.all\n render json: @dogs, each_serializer: DogSerializer, root: 'dogs'\n end", "def show\n dog = Dog.find(params[:id])\n render json: dog\n end", "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @mood }\n end\n end", "def new\n @cut = Cut.new\n @animals = Animal.all\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cut }\n end\n end", "def show\n @templete = Templete.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @templete }\n end\n end", "def show\n render json: @dna\n end", "def show\n @dog = Dog::Dog.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @dog }\n end\n end", "def show\n respond_to do |format|\n format.html\n format.json { render json: ProjectControl.find(params[:id]) }\n end\n end", "def show\n @client = Client.find params[:client_id]\n @pet = Pet.find params[:pet_id]\n end", "def read_controls\n finder = \"/resource/object[@name='#{base_id}']//*[@name]\"\n REXML::XPath.each(@xml_src, finder) do | elem |\n ctrl_name = elem.attributes['name']\n # skip default names\n next if ctrl_name =~ /^wx/\n next if ctrl_name =~ /^ID_/\n ctrl_subclass = elem.attributes['subclass']\n @controls << Control.new(ctrl_name, ctrl_subclass)\n end\n end" ]
[ "0.6556058", "0.636461", "0.61455053", "0.61082315", "0.5941021", "0.58936304", "0.5858589", "0.5834129", "0.58246624", "0.5819633", "0.5817017", "0.5741239", "0.573169", "0.56973547", "0.5689494", "0.5661258", "0.5653655", "0.56250393", "0.56229377", "0.56014323", "0.5591403", "0.55909044", "0.55766535", "0.55649084", "0.55599487", "0.55467993", "0.55441654", "0.55346453", "0.5516907", "0.5515015", "0.54891497", "0.54860055", "0.5465649", "0.5451456", "0.54446507", "0.54406995", "0.54364187", "0.54334253", "0.5431922", "0.54305804", "0.5424365", "0.5410232", "0.54098207", "0.54051304", "0.5396241", "0.5395485", "0.53906727", "0.5386423", "0.53843343", "0.5380769", "0.5377163", "0.5371196", "0.5364772", "0.53608865", "0.5359955", "0.53594196", "0.5355523", "0.5353434", "0.5353162", "0.53515196", "0.5351498", "0.534332", "0.5342992", "0.5339132", "0.5335871", "0.5335871", "0.53292173", "0.53092587", "0.53092116", "0.530416", "0.5303912", "0.529883", "0.5295775", "0.5292012", "0.52864486", "0.5277817", "0.526892", "0.5263546", "0.5262656", "0.52610207", "0.5260763", "0.5259247", "0.5251609", "0.52512306", "0.5249724", "0.5243478", "0.52414393", "0.5240779", "0.52402395", "0.5231987", "0.5229404", "0.52237624", "0.52229196", "0.5214107", "0.52121615", "0.52101576", "0.5207522", "0.5207092", "0.52059007", "0.5205491", "0.52049106" ]
0.0
-1
GET /animalcontrols/1 GET /animalcontrols/1.json
def show end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_animalcontrol\n @animalcontrol = Animalcontrol.find(params[:id])\n end", "def show\n @cvi = Cvi.find(params[:id])\n @animals = @cvi.animals\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cvi }\n end\n end", "def getControls\n controls = {}\n response = self.class.get(\"/rest/items\",:basic_auth => @auth)\n JSON.parse(response.body).each do |r|\n if r[\"category\"] == \"Controls\" || r[\"category\"] == \"Lamps\"\n controls[r[\"id\"]] = r[\"name\"]\n end\n end\n return controls\n end", "def show\n @adotando_animal = AdotandoAnimal.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @adotando_animal }\n end\n end", "def show\n @status_animal = StatusAnimal.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @status_animal }\n end\n end", "def index\n @controls = Control.all\n\n respond_with @controls\n end", "def show\n animal_id = params[:id]\n # Find that animal (by id) in the database\n @animal = Animal.find(animal_id)\n \n #Give back JSON details of that animal\n render json: @animal\n end", "def show\n @adocao_animal = AdocaoAnimal.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @adocao_animal }\n end\n end", "def show\n @cut = Cut.find(params[:id])\n @animal_name = Animal.find(@cut.animal_id).animal_name\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cut }\n end\n end", "def show\n @doador_animal = DoadorAnimal.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @doador_animal }\n end\n end", "def show\n render json: @dog\n end", "def show\n @animal = Animal.find(params[:id])\n end", "def control \n @movies = Movie.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @movies }\n end\n end", "def index\n @adocao_animals = AdocaoAnimal.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @adocao_animals }\n end\n end", "def show\n @experiment_control = ExperimentControl.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @experiment_control }\n end\n end", "def index\n render json: @owner.cats\n end", "def index\n @client = Client.find params[:client_id]\n @pets = @client.pets\n end", "def show\n animal = Animal.find(params[:id])\n render json: animal.as_json(include: :sightings) \n end", "def index\n response = HTTParty.get('http://okta-api:8080/pets/v1/cats', {headers: {\"X-Token\"=> session[:oktastate][:credentials][:token]}})\n if response.code == 200\n @cats = JSON.parse(response.body)\n else\n @cats = []\n end\n end", "def show\n @control_tower = ControlTower.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @control_tower }\n end\n end", "def show\n render json: @verb\n end", "def index\n @controls = @device.controls\n end", "def show\n @level_container = LevelContainer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @level_container }\n end\n end", "def show\n @irregular_verb = IrregularVerb.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @irregular_verb }\n end\n end", "def show\n @control = @device.controls.find(params[:id])\n end", "def show\n @konfig = Konfig.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @konfig }\n end\n end", "def index\n @animals = @person.animals\n end", "def index\n @microroles = Microrole.includes(:verb_coding_frame_microroles).readonly(false).all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @microroles }\n end\n end", "def show\n animal = Animal.find(params[:id])\n #return all the sightings for the animal\n render json: animal.to_json(include: :sightings)\nend", "def new\n @status_animal = StatusAnimal.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @status_animal }\n end\n end", "def show\n @pet = Pet.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pet }\n end\n end", "def show\n @pet = Pet.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pet }\n end\n end", "def show\n @animal = Animal.find(params[:id])\n \n @zoo = Zoo.find(params[:zoo_id])\n @father = @animal.father\n @mother = @animal.mother\n @children = @animal.children\n @siblings = @animal.siblings\n \n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @animal }\n end\n end", "def new\n @animal = Animal.new\n @zoo = Zoo.find(params[:zoo_id])\n @species = ['Lion', 'Koala', 'Panda']\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @animal }\n end\n end", "def show\n pet = BattlePet.find(params[:id])\n render json: pet, status: :ok\n end", "def show\n render json: @choice\n end", "def new\n @adotando_animal = AdotandoAnimal.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @adotando_animal }\n end\n end", "def show\n render json: @bike_type\n end", "def show\n @ami = Ami.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ami }\n end\n end", "def show\n @mood = Mood.find(params[:id])\n respond_to do |format|\n format.any { render :json => @mood }\n end\n end", "def show\n @vocalium = Vocalium.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @vocalium }\n end\n end", "def show\n respond_to do | format |\n format.html #show.html.erb\n format.json { render json: @pet_breed }\n end\n end", "def index\n @tunes = Tune.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tunes }\n end\n end", "def index\n @choices = Choice.all\n\n render json: @choices\n end", "def show\n render json: @diet, status: 200, root: true\n end", "def index\n @animals = Animal.all\n end", "def show\n dog = Dog.find(params[:id])\n render json: dog\n end", "def show\n @pictures_of_cat = PicturesOfCat.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pictures_of_cat }\n end\n end", "def show\n @beattape = Beattape.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @beattape }\n end\n end", "def show\n @criterion = Criterion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @criterion }\n end\n end", "def show\n @bowl = Bowl.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @bowl }\n end\n end", "def index\n @client = Client.find params[:client_id]\n @pet = Pet.find params[:pet_id]\n @pet_histories = @pet.pet_histories\n end", "def show\n @appliance_type = ApplianceType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @appliance_type }\n end\n end", "def index\n @objectives = @goal.objectives.all \n render json: @objectives \n end", "def show\n @bubble_tea = BubbleTea.find(params[:id])\n render json: @bubble_tea\n end", "def show\n @orthodb_level = OrthodbLevel.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @orthodb_level }\n end\n end", "def show\n @tinymap = Tinymap.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tinymap }\n end\n end", "def new\n @cut = Cut.new\n @animals = Animal.all\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cut }\n end\n end", "def show\n @dog = Dog::Dog.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @dog }\n end\n end", "def demo\n render json: Cat.all\n end", "def show\n @virus_characteristic = VirusCharacteristic.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @virus_characteristic }\n end\n end", "def show\n render json: @pet\n end", "def show\n @client = Client.find params[:client_id]\n @pet = Pet.find params[:pet_id]\n end", "def show\n canonical_url(\"/animals/#{params[:id]}\")\n @animal = Rails.cache.fetch(\"public_animal_#{params[:id]}\", :expires_in => 15.minutes) do\n Animal.includes(:animal_color, :animal_sex, :species, :status, :organization, :spay_neuter).find_by_uuid!(params[:id])\n end\n\n if @animal.public == 1\n # impressionist(@animal)\n respond_with(@animal)\n else\n redirect_to \"/animals/not_available\", :status => 302\n end\n end", "def show\n @voc = Voc.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @voc }\n end\n end", "def show\n respond_to do |format|\n format.html\n format.json { render json: ProjectControl.find(params[:id]) }\n end\n end", "def show\n @advocacy = Advocacy.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @advocacy }\n end\n end", "def index\n @pets = Pet.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pets }\n end\n end", "def show\n @mag_tape = MagTape.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @mag_tape }\n end\n end", "def show\n @plate = Plate.find(params[:id])\n\n render json: @plate\n end", "def index\n @mpg_controls = MpgControl.all\n end", "def index\n @dogs = Dog.all\n # render erb: 'dogs/index'\n render json: @dogs\n end", "def show\n @brain = Brain.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @brain }\n end\n end", "def index\n pet_type = PetType.find(params[:pet_type_id])\n @pet_breeds = pet_type.pet_breeds.select { | match | match.published }\n\n respond_to do | format |\n format.html #index.html.erb\n format.json { render json: @pet_breeds }\n end\n end", "def view\n res = @client.get(path)\n @attributes = res.json if res.success?\n end", "def index\n @animal_images = AnimalImage.all\n end", "def index\n @pictures = @album.pictures #JRD111115\n\n respond_to do |format|\n format.html #index.html.erb\n format.json { render json: @pictures}\n end\n end", "def show\n @goat = Goat.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @goat }\n end\n end", "def show\n @creature = Creature.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @creature }\n end\n end", "def show\n render json: @dice\n end", "def set_animal\n @animal = Animal.find(params[:id])\n end", "def set_animal\n @animal = Animal.find(params[:id])\n end", "def show\n mix = BreedMix.find(params[:id])\n render json: mix\n end", "def show\n @controlpersona = Controlpersona.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @controlpersona }\n end\n end", "def show\n @baton = Baton.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @baton }\n end\n end", "def index\n @plants = Plant.all\n\n respond_to do |format|\n format.html\n format.json { render :json => @plants }\n end\n end", "def manage\n @cats = Cat.page(params[:page] || 1).per(50)\n breadcrumbs.add \"manage\",manage_cats_url\n breadcrumbs.add \"preview\",preview_cats_url\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @cats }\n end\n end", "def show\n @click_thru = ClickThru.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @click_thru }\n end\n end", "def show\n render json: @vehicle\n end", "def index\n @caption_votes = CaptionVote.all\n render json: @caption_votes\n end", "def index\n # Retrieve kpis templates from impac api.\n # TODO: improve request params to work for strong parameters\n attrs = params.slice('metadata', 'opts')\n auth = { username: MnoEnterprise.tenant_id, password: MnoEnterprise.tenant_key }\n\n response = begin\n MnoEnterprise::ImpacClient.send_get('/api/v2/kpis', attrs, basic_auth: auth)\n rescue => e\n return render json: { message: \"Unable to retrieve kpis from Impac API | Error #{e}\" }\n end\n\n # customise available kpis\n kpis = (response['kpis'] || []).map do |kpi|\n kpi = kpi.with_indifferent_access\n kpi[:watchables].map do |watchable|\n kpi.merge(\n name: \"#{kpi[:name]} #{watchable.capitalize unless kpi[:name].downcase.index(watchable)}\".strip,\n watchables: [watchable],\n target_placeholders: {watchable => kpi[:target_placeholders][watchable]},\n )\n end\n end\n .flatten\n\n render json: { kpis: kpis }\n end", "def show\n @type = Type.find(params[:id])\n @things = @type.things\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @type }\n end\n end", "def index\n canonical_url(\"/animals\")\n \n @animals = Animal.includes(:animal_color, :animal_sex, :species, :status, :organization, :spay_neuter).\n where('public' => 1).\n paginate(:page => params[:page], :per_page => 10).\n order(\"updated_at DESC\").shuffle!\n \n @animals.select! {|animal| animal.organization.has_info? }\n respond_with(@animals)\n end", "def show\n @ocat = Ocat.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ocat }\n end\n end", "def show\n @physic = Physic.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @physic }\n end\n end", "def index\n @dog_walks = DogWalk.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @dog_walks }\n end\n \n end", "def show\n @cat = Cat.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cat }\n end\n end", "def index \n render json: Tuning.all\n end", "def show\n @templete = Templete.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @templete }\n end\n end", "def show\n @meteor = Meteor.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @meteor }\n end\n end", "def new\n @bemap = Bemap.new\n @show_controls = false\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bemap }\n end\n end" ]
[ "0.6581004", "0.62646437", "0.61185396", "0.60728", "0.60690963", "0.60163546", "0.59759474", "0.59373647", "0.5847238", "0.5826706", "0.5821832", "0.58089924", "0.57897115", "0.5785543", "0.5782728", "0.5759062", "0.5734136", "0.5723997", "0.56993574", "0.5692243", "0.56843626", "0.5681683", "0.56804585", "0.56234306", "0.56088", "0.5602056", "0.5599744", "0.55827767", "0.55677813", "0.55609643", "0.5552015", "0.5552015", "0.5549145", "0.55435026", "0.5529107", "0.5521003", "0.5516698", "0.55123895", "0.5503258", "0.54991937", "0.54990727", "0.5482279", "0.5476839", "0.5474692", "0.5472537", "0.5470622", "0.54700047", "0.54604137", "0.54505396", "0.5449757", "0.54441106", "0.5439771", "0.543302", "0.54327226", "0.5425136", "0.5418856", "0.5415718", "0.5413457", "0.5406798", "0.5406612", "0.54065746", "0.54063", "0.5405659", "0.5405171", "0.53994393", "0.5398867", "0.5397619", "0.5397432", "0.537929", "0.5378736", "0.53752047", "0.5373199", "0.53690666", "0.5362137", "0.53597176", "0.5357358", "0.5355961", "0.5354907", "0.5350913", "0.534872", "0.53461826", "0.53461826", "0.5343937", "0.53421366", "0.53416014", "0.533963", "0.53326267", "0.5330254", "0.53301734", "0.53287053", "0.5324609", "0.53237534", "0.5323565", "0.5322767", "0.5321199", "0.5320748", "0.53196925", "0.5315109", "0.5314028", "0.5310977", "0.531034" ]
0.0
-1
POST /animalcontrols POST /animalcontrols.json
def create @animalcontrol = Animalcontrol.new(animalcontrol_params) respond_to do |format| if @animalcontrol.save format.html { redirect_to @animalcontrol, notice: 'Animal Control Call-Out was successfully created.' } format.json { render :show, status: :created, location: @animalcontrol } else format.html { render :new } format.json { render json: @animalcontrol.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_animalcontrol\n @animalcontrol = Animalcontrol.find(params[:id])\n end", "def animalcontrol_params\n params.require(:animalcontrol).permit(:address, :name, :callback, :unitassigned, :problem, :comment)\n end", "def create\n @adotando_animal = AdotandoAnimal.new(params[:adotando_animal])\n\n respond_to do |format|\n if @adotando_animal.save\n format.html { redirect_to @adotando_animal, notice: 'Adotando animal was successfully created.' }\n format.json { render json: @adotando_animal, status: :created, location: @adotando_animal }\n else\n format.html { render action: \"new\" }\n format.json { render json: @adotando_animal.errors, status: :unprocessable_entity }\n end\n end\n end", "def animal_params\n params.require(:animal).permit(:name, :longevity, :preys_id => [], :predators_id => [])\n end", "def create\n @status_animal = StatusAnimal.new(params[:status_animal])\n\n respond_to do |format|\n if @status_animal.save\n format.html { redirect_to @status_animal, notice: 'Status animal was successfully created.' }\n format.json { render json: @status_animal, status: :created, location: @status_animal }\n else\n format.html { render action: \"new\" }\n format.json { render json: @status_animal.errors, status: :unprocessable_entity }\n end\n end\n end", "def animal_params\n params.require(:animal).permit(:name, :animal_type, :zooo_id)\n end", "def animal_params\n params.require(:animal).permit(:nom, :raza, :zona_id, :any_naixement, :cuidador_id)\n end", "def create\n @animal = Animal.new(animal_params)\n respond_to do |format|\n if @animal.save\n format.html { redirect_to @animal, notice: 'Animal was successfully created.' }\n format.json { render :show, status: :created, location: @animal }\n else\n format.html { render :new }\n format.json { render json: @animal.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @animal = Animal.new(animal_params)\n\n respond_to do |format|\n if @animal.save\n format.html { redirect_to @animal, notice: 'Animal was successfully created.' }\n format.json { render :show, status: :created, location: @animal }\n else\n format.html { render :new }\n format.json { render json: @animal.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n animal = Animal.new(animal_params)\n if !animal.name.nil?\n animal.save\n render json: animal, status: 201, location: [:api, animal]\n else\n render json: { errors: animal.errors }, status: 422\n end\n end", "def animal_params\n params.require(:animal).permit(:name, :zoo_id, :species_id)\n end", "def animal_params\n params.require(:animal).permit(:name, :entry_at, :condition, :personality, :age, :sex, :color, :chip, :hosted_in, :observations, :shelter_id, :rescued_from_id, :adopter_id)\n end", "def animal_params\n params.require(:animal).permit(:nom, :raza, :zone_id, :any_naixement, :user_id, :avatar, :avatar_cache, :remove_avatar)\n end", "def create\n @animal = @shelter.animals.build(animal_params)\n\n respond_to do |format|\n if @animal.save\n format.html { redirect_to [@shelter, @animal], notice: \"Animal was successfully created.\" }\n format.json { render :show, status: :created, location: [@shelter, @animal] }\n format.js\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @animal.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @doador_animal = DoadorAnimal.new(params[:doador_animal])\n\n respond_to do |format|\n if @doador_animal.save\n format.html { redirect_to @doador_animal, notice: 'Doador animal was successfully created.' }\n format.json { render json: @doador_animal, status: :created, location: @doador_animal }\n else\n format.html { render action: \"new\" }\n format.json { render json: @doador_animal.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n animal = Animal.create(animal_params)\n\n # if animal can be validated and updated then render the json\n if animal.valid?\n render json: animal\n else\n render json: animal.errors\n end \n end", "def create\n @animal = Animal.new(animal_params)\n @animal.preys_id = @animal.preys_id.gsub('\"\", ', '')\n @animal.predators_id = @animal.predators_id.gsub('\"\", ', '')\n\n respond_to do |format|\n if @animal.save\n format.html { redirect_to @animal, notice: 'Animal was successfully created.' }\n format.json { render :show, status: :created, location: @animal }\n else\n format.html { render :new }\n format.json { render json: @animal.errors, status: :unprocessable_entity }\n end\n end\n end", "def animal_params\n params.require(:animal).permit(:name, :description, :species, :race, :birth, :cover, :gender, :size, :birth_ca, :health_status, pictures: [])\n end", "def update\n respond_to do |format|\n if @animalcontrol.update(animalcontrol_params)\n format.html { redirect_to @animalcontrol, notice: 'Animal Control Call-Out was successfully updated.' }\n format.json { render :show, status: :ok, location: @animalcontrol }\n else\n format.html { render :edit }\n format.json { render json: @animalcontrol.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @control = @device.controls.new(control_params)\n\n respond_to do |format|\n if @control.save\n format.html { redirect_to [@device,@control], notice: 'Control was successfully created.' }\n format.json { render action: 'show', status: :created, location: @control }\n else\n format.html { render action: 'new' }\n format.json { render json: @control.errors, status: :unprocessable_entity }\n end\n end\n end", "def animal_params\n params.require(:animal).permit(:animal_type, :age, :sex, :location, :description, :user_id, :race_id, :solved)\n end", "def create\n @animal = @shelter.animals.build(animal_params)\n respond_with(@shelter)\n end", "def create\n @animal = Animal.new(animal_params)\n\n respond_to do |format|\n if @animal.save\n format.html do\n redirect(person_animal_url(@person, @animal), :create, 'animal')\n end\n\n format.json { render :show, status: :created, location: @animal }\n else\n format.html { render :new }\n format.json { render_json(@animal.errors, :unprocessable_entity) }\n end\n end\n end", "def post_params\n params.require(:animal).permit(:user_id, :name, :color, :additional_notes, :image, :age)\n end", "def animal_params\n params.require(:animal).permit(:nome, :raca, :sexo, :idade, :peso, :cuidador_id)\n end", "def animal_params\n params.require(:animal).permit(:id, :name, :identifier, :sex, \n :category, :animal_description, :animal_size, :birthday, \n :neutered, :medical_issues, :medical_issues_description, \n :child_friendly, :dog_friendly, :cat_friendly, :litter_trained, \n :other_info)\n end", "def create\n @register_animal_type = Register::AnimalType.new(register_animal_type_params)\n\n respond_to do |format|\n if @register_animal_type.save\n format.html { redirect_to register_animal_types_path, success: 'O tipo de animal foi criado com sucesso.' }\n format.json { render :index, status: :created, location: @register_animal_type }\n else\n format.html { render :new }\n format.json { render json: @register_animal_type.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @animal = Animal.new(params[:animal])\n @species = ['Lion', 'Koala', 'Panda']\n @zoo = Zoo.find(params[:zoo_id])\n @animal.zoo_id = params[:zoo_id];\n \n\n respond_to do |format|\n\n if @animal.save\n format.html { redirect_to zoo_animal_path(params[:zoo_id],@animal.id),\n notice: 'animal was successfully created.' }\n format.json { render json: @animal, status: :created,\n location: @animal }\n else\n format.html { render action: \"new\" }\n format.json { render json: @animal.errors,\n status: :unprocessable_entity }\n end\n end\n end", "def create\n @animal = Animal.new(post_params)\n @animal.breed_id = params[\"animal\"][\"breed\"].to_i\n @animal.user = current_user\n # @animal.breed = Breed.find_by(name: 'Golden Retriever')\n\n respond_to do |format|\n if @animal.save\n format.html { redirect_to '/posts/new', notice: 'Post was successfully created.' }\n format.json { redirect_to '/posts/new', status: :created, location: @animal }\n else\n format.html { render :new }\n format.json { render json: @animal.errors, status: :unprocessable_entity }\n end\n end\n end", "def animal_params\n params.require(:animal).permit(\n :name,\n :breed,\n :dob,\n :weight,\n :color,\n :good_with_kids,\n :good_with_dogs,\n :good_with_cats,\n :description,\n :fixed,\n :sex,\n images_attributes: %I[\n id\n image\n _destroy\n ]\n )\n end", "def new\n @status_animal = StatusAnimal.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @status_animal }\n end\n end", "def create\n @animals = Animal.all\n @animal = Animal.create(animal_params)\n\n end", "def new\n @adotando_animal = AdotandoAnimal.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @adotando_animal }\n end\n end", "def create\n @profile = Profile.find(params[:profile_id])\n authorize! :create, @profile\n respond_to do |format|\n begin\n @control = @profile.controls.new(control_params)\n @profile.save\n format.html { redirect_to @profile, notice: 'Control was successfully created.' }\n format.json { render :show, status: :created, location: @control }\n rescue Mongoid::Errors::InvalidValue\n format.html { redirect_to @profile, error: 'Control was not successfully created.' }\n format.json { render json: @control.errors, status: :unprocessable_entity }\n end\n end\n end", "def animal_params\n params.require(:animal).permit(:species, :last_seen_location, :seen_count)\n end", "def animal_params\n params.require(:animal).permit(:species, :last_seen_location, :seen_count)\n end", "def animal_params\n params.require(:animal).permit(:name, :breed, :birthdate, :photo_id, :bio)\n end", "def create\n @therapy = Therapy.new(therapy_params)\n category = TherapyCategory.create(name: @therapy.name)\n category.therapies << @therapy\n\n respond_to do |format|\n if @therapy.save\n format.html { redirect_to @therapy }\n format.json { render :show, status: :created, location: @therapy }\n else\n format.html { render :new }\n format.json { render json: @therapy.errors, status: :unprocessable_entity }\n end\n end\n end", "def post_authcontrols(body, opts = {})\n data, _status_code, _headers = post_authcontrols_with_http_info(body, opts)\n data\n end", "def animal_params\n params.require(:animal).permit(:name, :year_born, :weight, :bio, :species, :sponsored, :sponsor_price, :category_id, :owner_id, :profile_picture, media: [])\n end", "def create\n animal = Animal.create(animal_params)\n if animal.valid?\n render json: animal\n else\n r ender json: animal.errors\n end\n end", "def new\n @doador_animal = DoadorAnimal.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @doador_animal }\n end\n end", "def create\n @boat_type = BoatType.new(boat_type_params)\n respond_to do |format|\n if @boat_type.save\n format.html { redirect_to edit_boat_type_path(@boat_type)}\n format.json { render json: @boat_type.hash_view('control'), status: :created, location: @boat_type }\n else\n format.html { render :new }\n format.json { render json: @boat_type.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n response = post_request(URI.parse(\"http://\"+(sesh :donabe_ip)+\"/\"+(sesh :current_tenant)+\"/containers.json\"), params[:container].to_json, (sesh :current_token))\n json_respond response.body \n\n end", "def create\n response = post_request(URI.parse(\"http://\"+Storage.find(cookies[:donabe_ip]).data+\"/\"+Storage.find(cookies[:current_tenant]).data+\"/containers.json\"), params[:container].to_json, Storage.find(cookies[:current_token]).data)\n json_respond response.body \n\n end", "def create\n @animal_image = AnimalImage.new(animal_image_params)\n\n respond_to do |format|\n if @animal_image.save\n format.html { redirect_to @animal_image, notice: \"Animal image was successfully created.\" }\n format.json { render :show, status: :created, location: @animal_image }\n else\n format.html { render :new }\n format.json { render json: @animal_image.errors, status: :unprocessable_entity }\n end\n end\n end", "def animal_params\n params.require(:animal).permit(:species, :last_seen_location, :seen_count)\n end", "def animal_params\n params.require(:animal).permit(:id, :name, :breed_id, :egg_id)\n end", "def new\n @animal = Animal.new\n @zoo = Zoo.find(params[:zoo_id])\n @species = ['Lion', 'Koala', 'Panda']\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @animal }\n end\n end", "def new\n @bemap = Bemap.new\n @show_controls = false\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bemap }\n end\n end", "def post_authcontrols_with_http_info(body, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: AuthControlsApi.post_authcontrols ...'\n end\n # verify the required parameter 'body' is set\n if @api_client.config.client_side_validation && body.nil?\n fail ArgumentError, \"Missing the required parameter 'body' when calling AuthControlsApi.post_authcontrols\"\n end\n # resource path\n local_var_path = '/authcontrols'\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(body)\n\n # return_type\n return_type = opts[:debug_return_type] || 'AuthControlResponse'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || []\n\n new_options = opts.merge(\n :operation => :\"AuthControlsApi.post_authcontrols\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: AuthControlsApi#post_authcontrols\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def animal_params\n params.permit(:animal_type, :name, :breed, :sex, :age, :weight)\n end", "def create\n @verb = Verb.new(verb_params)\n\n if @verb.save\n render json: @verb, status: :created, location: @verb\n else\n render json: @verb.errors, status: :unprocessable_entity\n end\n end", "def create\n @animal = Animal.new(animal_params)\n flash[:notice] = \"New animal created\"\n redirect_to :back\n end", "def create\n @type_animal = TypeAnimal.new(type_animal_params)\n @type_animal.code = generateur_de_code(7)\n respond_to do |format|\n if @type_animal.save\n format.html { redirect_to @type_animal, notice: 'Type animal was successfully created.' }\n format.json { render :show, status: :created, location: @type_animal }\n else\n format.html { render :new }\n format.json { render json: @type_animal.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n #create a new animal and call the params method to check for appropriate data\n animal = Animal.create(animal_params)\n\n #if the animal is created return the animal info\n if animal.valid?\n render json: animal\n #if the animal is not created return an error\n else\n render json: animal.errors\n end\nend", "def register_animal_type_params\n params.require(:register_animal_type).permit(:nme_animal, :obs, :image)\n end", "def create\n cat = Cat.find(params[:cat_id])\n @adopted_pet = @selection.add_cat(cat.id)\n\n respond_to do |format|\n if @adopted_pet.save\n format.html { redirect_to adoption_url}\n format.js\n format.json { render action: 'show', status: :created, location: @adopted_pet }\n else\n format.html { render action: 'new' }\n format.json { render json: @adopted_pet.errors, status: :unprocessable_entity }\n end\n end\n end", "def create \n render json: Tuning.create(tuning_params)\n end", "def create\n @postulation_pet = PostulationPet.new(postulation_pet_params)\n respond_to do |format|\n if @postulation_pet.save\n\n @postulation_pet.addAnswer(params[:postulation_pet][:answer_pets], @postulation_pet.id )\n\n format.html { redirect_to @postulation_pet, notice: 'Postulation pet was successfully created.' }\n format.js\n # format.json { render :show, status: :created, location: @postulation_pet }\n else\n format.html { render :new }\n format.js\n # format.json { render json: @postulation_pet.errors, status: :unprocessable_entity }\n end\n end\n end", "def destroy\n @animalcontrol.destroy\n respond_to do |format|\n format.html { redirect_to animalcontrols_url, notice: 'Animal Control Call-Out was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def set_animal\n @animal = Animal.find(params[:animal_id])\n end", "def new\n @cut = Cut.new\n @animals = Animal.all\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cut }\n end\n end", "def create\n dive = Dive.new(dive_params)\n if dive.save\n render json: dive\n else\n render json: {message: dive.errors}, status: 400\n end\n end", "def new\n @antler = Antler.new(side: params[:side], animal_id: params[:animal_id])\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @antler }\n end\n end", "def animal_params\n species = Species.find_or_create_by(name: params[:species])\n permitted = params.permit(:name, :gender)\n permitted[\"species_id\"] = species.id\n permitted\n end", "def create\n @aktuator = Aktuator.new(aktuator_params)\n\n respond_to do |format|\n if @aktuator.save\n format.html { redirect_to @aktuator, notice: 'Aktuator was successfully created.' }\n format.json { render :show, status: :created, location: @aktuator }\n else\n format.html { render :new }\n format.json { render json: @aktuator.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_animal\n @animal = Animal.find(params[:id])\n end", "def set_animal\n @animal = Animal.find(params[:id])\n end", "def create\n @dog = Dog::Dog.new(params[:dog_dog])\n\n respond_to do |format|\n if @dog.save\n format.html { redirect_to @dog, notice: 'Dog was successfully created.' }\n format.json { render json: @dog, status: :created, location: @dog }\n else\n format.html { render action: \"new\" }\n format.json { render json: @dog.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @irregular_verb = IrregularVerb.new(params[:irregular_verb])\n\n respond_to do |format|\n if @irregular_verb.save\n format.html { redirect_to @irregular_verb, notice: 'Irregular verb was successfully created.' }\n format.json { render json: @irregular_verb, status: :created, location: @irregular_verb }\n else\n format.html { render action: \"new\" }\n format.json { render json: @irregular_verb.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @dog_poly = DogPoly.new(dog_poly_params)\n\n respond_to do |format|\n if @dog_poly.save\n format.html { redirect_to @dog_poly, notice: 'Dog poly was successfully created.' }\n format.json { render :show, status: :created, location: @dog_poly }\n else\n format.html { render :new }\n format.json { render json: @dog_poly.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n plant = Plant.create(plant_params)\n render json: plant, status: :created\n end", "def animal_params\n hash = params.require(:animal).permit(:name, :zoo_id, :species)\n hash.merge(zoo_id: params[:zoo_id])\n end", "def dog_params\n params.require(:dog).permit(:name, :description, :owner_id, images: [])\n end", "def create\n @experiment_control = ExperimentControl.new(params[:experiment_control])\n\n respond_to do |format|\n if @experiment_control.save\n format.html { redirect_to @experiment_control, notice: 'Experiment control was successfully created.' }\n format.json { render json: @experiment_control, status: :created, location: @experiment_control }\n else\n format.html { render action: \"new\" }\n format.json { render json: @experiment_control.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_animal\n @animal = Animal.find(params[:id])\n end", "def set_animal\n @animal = Animal.find(params[:id])\n end", "def set_animal\n @animal = Animal.find(params[:id])\n end", "def set_animal\n @animal = Animal.find(params[:id])\n end", "def set_animal\n @animal = Animal.find(params[:id])\n end", "def set_animal\n @animal = Animal.find(params[:id])\n end", "def set_animal\n @animal = Animal.find(params[:id])\n end", "def create\n @accessory = Accessory.new(params[:accessory])\n\n if @accessory.save\n render json: @accessory, status: :created, location: @accessory\n else\n render json: @accessory.errors, status: :unprocessable_entity\n end\n end", "def add_tenant_circle(args = {}) \n post(\"/tenantcircles.json/\", args)\nend", "def create\n render_json_auto @survey.add_logic_control_rule(params[:logic]) and return\n end", "def animal_params\n params.require(:animal)\n .permit(:name, :monthly_cost, :person_id, :animal_type_id)\n end", "def create\n @controlpleit = Controlpleit.new(controlpleit_params)\n\n respond_to do |format|\n if @controlpleit.save\n format.html { redirect_to @controlpleit, notice: 'Controlpleit was successfully created.' }\n format.json { render :show, status: :created, location: @controlpleit }\n else\n format.html { render :new }\n format.json { render json: @controlpleit.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n price_dollars = params[:animal][:sponsor_price].to_f\n price_cents = (price_dollars * 100.0).to_i\n @animal = Animal.new(animal_params)\n @animal.sponsor_price = price_cents\n @animal.owner = current_user\n\n respond_to do |format|\n if @animal.save\n format.html { redirect_to @animal, notice: \"Animal was successfully created.\" }\n format.json { render :show, status: :created, location: @animal }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @animal.errors, status: :unprocessable_entity }\n end\n end\n end", "def moip_post\n @nasp_rail = NaspRail.new(params[:nasp_rail])\n\n format.html { redirect_to @nasp_rail, :notice => 'Nova entrada criada com sucesso.' }\n format.json { render :json => @nasp_rail, :status => :created, :location => @nasp_rail }\n end", "def create\n @bike_type = BikeType.new(bike_type_params)\n\n if @bike_type.save\n audit(@bike_type, current_user)\n render json: @bike_type, status: :created\n else\n render json: @bike_type.errors, status: :unprocessable_entity\n end\n end", "def create\n @dog = Dog.new(dog_params)\n\n if @dog.save\n render json: @dog, status: 201\n else\n render json: {\n errors: @dog.errors\n }\n end\n end", "def create\n @controltleit = Controltleit.new(controltleit_params)\n\n respond_to do |format|\n if @controltleit.save\n format.html { redirect_to @controltleit, notice: 'Controltleit was successfully created.' }\n format.json { render :show, status: :created, location: @controltleit }\n else\n format.html { render :new }\n format.json { render json: @controltleit.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @appliance = Appliance.new(appliance_params)\n @appliance.owner = current_user\n authorize @appliance\n respond_to do |format|\n if @appliance.save\n format.html { redirect_to @appliance, notice: 'Appliance was successfully created.' }\n format.json { render :show, status: :created, location: @appliance }\n else\n format.html { render :new }\n format.json { render json: @appliance.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @found_animal = current_user.found_animals.build(found_animal_params)\n\n respond_to do |format|\n if @found_animal.save\n format.html { redirect_to @found_animal, notice: I18n.t('.found-created') || 'Found animal was successfully created.' }\n format.json { render :show, status: :created, location: @found_animal }\n else\n format.html { render :new }\n format.json { render json: @found_animal.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n\n @adocao_animal = AdocaoAnimal.new\n @adocao_animal.doador_animal_id = params[:doador_animal_id]\n @adocao_animal.adotando_animal_id = current_usuario.id\n @adocao_animal.animal_id = params[:animal_id]\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @adocao_animal }\n end\n \n end", "def create\n @bicyclepost = Bicyclepost.new(bicyclepost_params)\n\n respond_to do |format|\n if @bicyclepost.save\n format.html { redirect_to @bicyclepost, notice: 'Bicyclepost was successfully created.' }\n format.json { render :show, status: :created, location: @bicyclepost }\n else\n format.html { render :new }\n format.json { render json: @bicyclepost.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @choice = Choice.new(choice_params)\n\n if @choice.save\n render json: @choice, status: :created, location: @choice\n else\n render json: @choice.errors, status: :unprocessable_entity\n end\n end", "def create\n @idea = current_member.ideas.new(idea_params) \n respond_to do |format|\n sectors_params.delete(\"\")\n if @idea.save\n sectors_params.each do |k|\n @idea.sectors << Sector.find_by(id:k)\n end\n format.json { head :no_content }\n format.js\n else\n\n format.json { render :json => { :error => @idea.errors.full_messages }, :status => 422 }\n end\n \n end\n end", "def create\n @control_tower = ControlTower.new(params[:control_tower])\n\n respond_to do |format|\n if @control_tower.save\n format.html { redirect_to @control_tower, notice: 'Control tower was successfully created.' }\n format.json { render json: @control_tower, status: :created, location: @control_tower }\n else\n format.html { render action: \"new\" }\n format.json { render json: @control_tower.errors, status: :unprocessable_entity }\n end\n end\n end" ]
[ "0.63756686", "0.6221957", "0.57594293", "0.5747882", "0.5731585", "0.5700276", "0.5699038", "0.56507075", "0.56490535", "0.56368953", "0.5573037", "0.5549986", "0.55350286", "0.551721", "0.5497559", "0.5481593", "0.5481144", "0.54607636", "0.5445256", "0.5441208", "0.5437344", "0.5374453", "0.53726155", "0.5369983", "0.53692657", "0.5363535", "0.53613937", "0.53569", "0.5350422", "0.5346664", "0.5344179", "0.531781", "0.5300596", "0.52864236", "0.52817935", "0.52817935", "0.527248", "0.52565026", "0.52555496", "0.52465034", "0.52459496", "0.5237005", "0.52213883", "0.5216828", "0.5213338", "0.5213266", "0.521084", "0.52038765", "0.5182579", "0.5172783", "0.51706946", "0.5156711", "0.5152335", "0.5135358", "0.51304454", "0.51060426", "0.509122", "0.50885516", "0.5063203", "0.5061492", "0.5058539", "0.5056525", "0.5055456", "0.5036218", "0.503338", "0.5028734", "0.50200653", "0.50148183", "0.50148183", "0.50045073", "0.5001644", "0.4993869", "0.4991755", "0.4990087", "0.49677694", "0.49661803", "0.49657258", "0.49657258", "0.49657258", "0.49657258", "0.49657258", "0.49657258", "0.49657258", "0.4964345", "0.49619865", "0.49606037", "0.4960063", "0.4959078", "0.49518114", "0.49469334", "0.49431577", "0.49394038", "0.493153", "0.49292094", "0.49256304", "0.49215633", "0.4914089", "0.49081746", "0.48994958", "0.48964015" ]
0.69665813
0
PATCH/PUT /animalcontrols/1 PATCH/PUT /animalcontrols/1.json
def update respond_to do |format| if @animalcontrol.update(animalcontrol_params) format.html { redirect_to @animalcontrol, notice: 'Animal Control Call-Out was successfully updated.' } format.json { render :show, status: :ok, location: @animalcontrol } else format.html { render :edit } format.json { render json: @animalcontrol.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n animal = Animal.find(params[:id])\n\n if validate_params(animal_params)\n animal.update(animal_params)\n render json: animal, status: 200, location: [:api, animal]\n else\n render json: { errors: animal.errors }, status: 422\n end\n end", "def update\n animal = Animal.find(params[:id])\n animal.update(animal_params)\n if animal.valid?\n render json: animal\n else\n render json: animal.errors\n end\n end", "def update\n animal = Animal.find(params[:id])\n animal.update(animal_params)\n\n # if animal can be validated and updated then render the json\n if animal.valid?\n render json: animal\n else\n render json: animal.errors\n end\n end", "def update\n @animal = Animal.find(params[:id])\n @species = ['Lion', 'Koala', 'Panda']\n @zoo = Zoo.find(params[:zoo_id])\n\n respond_to do |format|\n\n if @animal.update_attributes(params[:animal])\n format.html { redirect_to zoo_animal_path(params[:zoo_id],@animal.id),\n notice: 'animal was successfully updated.' }\n format.json { head :no_content }\n else\n\n format.html { render action: \"edit\"}\n format.json { render json: @animal.errors,\n status: :unprocessable_entity }\n end\n end\n end", "def update\n @adocao_animal = AdocaoAnimal.find(params[:id])\n\n respond_to do |format|\n if @adocao_animal.update_attributes(params[:adocao_animal])\n format.html { redirect_to @adocao_animal, notice: 'Adocao animal was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @adocao_animal.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @status_animal = StatusAnimal.find(params[:id])\n\n respond_to do |format|\n if @status_animal.update_attributes(params[:status_animal])\n format.html { redirect_to @status_animal, notice: 'Status animal was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @status_animal.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @animals = Animal.all\n @animal = Animal.find(params[:id])\n\n @animal.update_attributes(animal_params)\n\n end", "def update\n respond_to do |format|\n if @animal.update(animal_params)\n format.html { redirect_to @animal, notice: 'Animal was successfully updated.' }\n format.json { render :show, status: :ok, location: @animal }\n else\n format.html { render :edit }\n format.json { render json: @animal.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @animal.update(animal_params)\n format.html { redirect_to @animal, notice: 'Animal was successfully updated.' }\n format.json { render :show, status: :ok, location: @animal }\n else\n format.html { render :edit }\n format.json { render json: @animal.errors, status: :unprocessable_entity }\n end\n end\n end", "def patch!\n request! :patch\n end", "def update\n @adotando_animal = AdotandoAnimal.find(params[:id])\n\n respond_to do |format|\n if @adotando_animal.update_attributes(params[:adotando_animal])\n format.html { redirect_to @adotando_animal, notice: 'Adotando animal was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @adotando_animal.errors, status: :unprocessable_entity }\n end\n end\n end", "def patch\n headers = {\"If-Match\" => @version}\n response = @context.request :patch, \"#{@path}/#{@id}\", @data.to_json, headers\n @version += 1\n response\n # 'X-HTTP-Method-Override' => 'PATCH'\n end", "def update\n @animal.update(animal_params)\n respond_with(@shelter)\n end", "def update\n respond_to do |format|\n if @animal.update(animal_params)\n format.html { redirect_to @animal, notice: \"Animal was successfully updated.\" }\n format.json { render :show, status: :ok, location: @animal }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @animal.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @animal.update(animal_params)\n format.html { redirect_to @animal, notice: \"Animal was successfully updated.\" }\n format.json { render :show, status: :ok, location: @animal }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @animal.errors, status: :unprocessable_entity }\n end\n end\n end", "def api_patch(path, data = {})\n api_request(:patch, path, :data => data)\n end", "def set_animalcontrol\n @animalcontrol = Animalcontrol.find(params[:id])\n end", "def update\n respond_to do |format|\n if @animal.update(animal_params)\n format.html do\n redirect(person_animal_url(@person, @animal), :update, 'animal')\n end\n\n format.json { render :show, status: :ok, location: @animal }\n else\n format.html { render :edit }\n format.json { render_json(animal.errors, :unprocessable_entity) }\n end\n end\n end", "def update\n respond_to do |format|\n if @type_animal.update(type_animal_params)\n format.html { redirect_to @type_animal, notice: 'Type animal was successfully updated.' }\n format.json { render :show, status: :ok, location: @type_animal }\n else\n format.html { render :edit }\n format.json { render json: @type_animal.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @bowl = Bowl.find(params[:id])\n \n # set bowl modify time\n @bowl.modified = Time.now\n \n respond_to do |format|\n if @bowl.update_attributes(params[:bowl])\n \n Rails.logger.info \"Updating Bowl Contents\"\n \n # remove all contents for this bowl and add new\n @bowl.contents.delete_all(\"bowl_id=\" + @bowl.id)\n \n params.keys.each do |param|\n if param.start_with?(\"input_\") and (params[param] != \"\") \n @bowl.contents.create(:bowl_id => @bowl.id, :dryfruit_id => param[6, 2], :quantity => params[param]) \n end\n end\n\n format.html { redirect_to bowls_path, :notice => 'Bowl was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @bowl.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n id = params[:id]\n @physical_rack = PhysicalRack.any_of({_id: id}, {name: id.gsub('-', '.')}).first\n @physical_rack.attributes = params[:physical_rack]\n @physical_rack.audits << Audit.new(source: 'controller', action: 'update', admin_user: current_user)\n respond_to do |format|\n if @physical_rack.save\n format.html { redirect_to @physical_rack, notice: 'Physical rack was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @physical_rack.errors, status: :unprocessable_entity }\n end\n end\n end", "def update # PATCH\n raise NotImplementedError\n end", "def update\n #find\n animal = Animal.find(params[:id])\n #update - call the params method to check for appropriate data\n animal.update_attributes(animal_params)\n\n#if the animal is created return the animal info\n if animal.valid?\n render json: animal\n#if the animal is not created return an error\n else\n render json: animal.errors\n end\nend", "def update\n @doador_animal = DoadorAnimal.find(params[:id])\n\n respond_to do |format|\n if @doador_animal.update_attributes(params[:doador_animal])\n format.html { redirect_to @doador_animal, notice: 'Doador animal was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @doador_animal.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @container = Container.find(params[:id])\n\n respond_to do |format|\n if @container.update_attributes(params[:container])\n format.html { redirect_to @container, notice: 'Container was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @container.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @patient = @client.patients.find(params[:id])\n\n respond_to do |format|\n if @patient.update_attributes(params[:patient])\n format.html { redirect_to @patient, notice: 'Patient was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @patient.errors, status: :unprocessable_entity }\n end\n end\n end", "def put!\n request! :put\n end", "def patch(type, info)\n path, info = type_info(type, :path), force_case(info)\n ida = type == :client ? 'client_id' : 'id'\n raise ArgumentError, \"info must include #{ida}\" unless id = info[ida]\n hdrs = headers\n if info && info['meta'] && (etag = info['meta']['version'])\n hdrs.merge!('if-match' => etag)\n end\n reply = json_parse_reply(@key_style,\n *json_patch(@target, \"#{path}/#{Addressable::URI.encode(id)}\", info, hdrs))\n\n # hide client endpoints that are not quite scim compatible\n type == :client && !reply ? get(type, info['client_id']): reply\n end", "def update_radios_for_array(args = {}) \n id = args['id']\n temp_path = \"/radios.json/{arrayId}\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"radioId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend", "def update\n @meteor = Meteor.find(params[:id])\n\n respond_to do |format|\n if @meteor.update_attributes(params[:meteor])\n format.html { redirect_to @meteor, notice: 'Meteor was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @meteor.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @pet = Pet.find(params[:id])\n\n respond_to do |format|\n if @pet.update_attributes(params[:pet])\n format.html { redirect_to root_path, notice: 'Pet was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @pet.errors, status: :unprocessable_entity }\n end\n end\n end", "def update options={}\n client.put(\"/#{id}\", options)\n end", "def update_tenant_circle(args = {}) \n put(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend", "def update\n @monkey = Monkey.find(params[:id])\n\n respond_to do |format|\n if @monkey.update_attributes(params[:monkey])\n format.html { redirect_to @monkey, notice: 'Monkey was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @monkey.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @knob = Knob.find(params[:id])\n\n respond_to do |format|\n if @knob.update_attributes(params[:knob])\n flash[:notice] = 'Knob was successfully updated.'\n format.html { redirect_to(@knob) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @knob.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @backfire_control = BackfireControl.find(params[:id])\n \n respond_to do |format|\n if @backfire_control.update_attributes(params[:backfire_control])\n format.html { redirect_to @backfire_control, notice: 'Backfire control was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @backfire_control.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @verb = Verb.find(params[:id])\n\n if @verb.update(verb_params)\n head :no_content\n else\n render json: @verb.errors, status: :unprocessable_entity\n end\n end", "def update\n @moose = Moose.find(params[:id])\n\n respond_to do |format|\n if @moose.update_attributes(params[:moose])\n format.html { redirect_to @moose, notice: 'Moose was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @moose.errors, status: :unprocessable_entity }\n end\n end\n end", "def update!(params)\n res = @client.put(path, nil, params, \"Content-Type\" => \"application/json\")\n @attributes = res.json if res.status == 201\n res\n end", "def update\n @pet = Pet.find(params[:id])\n\n respond_to do |format|\n if @pet.update_attributes(params[:pet])\n format.html { redirect_to @pet, notice: 'Pet was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @pet.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @pet_true.update(pet_true_params)\n format.html { redirect_to @pet_true, notice: 'Pet true was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @pet_true.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_plant\n @plant.deleted = false\n\n respond_to do |format|\n if set_attributes_from_filemaker(@plant)\n format.json do\n render status: :created,\n json: {\n id: @plant.id,\n botanical_name: @plant.botanical_name,\n alternative_names: @plant.alternative_names,\n updated_at: @plant.updated_at,\n visible: (!@plant.deleted).to_s\n }\n end\n else\n format.json do\n render json: @plant.errors, status: :unprocessable_entity\n end\n end\n end\n end", "def update\n @patch = Patch.find(params[:id])\n\n respond_to do |format|\n if @patch.update_attributes(params[:patch])\n format.html { redirect_to @patch, notice: 'Patch was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @patch.errors, status: :unprocessable_entity }\n end\n end\n end", "def patch(path, data)\n request 'PATCH', path, body: data.to_json\n end", "def update\n respond_to do |format|\n if @kata.update(kata_params)\n format.html { redirect_to @kata, notice: 'Kata was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @kata.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n authorize! :update, Client\n load_client\n build_client\n save_client or render :edit\n end", "def update\n prms = @boat_type.is_modification? ? modification_params : boat_type_params\n respond_to do |format|\n if @boat_type.update(prms)\n format.html { redirect_to edit_boat_type_path(@boat_type), notice: 'Тип лодки успешно обновлён' }\n format.json { render json: @boat_type.hash_view('control'), status: :ok}\n else\n format.html { render :edit }\n format.json { render json: @boat_type.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n \n if @animal.update(animal_params)\n if params[:images]\n params[:images].each { |image|\n @animal.images.create(image: image)\n }\n end\n if params[:selected]\n params[:selected].each { |selecte|\n @animal.images.destroy(selecte)\n }\n end\n if animal_params[:solved]\n format.html { redirect_to @animal}\n else\n format.html { redirect_to @animal, notice: 'Publicación actualizada correctamente.' }\n end\n format.json { render :show, status: :ok, location: @animal }\n else\n format.html { render :edit }\n format.json { render json: @animal.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @animal_image.update(animal_image_params)\n format.html { redirect_to @animal_image, notice: \"Animal image was successfully updated.\" }\n format.json { render :show, status: :ok, location: @animal_image }\n else\n format.html { render :edit }\n format.json { render json: @animal_image.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @project_control.update(project_controls_params) &&\n @project_control.update_attribute(:code, params[:code]) &&\n @project_control.update_attribute(:status, 'Awaiting Review') &&\n @project_control.children.each { |child| child.update_attribute(:applicability, @project_control.applicability) }\n format.html { redirect_to project_edit_controls_path(@project_control.project_id), notice: 'Control was successfully updated.' }\n format.json { render :show, status: :ok, location: @project_control }\n else\n format.html { render :edit }\n format.json { render json: @project_control.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @verb.update(verb_params)\n format.html { redirect_to @verb, notice: 'Verb was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @verb.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @client = Client.find params[:client_id]\n respond_to do |format|\n if @pet.update(pet_params)\n format.html { redirect_to client_pet_path(@client,@pet), notice: 'Datos de mascota actualizados.' }\n else\n format.html { render :edit }\n end\n end\n end", "def update\n request_body_Data= '{ \"widget\":\n {\n \"name\" : \"'+params[:name]+'\",\n \"description\" : \"'+params[:description]+'\"\n }}'\n response = RestClient::Request.new({\n method: :put,\n url: ENV['API_URL'] + '/widgets/' + params[:id],\n payload: request_body_Data,\n headers: { Authorization: session[:access_token], content_type: 'application/json'}\n }).execute do |response, request, result|\n case response.code\n when 400\n [ :error, JSON.parse(response) ]\n when 200\n [ :success, JSON.parse(response) ]\n json=JSON.parse(response)\n @widget= Widget.new do |widget|\n widget.id=json[\"data\"][\"widget\"][\"id\"]\n widget.name=json[\"data\"][\"widget\"][\"name\"]\n widget.description=json[\"data\"][\"widget\"][\"description\"]\n widget.kind=json[\"data\"][\"widget\"][\"kind\"]\n widget.userid=json[\"data\"][\"widget\"][\"user\"][\"id\"]\n widget.username=json[\"data\"][\"widget\"][\"user\"][\"name\"]\n widget.owner=json[\"data\"][\"widget\"][\"owner\"]\n end\n else\n fail \"Invalid response #{response.to_str} received.\"\n end\n end\n respond_to do |format|\n if @widget\n format.html { redirect_to @widget, notice: 'Widget was successfully updated.' }\n format.json { render :show, status: :ok, location: @widget }\n else\n format.html { render :edit }\n format.json { render json: @widget.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @thing = Thing.find(params[:id])\n\n respond_to do |format|\n if @thing.update_attributes(params[:thing])\n format.html { redirect_to things_path, notice: 'Your thing was successfully updated!' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @thing.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @client.update(client_params)\n render json: @client\n end", "def update\n @irregular_verb = IrregularVerb.find(params[:id])\n\n respond_to do |format|\n if @irregular_verb.update_attributes(params[:irregular_verb])\n format.html { redirect_to @irregular_verb, notice: 'Irregular verb was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @irregular_verb.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @patch.update(patch_params)\n format.html { redirect_to @patch, notice: 'Patch was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @patch.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_attr\n #sanity checks \n @persona = current_persona\n @mediaset = @persona.mediasets.find(params[:id])\n \n respond_to do |format|\n @mediaset.update_attributes( params[:mediaset] )\n format.json{ respond_with_bip(@mediaset) }\n end\n end", "def update\n @initiative = Initiative.find(params[:id])\n \n respond_to do |format|\n if @initiative.update_attributes(params[:initiative])\n \n format.html { redirect_to @initiative, notice: 'Initiative was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @initiative.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n if @animal.user != current_user || current_user.admin == false\n redirect_to posts_path\n end\n respond_to do |format|\n if @animal.update(animal_params)\n format.html { redirect_to @animal, notice: 'Animal was successfully updated.' }\n format.json { render :show, status: :ok, location: @animal }\n else\n format.html { render :edit }\n format.json { render json: @animal.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @vehicle_type.update(vehicle_type_params)\n images\n\n format.html { redirect_to @vehicle_type, notice: 'Vehicle type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @vehicle_type.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n put :update\n end", "def UpdateView params = {}\n \n APICall(path: 'views.json',method: 'PUT',payload: params.to_json)\n \n end", "def update(attrs, path=nil)\n resp = api_client.put(path || url, JSON.dump(attrs))\n refresh(JSON.load(resp.body))\n end", "def update\n @kitty = Kitty.find(params[:id])\n\n respond_to do |format|\n if @kitty.update_attributes(params[:kitty])\n format.html { redirect_to @kitty, notice: 'Kitty was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @kitty.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @kv = Kv.find(params[:id])\n\n respond_to do |format|\n if @kv.update_attributes(params[:kv])\n format.html { redirect_to @kv, notice: 'Kv was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @kv.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @thing = Thing.find(params[:id])\n\n respond_to do |format|\n if @thing.update_attributes(params[:thing])\n format.html { redirect_to @thing, notice: 'Thing was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @thing.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @go_slim = GoSlim.find(params[:id])\n\n respond_to do |format|\n if @go_slim.update_attributes(params[:go_slim])\n format.html { redirect_to @go_slim, notice: 'Go slim was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @go_slim.errors, status: :unprocessable_entity }\n end\n end\n end", "def update(&block)\n validate_request()\n\n # Params includes all of the PATCH data at the top level along with other\n # other Rails-injected params like 'id', 'action', 'controller'. These\n # are harmless given no namespace collision and we're only interested in\n # the 'Operations' key for the actual patch data.\n #\n render(json: yield(self.safe_params()[:id], self.safe_params().to_hash()))\n end", "def update\n respond_to do |format|\n if @control.update(control_params)\n format.html { redirect_to [@device,@control], notice: 'Control was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @control.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @experiment_control = ExperimentControl.find(params[:id])\n\n respond_to do |format|\n if @experiment_control.update_attributes(params[:experiment_control])\n format.html { redirect_to @experiment_control, notice: 'Experiment control was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @experiment_control.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @serving = Serving.find(params[:id])\n\n respond_to do |format|\n if @serving.update_attributes(params[:serving])\n format.html { redirect_to @serving, notice: 'Serving was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @serving.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @beattape = Beattape.find(params[:id])\n\n respond_to do |format|\n if @beattape.update_attributes(params[:beattape])\n format.html { redirect_to @beattape, notice: 'Beattape was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @beattape.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @api_v1_initiative.update(api_v1_initiative_params)\n format.html { redirect_to @api_v1_initiative, notice: 'Initiative was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_v1_initiative }\n else\n format.html { render :edit }\n format.json { render json: @api_v1_initiative.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n render_json_auto @survey.update_logic_control_rule(params[:id].to_i, params[:logic]) and return\n end", "def update\n @pet = Pet.find(params[:id])\n\n respond_to do |format|\n if @pet.update_attributes(params[:pet])\n format.html { redirect_to @pet, notice: 'Pet was successfully updated.' }\n format.json { render json: {\"message\" => \"Pet was successfully updated\", \"success\" => true, \"data\" => @pet}, status: :created, location: @pet }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @pet.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n authorize! :update, @profile\n respond_to do |format|\n begin\n @control.parse_update(control_params)\n @control.save\n format.html { redirect_to profile_control_url(@profile, @control), notice: 'Control was successfully updated.' }\n format.json { render :show, status: :ok, location: @control }\n rescue Mongoid::Errors::InvalidValue\n format.html { render :edit }\n format.json { render json: @control.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @appliance_type = ApplianceType.find(params[:id])\n\n respond_to do |format|\n if @appliance_type.update_attributes(params[:appliance_type])\n format.html { redirect_to @appliance_type, notice: 'Appliance type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @appliance_type.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n # respond_to do |format|\n # if @thing.update(thing_params)\n # format.html { redirect_to @thing, notice: 'Thing was successfully updated.' }\n # format.json { render :show, status: :ok, location: @thing }\n # else\n # format.html { render :edit }\n # format.json { render json: @thing.errors, status: :unprocessable_entity }\n # end\n # end\n end", "def update\n @model = Model.find(params[:id])\n # @model.name = \"test\"\n @model.scale = 1\n respond_to do |format|\n if @model.update_attributes(params[:model])\n format.html { redirect_to @model, notice: 'Model was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @model.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @thing = Thing.find(params[:id])\n params[:thing][:place_id] = place_id_from_form\n params[:thing][:owner_ids] = [ ] if params[:thing][:owner_ids].nil?\n params[:thing][:keeper_ids] = [ ] if params[:thing][:keeper_ids].nil?\n\n respond_to do |format|\n if @thing.update_attributes(params[:thing])\n format.html { redirect_to(@thing, :notice => 'Thing was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @thing.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @konfig = Konfig.find(params[:id])\n\n respond_to do |format|\n if @konfig.update_attributes(params[:konfig])\n format.html { redirect_to admin_konfig_path(@konfig), notice: 'Config was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @konfig.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @actuator = Actuator.find(params[:id])\n\n respond_to do |format|\n if @actuator.update_attributes(params[:actuator].each_value(&:strip!))\n format.html { redirect_to(@actuator, :notice => 'Actuator was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @actuator.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update_aos_version(args = {}) \n id = args['id']\n temp_path = \"/aosversions.json/{aosVersionId}\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"aosversionId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend", "def update\n respond_to do |format|\n if @instrument_patch.update(instrument_patch_params)\n format.html { redirect_to @instrument_patch, notice: 'Instrument patch was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @instrument_patch.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @apologetic.update(apologetic_params)\n format.html { redirect_to @apologetic, notice: 'Apologetic was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @apologetic.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @koti = Koti.find(params[:id])\n\n respond_to do |format|\n if @koti.update_attributes(params[:koti])\n format.html { redirect_to @koti, notice: 'Koti was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @koti.errors, status: :unprocessable_entity }\n end\n end\n end", "def jsonapi_update!(attributes)\n assign_jsonapi_attributes(attributes)\n save!\n end", "def update\n @plate = Plate.find(params[:id])\n\n if @plate.update(params[:plate])\n head :no_content\n else\n render json: @plate.errors, status: :unprocessable_entity\n end\n end", "def update\n respond_to do |format|\n if @api_v1_initiative_update.update(api_v1_initiative_update_params)\n format.html { redirect_to @api_v1_initiative_update, notice: 'Initiative update was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_v1_initiative_update }\n else\n format.html { render :edit }\n format.json { render json: @api_v1_initiative_update.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @bunny.update(bunny_params)\n format.html { redirect_to @bunny, notice: 'Bunny was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @bunny.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @goat = Goat.find(params[:id])\n\n respond_to do |format|\n if @goat.update_attributes(params[:goat])\n format.html { redirect_to @goat, notice: 'Goat was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @goat.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @dog_poly.update(dog_poly_params)\n format.html { redirect_to @dog_poly, notice: 'Dog poly was successfully updated.' }\n format.json { render :show, status: :ok, location: @dog_poly }\n else\n format.html { render :edit }\n format.json { render json: @dog_poly.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @interesting = Interesting.find(params[:id])\n\n respond_to do |format|\n if @interesting.update_attributes(params[:interesting])\n format.html { redirect_to @interesting, notice: 'Interesting was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @interesting.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @dog = Dog::Dog.find(params[:id])\n\n respond_to do |format|\n if @dog.update_attributes(params[:dog_dog])\n format.html { redirect_to @dog, notice: 'Dog was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @dog.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @survey_choice = Survey::Choice.find(params[:id])\n\n respond_to do |format|\n if @survey_choice.update_attributes(params[:survey_choice])\n format.html { redirect_to @survey_choice, notice: 'Choice was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @survey_choice.errors, status: :unprocessable_entity }\n5 end\n end\n end", "def update\n do_patch { return } # check if patch and do submission and return early if it is a patch (submission)\n # otherwise this is a PUT of the dataset metadata\n check_status { return } # check it's in progress, clone a submitted or raise an error\n respond_to do |format|\n format.json do\n dp = if @resource\n DatasetParser.new(hash: params['dataset'], id: @resource.identifier, user: @user) # update dataset\n else\n DatasetParser.new(hash: params['dataset'], user: @user, id_string: params[:id]) # upsert dataset with identifier\n end\n @stash_identifier = dp.parse\n ds = Dataset.new(identifier: @stash_identifier.to_s) # sets up display objects\n render json: ds.metadata, status: 200\n end\n end\n end", "def update\n respond_to do |format|\n if @capitol.update(capitol_params)\n format.html { redirect_to root_path, notice: 'Capitol was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @capitol.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @cookbook = current_cookbook\n\n # Process Paperclip attachments\n @cookbook.process_attachments(params)\n \n if @cookbook.update_attributes_individually params[:cookbook]\n flash[:notice] = 'The template was updated.'\n end\n respond_to do |format|\n format.js { render :update, content_type: \"text/plain\" }\n end\n end", "def update\n @cocktail = Cocktail.find(params[:id])\n respond_to do |format|\n if @cocktail.update_attributes(params[:cocktail])\n format.html { redirect_to @cocktail, :notice => 'Cocktail was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @cocktail.errors, :status => :unprocessable_entity }\n end\n end\n end" ]
[ "0.63176674", "0.6111031", "0.605045", "0.60483855", "0.6027697", "0.6010622", "0.5949315", "0.59429234", "0.59429234", "0.5921245", "0.5908152", "0.5879107", "0.58735347", "0.5870569", "0.5870569", "0.5829867", "0.5817469", "0.58036274", "0.5711903", "0.57088935", "0.56761986", "0.56735533", "0.5668244", "0.5646311", "0.5630823", "0.5622182", "0.56198764", "0.5608994", "0.56075037", "0.5601745", "0.5596296", "0.5592594", "0.55916715", "0.55839807", "0.55758977", "0.5573443", "0.5571645", "0.5565739", "0.555208", "0.55519056", "0.55493504", "0.5542684", "0.5536697", "0.5535385", "0.55333817", "0.5517289", "0.5517263", "0.5516036", "0.55155575", "0.54887724", "0.5488388", "0.5486515", "0.5478412", "0.5473231", "0.54669845", "0.54637", "0.5457438", "0.54480606", "0.5446453", "0.54450995", "0.54439735", "0.5439161", "0.543478", "0.54274434", "0.54237705", "0.5419337", "0.5416483", "0.5414888", "0.54122114", "0.5410942", "0.5398921", "0.53978276", "0.5394021", "0.5392398", "0.5391508", "0.538926", "0.5388986", "0.5381012", "0.53808665", "0.53778416", "0.53755754", "0.53752077", "0.5375032", "0.53741497", "0.5370927", "0.5370675", "0.5368116", "0.5367629", "0.53666395", "0.53635806", "0.5360199", "0.53513116", "0.53487694", "0.534766", "0.53460675", "0.5345202", "0.5345143", "0.5339513", "0.53379023", "0.5337512" ]
0.66352135
0
DELETE /animalcontrols/1 DELETE /animalcontrols/1.json
def destroy @animalcontrol.destroy respond_to do |format| format.html { redirect_to animalcontrols_url, notice: 'Animal Control Call-Out was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n animal = Animal.find(params[:id])\n animal.destroy\n head 204\n end", "def destroy\n @adocao_animal = AdocaoAnimal.find(params[:id])\n @adocao_animal.destroy\n\n respond_to do |format|\n format.html { redirect_to adocao_animals_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @animal = Animal.find(params[:id])\n @animal.destroy\n\n respond_to do |format|\n format.html { redirect_to zoo_animals_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @status_animal = StatusAnimal.find(params[:id])\n @status_animal.destroy\n\n respond_to do |format|\n format.html { redirect_to status_animais_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @animal.destroy\n\n respond_to do |format|\n format.html { redirect_to animals_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @animal.destroy\n respond_to do |format|\n format.html { redirect(person_animals_url, :delete, 'animal') }\n format.json { head :no_content }\n end\n end", "def delete\n client.delete(\"/#{id}\")\n end", "def destroy\n @adotando_animal = AdotandoAnimal.find(params[:id])\n @adotando_animal.destroy\n\n respond_to do |format|\n format.html { redirect_to adotando_animais_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @animal = Animal.find(params[:id])\n @animal.destroy\n render json: { message: \"Congrats youve won\"}\n end", "def destroy\n @animals = Animal.all\n @animal = Animal.find(params[:id])\n @animal.destroy\n end", "def destroy\n @animal = Animal.find(params[:id])\n @animal.destroy\n respond_to do |format|\n format.html { redirect_to root_path, notice: 'Animal was successfully deleted from database.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @animal = Animal.find(params[:id])\n @animal.destroy\n # respond_to do |format|\n # formal.html { redirect_to animals_url, notice: \"Animal was successfully removed.\"}\n # format.json { head :no_content}\n # end\n end", "def destroy\n @doador_animal = DoadorAnimal.find(params[:id])\n @doador_animal.destroy\n\n respond_to do |format|\n format.html { redirect_to doador_animais_url }\n format.json { head :no_content }\n end\n end", "def destroy\n animal = Animal.find(params[:id])\n if animal.destroy\n render json: animal\n else\n render json: animal.errors\n end\n end", "def destroy\n animal = Animal.find(params[:id])\n animal.destroy\n if animal.valid?\n render json: animal\n else\n render json: animal.errors\n end\n end", "def destroy\n @animal_image.destroy\n respond_to do |format|\n format.html\n format.js {}\n format.json { render json: { ok: true } }\n end\n end", "def destroy\n @animal.destroy\n respond_to do |format|\n format.html { redirect_to animals_url, notice: 'Animal was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @animal.destroy\n respond_to do |format|\n format.html { redirect_to animals_url, notice: 'Animal was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @animal.destroy\n respond_to do |format|\n format.html { redirect_to animals_url, notice: \"Animal was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def destroy\n @animal.destroy\n respond_to do |format|\n format.html { redirect_to animals_url, notice: \"Animal was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def destroy\n @type_animal.destroy\n respond_to do |format|\n format.html { redirect_to type_animals_url, notice: 'Type animal was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @backfire_control = BackfireControl.find(params[:id])\n @backfire_control.destroy\n \n respond_to do |format|\n format.html { redirect_to backfire_controls_url }\n format.json { head :no_content }\n end\n end", "def delete\n render json: Alien.delete(params[\"id\"])\n end", "def destroy\n id = params[:id]\n @physical_rack = PhysicalRack.any_of({_id: id}, {name: id.gsub('-', '.')}).first\n @physical_rack.destroy\n\n respond_to do |format|\n format.html { redirect_to physical_racks_url }\n format.json { head :ok }\n end\n end", "def destroy\n @adoption_dog.destroy\n respond_to do |format|\n format.html { redirect_to adoption_dog_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @verb.destroy\n\n head :no_content\n end", "def destroy\n @animal.destroy\n respond_with(@animal)\n end", "def destroy\n return if new_record?\n \n @api.delete \"/items/#{shortcode_url}.json\"\n end", "def destroy\n @animal.destroy\n respond_to do |format|\n format.html { redirect_to animals_url, notice: 'Publicación eliminada correctamente.' }\n format.json { head :no_content }\n format.js\n end\n end", "def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend", "def delete\n render json: Post.delete(params[\"id\"])\n end", "def destroy\n @capa = Capa.find(params[:id])\n @capa.destroy\n\n respond_to do |format|\n format.html { redirect_to capas_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @control.destroy\n respond_to do |format|\n format.html { redirect_to device_controls_url(@device) }\n format.json { head :no_content }\n end\n end", "def destroy\n #find\n animal = Animal.find(params[:id])\n #if the entry is deleted return the entry that was removed\n if animal.destroy\n render json:animal\n #if the entry was not deleted dreturn an error\n else\n render json:animal.errors\n end\nend", "def delete\n item = FormTemplate.last\n id = item[:id]\n item.destroy\n render json: {id: id}\n end", "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "def delete_aos_version(args = {}) \n delete(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend", "def destroy\n @level_container = LevelContainer.find(params[:id])\n @level_container.destroy\n\n respond_to do |format|\n format.html { redirect_to level_containers_url }\n format.json { head :no_content }\n end\n end", "def delete!( opts = {} )\n http_action :delete, nil, opts\n end", "def destroy\n @baton = Baton.find(params[:id])\n @baton.destroy\n\n respond_to do |format|\n format.html { redirect_to batons_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @register_animal_type.destroy\n respond_to do |format|\n format.html { redirect_to register_animal_types_url, notice: 'O tipo animal foi destruído com sucesso.' }\n format.json { head :no_content }\n end\n end", "def delete\n render json: Item.delete(params[\"id\"])\n end", "def destroy\n @verb.destroy\n respond_to do |format|\n format.html { redirect_to verbs_url }\n format.json { head :no_content }\n end\n end", "def delete\n item = FormImage.last\n id = item[:id]\n item.destroy\n render json: {id: id}\n end", "def destroy\n @kata.destroy\n respond_to do |format|\n format.html { redirect_to katas_url }\n format.json { head :no_content }\n end\n end", "def destroy\n if @diet.destroy\n head :no_content, status: 200\n else\n render json: @diet.errors, status: 405\n end\n end", "def delete path\n make_request(path, \"delete\", {})\n end", "def destroy\n @retroaspecto = Retroaspecto.find(params[:id])\n @retroaspecto.destroy\n\n respond_to do |format|\n format.html { redirect_to retroaspectos_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @vocalium = Vocalium.find(params[:id])\n @vocalium.destroy\n\n respond_to do |format|\n format.html { redirect_to vocalia_url }\n format.json { head :no_content }\n end\n end", "def test_del\n header 'Content-Type', 'application/json'\n\n data = File.read 'sample-traces/0.json'\n post('/traces', data, 'CONTENT_TYPE': 'application/json')\n\n id = last_response.body\n\n delete \"/traces/#{id}\"\n assert last_response.ok?\n\n get \"/traces/#{id}\"\n\n contents = JSON.parse last_response.body\n assert_kind_of(Hash, contents, 'Response contents is not a hash')\n assert contents.key? 'description'\n assert(!last_response.ok?)\n end", "def destroy\n client=Client.find_by_id(params[:id])\n if client != nil\n if client.destroy\n head 204\n end\n else\n head 404\n end\n end", "def destroy\n @apologetic.destroy\n respond_to do |format|\n format.html { redirect_to apologetics_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @found_animal.destroy\n respond_to do |format|\n format.html { redirect_to found_animals_url, notice: I18n.t('.found-deleted') || 'Found animal was successfully deleted.' }\n format.json { head :no_content }\n end\n end", "def delete\n request(:delete)\n end", "def DeleteView id\n \n APICall(path: \"views/#{id}.json\",method: 'DELETE')\n \n end", "def delete # rubocop:disable Metrics/AbcSize\n attrcheck = { 'container name' => @options[:container] }\n @validate.attrvalidate(@options, attrcheck)\n containerview = ObjectStorage.new(@options[:id_domain], @options[:user_name], @options[:passwd])\n if @options[:recurse]\n contents = containerview.contents(@options[:container])\n container_contents = contents.body.split(/\\n/)\n container_contents.each do |content|\n containerview.delete_content(@options[:container], content)\n puts 'deleted ' + content\n end\n end\n containerview = containerview.delete(@options[:container])\n if containerview.code == '204'\n puts \"Container #{@options[:container]} deleted\"\n else\n @util.response_handler(containerview)\n end\n end", "def destroy\n @record = Asset.find(params[:id])\n @record.trash\n respond_to do |format| \n format.json { head :no_content }\n end\n end", "def destroy\n @swarm_behavior.destroy\n respond_to do |format|\n format.html { redirect_to swarm_behaviors_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @mystic.destroy\n respond_to do |format|\n format.html { redirect_to mystics_url }\n format.json { head :no_content }\n end\n end", "def destroy\n render_json_auto @survey.delete_logic_control_rule(params[:id].to_i) and return\n end", "def destroy\n id = @slideshow.id\n @slideshow.delete\n render :json => {:id => id}\n end", "def destroy\n @go_slim = GoSlim.find(params[:id])\n @go_slim.destroy\n\n respond_to do |format|\n format.html { redirect_to go_slims_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @dog = Dog::Dog.find(params[:id])\n @dog.destroy\n\n respond_to do |format|\n format.html { redirect_to dog_dogs_url }\n format.json { head :ok }\n end\n end", "def delete_json(path)\n url = [base_url, path].join\n resp = HTTParty.delete(url, headers: standard_headers)\n parse_json(url, resp)\n end", "def delete(container_name, file_name)\n validate_path_elements(container_name, file_name)\n\n client.request(\n method: :delete,\n path: \"#{container_name}/#{file_name}\",\n expected: 204\n )\n end", "def delete(path)\n RestClient.delete request_base+path\n end", "def destroy\n @experiment_control = ExperimentControl.find(params[:id])\n @experiment_control.destroy\n\n respond_to do |format|\n format.html { redirect_to experiment_controls_url }\n format.json { head :no_content }\n end\n end", "def destroy\n compute.delete_flavor(params[:id])\n \n\n respond_to do |format|\n format.html { redirect_to flavors_path }\n format.json { head :ok }\n end\n end", "def destroy\n @advocacy = Advocacy.find(params[:id])\n @advocacy.destroy\n\n respond_to do |format|\n format.html { redirect_to advocacies_url }\n format.json { head :ok }\n end\n end", "def delete(options={})\n connection.delete(\"/\", @name)\n end", "def delete\n super \"/templates/#{template_id}.json\", {}\n end", "def destroy\n @monkey = Monkey.find(params[:id])\n @monkey.destroy\n\n respond_to do |format|\n format.html { redirect_to monkeys_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @pharmacy.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "def destroy\n @storage = @client.storages.find(params[:id])\n @storage.destroy\n\n respond_to do |format|\n format.html { redirect_to client_url(@client) }\n format.json { head :no_content }\n end\n end", "def destroy\n @three.destroy\n respond_to do |format|\n format.html { redirect_to threes_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @konfig = Konfig.find(params[:id])\n @konfig.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_konfigs_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @patient.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "def destroy\n @api_post.destroy\n\n head :no_content\n end", "def destroy\n @aspect = Aspect.find(params[:id])\n @aspect.destroy\n\n respond_to do |format|\n format.html { redirect_to(aspects_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @reflection = Reflection.find(params[:id])\n @reflection.destroy\n\n respond_to do |format|\n format.html { redirect_to reflections_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @ocat = Ocat.find(params[:id])\n @ocat.destroy\n\n respond_to do |format|\n format.html { redirect_to ocats_url }\n format.json { head :no_content }\n end\n end", "def delete\n api(\"Delete\")\n end", "def delete\n client.delete(url)\n @deleted = true\nend", "def destroy\n record = Asset.find(params[:id])\n record.destroy\n\n respond_to do |format| \n format.json { head :no_content }\n end\n end", "def destroy\n @dog_poly.destroy\n respond_to do |format|\n format.html { redirect_to dog_polies_url, notice: 'Dog poly was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @appliance.destroy\n respond_to do |format|\n format.html { redirect_to user_appliances_url, notice: 'Appliance was successfully destroyed.' }\n format.json { head :no_content }\n end\n=======\nend", "def destroy\n @ruby.destroy\n respond_to do |format|\n format.html { redirect_to rubies_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @beattape = Beattape.find(params[:id])\n @beattape.destroy\n\n respond_to do |format|\n format.html { redirect_to beattapes_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @api_noun = Api::Noun.find(params[:id])\n @api_noun.destroy\n\n respond_to do |format|\n format.html { redirect_to api_nouns_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @diet_type.destroy\n respond_to do |format|\n format.html { redirect_to diet_types_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @animal.destroy\n flash[:notice] = \"Animal type removed.\"\n redirect_to :back\n end", "def destroy\n IndicatorCategory.delete_hack(params[:id])\n\n respond_to do |format|\n format.html { redirect_to indicator_categories_url }\n format.json { head :ok }\n end\n end", "def destroy\n @ad = Ad.find(params[:id])\n @ad.destroy\nrender json: 1\n end", "def delete!\n request! :delete\n end", "def destroy\n @appliance_type = ApplianceType.find(params[:id])\n @appliance_type.destroy\n\n respond_to do |format|\n format.html { redirect_to appliance_types_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @droparea = Droparea.find(params[:id])\n @droparea.destroy\n @vehicle = Vehicle.find(1)\n\n respond_to do |format|\n format.html { redirect_to edit_post_url(@vehicle) }\n format.json { head :no_content }\n end\n end", "def destroy\n @octopus.destroy\n respond_to do |format|\n format.html { redirect_to octopi_url, notice: 'Octopus was successfully destroyed.' }\n format.json { head :no_content }\n end\n end" ]
[ "0.7078735", "0.70098305", "0.6943995", "0.6936795", "0.6925268", "0.68725455", "0.6822406", "0.6812868", "0.6735869", "0.67289764", "0.66958636", "0.66896856", "0.6671468", "0.6654652", "0.6633417", "0.6613773", "0.657441", "0.657441", "0.65690225", "0.65690225", "0.6568411", "0.65504986", "0.65367615", "0.6490065", "0.6482009", "0.64762264", "0.64615375", "0.64561737", "0.6430743", "0.6409319", "0.63976824", "0.63882655", "0.638772", "0.6364049", "0.6362601", "0.63524145", "0.63524145", "0.63524145", "0.63524145", "0.6351094", "0.6339083", "0.63302755", "0.63233113", "0.63227564", "0.6319332", "0.63190955", "0.629876", "0.6294049", "0.6293791", "0.6293409", "0.6273516", "0.62709993", "0.62707037", "0.62699264", "0.6265321", "0.6264972", "0.62617445", "0.62562996", "0.6255784", "0.6239812", "0.62373096", "0.62359977", "0.6234263", "0.62311447", "0.62266856", "0.6225341", "0.62224174", "0.6220643", "0.62190485", "0.62177116", "0.62170094", "0.62166965", "0.6216659", "0.6215189", "0.6214533", "0.62118083", "0.6211286", "0.6210767", "0.6210602", "0.62101233", "0.6207316", "0.6203567", "0.6203245", "0.6202842", "0.62001777", "0.6199309", "0.6197942", "0.6197037", "0.6197028", "0.6192356", "0.61916524", "0.61895984", "0.61845726", "0.6184402", "0.6182816", "0.6179174", "0.61740535", "0.61723113", "0.61717325", "0.6169352" ]
0.7201724
0
Use callbacks to share common setup or constraints between actions.
def set_animalcontrol @animalcontrol = Animalcontrol.find(params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "def action_hook; end", "def run_actions; end", "def define_action_hook; end", "def actions; end", "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end", "def add_actions; end", "def callbacks; end", "def callbacks; end", "def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end", "def define_action_helpers; end", "def post_setup\n end", "def action_methods; end", "def action_methods; end", "def action_methods; end", "def before_setup; end", "def action_run\n end", "def execute(setup)\n @action.call(setup)\n end", "def define_action_helpers?; end", "def set_actions\n actions :all\n end", "def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end", "def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end", "def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end", "def before_actions(*logic)\n self.before_actions = logic\n end", "def setup_handler\n end", "def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end", "def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end", "def action; end", "def action; end", "def action; end", "def action; end", "def action; end", "def workflow\n end", "def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end", "def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end", "def before(action)\n invoke_callbacks *self.class.send(action).before\n end", "def process_action(...)\n send_action(...)\n end", "def before_dispatch(env); end", "def after_actions(*logic)\n self.after_actions = logic\n end", "def setup\n # override and do something appropriate\n end", "def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end", "def setup(_context)\n end", "def setup(resources) ; end", "def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end", "def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end", "def determine_valid_action\n\n end", "def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end", "def startcompany(action)\n @done = true\n action.setup\n end", "def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end", "def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end", "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end", "def define_tasks\n define_weave_task\n connect_common_tasks\n end", "def setup(&block)\n define_method(:setup, &block)\n end", "def setup\n transition_to(:setup)\n end", "def setup\n transition_to(:setup)\n end", "def action\n end", "def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend", "def config(action, *args); end", "def setup\n @setup_proc.call(self) if @setup_proc\n end", "def before_action \n end", "def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end", "def action\n end", "def matt_custom_action_begin(label); end", "def setup\n # override this if needed\n end", "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end", "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end", "def after(action)\n invoke_callbacks *options_for(action).after\n end", "def pre_task\n end", "def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end", "def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end", "def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end", "def setup_signals; end", "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end", "def initialize(*args)\n super\n @action = :set\nend", "def after_set_callback; end", "def setup\n #implement in subclass;\n end", "def lookup_action; end", "def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end", "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "def release_actions; end", "def around_hooks; end", "def save_action; end", "def setup(easy)\n super\n easy.customrequest = @verb\n end", "def action_target()\n \n end", "def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end", "def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end", "def before_setup\n # do nothing by default\n end", "def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end", "def default_action; end", "def setup(&blk)\n @setup_block = blk\n end", "def callback_phase\n super\n end", "def advice\n end", "def _handle_action_missing(*args); end", "def duas1(action)\n action.call\n action.call\nend", "def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end", "def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end", "def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend" ]
[ "0.6163163", "0.6045976", "0.5946146", "0.591683", "0.5890051", "0.58349305", "0.5776858", "0.5703237", "0.5703237", "0.5652805", "0.5621621", "0.54210985", "0.5411113", "0.5411113", "0.5411113", "0.5391541", "0.53794575", "0.5357573", "0.53402257", "0.53394014", "0.53321576", "0.53124547", "0.529654", "0.5296262", "0.52952296", "0.52600986", "0.52442724", "0.52385926", "0.52385926", "0.52385926", "0.52385926", "0.52385926", "0.5232394", "0.523231", "0.5227454", "0.52226824", "0.52201617", "0.5212327", "0.52079266", "0.52050185", "0.51754695", "0.51726824", "0.51710224", "0.5166172", "0.5159343", "0.51578903", "0.51522785", "0.5152022", "0.51518047", "0.51456624", "0.51398855", "0.5133759", "0.5112076", "0.5111866", "0.5111866", "0.5110294", "0.5106169", "0.509231", "0.50873137", "0.5081088", "0.508059", "0.50677156", "0.50562143", "0.5050554", "0.50474834", "0.50474834", "0.5036181", "0.5026331", "0.5022976", "0.5015441", "0.50121695", "0.5000944", "0.5000019", "0.4996878", "0.4989888", "0.4989888", "0.49864885", "0.49797225", "0.49785787", "0.4976161", "0.49683493", "0.4965126", "0.4958034", "0.49559742", "0.4954353", "0.49535993", "0.4952725", "0.49467874", "0.49423352", "0.49325448", "0.49282882", "0.49269363", "0.49269104", "0.49252945", "0.4923091", "0.49194667", "0.49174926", "0.49173003", "0.49171105", "0.4915879", "0.49155936" ]
0.0
-1
Never trust parameters from the scary internet, only allow the white list through.
def animalcontrol_params params.require(:animalcontrol).permit(:address, :name, :callback, :unitassigned, :problem, :comment) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "def allow_params_authentication!; end", "def allowed_params\n ALLOWED_PARAMS\n end", "def default_param_whitelist\n [\"mode\"]\n end", "def param_whitelist\n [:role, :title]\n end", "def expected_permitted_parameter_names; end", "def safe_params\n params.except(:host, :port, :protocol).permit!\n end", "def strong_params\n params.require(:team_member).permit(param_whitelist)\n end", "def permitir_parametros\n \t\tparams.permit!\n \tend", "def strong_params\n params.require(:community).permit(param_whitelist)\n end", "def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end", "def strong_params\n params.require(:education).permit(param_whitelist)\n end", "def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end", "def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end", "def param_whitelist\n [:rating, :review]\n end", "def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end", "def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end", "def valid_params_request?; end", "def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end", "def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end", "def strong_params\n params.require(:experience).permit(param_whitelist)\n end", "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end", "def allowed_params\n params.require(:allowed).permit(:email)\n end", "def permitted_params\n []\n end", "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end", "def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend", "def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end", "def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end", "def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end", "def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end", "def safe_params\n params.require(:user).permit(:name)\n end", "def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end", "def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend", "def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end", "def check_params; true; end", "def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end", "def quote_params\n params.permit!\n end", "def valid_params?; end", "def paramunold_params\n params.require(:paramunold).permit!\n end", "def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend", "def filtered_parameters; end", "def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end", "def filtering_params\n params.permit(:email, :name)\n end", "def check_params\n true\n end", "def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend", "def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend", "def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end", "def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end", "def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end", "def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend", "def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end", "def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end", "def active_code_params\n params[:active_code].permit\n end", "def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end", "def filtering_params\n params.permit(:email)\n end", "def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end", "def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end", "def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end", "def post_params\n if current_user.admin? \n params.permit(:title, :body, :city, :country, :gps_location, :privacy, :visible, :latitude, :longitude, images: [], files: [])\n else \n params.permit(:title, :body, :city, :country, :gps_location, :privacy,:latitude, :longitude, images: [], files: [])\n end \n end", "def list_params\n params.permit(:name)\n end", "def filter_parameters; end", "def filter_parameters; end", "def vineyard_params\n params.permit(:vineyard_name, :email, :website_url, :phone, :address, :city, :region, :postcode, :country, :specialty, :description, :pet_friendly, :holiday, :tours, :events, :family_friendly, :cover_image, :image_one, :image_two, :image_three, :image_four, :user_id, :base64)\n end", "def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end", "def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end", "def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end", "def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end", "def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end", "def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end", "def url_whitelist; end", "def admin_social_network_params\n params.require(:social_network).permit!\n end", "def filter_params\n params.require(:filters).permit(:letters)\n end", "def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end", "def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end", "def sensitive_params=(params)\n @sensitive_params = params\n end", "def permit_request_params\n params.permit(:address)\n end", "def user_params\n # Ensure a user can't give themselves admin priveleges\n params.delete(:admin) if current_user.admin?\n params.require(:user).permit(:name, :email, :admin, :image)\n end", "def secure_params\n params.require(:location).permit(:name)\n end", "def strong_params\n params.require( :setting ).\n permit( :global_scan_limit, :per_user_scan_limit,\n :target_whitelist_patterns, :target_blacklist_patterns )\n end", "def question_params\n params.require(:survey_question).permit(question_whitelist)\n end", "def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end", "def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end", "def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end", "def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end", "def url_params\n params[:url].permit(:full)\n end", "def backend_user_params\n params.permit!\n end", "def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend", "def speed_measurement_params\n\n #fuckit, to lazy to deal with permit crap right now\n ActionController::Parameters.permit_all_parameters = true\n\n params[:speed_measurement]\n end", "def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end", "def get_params\r\n #params.require(:article).permit(:title, :permalink, :content, :source_site, :introtext, :type_id, :order_by, :searchable, :created_by, :edited_by, :published_by, :published_on, :user_id)\r\n params.require(:article).permit!\r\n\r\n end", "def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end", "def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end", "def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end", "def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end", "def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end" ]
[ "0.6980384", "0.6782743", "0.6746196", "0.6742575", "0.6736", "0.6594004", "0.65037984", "0.6496699", "0.64819324", "0.64791185", "0.6456292", "0.64403296", "0.63795286", "0.6375975", "0.6365291", "0.63210756", "0.6300542", "0.6299717", "0.62943304", "0.6292561", "0.6290683", "0.6290449", "0.6282986", "0.6241265", "0.62392694", "0.62192893", "0.621427", "0.62099457", "0.6195319", "0.61785376", "0.61747766", "0.6172739", "0.6162921", "0.6152228", "0.6152062", "0.6148811", "0.6122391", "0.6117956", "0.61083806", "0.6106195", "0.609274", "0.60815483", "0.60710186", "0.6064253", "0.60213476", "0.6018128", "0.60146624", "0.601063", "0.60068774", "0.60068774", "0.60026145", "0.6000521", "0.59987193", "0.5992379", "0.59922844", "0.5991889", "0.59803206", "0.5966244", "0.5959778", "0.5959708", "0.59588563", "0.5956974", "0.5953329", "0.59528023", "0.59439695", "0.59413165", "0.59397036", "0.59397036", "0.5933782", "0.59323835", "0.59258395", "0.59253365", "0.5917244", "0.59111005", "0.59093463", "0.5907942", "0.59047514", "0.58979666", "0.58971125", "0.589613", "0.5895083", "0.5893643", "0.5892825", "0.5887658", "0.5883417", "0.5878839", "0.5874345", "0.5869008", "0.5868205", "0.58672875", "0.5867031", "0.58662426", "0.5864551", "0.5863614", "0.5862626", "0.5861952", "0.58596134", "0.5855716", "0.58536863", "0.5851665", "0.5850823" ]
0.0
-1
Reset the configuration settings
def reset @@config_instance = nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reset_config\n config.reset_to_defaults\n end", "def reset_config\n\t\t\t@config = {}\n\t\tend", "def reset\n @config = empty_config\n end", "def reset\n @config = nil\n end", "def reset\n @config = Config.new\n end", "def reset_configuration\n @configuration = nil\n end", "def reset\n Configuration.new\n end", "def reset\n @configuration = Configuration.new\n end", "def reset\n self.configuration = Configuration.new\n end", "def reset!\n @config = Configuration.new\n end", "def reset\n @config = {}\n write_config\n end", "def reset\n configure({})\n end", "def reset\n CONFIGURATION_DEFAULTS.each { |k, v| send(\"#{k}=\", v) }\n self\n end", "def reset!\n self.configuration = Configuration.new\n end", "def reset\n reset_config\n reset_driver\n end", "def reset_config!\n @log = nil\n @logger = nil\n @log_level = nil\n end", "def reset_config!\n @log = nil\n @logger = nil\n @log_level = nil\n end", "def reset\n reset_adapters\n reset_config\n reset_handlers\n reset_hooks\n end", "def reset\n VALID_CONFIG_OPTIONS.each { |opt| self.reset_attribute(opt) }\n end", "def reset_configuration!\n @configuration = Auth::Configuration.new\n end", "def reset\n @config_file = nil\n set_defaults\n load_from_file if config_file\n end", "def reset\n self.configuration = ({})\n config_contexts.values.each(&:reset)\n end", "def reload_config\n @config = nil\n end", "def reset\n VALID_CONFIG_OPTIONS.each { |opt| self.send(\"#{opt}=\", nil) }\n self.logger = nil\n end", "def reset_conf(&block)\n reset_conf_sub\n yield\n\n # reset again to go back to default setting later. Otherwise,\n # above setting is kept later.\n reset_conf_sub\n end", "def reset\n @config = nil\n @client = nil\n end", "def reset!\n @setting_objects = @setting_templates.map { |k, _| [k, []] }.to_h\n @settings.values.each(&:reset!)\n end", "def reset!\n @orm = @namespace = @source = @setting_class = nil\n self.config = nil\n self.raise_missing = nil\n self.report_missing = nil\n self.typecast_on_write = nil\n self.password_secret = nil\n end", "def reset!\n configure do |c|\n DEFAULTS.each { |k, v| c.send(\"#{k}=\", v) }\n end\n end", "def reset_settings\n Thread.current[:shoppe_settings] = nil\n end", "def reset_config\n configure do |config|\n config.provider = :payu\n\n # payu configuration\n config.pos_id = 999\n config.pos_auth_key = 'pos_auth_key'\n config.key1 = 'key1'\n config.key2 = 'key2'\n\n config.test_mode = false\n end\n end", "def reload_configuration!\n @configuration = nil\n end", "def reload_configuration!\n @configuration = nil\n end", "def reset!\n DeskApi::Configuration.keys.each do |key|\n send(\"#{key}=\", DeskApi::Default.options[key])\n end\n self\n end", "def clear\n self.configuration = {}\n end", "def reset(options={})\n options = {\n :clear => true\n }.merge(options)\n\n registry.each do |option|\n if option.respond_to?(:reset)\n option.reset\n end\n end\n\n config.clear if options[:clear]\n self\n end", "def reset!\n tap { set_defaults }\n end", "def reset\n set(default_preferences)\n end", "def reset(scope = :all)\n configuration.reset(scope)\n end", "def reset\n set Exchange::Configuration::DEFAULTS[key]\n end", "def reset_config!\n self.log = true\n self.logger = ::Logger.new STDOUT\n self.log_level = :debug\n self.raise_errors = true\n end", "def reset\n (@settings||{}).each do |name,instance| \n remove_setter(name)\n remove_getter(name)\n remove_boolean_getter(name)\n instance.destroy\n end\n @settings = Hash.new\n end", "def tcfg_reset\n @tcfg_resolved_config = nil\n end", "def reset_config!\n self.log = true\n self.logger = ::Logger.new STDOUT\n self.log_level = :debug\n self.raise_errors = true\n self.soap_version = SOAP::DefaultVersion\n self.strip_namespaces = true\n self.env_namespace = nil\n self.soap_header = {}\n end", "def reset!\n Netaxept::Configurable.keys.each do |key|\n instance_variable_set(:\"@#{key}\", Netaxept::Default.options[key])\n end\n\n HTTPI.logger = self.logger if self.logger\n HTTPI.log = self.log || self.debug\n HTTPI.log_level = self.log_level\n self\n end", "def reset!\n Whitehouse::Configurable.keys.each do |key|\n instance_variable_set(:\"@#{key}\", Whitehouse::Default.options[key])\n end\n self\n end", "def reset!\n @options = defaults\n end", "def reset!\n @options = defaults\n end", "def reset!\n @options = {}\n end", "def reset!\n reset_endpoints!\n reset_routes!\n reset_validations!\n end", "def reset_defaults; end", "def reset!\n @defaults.each { |key, value| instance_variable_set(key, value) }\n end", "def reset!\n @defaults.each { |key, value| instance_variable_set(key, value) }\n end", "def reset!\n @defaults.each do |k, v|\n instance_variable_set(k, v)\n end\n end", "def reset\n setup\n end", "def reset_active_model_configurations!\n self.class.reset_active_model_configurations!\n end", "def reset_to_defaults\n @config_stack = [ EnvironmentSource.new, DefaultSource.new ]\n reset_cache\n end", "def reset!\n @_store = {:default => Configatron::Store.new}\n end", "def reset!\n Foxkit::Configurable.keys.each do |key|\n instance_variable_set(:\"@#{key}\", Foxkit::Default.options[key])\n end\n self\n end", "def reset\n @git = nil\n @configuration = nil\n end", "def reset_conf_sub\n Juli::Util::Config.instance_variable_set('@singleton__instance__', nil)\n $_repo = nil\n end", "def reset\n self.options = nil\n self.option_processors = nil\n end", "def reload_config!\n @config = nil\n load_config!\n self\n end", "def reset!\n CodesWholesale::Configurable.keys.each do |key|\n instance_variable_set(:\"@#{key}\", CodesWholesale::Default.options[key])\n end\n self\n end", "def reconfig\n KEYS_AND_QUESTIONS.each do |key, question|\n ask_question_and_force_update_config(question, key)\n end\n config_update_success\n end", "def reset\n\n end", "def reconfig(config)\n self.config = config\n end", "def reset\n # TODO\n end", "def reset!\n self.mode = ::Klarna::DEFAULT_MODE\n self.country = ::Klarna::DEFAULT_COUNTRY\n self.store_id = nil\n self.store_secret = nil\n self.store_pclasses = nil\n #self.store_config_file = ::Klarna::DEFAULT_STORE_CONFIG_FILE\n self.logger = ::Logger.new(::STDOUT)\n self.logging = false\n self.http_logging = false\n end", "def reset!\n self.api_key \t = DEFAULT_API_KEY\n self.adapter = DEFAULT_ADAPTER\n self.endpoint = DEFAULT_ENDPOINT\n self.user_agent = DEFAULT_USER_AGENT\n self\n end", "def reset\n initialize(@options)\n end", "def reset\n VALID_CONFIG_KEYS.each do |k, v|\n send(\"#{k}=\", v)\n end\n self.rpc_spec_path = ::ENV.fetch('RPC_SPEC_PATH', DEFAULT_RSPEC_PATH).to_s\n options\n end", "def reset\n end", "def reset\n end", "def reset!\n Promisepay::Configurable.keys.each do |key|\n instance_variable_set(:\"@#{key}\", Promisepay::Default.options[key])\n end\n self\n end", "def reset\n self.api_key = DEFAULT_API_KEY\n self.user_agent = DEFAULT_USER_AGENT\n self.search_query_defaults = DEFAULT_SEARCH_SETTINGS\n self\n end", "def reset!\n Coinprism::Configurable.keys.each do |key|\n instance_variable_set(:\"@#{key}\", Coinprism::Default.options[key])\n end\n self\n end", "def reset!\n Vipps::Configurable.keys.each do |key|\n instance_variable_set(:\"@#{key}\", Vipps::Default.options[key])\n end\n\n HTTPI.logger = self.logger if self.logger\n HTTPI.log = self.log || self.debug\n HTTPI.log_level = self.log_level\n self\n end", "def reset\n self.adapter = DEFAULT_ADAPTER\n self.user_login = DEFAULT_USER_LOGIN\n self.user_password = DEFAULT_USER_PASSWORD\n self.endpoint = DEFAULT_ENDPOINT\n self.format = DEFAULT_FORMAT\n self.proxy = DEFAULT_PROXY\n self.cookie = DEFAULT_COOKIE\n self.user_agent = DEFAULT_USER_AGENT\n self\n end", "def reset!\n Gocdkit::Configurable.keys.each do |key|\n instance_variable_set(:\"@#{key}\", Gocdkit::Default.options[key])\n end\n self\n end", "def reset\n self.adapter = DEFAULT_ADAPTER\n self.username = DEFAULT_USERNAME\n self.password = DEFAULT_PASSWORD\n self.organization = DEFAULT_ORGANIZATION\n self.endpoint = DEFAULT_ENDPOINT\n self.version = DEFAULT_VERSION\n self.path_prefix = DEFAULT_PATH_PREFIX\n self.proxy = DEFAULT_PROXY\n self.user_agent = DEFAULT_USER_AGENT\n self.connection_options = DEFAULT_CONNECTION_OPTIONS\n self\n end", "def reset!(reset_config=false)\n queue.clear\n ActiveSupport::Deprecation.behavior = @original_behavior if @original_behavior\n ActiveSupport::Notifications.unsubscribe(@subscriber) if @subscriber\n @registered = false\n\n if reset_config\n self.config = DEFAULT_CONFIG.dup\n @configured = false\n end\n end", "def clear(config)\n Array(config).each do |setting|\n delete_setting setting\n end\n end", "def reset\n @options = VALID_OPTIONS_KEYS.inject({}) do |opts, k|\n default_option = OnTheSnow::Config.const_get(\"DEFAULT_#{k.upcase}\")\n self.send(\"#{k}=\", default_option)\n opts[k.to_s] = default_option #unless default_option.nil?\n opts\n end\n self\n end", "def reset!\n @apps = {}\n @default_params = {}\n @basic_auth = nil\n end", "def reset!\n Unleashed::Configurable.keys.each do |key|\n instance_variable_set(:\"@#{key}\", Unleashed::Default.options[key])\n end\n\n self\n end", "def reset\n self.adapter = DEFAULT_ADAPTER\n self.endpoint = DEFAULT_ENDPOINT\n self.proxy = DEFAULT_PROXY\n self.user_agent = DEFAULT_USER_AGENT\n # self.response = DEFAULT_RESPONSE\n self.faraday_options = DEFAULT_FARADAY_OPTIONS\n self.login = DEFAULT_LOGIN\n self.pass = DEFAULT_PASS\n self\n end", "def reset\n end", "def reset\n end", "def reset\n end", "def reset\n end", "def reset\n initialize\n setup\n end", "def reset!\n defaults = Settler.config[self.key]\n self.label = defaults['label']\n self.value = defaults['value']\n self.editable = defaults['editable']\n self.deletable = defaults['deletable']\n self.deleted = false\n save(:validate => false)\n end", "def reset()\n \n end", "def reset!\n @options = Name.defaults.dup\n end", "def reset\n\n end", "def reset!\n HeiaHeia::Configurable.keys.each do |key|\n instance_variable_set(:\"@#{key}\", HeiaHeia::Default.options[key])\n end\n self\n end", "def reset!\n self.api_key = nil\n self.host = nil\n self.request_headers = nil\n self.version = nil\n self.retry_max_count = nil\n self.retry_wait_seconds = nil\n self.return_response = nil\n self.logger = nil\n @settings = nil\n end", "def reset!\n @application_name = NgpVan::Default.application_name\n @api_key = NgpVan::Default.api_key\n @api_endpoint = NgpVan::Default.api_endpoint\n @user_agent = NgpVan::Default.user_agent\n self\n end", "def reset!\n self.adapter = MarkupMechanic::DefaultAdapter\n self.logger = Rails.logger\n self.debug_mode = Rails.env.development?\n end" ]
[ "0.86073565", "0.84943277", "0.84462464", "0.8248292", "0.8238612", "0.82028466", "0.8197753", "0.8167996", "0.8163731", "0.8154217", "0.81309843", "0.81278926", "0.8086907", "0.79412115", "0.79251504", "0.7911866", "0.7911866", "0.7816713", "0.7629745", "0.7601162", "0.75837153", "0.7574102", "0.75657797", "0.75438035", "0.753674", "0.7486698", "0.74434674", "0.7431463", "0.74292934", "0.74150574", "0.74131924", "0.73054594", "0.73054594", "0.7246344", "0.72392935", "0.7200735", "0.7131098", "0.71267176", "0.7123555", "0.712158", "0.7120967", "0.711267", "0.7110513", "0.70878637", "0.70544255", "0.70037895", "0.69836473", "0.69836473", "0.69632447", "0.6953042", "0.6939754", "0.69383943", "0.69383943", "0.6933276", "0.69322276", "0.6929085", "0.68845946", "0.68831277", "0.6861507", "0.68083775", "0.6796756", "0.67939323", "0.67926425", "0.67874664", "0.677562", "0.675815", "0.67568153", "0.67278177", "0.6709721", "0.6706518", "0.66935563", "0.66908514", "0.66853637", "0.66853637", "0.6673304", "0.6656866", "0.66495454", "0.66461986", "0.6645048", "0.6638566", "0.66270596", "0.6625164", "0.6616523", "0.66151094", "0.66145515", "0.661074", "0.6610018", "0.6593943", "0.6593943", "0.6593943", "0.6593943", "0.65910333", "0.6588935", "0.65876395", "0.65856904", "0.6585174", "0.65834045", "0.6570459", "0.6566752", "0.6564554" ]
0.78899163
17
Create a new Config instance
def initialize @options = {} end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_config\n self.config = {} if !self.config\n end", "def create_config\n self.config = {} if !self.config\n end", "def new\n @config_value = ConfigValue.new\n end", "def config\n @config ||= Config.create ConfigLoader.new(root, CONFIG_FILE).to_hash, options.merge_config\n end", "def cfg_create(cfg)\n obj_create cfg, ZoneConfiguration\n end", "def config\n @config ||= OpenStruct.new(YAML.load_file(self.config_path))\n end", "def initialize\n @config = DEFAULT_CONFIG.deep_dup\n end", "def create_config\n FileUtils.touch(config_file)\n \n @settings = {\n 'username' => 'username@loopiaapi',\n 'password' => 'password',\n 'remote' => 'https://api.loopia.se/RPCSERV',\n 'default_domain' => 'example.com',\n 'verbose' => 'true' \n }\n\n File.open(config_file, 'w' ) { |f| YAML.dump(@settings, f) }\n end", "def config\n @config ||= Config.new\n end", "def config\n @config ||= Config.new\n end", "def config( path = nil )\n if ( !@config )\n @config = Config.new( path )\n end\n\n @config\n end", "def new_config\n Config.new(\n # This field is expected in API responses\n # and should point to an individual resource with more data\n :uri_property_name => :href,\n # Total number of entries\n # Used to paginate lists\n :total_entries_property_name => :total_entries,\n # Name of array property\n # that contains cureent page's entries\n :entries_property_name => :entries\n )\n end", "def configure_from_options\n if @options[:config]\n config = Configuration.new(@path, @options[:config])\n config.from_options\n end\n end", "def initialize\n @config = OpenStruct.new\n end", "def config=(options={})\n @config = Configuration.new(options)\n end", "def initialize(options)\n @config = Config.new(options)\n end", "def instantiate_configuration(options={}) #:nodoc:\n Capistrano::Configuration.new(options)\n end", "def initialize(config)\n raise TypeError, \"'config' needs to be a string\" unless config.is_a?(String)\n raise TypeError, \"Configuration file '#{config}' cannot be found\" unless File.exist? config\n\n begin\n # open base config\n @config = load(config)\n # set default value if key? does not exist\n @config.default = nil\n @@config = config\n rescue StandardError => e\n print_error \"Fatal Error: cannot load configuration file '#{config}' : #{e.message}\"\n print_more e.backtrace\n exit(1)\n end\n\n @@instance = self\n end", "def as_config\n Configureasy::Config.new self.parse\n end", "def create!\n adapter.transaction do\n @config.each do |key, config|\n create_or_update!(key, config)\n end\n end\n end", "def initialize\n @config = config_from_file || empty_config\n end", "def create_config \n @config = ::Capistrano::Configuration.new\n if @cloud.debug || @cloud.verbose \n @config.logger.level = @cloud.debug ? ::Capistrano::Logger::MAX_LEVEL : ::Capistrano::Logger::INFO\n else\n @config.logger.level = ::Capistrano::Logger::IMPORTANT\n end\n \n capfile = returning Array.new do |arr|\n Dir[\"#{::File.dirname(__FILE__)}/recipies/*.rb\"].each {|a| arr << \"require '#{a}'\" }\n arr << \"ssh_options[:keys] = '#{@cloud.full_keypair_basename_path}'\"\n \n arr << set_poolparty_roles\n end.join(\"\\n\")\n \n @config.provisioner = self\n @config.cloud = @cloud\n \n @config.load(:string => capfile)\n \n @cloud.deploy_file ? @config.load(@cloud.deploy_file) : @config.set(:user, @cloud.user)\n end", "def config\n @config ||= Configuration.new\n end", "def config(cfg)\n @options = Options.new(cfg)\n end", "def initialize(config = {})\n @config = OpenStruct.new(config)\n validate_config!\n end", "def initialize(config=nil)\n @config = Util.to_hash(config)\n end", "def initialize attributes={}\n self.config = attributes[:config]\n end", "def load_config!\n if options[:config]\n config_inst = Config.new(options[:config])\n elsif self.class.const_defined?(:DEFAULT_CONFIGURATION_FILES)\n path = self.class.const_get(:DEFAULT_CONFIGURATION_FILES).detect do |check|\n full_check = File.expand_path(check)\n File.exists?(full_check)\n end\n config_inst = Config.new(path) if path\n end\n if config_inst\n options.delete(:config)\n defaults_inst = Smash[\n config_class.new(\n defaults.to_smash\n ).to_smash.find_all do |key, value|\n defaults.key?(key)\n end\n ]\n config_data = config_inst.data\n config_inst = Smash[\n config_inst.to_smash.find_all do |key, value|\n config_data.key?(key)\n end\n ]\n options_inst = Smash[\n config_class.new(\n options.to_smash\n ).to_smash.find_all do |key, value|\n options.key?(key)\n end\n ]\n @options = config_class.new(\n defaults_inst.to_smash.deep_merge(\n config_inst.to_smash.deep_merge(\n options_inst.to_smash\n )\n )\n ).to_smash\n else\n @options = config_class.new(\n defaults.to_smash.deep_merge(\n options.to_smash\n )\n ).to_smash\n end\n options\n end", "def config(&block)\n if block_given?\n @@config = Config.new\n @@config.tap(&block)\n else\n @@config\n end\n end", "def load_config!\n if(options[:config])\n config_inst = config_class.new(options[:config])\n elsif(self.class.const_defined?(:DEFAULT_CONFIGURATION_FILES))\n path = self.class.const_get(:DEFAULT_CONFIGURATION_FILES).detect do |check|\n full_check = File.expand_path(check)\n File.exists?(full_check)\n end\n config_inst = config_class.new(path) if path\n end\n if(config_inst)\n options.delete(:config)\n @options = config_class.new(\n defaults.to_smash.deep_merge(\n config_inst.to_smash.deep_merge(\n options.to_smash\n )\n )\n ).to_smash\n else\n @options = config_class.new(\n defaults.to_smash.deep_merge(\n options.to_smash\n )\n ).to_smash\n end\n options\n end", "def initialize\n create_config unless File.exists?(config_file)\n load_settings\n set_domain\n end", "def config(opts=nil)\n return @@config if opts.nil?\n @@config = Config.new opts\n end", "def initialize(config = {})\n @config = config\n end", "def create\n @config = Config.new(config_params)\n\n respond_to do |format|\n if @config.save\n format.html { redirect_to @config, notice: \"Config was successfully created.\" }\n format.json { render :show, status: :created, location: @config }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @config.errors, status: :unprocessable_entity }\n end\n end\n end", "def from_config\n config ||= YAML::load(File.open((File.join(File.dirname(__FILE__), 'config.yml'))))\nend", "def load_config()\n self.config = Kitchenplan::Config.new().config\n end", "def initialize(config = {})\n init_config(config)\n end", "def initialize(config = {})\n init_config(config)\n end", "def initialize(config = {})\n init_config(config)\n end", "def initialize(config_path = nil)\n @config = Configuration.new(config_path)\n @errors = {}\n end", "def get_instance(payload)\n ConfigurationInstance.new(@version, payload)\n end", "def config\n @configuration ||= Configuration.new\n end", "def config\n @configuration ||= Configuration.new\n end", "def instance_by_config(config)\n klass = config[:klass] || config[:class_name].constantize\n klass.new(config)\n end", "def initialize\n @configuration = Configuration.new\n end", "def initialize(config={})\n @config = config\n end", "def config\n unless @config\n @config = Configuration.new\n @config.reset\n end\n @config\n end", "def create_config\n Time.use_zone(screen.time_zone) do\n self.start_time ||= Time.zone.parse(ConcertoConfig[:content_default_start_time], Clock.time + ConcertoConfig[:start_date_offset].to_i.days)\n self.end_time ||= Time.zone.parse(ConcertoConfig[:content_default_end_time], Clock.time + ConcertoConfig[:start_date_offset].to_i.days + ConcertoConfig[:default_content_run_time].to_i.days)\n end\n \n self.config = {} if !self.config\n self.config = default_config().merge(self.config)\n self.config\n end", "def initialize\n set_config\n end", "def initialize(attributes = {})\n attributes = ActiveSupport::HashWithIndifferentAccess.new attributes\n\n @config = attributes[:config]\n end", "def initialize(config)\n end", "def initialize(config)\n end", "def initialize\n configure_via_yaml\n configure_via_env\n end", "def create_configuration(name)\n # To create a configuration, we need to create or retrieve the configuration list\n \n created_config = build_configuration_list.create_config(name) do |config|\n yield config if block_given?\n end\n \n created_config\n end", "def instantiate_configuration #:nodoc:\n config = Webistrano::Configuration.new\n config.logger = logger\n config\n end", "def instantiate_configuration(options={})\n config = Capistrano::Configuration.new(options)\n config.logger = logger\n config\n end", "def initialize(config)\n @config = config\n end", "def initialize(config)\n @config = config\n end", "def config\n @config ||= load_config\n end", "def initialize(config = nil)\n @config = config\n end", "def config\n @config ||= Smartgen::Configuration.new\n end", "def config(&block)\n if block_given?\n c = Config.new\n c.instance_eval(&block)\n @config = c\n end\n\n @config ||= Config.new\n end", "def actual_config\n Config.instance\n end", "def config\r\n Configuration\r\n end", "def config\r\n Configuration\r\n end", "def config\r\n Configuration\r\n end", "def config\r\n Configuration\r\n end", "def config\r\n Configuration\r\n end", "def config\r\n Configuration\r\n end", "def config\n @config ||= YAML.load_file @options[:config_file]\n end", "def config\n Config.new(@sources, @deployments)\n end", "def initialize(app, config_options = {})\n super(app)\n @config = Config.new(config_options)\n end", "def initialize(config)\n\t\tend", "def initialize\n @conf = Hash.new\n @conf[:verbose] = 0\n @conf[:banner] = \"Usage: #{File.basename($0)} [options]\"\n @conf[:config_name] = Meta::NAME + '.yaml'\n @conf[:config_env] = Meta::NAME.upcase + '_CONF'\n @conf[:config_dirs] = DIR_CONFIG\n end", "def config\n @config ||= {}\n end", "def config\n @config ||= {}\n end", "def config\n @config ||= YAML.load File.read(@config_file)\n end", "def initialize(config)\n @config = config\n end", "def initialize(config)\n @config = config\n end", "def initialize(config)\n @config = config\n end", "def load_config\n project = if ENV['BOLT_PROJECT']\n Bolt::Project.create_project(ENV['BOLT_PROJECT'], 'environment')\n elsif options[:project]\n dir = Pathname.new(options[:project])\n if (dir + Bolt::Project::BOLTDIR_NAME).directory?\n Bolt::Project.create_project(dir + Bolt::Project::BOLTDIR_NAME)\n else\n Bolt::Project.create_project(dir)\n end\n else\n Bolt::Project.find_boltdir(Dir.pwd)\n end\n @config = Bolt::Config.from_project(project, options)\n rescue Bolt::Error => e\n fatal_error(e)\n raise e\n end", "def config\n @_config ||= Config.new\n yield @_config if block_given?\n @_config\n end", "def config\n @config ||= YAML.load_file(@config_file_path)\n end", "def initialize(conf,options={}) \n if conf.new.class == ZipMoney::Configuration\n @config = conf\n else\n raise ArgumentError, \"Config is not valid\"\n end\n @options = options\n end", "def initialize(config = {})\n super\n @config = config\n end", "def config=(config); end", "def config\n\t\t\t@config ||= begin\n\t\t\t\tfile = File.join(self.location, \"config.yaml\")\n\t\t\t\tif File.exists?(file)\n\t\t\t\t\tYAML::load_file(file)\n\t\t\t\telse\n\t\t\t\t\t{}\n\t\t\t\tend\n\t\t\tend\n\t\tend", "def new_config\n puts '####################################################################'\n puts '## Welcome to Fast Gitlab Issues configuration ##'\n puts \"####################################################################\\n\\n\"\n\n # -------------------------- #\n # CHECKERS #\n # -------------------------- #\n\n git_directory?\n already_configured?\n\n # -------------------------- #\n # INITIALIZERS #\n # -------------------------- #\n\n # The hash that will contain the project's fgi configuration to save as yml\n # It will contain :\n # :url\n # :routes\n # :project_id\n # :project_slug\n # :default_branch\n config = {}\n\n config[:git_service_class] = define_git_service\n config[:url] = save_git_url\n\n # Instanciation of the Git service class\n # TODO - HARD REFECTO NEEDED HERE...\n git_service = config[:git_service_class].new(config: config)\n config[:git_service] = git_service.to_sym\n user_token = save_user_token(config: config, git_service: git_service)\n project_name_and_id = define_project_name_and_id(git_service, user_token)\n config = config.merge(project_name_and_id)\n git_service = config[:git_service_class].new(config: config)\n config[:default_branch] = define_default_branch(git_service, user_token)\n\n # -------------------------- #\n # CREATORS #\n # -------------------------- #\n\n Fgi::Tokens.create_user_tokens_file(config: config, git_service: git_service, token: user_token)\n create_fgi_config_file(config)\n end", "def initialize(options) #:nodoc:\n self.config = OpenStruct.new(options)\n end", "def config\n (null_config? ? NoConfig.instance : actual_config)\n end", "def config\n Config.new(connection)\n end", "def configure\n raise 'Path is required' unless @resource[:path]\n arr = [\"create -b #{@resource[:create_args]}\"]\n\n # Then perform all of our configuration steps. It's annoying\n # that we need this much internal info on the resource.\n resource.properties.each do |property|\n next unless my_properties.include? property.name\n method = (property.name.to_s + '_conf').to_sym\n arr << send(method, @resource[property.name]) unless property.safe_insync?(properties[property.name])\n end\n setconfig(arr.join(\"\\n\"))\n end", "def initialize(*args)\n initialize_config unless instance_variable_defined?(:@config)\n super\n end", "def config_new\n cnf = GT::Style.new\n style_file = File.expand_path(\"config/default.style\",\n \"#{File.dirname(__FILE__)}/../..\")\n log \"new config, trying to load #{style_file}\", 2\n cnf.load_file style_file\n log \"new config, default.style loaded\", 2\n return cnf\n end", "def get_instance(payload)\n ConfigurationInstance.new(@version, payload, chat_service_sid: @solution[:chat_service_sid])\n end", "def config(&block)\n @config ||= Configuration.new\n instance_exec(@config, &block) if block_given?\n @config\n end", "def config\n @config = ActiveSupport::HashWithIndifferentAccess.new(@config) if @config.is_a? Hash\n @config\n end", "def initialize(config = nil)\n self.config = config || Cartage::Config.load(:default)\n end", "def initialize(conf = nil)\n @conf = conf || default_config\n end", "def initialize(config)\n case config\n when String\n @config = Snooper::Config.load config\n else\n @config = config\n end\n end", "def load_config\n @configuration = Configuration.find :first\n end" ]
[ "0.7425654", "0.7425654", "0.7048966", "0.70397705", "0.68793255", "0.6851928", "0.67711884", "0.6694753", "0.6663583", "0.6663583", "0.6648015", "0.66150254", "0.65808946", "0.6552033", "0.6499801", "0.6471179", "0.64452463", "0.64413464", "0.6425567", "0.64208513", "0.64157766", "0.6403457", "0.6400465", "0.63877046", "0.6378388", "0.637677", "0.63443595", "0.6331345", "0.6301422", "0.62984085", "0.629665", "0.62924176", "0.62559146", "0.62497544", "0.6233661", "0.62250495", "0.6224709", "0.6224709", "0.6224709", "0.62180054", "0.6214394", "0.6209185", "0.6209185", "0.6174036", "0.6169927", "0.6163609", "0.6155729", "0.61547047", "0.61533135", "0.61521256", "0.61449456", "0.61449456", "0.6139399", "0.6138775", "0.6131686", "0.61186594", "0.611662", "0.611662", "0.61091316", "0.61051124", "0.610236", "0.60956365", "0.60761774", "0.6073586", "0.6073586", "0.6073586", "0.6073586", "0.6073586", "0.6073586", "0.60607547", "0.6056901", "0.6052866", "0.6048893", "0.6045668", "0.60378104", "0.60378104", "0.6036929", "0.6027531", "0.6027531", "0.6027531", "0.60197157", "0.60174024", "0.6016942", "0.60161173", "0.600532", "0.59989417", "0.5996935", "0.5980167", "0.5971021", "0.594653", "0.5944257", "0.59393114", "0.593787", "0.593642", "0.59318405", "0.5925597", "0.5922361", "0.5919579", "0.5918041", "0.5917447", "0.5915132" ]
0.0
-1
Load a Config instance
def load(args = nil) @options[:config_file] = ENV['UBSAFE_CONFIG_FILE'] unless ENV['UBSAFE_CONFIG_FILE'].nil? #puts "UBConfig.load After env check @options #{@options.inspect}" @options.merge!(parse_args(args)) #puts "UBConfig.load After merge @options #{@options.inspect}" if @options[:config_file] @options.merge!(load_config_file(@options[:config_file])) end configure_logging end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def config_load(config); end", "def load_config\n @configuration = Configuration.find :first\n end", "def load_config\n if ::File.file?(CONFIG_PATH)\n config = ::OpenStruct.new\n config.reflected_validations = @@reflected_validations\n silence_warnings do\n eval(::IO.read(CONFIG_PATH), binding, CONFIG_PATH)\n end\n end\n end", "def load(options = HashWithIndifferentAccess.new)\n config = load_config_file(options[:config])\n import_config(config, options)\n end", "def load_config!\n if options[:config]\n config_inst = Config.new(options[:config])\n elsif self.class.const_defined?(:DEFAULT_CONFIGURATION_FILES)\n path = self.class.const_get(:DEFAULT_CONFIGURATION_FILES).detect do |check|\n full_check = File.expand_path(check)\n File.exists?(full_check)\n end\n config_inst = Config.new(path) if path\n end\n if config_inst\n options.delete(:config)\n defaults_inst = Smash[\n config_class.new(\n defaults.to_smash\n ).to_smash.find_all do |key, value|\n defaults.key?(key)\n end\n ]\n config_data = config_inst.data\n config_inst = Smash[\n config_inst.to_smash.find_all do |key, value|\n config_data.key?(key)\n end\n ]\n options_inst = Smash[\n config_class.new(\n options.to_smash\n ).to_smash.find_all do |key, value|\n options.key?(key)\n end\n ]\n @options = config_class.new(\n defaults_inst.to_smash.deep_merge(\n config_inst.to_smash.deep_merge(\n options_inst.to_smash\n )\n )\n ).to_smash\n else\n @options = config_class.new(\n defaults.to_smash.deep_merge(\n options.to_smash\n )\n ).to_smash\n end\n options\n end", "def load\n $LOG.debug \"Config::load\"\n\n filepath = cfgFilePath(\"pdconfig.yml\")\n if(!File.exists?( filepath )) # TODO: This needs to be moved into KtCfg.\n $LOG.debug \"Config file does not exist. Returning default config obj.\"\n return @cfg\n end\n\n @cfg = read(\"pdconfig.yml\")\n end", "def load_config!\n if(options[:config])\n config_inst = config_class.new(options[:config])\n elsif(self.class.const_defined?(:DEFAULT_CONFIGURATION_FILES))\n path = self.class.const_get(:DEFAULT_CONFIGURATION_FILES).detect do |check|\n full_check = File.expand_path(check)\n File.exists?(full_check)\n end\n config_inst = config_class.new(path) if path\n end\n if(config_inst)\n options.delete(:config)\n @options = config_class.new(\n defaults.to_smash.deep_merge(\n config_inst.to_smash.deep_merge(\n options.to_smash\n )\n )\n ).to_smash\n else\n @options = config_class.new(\n defaults.to_smash.deep_merge(\n options.to_smash\n )\n ).to_smash\n end\n options\n end", "def config\n @config ||= YAML.load_file(@config_file_path)\n end", "def load_config\n self.config = JSON.load(self.data)\n end", "def load_config\n YAML::load_file(File.join(__dir__, '../config/config.yml'))\n end", "def load\n configuration # Need to call this to make sure it's populated\n self.instance_eval(IO.read(path), path, 1) if path && File.exists?(path)\n self\n end", "def config\n @config ||= YAML.load_file @options[:config_file]\n end", "def load_config\n path = File.expand_path(@config_path)\n\n if File.exist?(path)\n file = File.new(path, \"r\")\n @config = MultiJson.decode(file.read)\n else\n load_default_config\n end\n end", "def load_config\n # Nothing in base class. This should be used to load the configuration from\n # disk if saved to a file.\n configuration || {}\n end", "def config\n @config ||= OpenStruct.new(YAML.load_file(self.config_path))\n end", "def config\n @config ||= YAML.load File.read(@config_file)\n end", "def config\n @config ||= load_config\n end", "def load\n unless File.exist?(config_file)\n fail \"YAML file #{config_file} does not exist. Try 'bento-qemu init'.\"\n end\n @config = YAML.load_file(config_file)\n end", "def from_config\n config ||= YAML::load(File.open((File.join(File.dirname(__FILE__), 'config.yml'))))\nend", "def load(name)\n config_file \"#{name}\"\n end", "def load_config\n self.config = JSON.load(self.data)\n end", "def load_config\n self.config = JSON.load(self.data)\n end", "def load_config()\n self.config = Kitchenplan::Config.new().config\n end", "def load_config\n file = root+CONFIG_FILE_NAME\n @config = file.file? ? YAML.load_file(file) : { :shared_directories => [], :core_modules => [] }\n end", "def load_config!\n cfg_data = begin\n YAML.load(File.open(CONFIG_DIR + GLOBAL_CONFIG))\n rescue Errno::ENOENT\n Hash.new\n end\n __load_config(DEFAULTS.merge(cfg_data))\n end", "def read_config!\n @config = YAML.load_file(CONFIG_FILE)\n end", "def load_config_file\n require 'yaml'\n YAML.load_file(@path)\n rescue Errno::ENOENT\n return\n end", "def load_config(config_file)\n YAML.load(File.open(config_file))\nend", "def load_config\n config_file = File.join(Dir.home, \".assemblotron\")\n if File.exists? config_file\n @log.debug \"config file found at #{config_file}\"\n config = YAML::load_file(config_file)\n if config.nil?\n @log.warn \"config file malformed or empty\"\n return\n end\n @config = config.deep_symbolize\n end\n end", "def config\n ensure_config_exists\n @config ||= (YAML.load_file(config_file) || {})\n end", "def load_configuration\n @config = {\n :start_date => Date.today - 1,\n :data_dir => default_data_dir\n }\n\n if File.exist?(config_file)\n @config = YAML.load_file(config_file)\n end\n\n @config\n end", "def config\n @config ||= Config.create ConfigLoader.new(root, CONFIG_FILE).to_hash, options.merge_config\n end", "def load_configuration\n config_path = options.fetch(:config_path) do\n root.join('brief.rb')\n end\n\n if config_path.exist?\n instance_eval(config_path.read)\n end\n end", "def load!(filename)\n config_file = File.open(filename).read\n config = YAML.load(config_file)\n raise ConfigError(\"unable to load config file #{filename}\") unless config\n @_config = config\n end", "def load_config\n cfg = File.open(CONFIG) { |yf| YAML::load( yf ) } if File.exists?(CONFIG)\n # => Ensure loaded data is a hash. ie: YAML load was OK\n if cfg.class != Hash\n raise \"ERROR: Configuration - invalid format or parsing error.\"\n else\n if cfg['login'].nil?\n raise \"ERROR: Configuration: login not defined.\"\n end\n end\n\n return cfg\nend", "def load!\n if !loaded?\n @loaded = true\n @logger.info(\"Loading configuration...\")\n load_config!\n end\n\n self\n end", "def load_config( filename )\n\n fullname = \"#{Rails.application.root}/config/#{filename}\"\n begin\n config_erb = ERB.new( IO.read( fullname ) ).result( binding )\n rescue StandardError => ex\n raise( \"#{filename} could not be parsed with ERB. \\n#{ex.inspect}\" )\n end\n\n begin\n yml = YAML.load( config_erb )\n rescue Psych::SyntaxError => ex\n raise \"#{filename} could not be parsed as YAML. \\nError #{ex.message}\"\n end\n\n config = yml.symbolize_keys\n @configuration = config[ Rails.env.to_sym ].symbolize_keys || {}\n end", "def config\n\tYAML.load(File.open(\"config.yaml\"))\nend", "def load_config\n config_data = File.read(app_config_file)\n YAML.load(config_data) || {}\n end", "def load_config(config_file)\n @config = YAML.load_file config_file\n @config = Hashie::Mash.new(@config) if @config\n\n Booru.import_config @config.booru\n end", "def configure_from_options\n if @options[:config]\n config = Configuration.new(@path, @options[:config])\n config.from_options\n end\n end", "def config\n\t\t\t@config ||= begin\n\t\t\t\tfile = File.join(self.location, \"config.yaml\")\n\t\t\t\tif File.exists?(file)\n\t\t\t\t\tYAML::load_file(file)\n\t\t\t\telse\n\t\t\t\t\t{}\n\t\t\t\tend\n\t\t\tend\n\t\tend", "def load_config()\n Kitchenplan::Log.debug \"Loading configs from #{self.options[:config_dir]} ...\"\n #Kitchenplan::Log.debug self.platform.ohai.inspect\n self.config = Kitchenplan::Config.new(self.platform.ohai, parse_configs=true,config_path=self.options[:config_dir]).config()\n end", "def load_from(path)\n self.configure(Halcyon::Config::File.load(path))\n self\n end", "def load_configuration\n config = options[\"config\"]\n return unless config\n\n Mihari.load_config_from_yaml config\n Database.connect\n end", "def load_config\n\t\t\t\tif defined? RAILS_ROOT\n\t\t\t\t\tconfig_path = File.join(RAILS_ROOT,\"config\",\"label_service.yml\")\n\t\t\t\t\t#warn \"We're riding on Rails, expecting LabelService config file to be located at: #{config_path}\"\n\t\t\t\telse\n\t\t\t\t\tconfig_path = File.join(LABEL_SERVICE_ROOT,\"../\",\"label_service.yml\")\n\t\t\t\t\twarn \"We're not riding on Rails, expecting LabelService config file to be located at: #{config_path}\"\n\t\t\t\tend\n\t\t\t\t\n\t\t\t\tif File.exists?(config_path)\n\t\t\t\t\tconfig_hash = YAML.load_file(config_path)\n\t\t\t\t\tself.config = OpenStruct.new(config_hash)\n\t\t\t\telse\n\t\t\t\t\traise LabelServiceError, \"No LabelService config file found!\"\n\t\t\t\tend\n\t\t\tend", "def load_config(file)\n @config = YAML.load_file(file)\n end", "def load config_file\n YAML.load_file(config_file).each do |parameter,value|\n instance_variable_set( \"@#{parameter}\", value )\n end\n end", "def load_config\n project = if ENV['BOLT_PROJECT']\n Bolt::Project.create_project(ENV['BOLT_PROJECT'], 'environment')\n elsif options[:project]\n dir = Pathname.new(options[:project])\n if (dir + Bolt::Project::BOLTDIR_NAME).directory?\n Bolt::Project.create_project(dir + Bolt::Project::BOLTDIR_NAME)\n else\n Bolt::Project.create_project(dir)\n end\n else\n Bolt::Project.find_boltdir(Dir.pwd)\n end\n @config = Bolt::Config.from_project(project, options)\n rescue Bolt::Error => e\n fatal_error(e)\n raise e\n end", "def load_config\n if @type == :upload\n config_file = \"ul_config.xml\"\n else\n config_file = \"dl_config.xml\"\n end\n doc = Nokogiri::XML(open(\"config/#{config_file}\"))\n doc.search(@type.to_s).each do |config|\n @config_map[:ip] = get_content config, \"ip\"\n @config_map[:port] = get_content config, \"port\"\n @config_map[:user] = get_content config, \"user\"\n @config_map[:password] = get_content config, \"password\"\n @config_map[:remotedir] = get_content config, \"remotedir\"\n @config_map[:localdir] = get_content config, \"localdir\"\n\n @localfile = get_content config, \"localfile\"\n @remotefile = get_content config, \"remotefile\"\n\n @thread_num = get_content(config, \"thread_num\").to_i\n @sleep = get_content(config, \"sleep\").to_i\n @test = get_content(config, \"test\")\n end\n\n if @type == :upload\n @thread_num = @thread_num >= 10 ? @thread_num : 10\n end\n end", "def load()\n\n checkFileExists()\n loadConfigs()\n checkConfigs() \n end", "def load_config\n\t\t# load conifg\n\t\tend", "def load(options = {})\n update(options) # from the command line\n\n unless File.exist?(config_file)\n raise Error, \"Could not find configuration file: '#{config_file}'.\"\n end\n\n config = File.read(config_file)\n check_config_version!(config)\n\n dsl = DSL.new\n dsl.instance_eval(config, config_file)\n\n update(dsl._config_options) # from config.rb\n update(options) # command line takes precedence\n\n dirs = Dir[File.join(File.dirname(config_file), \"models\", \"*.rb\")]\n dirs.each do |model|\n dsl.instance_eval(File.read(model), model)\n end\n end", "def [](name)\n @config ||= {}\n @config[name.to_sym] ||= load(name)\n end", "def load_config!\n config = YAML.load_file @config_path\n\n unless config.key? @environment\n raise ClientError, \"No configuration found for specified environment `#{@environment}'\"\n end\n\n @config = config[@environment]\n @config.deeper_merge! DEFAULT_CONFIG\n\n emit :config_load\n end", "def load_config\n @config = YAML.safe_load(ERB.new(File.read(config_path)).result)\n @queue_ahead = @config[\"queue_ahead\"] || Task::DEFAULT_QUEUE_AHEAD_MINUTES\n @queue_name = @config[\"queue_name\"] || \"default\"\n @time_zone = @config[\"tz\"] || Time.zone.tzinfo.name\n @config.delete(\"queue_ahead\")\n @config.delete(\"queue_name\")\n @config.delete(\"tz\")\n end", "def load_config\n if @configfile.nil?\n loader = R10K::Deployment::Config::Loader.new\n @configfile = loader.search\n if @configfile.nil?\n raise ConfigError, \"No configuration file given, no config file found in current directory, and no global config present\"\n end\n end\n begin\n @config = ::YAML.load_file(@configfile)\n apply_config_settings\n rescue => e\n raise ConfigError, \"Couldn't load config file: #{e.message}\"\n end\n end", "def load_config(file_path)\n config = OpenStruct.new\n YAML.load_file(file_path).each do |k,v|\n config.send(\"#{k}=\", v)\n end\n return config\n end", "def load_config!\n return unless options.empty?\n\n data = ::YAML.load_file(File.open(\"#{directory.path}/supernova.yml\", \"r\"))\n load_paths.push(*data.fetch(\"load_paths\", []))\n\n load_paths.map! do |path|\n File.absolute_path(path, directory.path)\n end\n\n @options = data\n end", "def config\n raise ScribdFuError, \"#{ConfigPath} does not exist\" unless File.file?(ConfigPath)\n\n # Load the config file and strip any whitespace from the values\n @config ||= YAML.load_file(ConfigPath).each_pair{|k,v| {k=>v.to_s.strip}}.symbolize_keys!\n end", "def [](name)\n @_configs ||= {}\n @_configs[name.to_sym] ||= load(name)\n end", "def load_config_file\n raise \"No config file set\" if config_file.nil?\n raise \"File #{config_file} does not exist\" unless File.file?(config_file)\n @config = YAML.load_file(config_file)\n @config_file_loaded = true\n @config.each { |k, v| send(\"#{k}=\", v) }\n end", "def load_conf(*path)\n manager.load_configuration(*path)\n end", "def load_config\n if @configfile.nil?\n loader = R10K::Deployment::Config::Loader.new\n @configfile = loader.search\n if @configfile.nil?\n raise ConfigError, \"No configuration file given, no config file found in parent directory, and no global config present\"\n end\n end\n begin\n @config = YAML.load_file(@configfile)\n apply_config_settings\n rescue => e\n raise ConfigError, \"Couldn't load config file: #{e.message}\"\n end\n end", "def load_config\n file = config_file\n unless file\n if chdir\n file = Dir.glob(File.join(chdir, GLOB_CONFIG)).first\n else\n file = Dir.glob(GLOB_CONFIG).first\n end\n end\n load file if file\n end", "def load_from(path)\n Halcyon::Config::File.load(path)\n end", "def load_settings\n @settings = YAML::load(File.new(config_file, 'r'))\n end", "def load_config\n BeEF::Core::Configuration.new(\"#{$root_dir}/config.yaml\")\n BeEF::Core::Configuration.instance.load_extensions_config\n @config = BeEF::Core::Configuration.instance.get('beef.extension.metasploit')\n end", "def config( path = nil )\n if ( !@config )\n @config = Config.new( path )\n end\n\n @config\n end", "def load_config\n if !File.exists?('config.yml')\n raise \"The config.yml file is not present in the current directory. Run -setup to configure this file.\"\n end\n\n # Load the config.yml configuration file.\n config = YAML::load_file('config.yml')\n\n # Create the ars models context given values from the config.yml file.\n context = ArsModels::Context.new({\n :username => config['username'],\n :password => config['password'],\n :server => config['server'],\n :port => config['port']\n })\n context\nend", "def load_config\n begin\n @@stored_config ||= YAML.load(File.open(File.expand_path(\"#{File.dirname(__FILE__)}/../conf/sensei-client.yml\")))\n return @@stored_config\n rescue\n raise \"Could not find a conf/sensei-client.yml file\"\n end\n end", "def load\n config_files.each do |file|\n config = YAML::load(File.open(file))\n @config.merge! config\n end\n end", "def config\n path = config_path\n @config ||= path.exist? ? JSON.parse(path.read) : {}\n end", "def load(path, options = {})\n return nil unless path\n config_path = File.join(path, CONFIG_PATH)\n options = options.merge(path: path)\n return new_settings({}, options) unless File.exist?(config_path)\n config = YAML.load_file(config_path) || {}\n new_settings(config, options)\n end", "def load_app_config\n Object.const_set(\"AppConfig\", AppConfig.load!(configuration.app_config_file))\n end", "def load\n config = YAML.load_file @config_path\n @path = config['steam']\n end", "def load_config(path=nil)\n\t\tbegin\n\t\t\tconf = Msf::Config.load(path)\n\t\trescue\n\t\t\twlog(\"Failed to load configuration: #{$!}\")\n\t\t\treturn\n\t\tend\n\n\t\t# If we have configuration, process it\n\t\tif (conf.group?(ConfigGroup))\n\t\t\tconf[ConfigGroup].each_pair { |k, v|\n\t\t\t\tcase k.downcase\n\t\t\t\t\twhen \"activemodule\"\n\t\t\t\t\t\trun_single(\"use #{v}\")\n\t\t\t\tend\n\t\t\t}\n\t\tend\n\tend", "def initialize(config)\n raise TypeError, \"'config' needs to be a string\" unless config.is_a?(String)\n raise TypeError, \"Configuration file '#{config}' cannot be found\" unless File.exist? config\n\n begin\n # open base config\n @config = load(config)\n # set default value if key? does not exist\n @config.default = nil\n @@config = config\n rescue StandardError => e\n print_error \"Fatal Error: cannot load configuration file '#{config}' : #{e.message}\"\n print_more e.backtrace\n exit(1)\n end\n\n @@instance = self\n end", "def load_config\n @log.debug \"loading validator-specific configuration\"\n config = Autosign::Config.new\n\n if config.settings.to_hash[self.name].nil?\n @log.warn \"Unable to load validator-specific configuration\"\n @log.warn \"Cannot load configuration section named '#{self.name}'\"\n return {}\n else\n @log.debug \"Set validator-specific settings from config file: \" + config.settings.to_hash[self.name].to_s\n return config.settings.to_hash[self.name]\n end\n end", "def config(path = \"config.yml\")\n @config ||= (begin\n Defaults.update(YAML.load_file('config.yml'))\n rescue Errno::ENOENT\n STDERR.puts \" !! config file not found at: '#{path}'\"\n Defaults\n end)\n end", "def load_config( name )\n config = INI.load_file( name )\n config\nend", "def read_configuration\n\t\t@config = YAML.load_file(\"config.yml\")\n\t\treturn @config\n\tend", "def parse_config(config)\n @config = YAML.load_file(config)\n debug_msg(\"CONFIG: #{@config.inspect}\")\nend", "def initialize\n @config = config_from_file || empty_config\n end", "def load_file(path)\n @configuration_data = YAML.load_file(path)[CONFIGURATION_KEY]\n end", "def load\n config = File.expand_path(@path)\n @settings.deep_merge!(YAML.load_file(config)) if File.exist? config\n @settings\n end", "def yml_config\n return @yml_config if @yml_config\n\n require 'yaml'\n data = File.open(options[:config_path]).read\n\n require 'erb'\n data = ERB.new(data).result(binding)\n\n @yml_config ||= YAML.load(data)\n end", "def config(value)\n # require value if File.exists?(value)\n if File.exists?(value)\n fc = File.read(value)\n self.instance_eval(fc)\n end\n end", "def config\n @config ||= YAML::load_file(File.join(@cwd, \"config\", \"settings.yml\"))\n end", "def load_config(path, options = {})\n # Option defaults\n options = options.dup\n if options[:resolve_extensions].nil?\n options[:resolve_extensions] = true\n end\n if not [true, false].include?(options[:resolve_extensions])\n raise \"The :resolve_extensions option must be a boolean value!\"\n end\n if options[:nonexistent_base].nil?\n options[:nonexistent_base] = :ignore\n end\n if not %i[extend ignore].include?(options[:nonexistent_base])\n raise \"The :nonexistent_base option must be one of :ignore or :extend!\"\n end\n options[:data] ||= {}\n if not options[:data].is_a? Hash\n raise \"The :data option must be a Hash!\"\n end\n\n # Load base and local configuration files\n base, config = load_base_config(path, options[:data])\n _, local_config = load_local_config(base, options[:data])\n\n # Merge local configuration\n config.recursive_merge!(local_config)\n\n # Resolve includes\n config = resolve_includes(base, config, options)\n\n # Create config from the result\n cfg = Configuration.new(config)\n\n # Now resolve config hashes that extend other hashes.\n if options[:resolve_extensions]\n cfg.resolve_extensions!(options)\n end\n\n return cfg\n end", "def config\n unless @config\n begin\n @config = YAML.load_file( @config_file )\n rescue => boom\n @config = nil\n raise \"Unable to grok yaml landscape file. #{boom}\"\n end\n end\n @config\n end", "def config\n unless @config\n begin\n @config = YAML.load_file( @config_file )\n rescue => boom\n @config = nil\n raise \"Unable to grok yaml landscape file. #{boom}\"\n end\n end\n @config\n end", "def parse_config \n path = \"#{Rails.root}/config/mebla.yml\"\n return unless File.exists?(path)\n \n conf = YAML::load(ERB.new(IO.read(path)).result)[Rails.env]\n \n conf.each do |key,value|\n self.send(\"#{key}=\", value) if self.respond_to?(\"#{key}=\")\n end unless conf.nil?\n end", "def load(fn)\n if File.file?(fn)\n begin\n File.open(fn).each do |line|\n #peel off terminators/leading spaces, etc.\n line.strip!\n\n #ignore comment lines...\n if (line[0..0]!=\"#\")\n keyval = line.split(\"=\") # split on equal sign\n\n #ignore blank lines\n if keyval.size>0\n key = keyval[0].strip\n value = keyval[1].strip\n self[key] = value\n end\n end\n end\n rescue\n raise \"Error: trouble loading data from file: #{fn}.\\nDetails: #{$!}\"\n end\n else\n raise \"Error: cannot find configuration file: #{fn}.\\nDetails: File not found.\"\n end\n end", "def [](name)\r\n load\r\n @config[name]\r\n end", "def load_configuration!\n unless @configured\n load Rails.root.join( *Parametrization::Config::DEFAULT_CONFIG_PATH )\n end\n end", "def config\n @config ||= begin\n if File.exist?(@config_file)\n begin\n YAML.load_file(@config_file) || {}\n rescue Psych::SyntaxError => e\n raise PgSync::Error, e.message\n end\n else\n {}\n end\n end\n end", "def config\n fail(SlashDeploy::NoConfig) unless config?\n SlashDeploy::Config.from_yaml(raw_config)\n end", "def load_config(config_file)\n if !(hash = YAML.load_file(config_file))\n raise(ConfigError, \"Config file [#{config_file}] contains no options.\")\n end\n \n debug(\"Config options:\")\n debug(\"\") \n hash.each do |key, val|\n debug(\"#{key}: #{val}\") \n if CONFIG_OPTIONS.include?(key.to_sym)\n self.send(\"#{key}=\", val)\n else\n raise(ConfigError, \"Unrecognized Option: #{key}\")\n end\n end\n end", "def load_configuration\n config_path = options.fetch(:config_path) do\n root.join('brief.rb')\n end\n\n if config_path.is_a?(String)\n config_path = root.join(config_path)\n end\n\n run(config_path) if config_path.exist?\n end", "def load_config(config_path = nil)\n path = File.expand_path(config_path || HSS::DEFAULT_CONFIG)\n files = path.split(CONFIG_DELIMITERS).map { |x| YAML.safe_load File.read x }\n @config = files.reverse.reduce(&:deep_merge)\n @patterns = @config.delete('patterns') || raise\n # rubocop:disable Lint/ShadowedException\n rescue Psych::SyntaxError, RuntimeError, Errno::ENOENT\n raise \"Failed to load config: #{config_path}\"\n end" ]
[ "0.78320205", "0.75885504", "0.7508643", "0.7422764", "0.7359215", "0.73114765", "0.7278264", "0.727519", "0.7254802", "0.7232049", "0.72265995", "0.7216135", "0.72140723", "0.7211009", "0.719429", "0.7158115", "0.7134655", "0.71242386", "0.71021914", "0.7089531", "0.7085734", "0.7085734", "0.7078879", "0.7069185", "0.70496565", "0.70312357", "0.7021743", "0.70195836", "0.70018315", "0.69945294", "0.6990199", "0.69897145", "0.6960386", "0.6960019", "0.69586354", "0.6950187", "0.69347256", "0.6933562", "0.69250584", "0.6918725", "0.689396", "0.68675655", "0.68579334", "0.6832948", "0.6824676", "0.6821617", "0.6817123", "0.68160635", "0.67866826", "0.67776626", "0.67659545", "0.67632973", "0.6750405", "0.6749751", "0.67457074", "0.6742555", "0.67393756", "0.67374164", "0.6733388", "0.67254424", "0.67226833", "0.67153734", "0.67039686", "0.66744506", "0.66732514", "0.66632706", "0.6662336", "0.6657412", "0.66488516", "0.6642884", "0.6633823", "0.6632199", "0.66241556", "0.66146433", "0.66139466", "0.660825", "0.6587819", "0.65862787", "0.6578033", "0.6575388", "0.65318626", "0.6519802", "0.65124565", "0.65084755", "0.64959157", "0.64786917", "0.64711815", "0.6470942", "0.6468041", "0.6463737", "0.6456205", "0.6456205", "0.6453715", "0.6430337", "0.6428839", "0.64213777", "0.6420195", "0.64130104", "0.6402233", "0.63993317", "0.63990617" ]
0.0
-1
Get the full set of configuration options for the specified backup
def full_options(backup_name) backup_options = {} # Get backup defaults backup_options.merge!(@options[:backup_defaults].dup_contents_1_level) # Get the specific backup definition unless @options[:backups].has_key?(backup_name.to_sym) @logger.fatal("The backup name specified '#{backup_name}' has no configuration defined in #{@options[:config_file]}") raise Exception.new("Non-existent backup specified '#{backup_name}'") end backup_options.merge!(@options[:backups][backup_name.to_sym].dup_contents_1_level) return nil unless backup_options[:enabled] backup_options[:backup_name] = backup_name.to_s unless backup_options[:backup_name] # Expand the backup host reference selected_host = backup_options[:backup_host] backup_options.merge!(@options[:backup_hosts][selected_host].dup_contents_1_level) # Expand the backup type reference selected_backup_type = backup_options[:backup_type] backup_options.merge!(@options[:backup_types][selected_backup_type].dup_contents_1_level) return backup_options end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def backup_configuration\n settings[\"backup_configuration\"]\n end", "def get_backup_config(opts = {})\n data, _status_code, _headers = get_backup_config_with_http_info(opts)\n return data\n end", "def all_options\n Config::Options.all\n end", "def get_backup_config_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: NsxComponentAdministrationApi.get_backup_config ...\"\n end\n # resource path\n local_var_path = \"/cluster/backups/config\"\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'BackupConfiguration')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: NsxComponentAdministrationApi#get_backup_config\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def configure_backup_config(backup_configuration, opts = {})\n data, _status_code, _headers = configure_backup_config_with_http_info(backup_configuration, opts)\n return data\n end", "def zabbix_get_backup_ips\n @config[:groups].each do |group, parameter|\n if parameter[:enable]\n ips = @zabbix.get_ips_by_group(parameter[:name])\n @config[:groups][group.to_sym][:ips] = ips\n end\n end\n return @config\n end", "def options\n @options = @options.select { |key, _val| CONFIGURATIONS.include?(key.to_sym) }\n end", "def options\n opts = {}\n self.configuration_options.each do |option|\n opts.merge!({option.name.to_sym => option.value})\n end\n opts\n end", "def get_full_options\n result = {}\n usable_properties = self.class.held_properties\n usable_properties.delete(:from_class)\n usable_properties.each do |option|\n result[option] = self.send(option) if self.send(option) && self.send(option) != \"\"\n end\n result\n end", "def describe_configuration_options(options={})\n if option_filters = options.delete('Options')\n options.merge!(AWS.indexed_param('Options.member.%d', [*option_filters]))\n end\n request({\n 'Operation' => 'DescribeConfigurationOptions',\n :parser => Fog::Parsers::AWS::ElasticBeanstalk::DescribeConfigurationOptions.new\n }.merge(options))\n end", "def describe_configuration_settings(options={})\n request({\n 'Operation' => 'DescribeConfigurationSettings',\n :parser => Fog::Parsers::AWS::ElasticBeanstalk::DescribeConfigurationSettings.new\n }.merge(options))\n end", "def config\n @options[:config]\n end", "def options\n Hash[\n DeskApi::Configuration.keys.map do |key|\n [key, instance_variable_get(:\"@#{key}\")]\n end\n ]\n end", "def parsed_options\n config\n end", "def options\n Hash[ *Configuration::VALID_CONFIG_KEYS.map { |key| [key, send(key)] }.flatten ]\n end", "def get_options(contexts, force = true)\n Config::Options.get(contexts, force)\n end", "def get_options\n @options\n end", "def options\n Properties[self.class] ||= {}\n return Properties[self.class][:opts] || []\n end", "def get_full_options\n options_hash = self.get_runtime_options\n [:task_list, :version, :_exponential_retry, :prefix_name, :return_on_start, :manual_completion, :data_converter].each do |attribute|\n options_hash.merge!(attribute => self.send(attribute)) if self.send(attribute)\n end\n options_hash\n end", "def options\n Hash[ * VALID_CONFIG_KEYS.map { |key| [key, send(key)] }.flatten ]\n end", "def options\n Hash[ * VALID_CONFIG_KEYS.map { |key| [key, send(key)] }.flatten ]\n end", "def options\n Hash[\n *Configuration::VALID_CONFIG_KEYS.map { |key| [key, send(key)] }.flatten\n ]\n end", "def options\n config.options\n end", "def all\n @options\n end", "def find_files_on_backup conf\n file_matcher = generate_intended_filename_regex conf\n unless BACKUP_SERVERS[conf['backup_hostname']]\n bs = BackupServer.new(conf['backup_hostname'], \n conf['backup_username'], \n conf['backup_destination'])\n BACKUP_SERVERS[conf['backup_hostname']] = bs\n end\n bs = BACKUP_SERVERS[conf['backup_hostname']]\n files = bs.all_files.select {|file| /#{ file_matcher }/ =~ file[:name] }\n return files.reverse()[0,20]\nend", "def get_options; end", "def retrieve_options\n options = {}\n options['an'] = self.accession_number\n options['dbid'] = self.database_id\n options\n end", "def get_all_settings\n return @db[:settings].as_hash(:name, :body) if onblock(:u, -1, @client).admin?\n end", "def homepage_options\n homepage_report_options + homepage_book_options\n end", "def rack_options\n opts = Hash.new\n Backdat::Config.configuration.each do |k,v|\n if /^rack/ =~ k.to_s\n param = k.to_s.gsub('rack_', '')\n\n case param\n when \"environment\"\n opts[param.to_sym] = v\n else\n opts[param.capitalize.to_sym] = v\n end\n end\n end\n opts\n end", "def all_backup_names(backup_options = nil)\n backup_options ||= @backup_options\n all_possible_file_names = []\n total_possible_file_names = backup_options[:backups_to_retain]\n total_possible_file_names.times do |current_generation|\n all_possible_file_names[current_generation] = get_backup_file_name_with_generation(backup_options,current_generation)\n end\n @backup_options[:all_possible_file_names] = all_possible_file_names\n return all_possible_file_names\n end", "def load_settings\n %w(user password database collections additional_options backup_method).each do |attribute|\n send(:\"#{attribute}=\", procedure.get_adapter_configuration.attributes[attribute])\n end\n \n %w(host port).each do |attribute|\n send(:\"#{attribute}=\", procedure.get_adapter_configuration.get_options.attributes[attribute])\n end\n \n self.backup_method ||= :mongodump\n end", "def get_backups_list(backup_name)\n logger.info \"Getting the list of backups from FTP: #{worker.user_host_and_dir}\"\n @worker.get_files_list backup_name\n end", "def options \n self.merge!(@config.opts)\n end", "def payment_gateway_options\n gateway_setting.symbolized_settings\n end", "def options\n opts = {}\n VALID_CONFIG_KEYS.each_key do |k|\n opts.merge!(k => send(k))\n end\n opts\n end", "def options\n opts = {}\n VALID_CONFIG_KEYS.each_key do |k|\n opts.merge!(k => send(k))\n end\n opts\n end", "def getOptions\n rOptions = nil\n\n if (@ConfigPanel != nil)\n rOptions = @ConfigPanel.getData\n end\n\n return rOptions\n end", "def configuration\n cfg = []\n @entries.each {|e| cfg.push(e.desc)}\n return(cfg)\n end", "def options\n regopt.children.map { |opt| OPTIONS.fetch(opt) }.inject(0, :|)\n end", "def options\n opts = {}\n VALID_CONFIG_KEYS.each_key do |k|\n opts.merge!(k => send(k))\n end\n opts\n end", "def options\n self.class.instance_variable_get(:@__options) || []\n end", "def get_full_options\n result = {}\n SignalWorkflowOptions.held_properties.each do |option|\n result[option] = self.send(option) if self.send(option) && self.send(option) != \"\"\n end\n result\n end", "def backup_files host, config\n files = expand_files host, config\n files = expand_files \"default\", config if files.empty? # Undefined hosts get default\n return files\nend", "def app_config\n values = {}\n\n GCLOUD_OPTIONS_LIST.each do |option|\n values[option] = ENV[option.to_s.upcase] || self.send(option)\n end\n\n return values\n end", "def all\n JSON.parse(@client.call('config.get'))\n end", "def config\n options.to_smash.deep_merge(opts.to_smash)\n end", "def config\n options.to_smash.deep_merge(opts.to_smash)\n end", "def available_settings\n []\n end", "def options(include_deprecated: false)\n src = File.read(CONFIG_RB_PATH)\n src.scan(OPTION_PATTERN)\n .map { |opt| Option.from_captures(opt) }\n .reject { |opt| !include_deprecated && opt.deprecated? }\n .sort_by { |opt| opt.name }\n end", "def get_opts(opts)\n return opts[GCOVR_SETTING_PREFIX.to_sym] || {}\n end", "def configure_backup_config_with_http_info(backup_configuration, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: NsxComponentAdministrationApi.configure_backup_config ...\"\n end\n # verify the required parameter 'backup_configuration' is set\n if @api_client.config.client_side_validation && backup_configuration.nil?\n fail ArgumentError, \"Missing the required parameter 'backup_configuration' when calling NsxComponentAdministrationApi.configure_backup_config\"\n end\n # resource path\n local_var_path = \"/cluster/backups/config\"\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(backup_configuration)\n auth_names = ['BasicAuth']\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 => 'BackupConfiguration')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: NsxComponentAdministrationApi#configure_backup_config\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def listAZs(region = MU.curRegion)\n\t\t\tazs = MU::Config.listAZs(region)\n\t\t\treturn azs\n\t\tend", "def get_override_settings\n {}\n end", "def all_merchant_configs\n profile.merchant_configs\n end", "def configuration\n cfg = {:service => @service}\n cfg[:acl] = @acl.name if (@acl)\n cfg[:avpairs] = @avpairs if (@avpairs)\n cfg[:network_av] = @network_av.configuration if (@network_av)\n cfg[:shell_command_av] = @shell_command_av.configuration if (@shell_command_av)\n return(cfg)\n end", "def config_opts\n CONFIG_OPTS.inject({}) do |config_hash, key|\n config_hash[key] = send(key)\n config_hash\n end\n end", "def config_options\n {\n 'datacenter' => new_resource.datacenter,\n 'template_path' => new_resource.template_path,\n 'power_on' => true,\n 'datastore' => new_resource.datastore,\n 'wait' => true,\n 'hostname' => new_resource.hostname,\n 'name' => new_resource.name,\n 'customization_spec' => {\n 'domain' => new_resource.domain,\n 'ipsettings' => {\n 'ip' => new_resource.ip || node['vcac_vm']['ip'],\n 'gateway' => new_resource.gateway,\n 'subnetMask' => new_resource.subnet_mask,\n },\n }\n }\nend", "def extract_options\n last.is_a?(::Hash) ? last : {}\n end", "def get_server_base_config\n backend_conf = @opts['backend_conf'] || {}\n return backend_conf\n end", "def extract_options(opts)\n lastmod = opts.delete(:lastmod)\n changefreq = opts.delete(:changefreq)\n priority = opts.delete(:priority)\n\n [lastmod, changefreq, priority]\n end", "def extract_base_config(whole)\n whole = whole.symbolize_keys\n whole.except(:connections, :databases, :db_adapter, :id, :namespace, :state_cache, :state_cache_store, :sticky_slave, :sticky_slaves, :sticky_master, :verbose)\n end", "def getconfig\n output = zonecfg :info\n\n name = nil\n current = nil\n hash = {}\n output.split(\"\\n\").each do |line|\n case line\n when /^(\\S+):\\s*$/\n name = $1\n current = nil # reset it\n when /^(\\S+):\\s*(.+)$/\n hash[$1.intern] = $2\n when /^\\s+(\\S+):\\s*(.+)$/\n if name\n hash[name] = [] unless hash.include? name\n\n unless current\n current = {}\n hash[name] << current\n end\n current[$1.intern] = $2\n else\n err \"Ignoring '#{line}'\"\n end\n else\n debug \"Ignoring zone output '#{line}'\"\n end\n end\n\n hash\n end", "def parse_options()\n\n options = {}\n\n ARGV.each_index do |index|\n case $*[index]\n when '-m' then options[:auto_connect] = false\n when '-v' then options[:verbose] = true\n when '-q' then options[:verbose] = false\n when '-t' then options[:log_truncate] = true\n when '-r' then options[:log_response] = false\n else\n ::Twiga.say_warn \"unknown option: #{arg}\"\n end # case\n\n $*.delete_at(index) # remove from command line\n\n end # do each cmd line arg\n \n return Kinokero::Cloudprint::DEFAULT_OPTIONS.merge(options)\n\n end", "def options\n OPTIONS.each_with_object({}) do |name, hash|\n hash[name] = raw.fetch(name, nil)\n end\n end", "def options\n OPTIONS.each_with_object({}) do |name, hash|\n hash[name] = raw.fetch(name, nil)\n end\n end", "def configuration\n cfg = []\n @entries.each {|e| cfg.push(e.configuration)}\n return(cfg)\n end", "def configuration\n cfg = []\n @entries.each {|e| cfg.push(e.configuration)}\n return(cfg)\n end", "def configuration\n cfg = []\n @entries.each {|e| cfg.push(e.configuration)}\n return(cfg)\n end", "def all\n self::OPTIONS.map {|e| build(e) }\n end", "def get_configuration(subid = nil)\n get_options(@nodename, subid)\n end", "def describe_backups(d_b_instance_id, end_time, start_time, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'DescribeBackups'\n\t\targs[:query]['DBInstanceId'] = d_b_instance_id\n\t\targs[:query]['EndTime'] = end_time\n\t\targs[:query]['StartTime'] = start_time\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :backup_id\n\t\t\targs[:query]['BackupId'] = optional[:backup_id]\n\t\tend\n\t\tif optional.key? :backup_location\n\t\t\targs[:query]['BackupLocation'] = optional[:backup_location]\n\t\tend\n\t\tif optional.key? :backup_mode\n\t\t\targs[:query]['BackupMode'] = optional[:backup_mode]\n\t\tend\n\t\tif optional.key? :backup_status\n\t\t\targs[:query]['BackupStatus'] = optional[:backup_status]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :page_number\n\t\t\traise ArgumentError, 'page_number must be equal or greater than 1' unless optional[:page_number] < 1\n\t\t\traise ArgumentError, 'page_number must be equal or less than 2147483647' unless optional[:page_number] > 2147483647\n\t\t\targs[:query]['PageNumber'] = optional[:page_number]\n\t\tend\n\t\tif optional.key? :page_size\n\t\t\traise ArgumentError, 'page_size must be equal or greater than 30' unless optional[:page_size] < 30\n\t\t\traise ArgumentError, 'page_size must be equal or less than 100' unless optional[:page_size] > 100\n\t\t\targs[:query]['PageSize'] = optional[:page_size]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend", "def get_options()\n\n all_options = []\n\n @raw.raw_options.each do |set|\n \n set.each do |option|\n all_options.push(option)\n end\n\n end\n\n @options = all_options.flatten.uniq.sort_by(&:downcase)\n\n end", "def getconfig\n output = zonecfg :info\n\n name = nil\n current = nil\n hash = {}\n output.split(\"\\n\").each do |line|\n case line\n when %r{^(\\S+):\\s*$}\n name = Regexp.last_match(1)\n current = nil # reset it\n when %r{^(\\S+):\\s*(\\S+)$}\n hash[Regexp.last_match(1).to_sym] = Regexp.last_match(2)\n when %r{^\\s+(\\S+):\\s*(.+)$}\n if name\n hash[name] ||= []\n unless current\n current = {}\n hash[name] << current\n end\n current[Regexp.last_match(1).to_sym] = Regexp.last_match(2)\n else\n err \"Ignoring '#{line}'\"\n end\n else\n debug \"Ignoring zone output '#{line}'\"\n end\n end\n\n hash\n end", "def show_effective_options\n puts \"Options:\\n\"\n\n @options.marshal_dump.each do |name, val|\n puts \" #{name} = #{val}\"\n end\n end", "def config_file_settings\n config_file_settings = {}\n self.class.options.keys.each do |key|\n config_file_settings[key] = Meggy::Config[:meg][key] if Meggy::Config[:meg].has_key?(key)\n end\n config_file_settings\n end", "def list\n \tputs \"The list of backups for #{self.name}\"\n \tself.each do |bck|\n \t puts bck.filepath\n \tend\n end", "def configuration\n if system_keys.any?\n options.merge({\n system_keys: Configuration.default_system_keys.merge(system_keys)\n })\n\n else\n options\n\n end\n end", "def gather_options\n @_options\n end", "def get_importers_configuration\n return @client.raw(\"get\", \"/config/importers/configuration\")\n end", "def backup_databases\n cloud_databases - ['redis']\n end", "def faraday_options\n cfg_get(:faraday_options)\n end", "def options\n return @options\n end", "def selected_config\n config[client_name]\n end", "def configuration\n _get(\"/system/configuration\") { |json| json }\n end", "def backups\n if args.count == 0\n list_backups\n else\n command = shift_argument\n case command\n when 'list' then list_backups\n when 'info' then backup_status\n when 'capture' then capture_backup\n when 'restore' then restore_backup\n when 'public-url' then public_url\n when 'cancel' then cancel_backup\n when 'delete' then delete_backup\n when 'schedule' then schedule_backups\n when 'unschedule' then unschedule_backups\n when 'schedules' then list_schedules\n else abort \"Unknown pg:backups command: #{command}\"\n end\n end\n end", "def backend_options\n raw_options = @options.dup\n\n raw_options[:address] = raw_options[:endpoint]\n raw_options.delete(:endpoing)\n\n # Removing Safekeeper-specific options\n %i{engine engine_type prefix}.each { |option| raw_options.delete(option) }\n\n raw_options\n end", "def extract_options!\n if last.is_a?(Hash)\n pop\n else\n {}\n end\n end", "def config\n overview[\"config\"]\n end", "def options\n OPTIONS.each_with_object({}) do |name, hash|\n hash[name] = raw.fetch(name, nil)\n end\n end", "def options\n @options ||= if top_class?\n DEFAULT_OPTIONS\n else\n superclass.options\n end.dup\n end", "def options(opt)\n []\n end", "def default_options()\n options = {\n :verbose => 0, # Logger::DEBUG\n :logfile => STDERR\n }\n config_file = File.join(ENV['HOME'],\"#{File.basename($0, \".*\")}.rc.yaml\")\n if File.exists? config_file then\n config_options = YAML.load_file(config_file)\n options.merge!(config_options)\n end\n return options\n end", "def all_options\n env_variable_options = UserOptions.new\n global_configuration_options = UserOptions.new(Departure.configuration.global_percona_args)\n options = env_variable_options.merge(global_configuration_options).merge(DEFAULT_OPTIONS)\n options.to_a.join(' ')\n end", "def faraday_options\n cfg_get(:faraday_options)\n end", "def extract_options!\n last.is_a?(Hash) ? pop : {}\n end", "def base_options\n [valid?(new_resource._?(:secure_storage, '-sSF')),\n valid?(new_resource._?(:master_passwd, '-mPF')),\n new_resource._?(:accept_license, '-acceptLicense'),\n ((new_resource.output == :silent) ? '-s' :\n (new_resource.output == :verbose) ? '-sP' :\n (new_resource.output == :debug) ? '-sVP' : '-sP')]\n end", "def get_delivery_options(code)\n delivery_config = get_delivery_config(code)\n\n # If this config has an 'available' list defined,\n # return it.\n # Otherwise, just return the default list.\n delivery_config['available'] ||\n DELIVERY['standard_delivery_locations']\n end", "def options_admin\n base.merge(routing_key: routing_key_admin)\n end", "def get_options\n hash = Hash.new\n instance_variables.each do |var|\n hash[var[1..-1].to_sym] = instance_variable_get(var)\n end\n\n return hash\n end" ]
[ "0.6871624", "0.67159015", "0.6055941", "0.6008119", "0.59407794", "0.591406", "0.5899428", "0.58764654", "0.57891995", "0.57613283", "0.56316054", "0.55814433", "0.55628467", "0.55529535", "0.55327094", "0.55311596", "0.55297494", "0.55154544", "0.55077904", "0.55060583", "0.55060583", "0.54981816", "0.5490218", "0.5486123", "0.5441448", "0.54362285", "0.54325145", "0.54160714", "0.5412454", "0.5410601", "0.54038304", "0.5400558", "0.53875095", "0.5375978", "0.53704965", "0.53678316", "0.53678316", "0.53579766", "0.5344122", "0.53378415", "0.5327879", "0.53190124", "0.52998024", "0.5276864", "0.5268995", "0.5267501", "0.5265226", "0.5265226", "0.52418804", "0.52388746", "0.5237325", "0.52332234", "0.52282536", "0.5211995", "0.5203492", "0.5195131", "0.51867944", "0.51802486", "0.5179015", "0.51757854", "0.5168305", "0.5157598", "0.5153417", "0.5151018", "0.5148183", "0.51473784", "0.5138464", "0.5138464", "0.5138464", "0.5124387", "0.5122225", "0.51152766", "0.51006836", "0.5097066", "0.5095587", "0.50945336", "0.5091939", "0.5086018", "0.508311", "0.5080438", "0.5078643", "0.5078605", "0.5077313", "0.50761247", "0.5073215", "0.5071558", "0.5069879", "0.5068592", "0.50653267", "0.50644326", "0.5063201", "0.5051393", "0.50494784", "0.50494033", "0.50455844", "0.5025315", "0.5023796", "0.50185204", "0.50169814", "0.5013634" ]
0.75578475
0
def current_player_lives current_player.lives end
def success_message puts "Correct!".green end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def player_lives(player)\n player == 1 ? @player_1_lives : @player_2_lives\nend", "def show_lives\n puts \"Lives remaining: #{@players[0].name}: #{@players[0].life}/3 - #{@players[1].name}: #{@players[1].life}/3\"\n end", "def show_lives(lives)\n puts \"#{lives} Lives left\"\n end", "def player_lives_status(player, num_lives)\n \"\\n#{player_name(player)} has #{num_lives} lives/life left.\\n\"\nend", "def initialize\n @lives = 3\n end", "def game_over\n @lives == 0\n end", "def players\n go_fish.players\n end", "def loser?\n @lives == 0\n end", "def life_count\n puts \"#{@player1.name}'s lives: #{@player1.lives}\\n#{@player2.name}'s lives: #{@player2.lives}\"\n end", "def get_players\n\n end", "def alive?\n @lives != 0\n end", "def alive?\n @lives > 0\nend", "def show_lives\n puts \"Lives: #{@lives} ♥\"\n end", "def take_life\n @lives -= 1\n end", "def game_over?\n @lives == 0\n end", "def have_lives?\r\n @chances >= 1\r\n end", "def player\n\t\t@current_player\n\tend", "def affichage_player\n\n\n end", "def starters\n self.players.starter\n end", "def playing?\n players.select{|player| player.lives > 0}.count > 1\n end", "def player; end", "def player; end", "def player; end", "def player; end", "def player; end", "def player; end", "def player; end", "def current_stat\n \"#{@lives}/#{@total_lives}\"\n end", "def lose_life\n @lives -= 1\n end", "def lose_life\n @lives -= 1\n end", "def lose_life\n @lives -= 1\n end", "def lose_life\n @lives -= 1\n end", "def subtract_point \n\t\t@lives -= 1\n\tend", "def current_player_is_alive?\n @players[@current_player_index].is_alive?\n end", "def reduce_life\n if @lives > 0\n @lives -= 1\n end\n end", "def looses_life\n @lives -= 1\n end", "def game_status(num_lives, player)\n if num_lives == 0\n puts end_of_game(player)\n earn_point(player)\n puts current_score\n puts ask_replay\n else\n puts player_lives_status(player, num_lives)\n end\nend", "def players_alive?\n @players[0][:lives] != 0 && @players[1][:lives] != 0 \nend", "def change_score\n @lives = @lives - 1\n end", "def show_players\r\n puts \"Tu as #{human_player.life_points}\"\r\n puts \"il reste #{@enemies.length} bots, courage!!\"\r\n end", "def level_up\n @lives += 1\n end", "def players\n users\n end", "def lose_life(player)\n @players[player][:lives] -= 1\nend", "def playerSide \n \"playerSide\" \n end", "def lives_checker\n if (player_1.lives == 0 || player_2.lives == 0)\n self.game_over\n else\n puts \"------NEW ROUND------\"\n self.start_game\n end\n end", "def game_over?\n # Write a if condition - true\n if @lives == 0\n true\n end\n end", "def give_bonus player\n player.add_1_life\n end", "def wrong\n self.lives -= 1\n end", "def getCurrentPlayer() # : Player\n @currentPlayer\n end", "def player_capacity\n 2\n end", "def ask_question_and_update_lives(player)\n result = ask_question_and_check_answer\n if !result\n player.lives -= 1\n end\n end", "def done\n @lives <= 0\n end", "def lose_life(player)\n player == 1 ? @player_1_lives -= 1 : @player_2_lives -= 1\nend", "def online_rivals\n \t rivals_by_me.online + rivals_for_me.online\n \t end", "def initialize (name)\n @name = name\n @lives = MAX_LIVES\n end", "def get_score()\r\n return @player.score()\r\n end", "def deduct_life\n @lives -= 1\n end", "def livedns?\n current == :livedns\n end", "def wrong \n @lives -= 1\n end", "def loser\n losing_players\n end", "def current_player\n players.first\n end", "def current\n self.players[self.current_turn]\n end", "def get_players_num\n\t\treturn @players.length\n\tend", "def lives_lost\n @lives -= 1\n pp \"INCORRECT -- YOU HAVE #{@lives} LIVES LEFT\"\n end", "def get_player_id\n\t\t@player_id\n\tend", "def player_name\n player.name\n end", "def player_of_game(game)\n game.player(self)\n end", "def life\n return @life\n end", "def initialize(name)\n @name=name\n @lives=3\n end", "def status\n \"#{@name}: #{@lives}/3 \"\n end", "def find_score \n player = self.find_winner\n if player == 1\n return @player_1.life\n end\n return @player_2.life\n end", "def give_point\n if@current_player == @player1\n @p1_score += 1\n else\n @p2_score += 1\n end\nend", "def change_player\n\n end", "def game_over?\n (@player1.lives == 0) || (@player2.lives == 0)\n end", "def initialize(name)\n @name = name\n @lives = 3\n end", "def initialize(name)\n @name = name\n @lives = 3\n end", "def initialize(name)\n @name = name\n @lives = 3\n end", "def initialize(name)\n @name = name\n @lives = 3\n end", "def lives_decriment\n\t\tlives_will_change!\n\t\tself.lives -= 1 \n\t\tself.hp = self.level+5\n\t\tself.save!\n\t\tif self.lives <=0 \n\t\t\t# restarts NPC's renders user-wizards unusable\n\t\t\tif self.user_id == 1\n\t\t\t\tself.default_values()\n\t\t\telse\n\t\t\t\tputs \"Game Over for #{self.name}!\"\n\t\t\t\tself.level = 0\n\t\t\tend\n\t\tend\n\tend", "def max_player\n return 1\n end", "def level_up\n @lives = @lives += 1\n puts \"You got a life! Now you have #{ @lives } lives.\"\n end", "def current_player_moves\r\n current_player.play(board)\r\n end", "def over?\n self.player.points == self.board.total_points\n end", "def player\n fetch('football.players')\n end", "def current_player\n @players[@turn%2]\n end", "def show_players\n puts \"Il reste #{players_left} enemies\"\n player1.show_state\n puts \"\\n\"\n end", "def current_player\n @players.first\n end", "def all_players\n away_players + home_players\nend", "def turn_player\n go_fish.turn_player\n end", "def current_player\n self.board.turn_count.even?? self.player_1 : self.player_2\n end", "def current_hp\n puts \"P1: #{@player1.hp}/3 vs P2: #{@player2.hp}/3\"\n end", "def player_state\n @ole.PlayerState\n end", "def players\n @players || []\n end", "def player_win\n @player.won_bet\n puts \"You have #{@player.chips_remaining} remaining\"\n end", "def player \n \"player\" \n end", "def vote\n\t\trandomPlayer\n\tend", "def all_players\n home_players + away_players\nend", "def current_team\n self.teams\n end", "def team_players\n Player.all\n end", "def getCurrentPlayer\n @currentPlayer\n end", "def view_position\n @player.position\n end" ]
[ "0.7545884", "0.7437891", "0.72662926", "0.7192068", "0.69195426", "0.67830175", "0.6757567", "0.67477065", "0.67462265", "0.66757804", "0.66724586", "0.66680974", "0.6569438", "0.65597665", "0.6553944", "0.65300196", "0.65276724", "0.64887786", "0.6462895", "0.64182526", "0.6416901", "0.6416901", "0.6416901", "0.6416901", "0.6416901", "0.6416901", "0.6416901", "0.6412746", "0.63020337", "0.63020337", "0.63020337", "0.63020337", "0.62850356", "0.6272984", "0.626504", "0.6257098", "0.62023", "0.6182277", "0.61800784", "0.61630964", "0.6143062", "0.6140237", "0.61362046", "0.61334294", "0.6124197", "0.6111534", "0.610422", "0.6100525", "0.60873026", "0.60594505", "0.6055316", "0.605458", "0.60525817", "0.60501087", "0.6045266", "0.60429937", "0.6018869", "0.60098284", "0.6008785", "0.60067606", "0.60029256", "0.59959817", "0.5991079", "0.5980102", "0.59736764", "0.5970272", "0.5962283", "0.59523726", "0.59510714", "0.5949445", "0.59360266", "0.59316266", "0.5930867", "0.5928668", "0.59174204", "0.59174204", "0.59174204", "0.59174204", "0.59130055", "0.5912302", "0.5902266", "0.5896568", "0.5891534", "0.588299", "0.58679926", "0.584913", "0.5840199", "0.5831083", "0.5817024", "0.5816203", "0.5810978", "0.58005536", "0.5787919", "0.5763617", "0.57533437", "0.57507354", "0.57501656", "0.5748589", "0.57334524", "0.57247674", "0.57214916" ]
0.0
-1
Create a deep copy of a hash This is useful for copying a hash that will be mutated
def deep_copy_hash hash require_that(hash.is_a?(Hash), "deep_copy_hash requires a hash be specified, got #{hash.class}") Marshal.load Marshal.dump(hash) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def deep_copy(hash)\n Marshal.load(Marshal.dump(hash))\n end", "def deep_copy\n copy = dup\n copy.values = {}\n @values.each { |k, v| copy.values[k] = v.clone }\n copy\n end", "def copy &alter\n Rumor.new(hash).tap &alter\n end", "def initialize_clone( * ) # :nodoc:\n\t\t@hash = deep_copy( @hash )\n\tend", "def copy\n self.class.new.tap do |obj|\n self.each_pair do |key, val|\n obj.set(key => (val.is_a?(Array) or val.is_a?(Hash)) ? val.clone : val)\n end\n end\n end", "def copy\n self.class.new.tap do |obj|\n self.each_pair do |key, val|\n obj.set(key => (val.is_a?(Array) or val.is_a?(Hash)) ? val.clone : val)\n end\n end\n end", "def initialize_dup( * ) # :nodoc:\n\t\t@hash = deep_copy( @hash )\n\tend", "def deep_dup(hash)\n hash.each_with_object({}) do |(key, value), dup|\n dup[key] = value.is_a?(Hash) ? deep_dup(value) : value\n end\n end", "def clone_hash(value)\n if value.is_a?(Hash)\n result = value.dup\n value.each { |k, v| result[k] = clone_hash(v) }\n result\n elsif value.is_a?(Array)\n result = value.dup\n result.clear\n value.each { |v| result << clone_hash(v) }\n result\n else\n value.dup\n end\n end", "def deep_copy_label_hash(hash)\n tmp = Hash.new{|h,k| h[k] = PolicyHelper.new }\n hash.each do |k,v|\n tmp[k] = v.dup\n end\n tmp\n end", "def __deep_copy__\n self.class.new(aliases, serializers) do |copy|\n each_pair do |key, value|\n copy.store(key, value.__deep_copy__)\n end\n end\n end", "def deep_copy\n deep_transform_values(&method(:_deep_copy))\n end", "def __deep_copy__\n self.class.new(aliases, serializers, associations, aliased_associations) do |copy|\n each_pair do |key, value|\n copy.merge!(key => value.__deep_copy__)\n end\n end\n end", "def dup\n self.class.new(to_hash)\n end", "def deep_copy(obj); end", "def deep_merge(hash)\n dup.deep_merge! hash\n end", "def dup\n HashWithIndifferentAccess.new(self)\n end", "def copyhash(inputhash)\n h = Hash.new\n inputhash.each do |pair|\n h.store(pair[0], pair[1])\n end\n return h\nend", "def deep_dup\n inject(self.class.new) do |new_hash, (key, value)|\n key = key.respond_to?(:deep_dup) ? key.deep_dup : key.dup?\n value = value.respond_to?(:deep_dup) ? value.deep_dup : value.dup?\n new_hash[key] = value\n new_hash\n end\n end", "def deep_copy(old_object)\n new_object = {}\n old_object.each do |key, value|\n new_object[key] = value\n end\n new_object\n end", "def new_from_hash_copying_default(hash)\n superclass.new_from_hash_copying_default hash\n end", "def deep_clone\n cloned = self.clone\n cloned.initialize_from_copy(self)\n cloned\n end", "def deep_clone\n Marshal.load(Marshal.dump(self))\n end", "def clone\n Chord::new self.to_hash\n end", "def copy_hash(hash, wrapper: {})\n hash.each_with_object(wrapper) do |(key, value), new|\n new[key] = value.is_a?(Hash) ? copy_hash(value) : value\n end\n end", "def deep_copy_hash g\n h = {}\n g.each_pair do |k,v|\n v = Marshal.load(Marshal.dump(v))\n h[k] = v\n end\n h\nend", "def shallow_merge(other_hash)\n dup.shallow_update(other_hash)\n end", "def to_hash\n @_hash.dup\n end", "def deep_copy\n Marshal.load(Marshal.dump(self))\n end", "def deep_clone; end", "def deep_clone\n Marshal::load(Marshal.dump(self))\n end", "def deep_merge(other_hash)\n dup.deep_merge!(other_hash)\n end", "def to_hash\n @hash.dup\n end", "def shallow_update(other_hash); end", "def shallow_merge(other_hash); end", "def to_hash\n @hash.dup\n end", "def initialize( hash )\n\t\t\t@hash = hash.dup\n\t\t\t@dirty = false\n\t\tend", "def clone\n newobj = super\n newobj.instance_eval do\n __getobj__.each_pair do |k, v|\n __getobj__[k] = v.clone\n end\n end\n newobj\n end", "def deep_copy( obj )\n\n\t\t\t# Handle mocks during testing\n\t\t\treturn obj if obj.class.name == 'RSpec::Mocks::Mock'\n\n\t\t\treturn case obj\n\t\t\t\twhen NilClass, Numeric, TrueClass, FalseClass, Symbol,\n\t\t\t\t Module, Encoding, IO, Tempfile\n\t\t\t\t\tobj\n\n\t\t\t\twhen Array\n\t\t\t\t\tobj.map {|o| deep_copy(o) }\n\n\t\t\t\twhen Hash\n\t\t\t\t\tnewhash = {}\n\t\t\t\t\tnewhash.default_proc = obj.default_proc if obj.default_proc\n\t\t\t\t\tobj.each do |k,v|\n\t\t\t\t\t\tnewhash[ deep_copy(k) ] = deep_copy( v )\n\t\t\t\t\tend\n\t\t\t\t\tnewhash\n\n\t\t\t\telse\n\t\t\t\t\tobj.clone\n\t\t\t\tend\n\t\tend", "def deep_copy\n Marshal.load(Marshal.dump(self))\n end", "def deep_copy\n Marshal.load(Marshal.dump(self))\n end", "def clone\n other = dup\n other.freeze if frozen?\n other\n end", "def deep_clone\n Marshal.load(Marshal.dump(self))\n end", "def deep_copy\r\n Marshal.load(Marshal.dump(self))\r\n end", "def deep_copy(o)\n\tMarshal.load(Marshal.dump(o))\nend", "def deep_clone; Marshal::load(Marshal.dump(self)); end", "def clone\n self.class.new(**as_json)\n end", "def deep_copy\n Marshal.load(Marshal.dump(self))\n end", "def initialize_copy(other)\n @mutex = Mutex.new\n other.instance_variable_get(:@mutex).synchronize do\n @hash = other.instance_variable_get(:@hash).dup\n end\n end", "def initialize_copy(other)\n @mutex = Mutex.new\n other.instance_variable_get(:@mutex).synchronize do\n @hash = other.instance_variable_get(:@hash).dup\n end\n end", "def clone\n o = dup\n o.freeze if frozen?\n o\n end", "def deep_copy(_h = nil)\n copy = Styles.new\n each_pair { |style, value| copy[style] = value }\n copy\n end", "def deep_copy\n Expression.new(name.deep_copy, value && value.deep_copy)\n end", "def new_from_hash(hash)\n if hash == nil\n self.class.new.assign(self)\n else\n hash_obj = hash\n if hash.instance_of?(Hash)\n hash_obj = self.class.new\n merge_hash_into_object(hash, hash_obj)\n end\n instance = self.class.new\n object_assign(instance, hash_obj)\n end\n end", "def deep_copy_node(oldhash)\n newhash = {}\n newhash['fqdn'] = oldhash['fqdn'] || oldhash['id'].gsub('_', '.') # Fix the fqdn, since periods couldn't be used in the databag ID.\n newhash['chef_environment'] = oldhash['chef_environment']\n begin\n newhash['chef_environment'] ||= oldhash.chef_environment # In case it's an actual Chef node and not a hash emulating one.\n rescue\n end\n newhash['rdiff-backup'] = oldhash['rdiff-backup'].to_hash\n return newhash\nend", "def deep_copy(o)\n Marshal.load(Marshal.dump(o))\n end", "def _deep_copy(value)\n case value\n when Module then value\n when NestedOpenStructWithHashAccess then value.class.new(value.nested_class, value.to_h.deep_transform_values(&method(:_deep_copy)))\n when OpenStruct then value.class.new(value.to_h.deep_transform_values(&method(:_deep_copy)))\n else\n value.dup\n end\n end", "def deep_clone\n Marshal::load(Marshal.dump(self))\n end", "def deep_copy object\n Marshal.load(Marshal.dump(object))\n end", "def deep_copy object\n Marshal.load(Marshal.dump(object))\n end", "def deep_copy(o)\n Marshal.load(Marshal.dump(o))\n end", "def clone\n other = dup\n other.freeze if self.frozen?\n other\n end", "def deep_copy(o)\n Marshal.load(Marshal.dump(o))\nend", "def deep_copy(o)\n Marshal.load(Marshal.dump(o))\nend", "def deep_merge!(target, hash); end", "def deep_merge!(target, hash); end", "def deep_copy(**options)\n copy = self.dup\n copy.question_id = options.fetch(:question_id, nil)\n return copy\n end", "def clone\n Marshal.load(Marshal.dump self)\n end", "def initialize_copy(*)\n @cache = @cache.dup\n @entries = @entries.dup\n end", "def deep_hash(hash)\n break_keys(hash).tap do\n hash.each do |key, value|\n hash[key] = deep_hash_value(value)\n end\n end\n end", "def deep_copy(obj)\n if obj.is_a?(Hash)\n obj.inject({}) { |h, kv| h.merge(kv[0] => deep_copy(kv[1])) }\n elsif obj.is_a?(Array)\n obj.map { |el| deep_copy(el) }\n else\n obj\n end\n end", "def pristine_copy\n @pristine = {}\n for key, val in self\n @pristine[key] = \n val.dup rescue val\n end\n end", "def deep_copy(obj)\n Marshal.load(Marshal.dump(obj))\nend", "def deep_copy(name = @name)\n copy = dup\n copy.name = name\n copy.rules = {}\n @rules.each { |k, v| copy.rules[k] = v.deep_copy }\n copy\n end", "def clone\n copy(false)\n end", "def deepcopy\n\t\tMarshal.load(Marshal.dump(self))\n\tend", "def clone\n @clone ||= super\n end", "def clone\n self.class.new(@attributes.except(:_id).except(:versions).dup)\n end", "def deep_copy(object)\n Marshal.load(Marshal.dump(object))\nend", "def dup\n\n # duplicate self\n rta = super\n\n # iterate through array and dup each hash\n rta.each_with_index do |w_hash, index|\n\n # dup the hash at this index\n rta[index] = w_hash.dup\n\n # to be complete, also dup the key/values in the hash, in case another hash/array is nested\n w_hash.each_pair do |k, v|\n rta[index][k] = v.dup if v.is_a? Hash\n end\n end\n\n # now everything should have new object_id's\n rta\n end", "def deep_clone!\n opts = {}\n opts[:except] = [ \n :updated_at\n ]\n self.clone(opts) \n end", "def deepcopy(o)\n Marshal.load(Marshal.dump(o))\nend", "def unaltered(hash)\n hash\n end", "def dup\n self.class.new(@value, **(@object || {}))\n end", "def clone\n Marshal.load(Marshal.dump(self))\n end", "def clone\n Marshal.load(Marshal.dump(self))\n end", "def clone\n Marshal.load(Marshal.dump(self))\n end", "def clone\n Marshal.load(Marshal.dump(self))\n end", "def clone\n Marshal.load(Marshal.dump(self))\n end", "def __deep_copy__\n self.class.new(aliases) do |copy|\n each do |entry|\n copy.push(entry.__deep_copy__)\n end\n end\n end", "def initialize\n @h = new_hash\n end", "def deep_dup\n Marshal.load(Marshal.dump(self))\n end", "def deepcopy(o)\n Marshal.load(Marshal.dump(o))\nend", "def deep_clone\n if RUBY_PLATFORM == 'opal'\n JSON.parse(to_json)\n else\n Marshal.load(Marshal.dump(self))\n end\n end", "def hash_dup\n save\n end", "def deep_copy\n field_copy = self.dup\n field_copy.save!\n field_copy\n end", "def deep_clone(object)\n Marshal.load(Marshal.dump(object))\n end", "def _deep_merge(hash, other_hash); end", "def deep_dup; end", "def deep_dup\n # noinspection RubyMismatchedReturnType\n dup\n end" ]
[ "0.8200839", "0.747171", "0.73471075", "0.73406154", "0.7339316", "0.7339316", "0.7270076", "0.7235719", "0.7235692", "0.72133195", "0.7176458", "0.716959", "0.70139116", "0.701154", "0.69308716", "0.6858759", "0.6856367", "0.68277925", "0.67780924", "0.6746879", "0.6659827", "0.6651648", "0.66341746", "0.66065925", "0.6602817", "0.65924907", "0.6565838", "0.65637493", "0.6555855", "0.65528286", "0.6538532", "0.65372705", "0.6532922", "0.6485746", "0.6484798", "0.6458735", "0.6440668", "0.64161116", "0.6399291", "0.6387215", "0.6387215", "0.6380991", "0.63699144", "0.6366445", "0.6339676", "0.6339005", "0.63365746", "0.6336221", "0.63330793", "0.63330793", "0.6332314", "0.6329829", "0.63270456", "0.6319264", "0.6315428", "0.63115686", "0.6287488", "0.6274692", "0.6272934", "0.6272934", "0.62696713", "0.6269505", "0.6260406", "0.6260406", "0.62259126", "0.62259126", "0.62152696", "0.6206046", "0.6201532", "0.6198509", "0.6198028", "0.6198", "0.619658", "0.6195976", "0.61911714", "0.6189837", "0.6177996", "0.6144847", "0.61371744", "0.611819", "0.6115617", "0.61085933", "0.61029005", "0.6101631", "0.6088877", "0.6088877", "0.6088877", "0.6088877", "0.6088877", "0.60836273", "0.6063205", "0.60442674", "0.6042168", "0.6041047", "0.6040046", "0.6038049", "0.6033786", "0.60337746", "0.6028237", "0.6028008" ]
0.8403944
0
Require that a guard condition passes Simply checks that the guard is truthy, and throws an error otherwise
def require_that guard, message, return_guard = false if not guard then raise ExpectationFailedError.new(message) end if return_guard == true then guard elsif return_guard != false then return_guard end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def assert cond\n fail! unless cond\n end", "def guard; end", "def assert(cond)\n failure unless cond\n end", "def deny(condition, msg=\"\")\n assert !condition, msg\n end", "def deny(condition)\n # a simple transformation to increase readability IMO\n assert !condition\n end", "def deny(condition)\n # a simple transformation to increase readability IMO\n assert !condition\n end", "def deny(condition)\n # a simple transformation to increase readability IMO\n assert !condition\n end", "def deny(condition, message='')\n assert !condition, message\n end", "def assert_1\n raise \"Invalid argument\" unless yield\nend", "def assert truthy\n raise \"Tests failed\" unless truthy\nend", "def rtassert(cond, ex_class, msg)\r\n\t\tif (!cond)\r\n\t\t\traise ex_class, msg\r\n\t\tend\r\n\tend", "def assert_true(a)\n raise RuntimeError unless a\nend", "def deny(condition, msg=\"\")\n # a simple transformation to increase readability IMO\n assert !condition, msg\n end", "def deny(condition, msg=\"\")\n # a simple transformation to increase readability IMO\n assert !condition, msg\n end", "def deny(condition, msg=\"\")\n # a simple transformation to increase readability IMO\n assert !condition, msg\n end", "def foo(bar)\n unless allowed?(bar)\n raise \"bad bar: #{bar.inspect}\"\n end\nend", "def checkCond(cond, bind)\t\n\t\tcond.collect do |c|\n\t\t\tif !eval(c, bind)\n\t\t\t\traise \"precondition violation\"\n\t\t\tend\n\t\tend\n\tend", "def assert(truth)\n raise \"ERROR\" if !truth\nend", "def protects?(thing)\n false\n end", "def protects?(_thing)\n false\n end", "def check_age(age)\n raise ArgumentError, \"Enter Positive Number\" unless age > 0\nend", "def assert\n\traise ArgumentError.new(\"Assertion failed!\") unless yield\nend", "def assert\n raise \"Assertion failed!\" unless yield #unless yield, is saying unless true\nend", "def assert\n\traise ArgumentError.new(\"assertion error\") unless yield\nend", "def assert(condition, msg = 'Assertion failed! I quit!')\n raise msg unless condition\nend", "def error_unless_condition\n output_error 'unless_condition'\n end", "def refute(condition, message='')\n assert(!condition, message)\n end", "def assert\n raise \"Something is wrong\" unless yield\nend", "def assert\n raise \"something is wrong!\" unless yield\nend", "def assert\n raise \"something is wrong!\" unless yield\nend", "def assert\n\traise \"Uh oh.\" unless yield\nend", "def assert \n raise \"Error! your code sucks!\" unless yield\nend", "def assert\n raise \"Found an error!\" unless yield\nend", "def assert\n raise \"Card not valid!\" unless yield\nend", "def assert\n raise \"ERROR!\" unless yield \nend", "def assert(condition,conditionType)\n raise \"#{conditionType} not met. \" unless condition\n end", "def assert\n\traise \"Error! Error!\" unless yield\nend", "def check_guard(message)\n guard = message.guard\n\n if guard.nil? || guard.empty?\n return true\n else\n guard.keys.all? do |key|\n value = self.__send__(\"request_#{key}\")\n if value.kind_of? Symbol\n value.to_s == guard[key].to_s\n else\n value == guard[key]\n end\n end\n end\n end", "def assert(message)\n raise message unless yield\nend", "def assert\nraise \"Card not valid!\" unless yield\nend", "def assert( condition, message=nil )\r\n ## note: use message to avoid conflict with msg helper/builtin in contract!!!\r\n if condition == true\r\n ## do nothing\r\n else\r\n if message\r\n raise \"Contract Assertion Failed; Contract Halted (Stopped): #{message}\"\r\n else\r\n raise 'Contract Assertion Failed; Contract Halted (Stopped)'\r\n end\r\n end\r\n end", "def assert\n raise 'Assertion Failed!' unless yield\nend", "def governed(method, &block)\n before = self.guard_count\n res = yield\n\n if @unguarded != true && self.guard_count == before\n raise Kindergarten::Perimeter::Unguarded.new(\n \"#{method} was executed without propper guarding\"\n )\n end\n\n return res\n end", "def assert\n raise \"Assertion Failed!\" unless yield\n end", "def assert\n raise 'The card number is not valid ' unless yield\n end", "def assert\n raise \"Assertion Failed\" unless yield\nend", "def may_fail # block\n begin\n yield\n rescue\n end\nend", "def must_throw(sym, msg=nil)\n ThrowAssay.assert!(sym, :message=>msg, :backtrace=>caller, &self)\n end", "def assert\n raise \"Assertion Failed!\" unless yield \nend", "def assert\n raise \"Assertion Failed!\" unless yield \nend", "def assert\n raise \"Assertion Failed!\" unless yield \nend", "def assert \n raise \"Assertion failed!\" unless yield\nend", "def check_condition binding\n return true if condition.nil? || condition.empty?\n begin\n Evaluator.eval_condition binding, condition\n rescue\n set_error_state \"Unable to evaluate condition\",\n refers_to: :BREAKPOINT_CONDITION\n false\n end\n end", "def assert\n raise \"Assertion failed!\" unless yield\nend", "def assert\n raise \"Assertion failed!\" unless yield\nend", "def assert\n raise \"Assertion failed!\" unless yield\nend", "def assert\n raise \"Assertion failed!\" unless yield\nend", "def assert\n raise \"get_grade is not a method\" unless yield\n raise \"90 and above failed\" unless yield\n raise \"80 and above failed\" unless yield\n raise \"70 and above failed\" unless yield\n raise \"60 and above failed\" unless yield\n raise \"59 and below failed\" unless yield\nend", "def enforce(*rvals)\n enforce_ex(*rvals)[0]\n end", "def assert\r\n raise \"Assert Faild\" unless yield\r\nend", "def assert\n\traise \"Assertion error!\" unless yield\nend", "def assert\n\traise \"Assertion Raised!\" unless yield\nend", "def assert\n\traise \"Assertion Failed!\" unless yield\nend", "def assert\n\traise \"Assertion Failed!\" unless yield\nend", "def check_age(age)\n\traise ArgumentError, \"Enter Positive Number\" unless age >0\nend", "def assert\n# puts \"Processing...\"\n raise \"Assertion failed!\" unless yield \n puts \"True!\"\nend", "def assert_valid\n raise ValidationError, \"no name\" unless name\n raise ValidationError, \"no version\" unless version\n raise ValidationError, \"no summary\" unless summary\n #raise ValidationError, \"no maintainer\" unless maintainer\n #raise ValidationError, \"no homepage\" unless homepage\n end", "def assert(message=\"Assertion Failed\")\n raise RuntimeError, message unless yield\nend", "def assert\n raise \"Assertion failed\" unless yield\nend", "def assert(truthy=false)\n unless truthy || (block_given? && yield)\n file, line = caller[0].split(\":\")\n error_message = \"Assertion Failed! < #{file}:#{line}:#{ SCRIPT_LINES__[file][line.to_i - 1][0..-2] rescue ''} >\"\n raise AssertionException.new(error_message)\n end\n end", "def assert\n\traise \"Assertion Failed\" unless yield\nend", "def assert\n raise \"Assertion failed!\" unless yield\nend", "def assert\n raise \"Assertion failed!\" unless yield\nend", "def assert\n raise \"Assertion failed!\" unless yield\nend", "def assert\n raise \"Assertion failed!\" unless yield\nend", "def assert\n raise \"Assertion failed!\" unless yield\nend", "def assert\n raise \"Assertion failed!\" unless yield\nend", "def assert\n raise \"Assertion failed!\" unless yield\nend", "def assert\n raise \"Assertion failed!\" unless yield\nend", "def assert\n raise \"Assertion failed!\" unless yield\nend", "def assert\n raise \"Assertion failed!\" unless yield\nend", "def assert\n raise \"Assertion failed!\" unless yield\nend", "def assert\n raise \"Assertion failed!\" unless yield\nend", "def assert\n raise \"Assertion failed!\" unless yield\nend", "def assert\n raise \"Assertion failed!\" unless yield\nend", "def assert\n raise \"Assertion failed!\" unless yield\nend", "def assert\n raise \"Assertion failed!\" unless yield\nend", "def assert\n raise \"Assertion failed!\" unless yield\nend", "def assert\n raise \"Assertion failed!\" unless yield\nend", "def assert\n raise \"Assertion failed!\" unless yield\nend", "def assert\n raise \"Assertion failed!\" unless yield\nend", "def assert\n raise \"Assertion failed!\" unless yield\nend", "def assert\n raise \"Assertion failed!\" unless yield\nend", "def assert\n raise \"Assertion failed!\" unless yield\nend", "def assert\n raise \"Assertion failed!\" unless yield\nend", "def assert\n raise \"Assertion failed!\" unless yield\nend", "def assert\n raise \"Assertion failed!\" unless yield\nend", "def assert\n raise \"Assertion failed!\" unless yield\nend", "def assert\n raise \"Assertion failed!\" unless yield\nend", "def assert\n raise \"Assertion failed!\" unless yield\nend" ]
[ "0.7233741", "0.6811358", "0.6462656", "0.63291764", "0.6272759", "0.6272759", "0.6272533", "0.6163501", "0.61149216", "0.6078253", "0.6055291", "0.6043552", "0.60076654", "0.60076654", "0.60076654", "0.5986781", "0.5926237", "0.59229416", "0.5859819", "0.58287674", "0.58218336", "0.5820406", "0.58115375", "0.5810477", "0.5798999", "0.57910436", "0.5784422", "0.577428", "0.57716167", "0.57716167", "0.57620454", "0.57609034", "0.5759966", "0.5755841", "0.5752318", "0.5741726", "0.571826", "0.5712849", "0.5662315", "0.5662237", "0.56448025", "0.5635487", "0.56136787", "0.560901", "0.5601809", "0.559799", "0.5583566", "0.5583536", "0.55775654", "0.55775654", "0.55775654", "0.5570228", "0.5567063", "0.55578154", "0.55578154", "0.55578154", "0.55578154", "0.55564415", "0.5554944", "0.5550532", "0.5550207", "0.5547611", "0.55440706", "0.55440706", "0.55410844", "0.5538358", "0.5534193", "0.55333614", "0.5533206", "0.5532276", "0.5525639", "0.5525114", "0.5525114", "0.5525114", "0.5525114", "0.5525114", "0.5525114", "0.5525114", "0.5525114", "0.5525114", "0.5525114", "0.5525114", "0.5525114", "0.5525114", "0.5525114", "0.5525114", "0.5525114", "0.5525114", "0.5525114", "0.5525114", "0.5525114", "0.5525114", "0.5525114", "0.5525114", "0.5525114", "0.5525114", "0.5525114", "0.5525114", "0.5525114", "0.5525114" ]
0.7565209
0
Given a hash, convert all keys to strings
def stringify_hash hash, options = {} (raise ExpectationFailedError.new("stringify_hash called without a hash")) unless hash.is_a?(Hash) hash.inject({}) do |result, (k,v)| key = options[:downcase] ? k.to_s.downcase : k.to_s if v.is_a?(Hash) then result[key] = stringify_hash(v) elsif v.is_a?(Regexp) && options[:rewrite_regex] then result[key] = v.inspect[1..-2] else result[key] = v end result end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def stringify_keys!(hash)\n transform_keys!(hash){ |key| key.to_s }\n end", "def stringify_hash_keys(hash); end", "def key2str(hash)\n return hash unless hash.is_a? Hash\n hash.each_value.select { |h| h.is_a? Hash }.each do |subh|\n sv = {}\n subh.each { |k, v| sv[k.to_s] = v }\n subh.replace sv\n end\n hash\n end", "def stringify_keys(hash)\n transform_hash(hash) {|hash, key, value| \n hash[key.to_s] = value\n }\n end", "def stringify_keys(hash)\n transform_hash(hash) {|hash, key, value|\n hash[key.to_s] = value\n }\n end", "def stringify_keys!(hash)\n map_keys!(hash, Transproc(:to_string).fn)\n end", "def stringify_keys!(hash)\n hash.keys.each {|key| hash[key.to_s] = hash.delete(key)}\n end", "def to_str_form(hash)\n hash.inject({}) do |h, (k, v)|\n h.merge((k.is_a?(Symbol) ? k.to_s : k) => (v.is_a?(Symbol) ? v.to_s : v))\n end\n end", "def deep_stringify_keys!(hash)\n deep_transform_keys!(hash){ |key| key.to_s }\n end", "def stringify_keys( hash )\n\t\t\tnewhash = {}\n\n\t\t\thash.each do |key,val|\n\t\t\t\tif val.is_a?( Hash )\n\t\t\t\t\tnewhash[ key.to_s ] = stringify_keys( val )\n\t\t\t\telse\n\t\t\t\t\tnewhash[ key.to_s ] = val\n\t\t\t\tend\n\t\t\tend\n\n\t\t\treturn newhash\n\t\tend", "def stringify_keys( hash )\n\t\t\tnewhash = {}\n\n\t\t\thash.each do |key,val|\n\t\t\t\tif val.is_a?( Hash )\n\t\t\t\t\tnewhash[ key.to_s ] = stringify_keys( val )\n\t\t\t\telse\n\t\t\t\t\tnewhash[ key.to_s ] = val\n\t\t\t\tend\n\t\t\tend\n\n\t\t\treturn newhash\n\t\tend", "def stringify_keys( hash )\n\t\t\tnewhash = {}\n\n\t\t\thash.each do |key,val|\n\t\t\t\tif val.is_a?( Hash )\n\t\t\t\t\tnewhash[ key.to_s ] = stringify_keys( val )\n\t\t\t\telse\n\t\t\t\t\tnewhash[ key.to_s ] = val\n\t\t\t\tend\n\t\t\tend\n\n\t\t\treturn newhash\n\t\tend", "def stringify_keys( hash )\n\t\t\tnewhash = {}\n\n\t\t\thash.each do |key,val|\n\t\t\t\tif val.is_a?( Hash )\n\t\t\t\t\tnewhash[ key.to_s ] = stringify_keys( val )\n\t\t\t\telse\n\t\t\t\t\tnewhash[ key.to_s ] = val\n\t\t\t\tend\n\t\t\tend\n\n\t\t\treturn newhash\n\t\tend", "def stringify_hash_keys hash\n Hash[hash.map { |(k, v)| [k.to_s, v] }]\n end", "def stringify_keys\n reduce({}) { |hsh,(k,v)| hsh.merge(k.to_s => v) }\n end", "def stringify_keys\n transform_keys { |key| key.to_s rescue key }\n end", "def stringify_keys\n reduce({}) { |hsh, (k, v)| hsh.merge(k.to_s => v) }\n end", "def stringify_keys\n reduce({}) { |hsh, (k, v)| hsh.merge(k.to_s => v) }\n end", "def stringify_keys\n reduce({}) { |hsh, (k, v)| hsh.merge(k.to_s => v) }\n end", "def keys_to_s\n self.inject({}){|memo,(k,v)| memo[k.to_s] = (v.is_a?(Hash) || v.is_a?(Array) ? v.keys_to_s : v); memo}\n end", "def stringify_keys(hash)\n hash.keys.each do |key|\n hash[key.to_s] = hash.delete(key)\n end\n\n hash.values.select{ |v| v.is_a?(Hash) }.each do |h| \n stringify_keys(h)\n end\n hash\n end", "def flatten_keys(hash)\n hash.transform_keys(&:downcase).transform_keys(&:to_sym)\n end", "def string_hash(hash)\n hash.map { |k, v| [k.to_s, v.to_s] }.to_h\n end", "def hash_sym_key_to_str(hash)\n new_hash = {}\n hash.each do |k, v|\n if v.is_a? Hash\n v = hash_sym_key_to_str(v)\n end\n if k.is_a? Symbol\n new_hash[k.to_s] = v\n else\n new_hash[k] = v\n end\n end\n return new_hash\n end", "def stringify_keys\n each_with_object({}) { |(k, v), hsh| hsh[k.to_s] = v }\n end", "def hash_to_str(hash)\n hash.map {|key, val| \"#{key} #{val}\"}.join(\", \")\n end", "def stringify_keys!\n transform_keys!{ |key| key.to_s }\n end", "def stringify_keys\n transform_keys(&:to_s)\n end", "def hash_to_string(hash)\n\tstring=\"\"\n\thash.each do |key, value|\n\t\tstring << \"#{key} : #{value} \"\n\tend\n\tstring\nend", "def stringify_keys!\n transform_keys!(&:to_s)\n end", "def stringify_keys!\n transform_keys!(&:to_s)\n end", "def stringify_keys!\n transform_keys!(&:to_s)\n end", "def stringify_keys!\n transform_keys!(&:to_s)\n end", "def transform_hash_to_string(hash)\n \"{#{hash.map { |k, v| \"\\\"#{k}\\\":#{v}\" }.join ', '}}\"\n # return \"{#{hash.map {|h| h.join ':'}.join ', '}}\"\n end", "def stringify_keys\n each_with_object({}) { |(k, v), hsh| hsh[k.to_s] = v.is_a?(Hash) ? v.stringify_keys : v }\n end", "def keys_to_s(recursive: true)\n each_with_object({}) do |(k, v), memo|\n memo[k.to_s] = recursive && v.respond_to?(:keys_to_sym) ? v.keys_to_s : v\n end\n end", "def deep_stringify_keys(hash)\n hash.inject({}) { |result, (key, value)|\n value = deep_stringify_keys(value) if value.is_a?(Hash)\n result[key.to_s] = value\n result\n }\n end", "def stringified_keys; end", "def humanize_keys(hash)\n Hash[hash.map { |k, v| [k.humanize, v] }]\n end", "def to_safe_hashes(hashes)\n hashes.map do |item|\n item.transform_keys(&:to_s)\n .transform_values do |v|\n if v.is_a? Symbol\n v.to_s\n else\n v\n end\n end\n end\n end", "def deep_stringify_keys(hash)\n transform_hash(hash, :deep => true) {|hash, key, value|\n hash[key.to_s] = value\n }\n end", "def dasherize_keys(hash)\n hash.deep_transform_keys do |key|\n key.to_s.dasherize\n end\n end", "def stringify_keys!\n\t\t\tself.each do |k,v|\n\t\t\t\tnext if k.kind_of? String\n\t\t\t\tself[k.to_s] = v\n\t\t\t\tself.delete k\n\t\t\tend\n\t\tend", "def deep_stringify_keys\n deep_transform_keys { |key| key.to_s }\n end", "def to_normal_hash(hash)\n hash.to_h.transform_keys(&:to_sym)\n end", "def stringify(hash)\n {}.tap do |h|\n hash.each { |key, value| h[key.to_s] = map_value_string(value) }\n end\n end", "def keys_to_strs(event)\n return event unless event.is_a? Hash\n\n out = {}\n\n event.each do |key, value|\n out[key.to_s] = keys_to_strs value\n end\n\n out\n end", "def deep_stringify_keys(hash)\n hash.each_with_object({}) do |(key, value), new_hash|\n new_hash[key.to_s] = (value.respond_to?(:to_hash) ? deep_stringify_keys(value) : value)\n end\n end", "def deep_stringify_keys!\n deep_transform_keys!{ |key| key.to_s }\n end", "def deep_stringify_keys!\n deep_transform_keys! { |key| key.to_s }\n end", "def stringify_keys\n hsh = Hash.new(default)\n self.each do |key, val|\n hsh[key.to_s] = val\n end\n hsh\n end", "def stringify_keys; end", "def stringify_keys; end", "def stringify_keys; end", "def hash(key)\n\t\tascii_keys = [] \n\t\tkey.to_s.each_byte { |el| ascii_keys << el }\n\t\tascii_keys.map { |el| el.to_s }.join('')\n\tend", "def fixed_keys_sort(hash)\n hash.keys.sort_by(&:to_s)\n end", "def convert_to_utf8(hash)\n charset = hash[:charset]\n hash.map { |k, v| [k, v.dup.force_encoding(charset).encode(\"utf-8\")] }.to_h.symbolize_keys\n end", "def add_key_values_to_str(hash)\n str_keys_values = \"\" # One long String in format \n\n str_keys_values += hash[:msg].to_s + \" | \" # Add msg first\n # We loop over every key in the hash and format the key/value in the string format we want \n hash.each do |key, value|\n if !key.to_s.eql?(\"level\") && !key.to_s.eql?(\"msg\") && !key.to_s.eql?(\"file\")\n key = \"#{add_color_key(key)}\" if with_color # Add color to keys if with_color is set to true\n str_keys_values += \"#{key}: #{value} \"\n end\n end\n str_keys_values\n end", "def keys_to_s!(recursive: true)\n replace(keys_to_s(recursive: recursive))\n end", "def stringify_hash(input)\n input.inject({}){|h,(k,v)| h[k.to_s] = v.to_s; h}\n end", "def deep_stringify_keys!\n deep_transform_keys!(&:to_s)\n end", "def kv_encode(h); h.map {|k,v| k.to_s + \":\" + v.to_s + 10.chr }.join end", "def to_s\n str = ''\n longest_key = length_of_longest_key\n unless @hash.empty?\n @hash.keys.sort.each do |key|\n str += format_key_val_string(key, @hash[key], longest_key) + \"\\n\"\n end\n end\n str\n end", "def deep_stringify_keys!\n deep_transform_keys!(&:to_s)\n end", "def deep_stringify_keys!\n deep_transform_keys!(&:to_s)\n end", "def stringify_values(hash)\n transform_hash(hash) do |inner_hash, key, value|\n if value.is_a?(Hash)\n inner_hash[key] = value\n elsif value.is_a?(Array)\n inner_hash[key] = stringify(value)\n else\n inner_hash[key] = value.to_s\n end\n end\n end", "def keys_to_sym hash\n return hash unless hash.is_a? Hash\n hash.inject({}){ |opts,(k,v)| opts[k.to_sym] = v; opts }\n end", "def symbolize_hash_keys(hash); end", "def normalize_keys(hash)\n hash.inject(HashWithIndifferentAccess.new) do |new_hash, (key, value)|\n new_hash[key.parameterize(separator: \"_\")] = value\n new_hash\n end\n end", "def moonshine_stringify_keys(h)\n h.inject({}) do |options, (key, value)|\n options[key.to_s] = value\n options\n end\n end", "def moonshine_stringify_keys(h)\n h.inject({}) do |options, (key, value)|\n options[key.to_s] = value\n options\n end\n end", "def keys_to_symbols(hash)\n\t\thash.keys.inject({}) do |hsh, key|\n\t\t\thsh[key.to_sym] = hash[key]\n\t\t\thsh\n\t\tend\n\tend", "def print_hash(hash)\n hash.inject(\"\") { |s, (k, v)| \"#{s} #{k}: #{v}.\" }\nend", "def print_hash(hash)\n hash.inject(\"\") { |s, (k, v)| \"#{s} #{k}: #{v}.\" }\nend", "def normalize_hash(h)\n h.map do |k,v|\n v = v.strip if v.respond_to?(:strip)\n v = v.gsub(/[^[[:ascii:]]]/, \"\") if v.respond_to?(:gsub)\n [k, v]\n end.to_h\n end", "def stringify_keys(object)\n case object\n when Hash\n object.each_with_object({}) do |(key, value), result|\n result[key.to_s] = stringify_keys(value)\n end\n when Array\n object.map { |e| stringify_keys(e) }\n else\n object\n end\n end", "def _squish(hash)\n hash = _flatten(hash)\n hash.each_with_object({}) do |(k, v), ret|\n k = k.gsub(/extensions|com|instructure|canvas/, '').gsub(/_+/, '_').gsub(/^_/, '').downcase\n ret[k] = v\n end\nend", "def dot_key_values(hash)\n hash.map{|k,v| \n \"#{k}=\\\"#{ v.to_s.gsub(/\"/, \"''\" ).gsub(\"\\n\",' ') }\\\"\" \n }.join(', ') rescue \"boh1235: #{$!}\"\n end", "def symbolize_keys(hash)\n hash.inject({}){|result, (key, value)|\n new_key = case key\n when String then key.to_sym\n else key\n end\n new_value = case value\n when Hash then symbolize_keys(value)\n else value\n end\n result[new_key] = new_value\n result\n }\n end", "def with_stringified_keys\n inject({}) do |hash, (key, value)|\n hash.update key.to_s => value\n end\n end", "def to_h\n dasherize_keys(hash)\n end", "def stringify_keys\n inject({}) do |options, (key, value)|\n options[(key.to_s rescue key) || key] = value\n options\n end\n end", "def symbolize_keys!(hash)\n transform_keys!(hash){ |key| key.to_sym rescue key }\n end", "def camelize_hash(hash)\n if hash.is_a?(Hash)\n Hash[hash.map { |k, v| [camelize_key(k, false), camelize_hash(v)] }]\n else\n hash\n end\n end", "def camelize_hash(hash)\n if hash.is_a?(Hash)\n Hash[hash.map { |k, v| [camelize_key(k, false), camelize_hash(v)] }]\n else\n hash\n end\n end", "def recursively_stringify_key\n recursively_transform_keys { |key| key.to_s rescue key }\n end", "def keys_to_camelcase(hash)\n hash.transform_keys do |key|\n key.to_s\n .gsub(%r{(?:_+)([a-z])}) { Regexp.last_match(1).upcase }\n .gsub(%r{(\\A|\\s)([A-Z])}) { Regexp.last_match(1) + Regexp.last_match(2).downcase }\n .to_sym\n end\n end", "def to_s\n @hash.inject(+'') do |memo, (k, v)|\n memo << k << '=' << v << ','\n end.chop! || ''\n end", "def symbolize_keys(hash)\n case hash\n when Array\n hash.map { |v| symbolize_keys(v) }\n when Hash\n Hash[hash.map { |k, v| [k.to_sym, symbolize_keys(v)] }]\n else\n hash\n end\n end", "def normalize(hash)\n hash.symbolize_keys if hash\n end", "def hash_to_consistent_string(hash)\n return hash unless hash.is_a?(Hash)\n hash = hash.dup\n hash.each do |key, value|\n hash[key] = value.source_location if value.is_a?(Proc)\n end\n hash.to_s\n end", "def hash_string(hash, **opt)\n pair_separator = opt[:pair_separator] || PAIR_SEPARATOR\n normalized_list(hash, **opt).join(pair_separator)\n end", "def stringify_keys!\n replace stringify_keys\n end", "def hash_keys(hash)\n\thash.map { |k, v| k }\nend", "def symbolify_keys( hash )\n\t\t\tnewhash = {}\n\n\t\t\thash.each do |key,val|\n\t\t\t\tkeysym = key.to_s.dup.untaint.to_sym\n\n\t\t\t\tif val.is_a?( Hash )\n\t\t\t\t\tnewhash[ keysym ] = symbolify_keys( val )\n\t\t\t\telse\n\t\t\t\t\tnewhash[ keysym ] = val\n\t\t\t\tend\n\t\t\tend\n\n\t\t\treturn newhash\n\t\tend", "def symbolify_keys( hash )\n\t\t\tnewhash = {}\n\n\t\t\thash.each do |key,val|\n\t\t\t\tkeysym = key.to_s.dup.untaint.to_sym\n\n\t\t\t\tif val.is_a?( Hash )\n\t\t\t\t\tnewhash[ keysym ] = symbolify_keys( val )\n\t\t\t\telse\n\t\t\t\t\tnewhash[ keysym ] = val\n\t\t\t\tend\n\t\t\tend\n\n\t\t\treturn newhash\n\t\tend", "def symbolify_keys( hash )\n\t\t\tnewhash = {}\n\n\t\t\thash.each do |key,val|\n\t\t\t\tkeysym = key.to_s.dup.untaint.to_sym\n\n\t\t\t\tif val.is_a?( Hash )\n\t\t\t\t\tnewhash[ keysym ] = symbolify_keys( val )\n\t\t\t\telse\n\t\t\t\t\tnewhash[ keysym ] = val\n\t\t\t\tend\n\t\t\tend\n\n\t\t\treturn newhash\n\t\tend", "def symbolify_keys( hash )\n\t\t\tnewhash = {}\n\n\t\t\thash.each do |key,val|\n\t\t\t\tkeysym = key.to_s.dup.untaint.to_sym\n\n\t\t\t\tif val.is_a?( Hash )\n\t\t\t\t\tnewhash[ keysym ] = symbolify_keys( val )\n\t\t\t\telse\n\t\t\t\t\tnewhash[ keysym ] = val\n\t\t\t\tend\n\t\t\tend\n\n\t\t\treturn newhash\n\t\tend", "def keys_to_snake_case(hash)\n hash.transform_keys do |key|\n key.gsub(%r{([A-Z]+)([A-Z][a-z])}, '\\1_\\2')\n .gsub(%r{([a-z\\d])([A-Z])}, '\\1_\\2')\n .downcase\n .to_sym\n end\n end", "def stringify_keys!\n keys.each{|k| \n v = delete(k)\n self[k.to_s] = v\n v.stringify_keys! if v.is_a?(Hash)\n v.each{|p| p.stringify_keys! if p.is_a?(Hash)} if v.is_a?(Array)\n }\n self\n end" ]
[ "0.84265304", "0.8346799", "0.82667536", "0.8126027", "0.8119735", "0.80757165", "0.7916707", "0.7776567", "0.7755829", "0.7669759", "0.7669759", "0.7669759", "0.7669759", "0.76611507", "0.7580043", "0.75631803", "0.7562723", "0.7562723", "0.7562723", "0.75555116", "0.755153", "0.74986446", "0.74839264", "0.74640006", "0.74367404", "0.7412221", "0.7376135", "0.7370305", "0.73469466", "0.73215914", "0.73215914", "0.73215914", "0.7312462", "0.7215408", "0.71967286", "0.7107817", "0.7060181", "0.6976399", "0.69338924", "0.6875263", "0.68677706", "0.68640006", "0.68580693", "0.6853547", "0.6824393", "0.6821887", "0.6813986", "0.6789414", "0.676965", "0.67659533", "0.673736", "0.67208076", "0.67208076", "0.67208076", "0.6714746", "0.6684273", "0.66815805", "0.66416806", "0.66275704", "0.66251653", "0.6607508", "0.6602534", "0.65908265", "0.65779126", "0.65779126", "0.65691", "0.6566634", "0.65098953", "0.6471167", "0.64576846", "0.64576846", "0.6453164", "0.6443668", "0.6443668", "0.6403646", "0.6403544", "0.639188", "0.6386123", "0.6376031", "0.636719", "0.6360291", "0.6357299", "0.63433415", "0.63358855", "0.63358855", "0.6333821", "0.6331854", "0.6308967", "0.63067853", "0.6302288", "0.6300037", "0.6290069", "0.6278771", "0.6273482", "0.62647074", "0.62647074", "0.62647074", "0.62647074", "0.6259155", "0.62284213" ]
0.6355506
82
Never trust parameters from the scary internet, only allow the following list through.
def rating_params params.require(:rating).permit(:rating, :task_id) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def url_allowlist=(_arg0); end", "def url_allowlist; end", "def allowed_params\n ALLOWED_PARAMS\n end", "def default_param_whitelist\n [\"mode\"]\n end", "def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end", "def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end", "def allow_params_authentication!; end", "def param_whitelist\n [:role, :title]\n end", "def expected_permitted_parameter_names; end", "def allowed_options\n []\nend", "def allowed_options\n []\nend", "def allowed_options\n []\nend", "def allowed_options\n []\nend", "def allowed_options\n []\nend", "def allowed_options\n []\nend", "def allowed_options\n []\nend", "def allowed_options\n []\nend", "def allowed_options\n []\nend", "def allowed_options\n []\nend", "def allowed_options\n []\nend", "def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end", "def parameters_list_params\n params.require(:parameters_list).permit(:name, :description, :is_user_specific)\n end", "def url_whitelist; end", "def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end", "def allowed_params(parameters)\n parameters.select do |name, values|\n values.location != \"path\"\n end\n end", "def param_whitelist\n [:rating, :review]\n end", "def url_whitelist=(_arg0); end", "def accepted_params\n [\n :Amount,\n :isPreAuth,\n :ServiceId, \n :RequestLang, \n :FullName, \n :Email, \n :Phone, \n :MaxInstallments,\n :MerchantTrns,\n :CustomerTrns,\n :SourceCode,\n :PaymentTimeOut,\n :ExpirationDate,\n :AllowRecurring,\n :Tags,\n :AllowTaxCard,\n :ActionUser,\n :DisableCash,\n :DisableCard\n ]\n end", "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "def url_list_params\n params.require(:url_list).permit(:full_url, :short_url)\n end", "def valid_parameters\n sort_symbols(@interface.allowed_parameters)\n end", "def permitted_params\n []\n end", "def extension_allowlist\n end", "def whitelist; end", "def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end", "def param_whitelist\n [\n :school_name,\n :school_id,\n :degree,\n :started_at,\n :finished_at,\n majors: [],\n minors: []\n ]\n end", "def valid_params_request?; end", "def list_params\n params.require(:list).permit(:name, :description, :type, :privacy, :allow_edit, :rating, :votes_count, :user_id)\n end", "def list_params\n params.permit(:list_name)\n end", "def whitelisted_args\n args.select &:allowed\n end", "def safe_params\n params.except(:host, :port, :protocol).permit!\n end", "def user_pref_list_params\n\t\tparams.require(:user).permit(:preference_list)\n\tend", "def blacklisted_search_session_params\n PARAM_NOT_PERSISTED\n end", "def whitelist_place_params\n params.require(:place).permit(:place_name, :unlock, :auth, :is_deep_checked, :parent_ADM4, :parent_ADM3, :parent_ADM2, :parent_ADM1, :parent_country, feature_code: [], same_as: [], related_authority: [], altlabel: [], note: []) # Note - arrays need to go at the end or an error occurs!\n end", "def sequence_param_whitelist\n default_param_whitelist << \"show_index\"\n end", "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "def check_params; true; end", "def filtered_parameters; end", "def strong_params\n params.require( :setting ).\n permit( :global_scan_limit, :per_user_scan_limit,\n :target_whitelist_patterns, :target_blacklist_patterns )\n end", "def valid_access_params\n params.require(:valid_access).permit(:wish_list_id, :user_id)\n end", "def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end", "def request_parameters; end", "def blacklisted_params\n params.keys.each_with_object({}) do |param, hash|\n param = param.to_sym\n hash[param] = nil unless WHITELIST_PAGINATION_PARAMS.include?(param)\n end\n end", "def allowed_query_params\n %w[include fields filter sort page]\n end", "def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end", "def allowed?; true end", "def url_params\n []\n end", "def recipient_list_params\n params.require(:recipient_list).permit(:name, :list, :references)\n end", "def listed_params\n params.permit(:listed, :list_id, :listable_id, :listable_type, :campsite_id)\n end", "def extension_denylist\n end", "def special_device_list_params\n params.require(:special_device_list).permit(:name)\n end", "def ml_list_params\n params.require(:ml_list).permit(:name,\n :email,\n :description,\n :aliases,\n :diffusion_policy,\n :inscription_policy,\n :is_public,\n :messsage_header,\n :message_footer,\n :is_archived,\n :custom_reply_to,\n :default_message_deny_notification_text,\n :msg_welcome,\n :msg_goodbye,\n :message_max_bytes_size,\n :group_uuid,\n )\n end", "def list_params\n params.require(:list).permit(:name)\n end", "def list_params\n params.require(:list).permit(:name)\n end", "def list_params\n params.require(:list).permit(:name)\n end", "def list_params\n params.require(:list).permit(:name, :account_id, :owner_id)\n end", "def list_params\n params.permit(:name)\n end", "def safelist; end", "def list_params\n params.require(:list).permit(:name)\n end", "def list_params\n if current_user && current_user.role == 'admin'\n params.require(:list).permit(:name, :url, :description, :user_id,\n ideas_attributes: [:id, :list_id, :body, :due_date, :completion_status, :_destroy])\n else\n params.require(:list).permit(:name, :description,\n ideas_attributes: [:body, :due_date, :completion_status]) \n end\n end", "def list_params\n params.require(:list).permit(:name)\n end", "def white_listed\n @white_listed ||= []\n end", "def all_params; end", "def filter_parameters; end", "def filter_parameters; end", "def access_list_to_ea_point_params\n params.require(:access_list_to_ea_point).permit(:ea_pproof, :remove_ea_pproof, :al_file_name, :al_eap_id)\n end", "def list_params\n params.require(:list).permit(:name, :user_id)\n end", "def whitelist\n @whitelist || []\n end", "def list_params\n params.fetch(:list, {}).permit(:user_id, :name, :active)\n end", "def lists_params\n params.require(:list).permit(:name)\n\n end", "def get_allowed_parameters\n return _get_specific_action_config(:allowed_action_parameters, :allowed_parameters)&.map(&:to_s)\n end", "def allowed?(*_)\n true\n end", "def subscription_list_params\n #params[:subscription_list].permit(:name, :description)\n #params.permit(:careers, :years, :subjects).permit(subscription_list: [ :name, :description ])\n #params.permit(:careers).require(:subscription_list).permit(:name, :description)\n params.permit! # So far, no strong params here...\n end", "def param_whitelist\n whitelist = [\n :comment,\n :old_progress, :new_progress,\n :metric_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:metric_id)\n end\n \n whitelist\n end", "def list_params\n params.require(:list).permit(:name).merge(user_id: current_user.id)\n end", "def request_params; end", "def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end", "def anonymous_safelists; end", "def allow(ids); end", "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "def allowed_params\n params.require(:allowed).permit(:email)\n end", "def additional_permitted_params\n []\n end", "def anonymous_filter_params\n p = params.required('payload')\n # p.permit!('controls_params')\n # p.permit!('columns_params')\n # p.permit!('sorting')\n # p.permit!('global_config')\n p.permit(\n 'name',\n 'controls_list' => [],\n 'controls_hl_mode' => [],\n 'controls_params' => {},\n 'columns_list' => [],\n 'columns_params' => {},\n 'sorting' => {},\n 'global_config' => {}\n ).merge(permit_hashes(p, [\n 'controls_params',\n 'columns_params',\n 'sorting',\n 'global_config'\n ]))\n end", "def allowed_resources\n %w( )\n end", "def strong_params\n params.require(:community).permit(param_whitelist)\n end", "def list_params\n params.require(:list).permit(:user_id, :name, :privacy, :status, :description, \n user:[:name, :id], task:[:id, :list_id, :title, :note, :completed])\n end", "def query_parameters; end", "def allowed_filters\n []\n end", "def price_list_params\n params.fetch(:price_list, {}).permit(:name, :valid_from, :valid_to, :active,\n :all_warehouses, :all_users, :all_contact_groups,\n warehouse_ids: [], price_lists_user_ids: [], contact_group_ids: [])\n end", "def content_type_denylist\n end", "def allow_anon\n end" ]
[ "0.7361518", "0.7340487", "0.7001328", "0.68377465", "0.68079937", "0.677716", "0.6646763", "0.6632506", "0.65495855", "0.6519738", "0.6519738", "0.6519738", "0.6519738", "0.6519738", "0.6519738", "0.6519738", "0.6519738", "0.6519738", "0.6519738", "0.6519738", "0.64730406", "0.6397407", "0.6388369", "0.6379525", "0.63582003", "0.6345939", "0.6340584", "0.6321921", "0.6307226", "0.6259175", "0.6223032", "0.6212291", "0.62038857", "0.6188274", "0.61624134", "0.6152169", "0.6104213", "0.6090194", "0.60832995", "0.60768336", "0.60504943", "0.6047381", "0.6036158", "0.59900856", "0.59856504", "0.5983213", "0.59712297", "0.59694695", "0.5968887", "0.5963296", "0.59619254", "0.5960221", "0.5957113", "0.59552187", "0.59429455", "0.59363645", "0.5913618", "0.5912073", "0.590965", "0.5893941", "0.58926225", "0.5886445", "0.58830315", "0.58830315", "0.58830315", "0.58802426", "0.5878862", "0.58767897", "0.5873922", "0.5872649", "0.5872544", "0.5870409", "0.5865746", "0.58593583", "0.58593583", "0.5856343", "0.5837225", "0.5835851", "0.5835055", "0.58329743", "0.5827142", "0.58262646", "0.5817912", "0.581739", "0.5803317", "0.5799921", "0.5798867", "0.57987267", "0.57983804", "0.5793901", "0.57936734", "0.57930833", "0.579161", "0.57893646", "0.57887757", "0.5787823", "0.57859933", "0.5777788", "0.5770963", "0.57686245", "0.5767154" ]
0.0
-1
Use callbacks to share common setup or constraints between actions.
def set_event @event = Event.find(params[:event_id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "def action_hook; end", "def run_actions; end", "def define_action_hook; end", "def actions; end", "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end", "def add_actions; end", "def callbacks; end", "def callbacks; end", "def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end", "def define_action_helpers; end", "def post_setup\n end", "def action_methods; end", "def action_methods; end", "def action_methods; end", "def before_setup; end", "def action_run\n end", "def execute(setup)\n @action.call(setup)\n end", "def define_action_helpers?; end", "def set_actions\n actions :all\n end", "def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end", "def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end", "def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end", "def before_actions(*logic)\n self.before_actions = logic\n end", "def setup_handler\n end", "def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end", "def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end", "def action; end", "def action; end", "def action; end", "def action; end", "def action; end", "def workflow\n end", "def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end", "def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end", "def before(action)\n invoke_callbacks *self.class.send(action).before\n end", "def process_action(...)\n send_action(...)\n end", "def before_dispatch(env); end", "def after_actions(*logic)\n self.after_actions = logic\n end", "def setup\n # override and do something appropriate\n end", "def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end", "def setup(_context)\n end", "def setup(resources) ; end", "def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end", "def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end", "def determine_valid_action\n\n end", "def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end", "def startcompany(action)\n @done = true\n action.setup\n end", "def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end", "def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end", "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end", "def define_tasks\n define_weave_task\n connect_common_tasks\n end", "def setup(&block)\n define_method(:setup, &block)\n end", "def setup\n transition_to(:setup)\n end", "def setup\n transition_to(:setup)\n end", "def action\n end", "def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend", "def config(action, *args); end", "def setup\n @setup_proc.call(self) if @setup_proc\n end", "def before_action \n end", "def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end", "def action\n end", "def matt_custom_action_begin(label); end", "def setup\n # override this if needed\n end", "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end", "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end", "def after(action)\n invoke_callbacks *options_for(action).after\n end", "def pre_task\n end", "def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end", "def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end", "def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end", "def setup_signals; end", "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end", "def initialize(*args)\n super\n @action = :set\nend", "def after_set_callback; end", "def setup\n #implement in subclass;\n end", "def lookup_action; end", "def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end", "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "def release_actions; end", "def around_hooks; end", "def save_action; end", "def setup(easy)\n super\n easy.customrequest = @verb\n end", "def action_target()\n \n end", "def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end", "def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end", "def before_setup\n # do nothing by default\n end", "def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end", "def default_action; end", "def setup(&blk)\n @setup_block = blk\n end", "def callback_phase\n super\n end", "def advice\n end", "def _handle_action_missing(*args); end", "def duas1(action)\n action.call\n action.call\nend", "def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end", "def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end", "def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend" ]
[ "0.6163163", "0.6045976", "0.5946146", "0.591683", "0.5890051", "0.58349305", "0.5776858", "0.5703237", "0.5703237", "0.5652805", "0.5621621", "0.54210985", "0.5411113", "0.5411113", "0.5411113", "0.5391541", "0.53794575", "0.5357573", "0.53402257", "0.53394014", "0.53321576", "0.53124547", "0.529654", "0.5296262", "0.52952296", "0.52600986", "0.52442724", "0.52385926", "0.52385926", "0.52385926", "0.52385926", "0.52385926", "0.5232394", "0.523231", "0.5227454", "0.52226824", "0.52201617", "0.5212327", "0.52079266", "0.52050185", "0.51754695", "0.51726824", "0.51710224", "0.5166172", "0.5159343", "0.51578903", "0.51522785", "0.5152022", "0.51518047", "0.51456624", "0.51398855", "0.5133759", "0.5112076", "0.5111866", "0.5111866", "0.5110294", "0.5106169", "0.509231", "0.50873137", "0.5081088", "0.508059", "0.50677156", "0.50562143", "0.5050554", "0.50474834", "0.50474834", "0.5036181", "0.5026331", "0.5022976", "0.5015441", "0.50121695", "0.5000944", "0.5000019", "0.4996878", "0.4989888", "0.4989888", "0.49864885", "0.49797225", "0.49785787", "0.4976161", "0.49683493", "0.4965126", "0.4958034", "0.49559742", "0.4954353", "0.49535993", "0.4952725", "0.49467874", "0.49423352", "0.49325448", "0.49282882", "0.49269363", "0.49269104", "0.49252945", "0.4923091", "0.49194667", "0.49174926", "0.49173003", "0.49171105", "0.4915879", "0.49155936" ]
0.0
-1
Never trust parameters from the scary internet, only allow the white list through.
def agenda_item_params params.require(:agenda_item).permit(:name, :event_id) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "def allow_params_authentication!; end", "def allowed_params\n ALLOWED_PARAMS\n end", "def default_param_whitelist\n [\"mode\"]\n end", "def param_whitelist\n [:role, :title]\n end", "def expected_permitted_parameter_names; end", "def safe_params\n params.except(:host, :port, :protocol).permit!\n end", "def strong_params\n params.require(:team_member).permit(param_whitelist)\n end", "def permitir_parametros\n \t\tparams.permit!\n \tend", "def strong_params\n params.require(:community).permit(param_whitelist)\n end", "def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end", "def strong_params\n params.require(:education).permit(param_whitelist)\n end", "def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end", "def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end", "def param_whitelist\n [:rating, :review]\n end", "def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end", "def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end", "def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end", "def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end", "def valid_params_request?; end", "def strong_params\n params.require(:experience).permit(param_whitelist)\n end", "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end", "def allowed_params\n params.require(:allowed).permit(:email)\n end", "def permitted_params\n []\n end", "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end", "def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend", "def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end", "def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end", "def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end", "def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end", "def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end", "def safe_params\n params.require(:user).permit(:name)\n end", "def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend", "def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end", "def check_params; true; end", "def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end", "def quote_params\n params.permit!\n end", "def valid_params?; end", "def paramunold_params\n params.require(:paramunold).permit!\n end", "def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend", "def filtered_parameters; end", "def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end", "def filtering_params\n params.permit(:email, :name)\n end", "def check_params\n true\n end", "def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend", "def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend", "def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end", "def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end", "def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end", "def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend", "def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end", "def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end", "def active_code_params\n params[:active_code].permit\n end", "def filtering_params\n params.permit(:email)\n end", "def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end", "def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end", "def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end", "def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end", "def post_params\n if current_user.admin? \n params.permit(:title, :body, :city, :country, :gps_location, :privacy, :visible, :latitude, :longitude, images: [], files: [])\n else \n params.permit(:title, :body, :city, :country, :gps_location, :privacy,:latitude, :longitude, images: [], files: [])\n end \n end", "def list_params\n params.permit(:name)\n end", "def filter_parameters; end", "def filter_parameters; end", "def vineyard_params\n params.permit(:vineyard_name, :email, :website_url, :phone, :address, :city, :region, :postcode, :country, :specialty, :description, :pet_friendly, :holiday, :tours, :events, :family_friendly, :cover_image, :image_one, :image_two, :image_three, :image_four, :user_id, :base64)\n end", "def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end", "def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end", "def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end", "def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end", "def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end", "def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end", "def url_whitelist; end", "def admin_social_network_params\n params.require(:social_network).permit!\n end", "def filter_params\n params.require(:filters).permit(:letters)\n end", "def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end", "def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end", "def sensitive_params=(params)\n @sensitive_params = params\n end", "def permit_request_params\n params.permit(:address)\n end", "def user_params\n # Ensure a user can't give themselves admin priveleges\n params.delete(:admin) if current_user.admin?\n params.require(:user).permit(:name, :email, :admin, :image)\n end", "def secure_params\n params.require(:location).permit(:name)\n end", "def strong_params\n params.require( :setting ).\n permit( :global_scan_limit, :per_user_scan_limit,\n :target_whitelist_patterns, :target_blacklist_patterns )\n end", "def question_params\n params.require(:survey_question).permit(question_whitelist)\n end", "def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end", "def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end", "def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end", "def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end", "def url_params\n params[:url].permit(:full)\n end", "def backend_user_params\n params.permit!\n end", "def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend", "def speed_measurement_params\n\n #fuckit, to lazy to deal with permit crap right now\n ActionController::Parameters.permit_all_parameters = true\n\n params[:speed_measurement]\n end", "def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end", "def get_params\r\n #params.require(:article).permit(:title, :permalink, :content, :source_site, :introtext, :type_id, :order_by, :searchable, :created_by, :edited_by, :published_by, :published_on, :user_id)\r\n params.require(:article).permit!\r\n\r\n end", "def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end", "def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end", "def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end", "def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end", "def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end" ]
[ "0.69792545", "0.6781151", "0.67419964", "0.674013", "0.6734356", "0.6591046", "0.6502396", "0.6496313", "0.6480641", "0.6477825", "0.64565", "0.6438387", "0.63791263", "0.63740575", "0.6364131", "0.63192815", "0.62991166", "0.62978333", "0.6292148", "0.6290449", "0.6290076", "0.62894756", "0.6283177", "0.6242471", "0.62382483", "0.6217549", "0.6214457", "0.6209053", "0.6193042", "0.6177802", "0.6174604", "0.61714715", "0.6161512", "0.6151757", "0.6150663", "0.61461", "0.61213595", "0.611406", "0.6106206", "0.6105114", "0.6089039", "0.6081015", "0.6071004", "0.60620916", "0.6019971", "0.601788", "0.6011056", "0.6010898", "0.6005122", "0.6005122", "0.6001556", "0.6001049", "0.59943926", "0.5992201", "0.59909594", "0.5990628", "0.5980841", "0.59669393", "0.59589154", "0.5958826", "0.5957911", "0.5957385", "0.5953072", "0.59526145", "0.5943361", "0.59386164", "0.59375334", "0.59375334", "0.5933856", "0.59292704", "0.59254247", "0.5924164", "0.59167904", "0.59088355", "0.5907542", "0.59064597", "0.5906243", "0.5898226", "0.589687", "0.5896091", "0.5894501", "0.5894289", "0.5891739", "0.58860534", "0.5882406", "0.587974", "0.58738774", "0.5869024", "0.58679986", "0.5867561", "0.5865932", "0.5864461", "0.58639693", "0.58617616", "0.5861436", "0.5860451", "0.58602303", "0.5854586", "0.58537364", "0.5850427", "0.5850199" ]
0.0
-1
q = "The exception object passed to raise" a = "$!"
def continue? print "Enter any key to continue or 'x' to exit: " response = gets.chomp().downcase if response == 'x' return true else return false end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def raise(exception); end", "def throw _args\n \"throw _args;\" \n end", "def raise(exception_klass = T.unsafe(nil)); end", "def raise(*rest) end", "def raise(*rest) end", "def foo\n return raise\n#> xxxxxx\n end", "def exception\n raise \"It's a bad one!\"\n end", "def raise_exception \n puts 'I am before the raise.' \n raise 'An error has occuredzzzz' \n puts 'I am after the raise' \nend", "def continued_exception=(_arg0); end", "def underlying_exception=(_arg0); end", "def exception; end", "def exception; end", "def exception; end", "def exception; end", "def exception; end", "def reraise\n raise $!.class, $!.message, caller[1..-1]\nend", "def original_exception=(_arg0); end", "def assert_raise(error_to_raise = Exception)\n begin\n # Dangerous Code\n yield\n rescue => the_error_object\n if the_error_object.class == error_to_raise\n print \".\"\n else\n print \"F\"\n end\n else\n print \"E\"\n end\n\nend", "def raise(*args)\n ::Object.send(:raise, *args)\n end", "def rescue_action(e); raise e; end", "def exception(*rest) end", "def raises *args\n @raises = args\n self\n end", "def raise(*args)\n ::Object.send(:raise, *args)\n end", "def exceptions; end", "def raise(*args)\n Kernel.raise(*args)\n end", "def refute_nothing_raised(msg=nil, &block)\n RescueAssay.assert!(Exception, :message=>msg, :backtrace=>caller, &block)\n end", "def rescue_action(e) raise e end", "def rescue_action(e) raise e end", "def rescue_action(e) raise e end", "def rescue_action(e) raise e end", "def keep_it_in\n raise \"rawr\"\nrescue\n # ahem\nend", "def raise_an_exception\n puts \"Going to cause an exception.\"\n # If you include a string, this is a generic RuntimeError\n # It is not rescued.\n # An un-rescued exception will cause the current Ruby process\n # to exit with error code 1 (error code 0 indicates normal\n # execution, anything else something anomalous)\n # You can view the error code of a process in most Unix-like\n # systems by typing echo $? at the prompt after execution.\n raise \"I am the exception\"\n puts \"This line will never be executed\"\nend", "def test_of_caller_exception\r\n x = 10\r\n assert_raises(Exception) do\r\n _bar\r\n puts x\r\n end\r\n end", "def rescue_from(exception); end", "def is_exception?; end", "def assert_throws(sym, msg = T.unsafe(nil)); end", "def throw(symb, *rest) end", "def expected(s)\n abort \"#{s} Expected\"\nend", "def expected(s)\n abort \"#{s} Expected\"\nend", "def expected(s)\n abort \"#{s} Expected\"\nend", "def original_exception; end", "def exceptions_app=(_arg0); end", "def exceptions_app=(_arg0); end", "def to_s\n \"#{@stub} # raise #{@exception}\"\n end", "def expected(s)\n abort(\"#{s} Expected\")\nend", "def hsdq_error(message, context); placeholder; end", "def test_exception_notification\n raise 'Testing, 1 2 3.'\n end", "def raise(fiber, *arguments); end", "def raise_exc\n <<-CODE\n t1 = stack_pop();\n cpu_raise_exception(state, c, t1);\n CODE\n end", "def exception_details(e, msg); end", "def exception_class; end", "def cause; end", "def cause; end", "def raise_rescue\n begin\n puts 'I am before the raise.'\n raise 'An error has occured.'\n puts 'I am after the raise.'\n rescue RuntimeError # 指定捕获异常的类型\n puts 'I am rescue!'\n end\n puts 'I am after the rescue.'\nend", "def assert_nothing_raised(msg=nil, &block)\n RescueAssay.refute!(Exception, :message=>msg, :backtrace=>caller, &block)\n end", "def raise_exc\n raise\n rescue\n end", "def abort_on_exception=(_arg0); end", "def ignore_raise\n yield\nrescue StandardError\n :raised\nend", "def exception(arg0, arg1, *rest)\n end", "def catch_exceptions; end", "def assert_raises\n [\"assert_raises #{@exception.class.name} do\"] + body + [\"end\"]\n end", "def print_exception(e)\n\tputs \"error: #{e.message}\"\nend", "def wrapped_exception; end", "def wont_throw(sym, msg=nil)\n ThrowAssay.refute!(sym, :message=>msg, :backtrace=>caller, &self)\n end", "def abort_on_exception=(*) end", "def miss_reason=(_arg0); end", "def exception_on_syntax_error=(_arg0); end", "def underlying_exception; end", "def raise_error aMessage, aError = $!\n raise aError.class, \"#{aMessage}:\\n#{aError}\", aError.backtrace\n end", "def boom\n raise \"boom\"\n end", "def x\n # ...\nrescue\n # ...\nend", "def any_exception_captured=(_arg0); end", "def exceptions\n Calls.new(select(&:raised?))\n end", "def zlosniwa\r\n raise # ponownie zglasza biezacy wyjatek\r\n raise \"Houston, we've got a problem!\" # zglasza RuntimeError\r\n raise InterfaceException, \"Blad klawiatury\", caller # ustawia komunikat i slad stosu\r\nend", "def test_raise_error\n assert_raises(CustomError) do\n resolver_returning_error.query_raw(Dnsruby::Message.new, :raise)\n end\n end", "def raise_error(*args)\n @expectation.raise(*args)\n self\n end", "def error(message)\n raise Error, message, caller\n end", "def abort_on_exception(*) end", "def raise_exception_info\n begin\n puts 'I am before the raise.'\n raise 'An error has occured.'\n puts 'I am after the raise.'\n rescue RuntimeError => e\n puts e.message\n puts e.backtrace.inspect # 打印具体的错误位置\n end\n puts 'I am after the rescue.'\nend", "def raise_exception\n\tbegin\n\t\tputs \"I am before the raise 1\"\n\t\traise 'An error has occured during the process'\n\t\tputs 'After the raise'\n\trescue\n\t\tputs 'Rescued for the first time'\n\tend\nend", "def refute_throws(expected, msg=nil, &blk)\n ThrowAssay.refute!(expected, :message=>msg, :backtrace=>caller, &blk)\n end", "def must_throw(sym, msg=nil)\n ThrowAssay.assert!(sym, :message=>msg, :backtrace=>caller, &self)\n end", "def refute_throws(sym, msg=nil, &blk)\n ThrowFailure.refute(sym, :message=>msg, :backtrace=>caller, &blk)\n end", "def exit_exception; end", "def raise_inspect(message, tokens, state = T.unsafe(nil), ambit = T.unsafe(nil), backtrace = T.unsafe(nil)); end", "def error(msg, exc: nil)\n must \"message\", msg, be: String\n\n tell(colorize(\"☠ \", :magenta) + colorize(msg, :red))\n\n if exc\n raise exc.new(msg)\n else\n exit(-1)\n end\n end", "def exception(command, exception)\n end", "def error(exception) nil ; end", "def puts_ex(e)\n\tputs \"\\nException: #{e}\"\n\tputs e.backtrace\t\n end", "def show_detailed_exceptions?; end", "def exc_msg_and_response(exc, response = T.unsafe(nil)); end", "def raise_deprecations=(_arg0); end", "def bold_error(*args); end", "def model_exception(e)\n\t puts e\n\tend", "def exception_handler; end", "def continued_exception; end", "def exception_renderer=(_arg0); end", "def raise_error\n raise SyntaxError, '(ERROR) this error is a thing that is happenened'\nend", "def without_bindings_below_raise(bindings); end", "def expects_exception?; self.class.expects_exception; end", "def helper_nested_raise(*args)\n Proc.new{\n raise(*args)\n }.call\n end" ]
[ "0.7040508", "0.69944483", "0.67944354", "0.67427915", "0.67427915", "0.67416877", "0.66127324", "0.6548758", "0.653782", "0.65268755", "0.64640105", "0.64640105", "0.64640105", "0.64640105", "0.64640105", "0.6454771", "0.6414772", "0.6413546", "0.6379602", "0.63581204", "0.63503385", "0.63416463", "0.63398093", "0.6319816", "0.63176143", "0.6314166", "0.63080657", "0.63080657", "0.63080657", "0.63080657", "0.63059527", "0.63051105", "0.6294942", "0.6287516", "0.6282584", "0.62298894", "0.6228152", "0.6223384", "0.6223384", "0.6223384", "0.6181622", "0.6171623", "0.6171623", "0.6154122", "0.6152752", "0.6150475", "0.6147795", "0.6147578", "0.6146972", "0.6145199", "0.6130204", "0.61179453", "0.61179453", "0.6115105", "0.6111309", "0.61078334", "0.6091585", "0.6079852", "0.6071971", "0.6051963", "0.603592", "0.60356486", "0.60247195", "0.60032284", "0.599428", "0.5987364", "0.5986879", "0.5985277", "0.59811723", "0.59794074", "0.59630644", "0.5955999", "0.59485066", "0.5940178", "0.592681", "0.59205633", "0.59196615", "0.5874144", "0.5846598", "0.5838981", "0.5836354", "0.5833667", "0.5822656", "0.5816574", "0.580851", "0.5804527", "0.5802019", "0.5799616", "0.579654", "0.57951456", "0.57912576", "0.57788706", "0.57642967", "0.5731941", "0.57282", "0.5725183", "0.57184255", "0.5704331", "0.57018363", "0.5698632", "0.5686591" ]
0.0
-1
GET /clients/1 GET /clients/1.json
def show @pessoa = Pessoa.find(params[:id]) respond_to do |format| # format.html # show.html.erb format.json { render json: @pessoa } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @clients = current_user.clients\n render json: @clients\n end", "def show\n client = Client.retrieve_by_id(params[:id])\n\n render json: client, serializer: SingleClientSerializer\n end", "def index\n @clients = Client.all\n render json: @clients\n end", "def index\n @clients = Client.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @clients }\n end\n end", "def index\n @clients = Client.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @clients }\n end\n\n end", "def index\n @clients = Client.all\n @uuid = params[:uuid]\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @clients }\n end\n end", "def show\n @client = Client.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @client }\n end\n end", "def show\n @client = Client.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @client }\n end\n end", "def show\n @client = Client.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @client }\n end\n end", "def show\n @client = Client.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @client }\n end\n end", "def show\n @client = Client.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @client }\n end\n end", "def show\n @client = Client.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @client }\n end\n end", "def show\n @client = Client.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @client }\n end\n end", "def show\n @client = clients.find(params[:id])\n end", "def show\r\n @client = Client.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @client }\r\n end\r\n end", "def index\n sanitized_params = parse_params(client_where_params)\n clients = Client.find_all(sanitized_params)\n render json: clients\n end", "def index\n render json: Client.all\n end", "def find_client\n cliente = get_cliente(params[:id])\n\n respond_to do |format|\n format.json {render json: {client: cliente}}\n end\n end", "def show\n render json: @client\n end", "def show\n\t\t@client = Client.find(params[:id])\n\t\tif @client.status != 0\n\t\t\trender :json => @client, status: 200\n\t\telse\n\t\t\trender :json => @client.status, status: 400\n\t\tend\n\tend", "def details\n response = CreateSend.get \"/clients/#{client_id}.json\", {}\n Hashie::Mash.new(response)\n end", "def get_clients\n @clients\n end", "def get_clients\n @clients\n end", "def show\n @client = Client.find(params[:id])\n @uuid = params[:uuid]\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @client }\n end\n end", "def index\n @clients = Client.all\n end", "def index\n @clients = Client.all\n end", "def index\n @clients = Client.all\n end", "def index\n @clients = Client.all\n end", "def index\n @clients = Client.all\n end", "def index\n @clients = Client.all\n end", "def index\n @clients = Client.all\n end", "def index\n @clients = Client.all\n end", "def show\n @clients = get_clients\n @client = Client.find(params[:id])\n\n respond_to do |format|\n #format.html # show.html.erb\n format.json { render json: @client }\n format.js\n end\n end", "def index\n @clients = Client.all\n end", "def clients\n @clients = Vendor.find(params[:id]).clients\n end", "def show\n\n @client = Client.find(params[:id])\n end", "def show\n @client = Client.find(params[:id])\n @contracts = Contract.where(:client_id => @client.id)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @client }\n end\n end", "def show\n @client = Client.find(params[:id])\n end", "def show\n @client = Client.find(params[:id])\n end", "def show\n @client = Client.find(params[:id])\n end", "def show\n @client = Client.find(params[:id])\n end", "def show\n @client = Client.find(params[:id])\n end", "def recent\n if current_user.is_admin?\n @clients = Client.all\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @clients }\n end\n end", "def show\n @client = Client.find_by(id: params[:id])\n end", "def index\n add_breadcrumb(I18n.t('model.list', model: Client.model_name.human))\n\n @clients = Client.all()\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @clients }\n end\n end", "def show\n @client = Client.find(params[:id])\n\n end", "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", "def show\n client= Client.find_by_id params[:id]\n if client != nil\n render(json: client, status: 200) \n else\n head 404\n end \n end", "def show\n @client = Client.find(params[:id])\n respond_with(@client)\n end", "def show\n @client = Client.find(params[:id])\n respond_with(@client)\n end", "def index\n @clients = Client.where(params.except(:action, :controller, :format)).to_a # TODO: remove .to_a when Rails to_json bug fixed\n respond_with(@clients)\n end", "def client(client, options = {})\n get(\"clients/#{client}\", options).pop\n end", "def show\n @clientsOffers = ClientsOffers.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @clientsOffers }\n end\n end", "def index\n if @clients.count > 0\n @client = params[:client_id].blank? ? @clients[0] :\n Client.find_by_id(params[:client_id])\n @client = @clients[0] unless @client\n else\n @clients = Array.new\n end\n end", "def list_clients(json_payload={})\n conn = @client.get do |req|\n req.url \"/api/v2/client/list?\"\n req.headers[\"Authorization\"] = @token\n req.params = json_payload\n end\n conn.body\n end", "def index\n get_clientes\n end", "def index \n @clients = ApiClient.all\n end", "def show\n @client = Client.find params[:id]\n end", "def index_clients\n @client = Client.all\n end", "def get_client_by_id client_id\n @clients[client_id]\n end", "def index\n @clients = Client.page(params[:page] || 1).per(10)\n end", "def show\n @client = Client.find(params[:id])\n authorize! :read, @client\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @client }\n end\n end", "def index\n puts params\n puts params[:filter]\n \n @clients = get_clients \n @client = Client.new\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @clients }\n end\n end", "def show\n @client = Client.find(params[:id])\n if @client.nil?\n @clients = Client.all\n flash.now[:alert] = \"Les détails du client n'ont pas été trouvés\"\n render \"index\"\n end\n respond_to do |format|\n format.html #show.html.erb\n format.xml { render :xml => @client }\n end\n end", "def show\n id = shift_argument || raise(Heroku::Command::CommandFailed, \"Usage: clients:show [ID]\")\n\n client = request do\n api.request(\n :expects => 200,\n :headers => headers,\n :method => :get,\n :path => \"/oauth/clients/#{CGI.escape(id)}\"\n ).body\n end\n\n if options[:shell]\n puts \"HEROKU_OAUTH_ID=#{client[\"id\"]}\"\n puts \"HEROKU_OAUTH_SECRET=#{client[\"secret\"]}\"\n else\n styled_header(%{Client \"#{client[\"name\"]}\".})\n styled_hash(client)\n end\n end", "def index\n clients = request do\n api.request(\n :expects => 200,\n :headers => headers,\n :method => :get,\n :path => \"/oauth/clients\"\n ).body\n end\n styled_header(\"OAuth Clients\")\n styled_array(clients.map { |client|\n [client[\"name\"], client[\"id\"], client[\"redirect_uri\"]]\n })\n end", "def show\n @client = Client.find params[:client_id]\n end", "def index\n @clients = Client.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @client }\n end\n end", "def clients\n response = User_GetClients()\n return [] if response.empty?\n unless response[\"Code\"].to_i != 0\n response[\"Client\"].collect{|c| Client.new(c[\"ClientID\"].to_i, c[\"Name\"])}\n else\n raise response[\"Code\"] + \" - \" + response[\"Message\"]\n end\n end", "def show\n @client_number = ClientNumber.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @client_number }\n end\n end", "def show\n @api_client = ApiClient.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @api_client }\n end\n end", "def show\n # @client = Client.find(params[:client_id])\n end", "def index\n @client_infos = ClientInfo.all\n end", "def show\n @client_need = ClientNeed.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @client_need }\n end\n end", "def client_detail\n service_response = UserManagement::GetClientDetail.new(params).perform\n render_api_response(service_response)\n end", "def clients_index\n @clients = User.clients\n end", "def show\n @cliente = Cliente.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cliente }\n end\n end", "def show\n @cliente = Cliente.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cliente }\n end\n end", "def show\n @cliente = Cliente.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cliente }\n end\n end", "def index\n @clients = Client.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @clients }\n end\n end", "def new\n @client = Client.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @client }\n end\n end", "def new\n @client = Client.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @client }\n end\n end", "def new\n @client = Client.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @client }\n end\n end", "def new\n @client = Client.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @client }\n end\n end", "def index\n \n @qa_clients = QaClient.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @qa_clients }\n end\n end", "def client_by_name(client_name, options={})\n params = {\n :klass => Invoicexpress::Models::Client,\n :client_name => client_name\n }\n\n get(\"clients/find-by-name.xml\", params.merge(options))\n end", "def show\n @my_studio_client = MyStudio::Client.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @my_studio_client }\n end\n end", "def show\n @client = Client.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @client }\n end\n end", "def client_list\n @clients.each do |item|\n puts \"List of clients:\"\n puts \"----------------------------------------------\"\n puts item.name\n end\n end", "def clients\r\n ClientsController.instance\r\n end", "def index\n @page_count, @clients = Locomotive::Client.paginated(:page => (params[:page] || 1).to_i)\n display @clients\n end", "def show\n @blocking_client = BlockingClient.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @blocking_client }\n end\n end", "def index\n @clients = current_user.account.clients.search(params[:search]).order(sort_column + \" \" + sort_direction).paginate(:per_page => 10, :page => params[:page])\n\n @account = current_user.account\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @clients }\n end\n end", "def index\n @clients = Client.all.paginate(page: params[:page], per_page: 4)\n end", "def show\n @client = Client.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @client }\n end\n end", "def show\n @client = Client.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @client }\n end\n end", "def show\n @client = Client.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @client }\n end\n end", "def show\n @cliente = Cliente.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cliente }\n end\n end", "def show\n @client_type = ClientType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @client_type }\n end\n end", "def show_client_name\n @clients = Client.order(:name)\n end", "def show\n @player_client = PlayerClient.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @player_client }\n end\n end" ]
[ "0.7714569", "0.7692897", "0.7610902", "0.7599894", "0.7557071", "0.7554301", "0.75299674", "0.75299674", "0.75299674", "0.75299674", "0.75299674", "0.75299674", "0.75299674", "0.75143087", "0.747129", "0.73328424", "0.7307047", "0.7303964", "0.73004144", "0.72511", "0.7203742", "0.71712613", "0.71712613", "0.7110962", "0.70833385", "0.70833385", "0.70833385", "0.70833385", "0.70833385", "0.70833385", "0.70833385", "0.70833385", "0.7043464", "0.70392054", "0.7035624", "0.70221287", "0.7010251", "0.700844", "0.70066816", "0.70066816", "0.70066816", "0.70066816", "0.69952065", "0.6968492", "0.696331", "0.695731", "0.69530874", "0.69529605", "0.69481707", "0.69481707", "0.69376135", "0.69107944", "0.6905851", "0.6902439", "0.6895638", "0.68908143", "0.6858797", "0.6851074", "0.68357044", "0.6831114", "0.68289775", "0.6822337", "0.68089706", "0.67787457", "0.6748837", "0.67321974", "0.67297375", "0.67199075", "0.67038614", "0.6698816", "0.6681345", "0.6673867", "0.6619144", "0.66109705", "0.66084546", "0.66078824", "0.66015464", "0.66015464", "0.66015464", "0.6593926", "0.6592166", "0.6592166", "0.6592166", "0.6592166", "0.6584528", "0.6557772", "0.6555859", "0.6530198", "0.6522723", "0.6513703", "0.65061176", "0.65043294", "0.6500603", "0.6489269", "0.6488731", "0.6488731", "0.6488095", "0.6479994", "0.646902", "0.64458615", "0.64450085" ]
0.0
-1
GET /pessoas/new GET /pessoas/new.json
def new puts 'NEW METHOD' @pessoa = Pessoa.new @pessoa.enderecos.build 2.times { @pessoa.telefones.build } respond_to do |format| format.html # new.html.erb format.json { render json: @pessoa } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @peso = Peso.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @peso }\n end\n end", "def new\n @pto = Pto.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pto }\n end\n end", "def new\n @puntaje = Puntaje.new\n atributos\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @puntaje }\n end\n end", "def new\n @puntaje = Puntaje.new\n atributos\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @puntaje }\n end\n end", "def new\n @paciente = Paciente.new\n @paciente.pessoa = Pessoa.new\n #respond_to do |format|\n # format.html # new.html.erb\n # format.json { render json: @paciente }\n #end\n end", "def new\n @partecipante = Partecipante.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @partecipante }\n end\n end", "def new\n @presenza = Presenza.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @presenza }\n end\n end", "def new\n @sezione = Sezione.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @sezione }\n end\n end", "def new\n @premio = Premio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @premio }\n end\n end", "def new\n @papel = Papel.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @papel }\n end\n end", "def new\n @tipo_pensum = TipoPensum.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tipo_pensum }\n end\n end", "def new\n @psa = Psa.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @psa }\n end\n end", "def new\n @selecao = Selecao.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @selecao }\n end\n end", "def new\n @po = Po.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @po }\n end\n end", "def new\n @premio = Premio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @premio }\n end\n end", "def new\n @paciente = Paciente.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @paciente }\n end\n end", "def new\n @pessoa_receber = PessoaReceber.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @pessoa_receber }\n end\n end", "def new\n @projeto = Projeto.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @projeto }\n end\n end", "def new\n @produccion = Produccion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @produccion }\n end\n end", "def new\n @produccion = Produccion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @produccion }\n end\n end", "def new\n @perfilnegocio = Perfilnegocio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @perfilnegocio }\n end\n end", "def new\n @propuesta = Propuesta.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @propuesta }\n end\n end", "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", "def new\n @publicidade = Publicidade.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @publicidade }\n end\n end", "def new\n @clasificacion_pegi = ClasificacionPegi.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @clasificacion_pegi }\n end\n end", "def new\n @pologeno = Pologeno.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pologeno }\n end\n end", "def new\n @pedido = Pedido.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pedido }\n end\n end", "def new\n @posto = Posto.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @posto }\n end\n end", "def new\n @tipomedalla = Tipomedalla.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tipomedalla }\n end\n end", "def new\n @pagamento = Pagamento.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pagamento }\n end\n end", "def new\n @caixa = Caixa.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @caixa }\n end\n end", "def new\n @ventas_presupuesto = Ventas::Presupuesto.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ventas_presupuesto }\n end\n end", "def new\n @atracao = Atracao.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @atracao }\n end\n end", "def new\n @noto = Noto.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @noto }\n end\n end", "def new\n @publicidad = Publicidad.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @publicidad }\n end\n end", "def new\n @asociado = Asociado.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @asociado }\n end\n end", "def new\n @seguro = Seguro.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @seguro }\n end\n end", "def new\n @prestador = Prestador.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @prestador }\n end\n end", "def new\n @prioridade = Prioridade.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @prioridade }\n end\n end", "def new\n\n @paciente = Paciente.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @paciente }\n end\n end", "def new\n @personaje = Personaje.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @personaje }\n end\n end", "def new\n @spiel = Spiel.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @spiel }\n end\n end", "def new\n @tipo_negocio = TipoNegocio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tipo_negocio }\n end\n end", "def new\n @tipo_usuario = TipoUsuario.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tipo_usuario }\n end\n end", "def new\n @tecnico = Tecnico.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tecnico }\n end\n end", "def create\n @peso = Peso.new(params[:peso])\n\n respond_to do |format|\n if @peso.save\n format.html { redirect_to @peso, notice: 'Peso was successfully created.' }\n format.json { render json: @peso, status: :created, location: @peso }\n else\n format.html { render action: \"new\" }\n format.json { render json: @peso.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @repa = Repa.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @repa }\n end\n end", "def new\n @pessoa = Pessoa.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pessoa }\n end\n end", "def new\n @pessoa = Pessoa.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pessoa }\n end\n end", "def new\n @empresa = Empresa.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @empresa }\n end\n end", "def new\n @patrocinio = Patrocinio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @patrocinio }\n end\n end", "def new\n @partecipanti_gruppo = PartecipantiGruppo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @partecipanti_gruppo }\n end\n end", "def new\n @suplente = Suplente.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @suplente }\n end\n end", "def new\n @recurso = Recurso.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @recurso }\n end\n end", "def new\n @prestacion = Prestacion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @prestacion }\n end\n end", "def new\n @respuesta = Respuesta.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @respuesta }\n end\n end", "def new\n @puestos_entidad = PuestosEntidad.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @puestos_entidad }\n end\n end", "def new\n @newspage = Newspage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @newspage }\n end\n end", "def new\n @estatuto = Estatuto.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @estatuto }\n end\n end", "def new\n @asignatura = Asignatura.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @asignatura }\n end\n end", "def new\n @tecnico = Tecnico.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @tecnico }\n end\n end", "def new\n @plannegocio = Plannegocio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @plannegocio }\n end\n end", "def new\n @sistema = Sistema.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @sistema }\n end\n end", "def new\n @profesor_pertenece_asignatura = ProfesorPerteneceAsignatura.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @profesor_pertenece_asignatura }\n end\n end", "def new\n @prepagada = Prepagada.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @prepagada }\n end\n end", "def new\n @pony = Pony.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pony }\n end\n end", "def new\n @producto = Producto.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @producto }\n end\n end", "def new\n @tipo_convenio = TipoConvenio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tipo_convenio }\n end\n end", "def new\n @profesore = Profesore.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @profesore }\n end\n end", "def new\n @sitio_entrega = SitioEntrega.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @sitio_entrega }\n end\n end", "def new\n @db_pekerjaan = DbPekerjaan.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @db_pekerjaan }\n end\n end", "def new\n @nabe = Nabe.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @nabe }\n end\n end", "def new\n @etnia = Etnia.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @etnia }\n end\n end", "def new\n @asignaturas = Asignatura.find(:all)\n @peso = Peso.new\n \n if !params[:id].nil? \n @asignaturas = Asignatura.find_all_by_id(params[:id])\n end\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @peso }\n end\n end", "def new\n @tip_so = TipSo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tip_so }\n end\n end", "def new\n @veiculo = Veiculo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @veiculo }\n end\n end", "def new\n @competicao = Competicao.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @competicao }\n end\n end", "def new\n @torso = Torso.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @torso }\n end\n end", "def new\n @persona = Persona.new\n\n respond_to do |format|\n format.json { render json: @persona }\n end\n end", "def new\n @seguidore = Seguidore.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @seguidore }\n end\n end", "def new\n @sugerencia = Sugerencia.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @sugerencia }\n end\n end", "def new\n @paise = Paise.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @paise }\n end\n end", "def new\n @viaje = Viaje.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @viaje }\n end\n end", "def new\n @tipo_atendimento = TipoAtendimento.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tipo_atendimento }\n end\n end", "def new\n @comentario = Comentario.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @comentario }\n end\n end", "def new\n @persona = Persona.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @persona }\n end\n end", "def new\n @persona = Persona.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @persona }\n end\n end", "def new\n @persona = Persona.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @persona }\n end\n end", "def new\n @escola = Escola.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @escola }\n end\n end", "def new\n @requerimiento = Requerimiento.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @requerimiento }\n end\n end", "def new\n @concurso = Concurso.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @concurso }\n end\n end", "def new\n @tipo_product = TipoProduct.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tipo_product }\n end\n end", "def new\n @propose = Propose.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @propose }\n end\n end", "def new\n unless possui_acesso?()\n return\n end\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", "def new\n @torneo = Torneo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @torneo }\n end\n end", "def new\n @ano = Ano.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ano }\n end\n end", "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", "def new\n @reparacion = Reparacion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @reparacion }\n end\n end", "def new\n @cuerpo = Cuerpo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cuerpo }\n end\n end", "def new\n @estacionamiento = Estacionamiento.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @estacionamiento }\n end\n end" ]
[ "0.7907233", "0.7842003", "0.7615102", "0.7615102", "0.7613786", "0.759081", "0.7580052", "0.75653297", "0.7562309", "0.75578606", "0.7555149", "0.7544436", "0.7539151", "0.7507897", "0.7504545", "0.7490896", "0.747814", "0.7456194", "0.7453076", "0.74522394", "0.744491", "0.7438637", "0.7433647", "0.74293405", "0.7421751", "0.74121404", "0.7405545", "0.7391131", "0.7385623", "0.7372768", "0.73623115", "0.7362204", "0.7355108", "0.7345197", "0.73395133", "0.73326784", "0.7330017", "0.7329812", "0.73254204", "0.73246104", "0.7316276", "0.73145384", "0.7312951", "0.73115593", "0.73056746", "0.73041815", "0.7292482", "0.72875994", "0.72875994", "0.7287318", "0.72848105", "0.72812265", "0.7280711", "0.7277545", "0.7266952", "0.72623897", "0.7258876", "0.7253312", "0.72520757", "0.7250602", "0.72364074", "0.7235743", "0.7235065", "0.7226296", "0.72260374", "0.7224376", "0.7218943", "0.72126", "0.7210557", "0.72069633", "0.72041476", "0.7193684", "0.71928877", "0.7190714", "0.71855", "0.71850145", "0.7180288", "0.7178381", "0.7177878", "0.7177785", "0.7176717", "0.7176363", "0.7174778", "0.7169925", "0.716506", "0.715989", "0.715989", "0.715989", "0.7157435", "0.7153617", "0.7149588", "0.7148531", "0.7148481", "0.7148261", "0.7145895", "0.7139799", "0.71311575", "0.71202683", "0.71196556", "0.711513" ]
0.76610804
2
POST /clients POST /clients.json
def create puts 'AQQQQQUUUUUUUIIIIII' json = ActiveSupport::JSON.decode(params[:pessoa]) puts json @pessoa = Pessoa.new(json) # @address = Address.new(params[:address]) # @client.addresses = @address respond_to do |format| if @pessoa.save format.html { redirect_to @pessoa, notice: 'Pessoa was successfully created.' } format.json { render json: @pessoa, status: :created, location: @pessoa } else format.html { render action: "new" } format.json { render json: @pessoa.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @client = Client.new(client_params)\n\n respond_to do |format|\n if @client.save\n format.html { redirect_to clients_url, notice: 'El cliente se creó correctamente' }\n format.json { render :index, status: :created, location: @client }\n else\n format.html { render :new }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @client = current_user.clients.build(client_params)\n\n respond_to do |format|\n if @client.save\n format.html { redirect_to @client, notice: 'Client was successfully created.' }\n format.json { render :show, status: :created, location: @client }\n else\n format.html { render :new }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @client = Client.new(params[:client])\n\n respond_to do |format|\n if @client.save\n format.html { redirect_to clients_path, notice: 'Client was successfully created.' }\n format.json { render json: @client, status: :created, location: @client }\n else\n format.html { render action: \"new\" }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @client = current_user.clients.build(client_params)\n \n respond_to do |format|\n if @client.save\n format.html { redirect_to @client, notice: 'Client was successfully created.' }\n format.json { render :show, status: :created, location: @client }\n else\n format.html { render :new }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @client = Client.new(client_params)\n\n respond_to do |format|\n if @client.save\n format.html { redirect_to clients_path, notice: 'Client was successfully created.' }\n format.json { render :show, status: :created, location: @client }\n else\n format.html { render :new }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @client = Client.new(params[:client])\n\n respond_to do |format|\n if @client.save\n format.html { redirect_to @client, notice: 'Client was successfully created.' }\n format.json { render json: @client, status: :created, location: @client }\n else\n format.html { render action: \"new\" }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @client = Client.new(params[:client])\n\n respond_to do |format|\n if @client.save\n format.html { redirect_to @client, notice: 'Client was successfully created.' }\n format.json { render json: @client, status: :created, location: @client }\n else\n format.html { render action: \"new\" }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @client = Client.new(params[:client])\n\n respond_to do |format|\n if @client.save\n format.html { redirect_to @client, notice: 'Client was successfully created.' }\n format.json { render json: @client, status: :created, location: @client }\n else\n format.html { render action: \"new\" }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @client = Client.new(client_params)\n\n respond_to do |format|\n if @client.save\n format.html { redirect_to @client, notice: 'client was successfully created.' }\n format.json { render :show, status: :created, location: @client }\n else\n format.html { render :new }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @client = Client.new(client_params)\n\n respond_to do |format|\n if @client.save\n format.html { redirect_to @client, notice: 'Client was successfully created.' }\n format.json { render :show, status: :created, location: @client }\n else\n format.html { render :new }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @client = Client.new(client_params)\n\n respond_to do |format|\n if @client.save\n format.html { redirect_to @client, notice: 'Client was successfully created.' }\n format.json { render :show, status: :created, location: @client }\n else\n format.html { render :new }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @client = Client.new(client_params)\n\n respond_to do |format|\n if @client.save\n format.html { redirect_to @client, notice: 'Client was successfully created.' }\n format.json { render :show, status: :created, location: @client }\n else\n format.html { render :new }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @client = Client.new(client_params)\n respond_to do |format|\n if @client.save\n format.html { redirect_to @client, notice: 'Client was successfully created.' }\n format.json { render :show, status: :created, location: @client }\n else\n format.html { render :new }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n #newParams = client_params.as_json\n flash[:notice] = \"Cliente creado\"\n @client = current_freelance.clients.create(client_params)\n\n #@client = current_freelance.clients\n #@client.name = params[:name]\n #@client.surname = params[:surname]\n #@client.username = params[:username]\n #@client.password = params[:password]\n\n respond_to do |format|\n if @client.save\n format.html { redirect_to clients_path, notice: 'Client was successfully created.' }\n #format.json { render :show, status: :created, location: @client }\n else\n format.html { render :new }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @client = Client.new(client_params)\n\n respond_to do |format|\n if @client.save\n format.html { redirect_to @client, notice: \"Client was successfully created.\" }\n format.json { render :show, status: :created, location: @client }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @client = Client.create(client_params)\n # byebug\n if @client.valid?\n render json: { client: ClientSerializer.new(@client) }, status: :created\n else\n render json: { error: 'failed to create account' }, status: :not_acceptable\n end \n end", "def create\n @client = Client.new(params[:client])\n\n respond_to do |format|\n if @client.save \n format.html { redirect_to @client, :notice => 'Klijent je uspjesno kreiran.' }\n format.json { render :json => @client, :status => :created, :location => @client }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @client.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @client = Client.new(client_params)\n\n respond_to do |format|\n if @client.save\n format.html { redirect_to @client, notice: 'Cliente cadastrado com sucesso!' }\n format.json { render :show, status: :created, location: @client }\n else\n format.html { render :new }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @client = Client.create(client_params)\n @clients = Client.all\n flash[:notice]=\"client créé avec succès!!!\"\n end", "def create\n @client = current_user.clients.new(client_params)\n\n respond_to do |format|\n if @client.save\n format.html { redirect_to @client, notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @client }\n else\n format.html { render :new }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @client = current_user.clients.build(client_params)\n\n if @client.save\n render :create, status: :created\n CareeerMailer.trial_end(current_user.email, @client).deliver_later\n CareeerMailer.welcome(current_user.email, @client).deliver_later\n else\n render json: @client.errors, status: :unprocessable_entity\n end\n end", "def create\n @client = Client.new(params[:client])\n flash[:notice] = 'Client was successfully created.' if @client.save\n respond_with(@client)\n end", "def create\n @client = Client.new(client_params)\n\n respond_to do |format|\n if @client.save\n format.html { redirect_to @client, notice: 'Cliente criado com sucesso.' }\n format.json { render :show, status: :created, location: @client }\n else\n format.html { render :new }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_client(options = {})\n post(:clients, clients: [options]).pop\n end", "def create\n @client = Client.new(client_params)\n @client.user_id = current_user.id\n respond_to do |format|\n if @client.save\n format.html { redirect_to @client, notice: 'Client record was successfully created.' }\n format.json { render :show, status: :created, location: @client }\n else\n format.html { render :new }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @client = current_user.clients.new(client_params)\n\n @client.save\n redirect_to @client\n end", "def create\n\n @client = Client.new(client_params)\n\n #se não aguardar carregar os dados\n if @client.state == '...'\n sweetalert_warning('Você precisa informar o CEP e aguardar os dados do endereço serem preenchidos.', 'Aviso!', useRejections: false)\n redirect_to new_client_path and return\n end\n\n respond_to do |format|\n if @client.save\n format.html { redirect_to @client, notice: 'Cliente criado com sucesso.' }\n format.json { render :show, status: :created, location: @client }\n sweetalert_success('Cliente cadastrado com sucesso.', 'Sucesso!', useRejections: false)\n else\n format.html { render :new }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @client = Client.new(params[:client])\n \n respond_to do |format|\n if @client.save\n format.html { redirect_to(@client, :notice => \"Client was successfully created. #{undo_link}\") }\n end\n respond_with(@client)\n end\n end", "def create\n @client = Client.new(client_params)\n authorize @client\n respond_to do |format|\n if @client.save\n format.html { redirect_back_or_default clients_url, t('Record has been saved') }\n format.json { render :show, status: :created, location: @client }\n format.js { render :show, status: :created, location: @client }\n else\n format.html { render :new }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n format.js { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @client = Client.new(params[:client])\n @client.campaign_id = session[:campaign_id]\n @groups = Group.all.map {|g| [g.name, g.id]}\n\n respond_to do |format|\n if @client.save\n format.html { redirect_to @client, :notice => 'Client was successfully created.' }\n format.json { render :json => @client, :status => :created, :location => @client }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @client.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n\n client = Cliente.new\n\n client.nombre = params[:nombre]\n client.cedula = params[:cedula]\n client.pagina = params[:pagina]\n\n client.dirrecion = params[:dirrecion]\n client.telefono = params[:telefono]\n \n client.sector = params[:sector]\n \n\n if client.save\n \n\n render(json: client,status: 201 ,location: client)\n else\n\n render(json: client.errors,status: 422 )\n\n end\n end", "def create\n client= Client.new\n client.cedula= params[:cedula]\n client.sector= params[:sector]\n client.nombre= params[:nombre]\n client.telefono= params[:telefono]\n client.pagina= params[:pagina]\n client.direccion= params[:direccion]\n if client.save\n render(json: client, status: 201 , location: client)\n else \n render(json: client.errors, status: 422)\n end\n end", "def create\n @clientsOffers = ClientsOffers.new(params[:clientsOffers])\n\n respond_to do |format|\n if @clientsOffers.save\n format.html { redirect_to @clientsOffers, notice: 'ClientsOffers was succesfully created.' }\n format.json { render json: @clientsOffers, status: :created, location: @clientsOffers }\n else\n format.html { render action: \"new\" }\n format.json { render json: @clientsOffers.errors, status: :unprocesable_entity }\n end\n end\n end", "def create(client)\n @client = Locomotive::Client.new(client)\n\n if @client.save\n redirect resource(@client), :message => {:notice => \"Client was successfully created\"}\n else\n render :new\n end\n end", "def create\r\n params[:client][:version] = ENV[\"VERSION\"]\r\n params[:client][:domain] = current_user.domain\r\n params[:client][:username] = current_user.username\r\n @client = Client.new(client_params)\r\n\r\n respond_to do |format|\r\n if @client.save\r\n format.html { redirect_to @client, notice: 'Client was successfully created.' }\r\n format.json { render json: @client, status: :created, location: @client }\r\n format.js {}\r\n else\r\n format.html { render action: \"new\" }\r\n format.json { render json: @client.errors, status: :unprocessable_entity }\r\n format.js {}\r\n end\r\n end\r\n end", "def create\n @clients = get_clients\n @client = Client.new(params[:client])\n\n respond_to do |format|\n if @client.save\n @clients = get_clients\n newVisitOnCreate(@client)\n #format.html { redirect_to @client, notice: 'Client was successfully created.' }\n format.json { render json: @client, status: :created, location: @client }\n format.js\n else\n #format.html { render action: \"index\" }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n format.js\n end\n end\n end", "def create\n @client = Client.new(params[:client])\n\n respond_to do |format|\n if @client.save\n format.html { redirect_to @client, notice: 'Client was successfully created.' }\n format.json { render json: @client, status: :created, location: @client }\n format.js\n else\n format.html { render action: \"new\" }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n format.js\n end\n end\n end", "def create\n @client = Client.new(client_params)\n authorize! :create, @client\n\n respond_to do |format|\n if not @client.caseworker.can_add_clients?\n @client.errors[:base] << \"You are past your limit. Please come back later.\"\n format.html { render :action => \"new\" }\n format.json { render :json => @client.errors, :status => :unprocessable_entity }\n elsif @client.save\n format.html { redirect_to @client, :notice => 'Client was successfully created.' }\n format.json { render :json => @client, :status => :created, :location => @client }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @client.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @client = Client.new(client_params)\n respond_to do |format|\n # if @client.valid? \n if @client.save\n format.html { redirect_to @client, notice: 'Client was successfully created.' }\n format.json { render :show, status: :created, location: @client }\n else\n format.html { render :new }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n # else\n # format.html { render :new }\n # format.json { render json: @client.errors, status: :unprocessable_entity }\n # end\n end\n end", "def create\n @client = Client.new(params[:client])\n\n respond_to do |format|\n if @client.save\n format.html { redirect_to(@client, :notice => 'Client was successfully created.') }\n format.xml { render :xml => @client, :status => :created, :location => @client }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @client.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n #create the object of client and assign the attributes in the request\n @client = Client.new(params[:client])\n \n #save the client\n if @client.save\n #if saved, return and redirect to client show page with success message\n return redirect_to client_path(@client), notice: \"client created successfuly\"\n else\n #if not saved, render the form with error messages\n return render action: :new\n end\n end", "def create\n @client = Client.new(params[:client])\n\n respond_to do |format|\n if @client.save\n\t\tClientMailer.registration_confirmation(@client).deliver\n\t\tCountry.create!({'clientkey'=>@client.id, 'country'=>@client.country})\n format.html { redirect_to @client, notice: 'Client was successfully created.' }\n format.json { render json: @client, status: :created, location: @client }\n else\n format.html { render action: \"new\" }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_client(name, facebook_id, twitter_handle)\n puts name, facebook_id, twitter_handle\n # Point the HTTP POST method at the clients endpoint of Klipfolio's API.\n response = self.class.post(\"https://app.klipfolio.com/api/1.0/clients\", basic_auth: @auth, headers: { \"Content-Type\" => \"application/json\" },\n body: {\n \"name\": name,\n \"description\": \"\",\n \"seats\": 5,\n \"status\": \"active\"\n }.to_json)\n puts response.body\n puts \"Client was successfully created.\" if response.success?\n\n # Extract the new client's ID from the HTTP response so that it can be passed to the update_features & update_resources methods.\n client_id = response[\"meta\"][\"location\"]\n client_id.slice!(\"/clients/\")\n p client_id\n\n update_resources(client_id)\n update_features(client_id)\n update_company_properties(client_id, facebook_id, twitter_handle)\n create_group(client_id)\n share_dashboard(client_id)\n end", "def create\n @client = clients.new(params[:client])\n\n if @client.save\n flash[:notice] = 'Customer was successfully created.'\n redirect_to(user_company_clients_url(current_company))\n else\n render :action => \"new\"\n end\n end", "def create\n @client = Client.new(client_params)\n\n respond_to do |format|\n if @client.save\n password = params[:password] || random_password\n @client.user.update(password: password)\n\n ClientMailer.after_sign_up(@client, password).deliver_now\n format.html { redirect_to clients_path, notice: \"Client: #{@client.email} was sucessfully created.\" }\n # format.json { render :show, status: :created, location: @client }\n else\n format.html { render :new }\n # format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @client = Client.new(client_params)\n respond_to do |format|\n if @client.save\n format.html { redirect_to(@client, :notice => 'Client was successfully created.') }\n format.xml { render :xml => @client, :status => :created, :location => @client }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @client.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n\t\t@client = User.create(clients_params)\n\t\tif @client.save\n flash[:success] = \"Record saved successfully.\"\n\t\t\tredirect_to clients_params\n else\n @error = @client.errors.full_messages\n redirect_to clients_params\n\t\tend\n\tend", "def index\n @clients = current_user.clients\n render json: @clients\n end", "def create\n @id = client_params[:id].to_i\n @message = ''\n\n if @id.nil? || @id == 0\n @client = Client.new(client_params)\n else\n @client = Client.find_by_id(@id)\n end\n\n if @client.valid?\n if @client.id == 0 || @client.id.nil? \n @client.save()\n else\n @client.update(client_params)\n end\n else\n @message = @client.errors.messages\n end\n\n render json:{client: @client, message: @message}\n end", "def create\n @client = Client.new(client_params)\n\n respond_to do |format|\n if @client.save\n format.html { redirect_to(@client, :notice => 'Le client a bien été créé.') }\n format.xml { render :xml => @client, :status => :created, :location => @client }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @client.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create_client\n if current_admin.present?\n @client = Client.new(params[:client])\n respond_to do |format|\n if @client.save\n flash[:notice] = \"Client has been successfully added!\"\n format.html { redirect_to root_url }\n format.json { render json: @client, status: :created, location: @client }\n else\n format.html { render action: \"new\" }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n else\n redirect_to new_admin_session_path and return\n end \n end", "def create\n @client = Client.new(params[:client])\n\n respond_to do |format|\n if @client.save\n flash[:notice] = 'Client was successfully created.'\n format.html { redirect_to(@client) }\n format.xml { render :xml => @client, :status => :created, :location => @client }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @client.errors, :status => :unprocessable_entity }\n end\n end\n end", "def new\n @client = Client.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @client }\n end\n end", "def new\n @client = Client.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @client }\n end\n end", "def new\n @client = Client.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @client }\n end\n end", "def new\n @client = Client.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @client }\n end\n end", "def create\n @client = Client.new(client_params)\n\n if @client.save\n redirect_to @client, notice: 'Client was successfully created.'\n else\n render :new\n end\n end", "def client_create(global_options, options)\n result = Excon.post(\n \"#{global_options[:fenton_server_url]}/clients.json\",\n body: client_json(options),\n headers: { 'Content-Type' => 'application/json' }\n )\n\n [result.status, JSON.parse(result.body)]\n end", "def create\n @client = Client.new(params[:client])\n \n respond_to do |format|\n if @client.save\n flash[:notice] = 'Client was successfully created.'\n format.html { redirect_to client_url(@role) }\n format.xml { head :created, :location => client_url(@role) }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @client.errors.to_xml }\n end\n end\n end", "def create\n @client = Client.new(params[:client])\n\t\t@client.logged = false\n if @client.save\n redirect_to signup_clients_path, notice: 'Client was successfully created!'\n else\n render action: \"new\"\n end\n end", "def create\n authorize! :create, Client\n build_client\n save_client or render :new\n end", "def create\n @client = Client.new(client_params)\n\n respond_to do |format|\n if @client.save\n\n format.js\n\n format.html { redirect_to root_path, notice: 'Vous avez bien été ajouté à notre newsletter' }\n\n format.json { render :show, status: :created, location: @client }\n\n else\n\n format.html { render :new }\n\n format.json { render json: @client.errors, status: :unprocessable_entity }\n\n end\n end\n end", "def serialized_clients(_data)\n ActiveModel::ArraySerializer.new(_data, each_serializer: Api::V1::ClientsSerializer, root: 'clients')\n end", "def create\n @client = Client.new(params[:client])\n @uuid = params[:uuid]\n respond_to do |format|\n if @client.save\n format.html { redirect_to :controller => 'ads', :action => 'admin_dash', :id => 1, :uuid => @uuid, notice: 'Client was successfully created.' }\n format.json { render json: @client, status: :created, location: @client }\n else\n format.html { render action: \"new\" }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @clientes_servico = ClientesServico.new(clientes_servico_params)\n\n respond_to do |format|\n if @clientes_servico.save\n format.html { redirect_to @clientes_servico, notice: 'Clientes servico was successfully created.' }\n format.json { render action: 'show', status: :created, location: @clientes_servico }\n else\n format.html { render action: 'new' }\n format.json { render json: @clientes_servico.errors, status: :unprocessable_entity }\n end\n end\n end", "def client_params\n params.require(:client).permit(:name, :recruiter_id, :user_ids => [])\n end", "def create\n @members_client = MembersClient.new(members_client_params)\n\n respond_to do |format|\n if @members_client.save\n format.html { redirect_to @members_client, notice: 'Members client was successfully created.' }\n format.json { render :show, status: :created, location: @members_client }\n else\n format.html { render :new }\n format.json { render json: @members_client.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @client = Client.new(client_params)\n\n respond_to do |format|\n if @client.save\n format.html { redirect_to admin_client_path(@client, search: params[:search], page: params[:page]),\n notice: 'Клиент успешно создан.' }\n format.json { render :show, status: :created, location: @client }\n else\n format.html { render :new }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @client = Client.new(params[:client])\n\n if @client.password == nil then @client.password = temp_password && @client.password_confirmation = temp_password end\n password = @client.password\n\n respond_to do |format|\n if @client.save\n ClientMailer.new_client(@client, password).deliver\n format.html { redirect_to project_url(:id => @client.project_id, :page => 'options'), notice: 'Client was successfully created.' }\n format.json { render json: @client, status: :created, location: @client }\n else\n format.html { render action: \"new\" }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @invoice_client = InvoiceClient.new(invoice_client_params)\n\n respond_to do |format|\n if @invoice_client.save\n format.html { redirect_to @invoice_client, notice: 'Invoice client was successfully created.' }\n format.json { render :show, status: :created, location: @invoice_client }\n else\n format.html { render :new }\n format.json { render json: @invoice_client.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n\n @client = Client.new(client_params)\n @client.business_owner_id = helpers.current_business_owner.id\n\n if @client.save\n flash[:notice] = \"#{@client.name} was added as a new client.\"\n redirect_to clients_path\n else\n render :new\n end\n end", "def create\n @client = Client.new(client_params)\n \n if @client.valid?\n code = Random.new\n @client.code = code.rand(1000)\n old_password = @client.password\n @client.password = SecureRandom.hex(6)\n status = ApiClient.save(@client)\n\n if status\n @user = User.create(\n name: @client.name,\n email: @client.email,\n password: old_password,\n password_salt: @client.password,\n client_id: @client.code\n )\n end\n end\n\n respond_to do |format|\n if status\n format.html { redirect_to client_path(@client.code), notice: 'Client was successfully created.' }\n format.json { render action: 'show', status: :created, location: @client }\n else\n format.html { render action: 'new', notice: 'Could not create a client.' }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @clients = Client.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @clients }\n end\n end", "def create\n @cliente = Cliente.new(params[:cliente])\n\n respond_to do |format|\n if @cliente.save\n format.html { redirect_to @cliente, notice: 'Cliente was successfully created.' }\n format.json { render json: @cliente, status: :created, location: @cliente }\n else\n format.html { render action: \"new\" }\n format.json { render json: @cliente.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @cliente = Cliente.new(params[:cliente])\n\n respond_to do |format|\n if @cliente.save\n format.html { redirect_to @cliente, notice: 'Cliente was successfully created.' }\n format.json { render json: @cliente, status: :created, location: @cliente }\n else\n format.html { render action: \"new\" }\n format.json { render json: @cliente.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @clients = Client.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @clients }\n end\n\n end", "def client_params\n params.require(:client).permit(\n :name,\n )\n end", "def index\n @clients = Client.all\n render json: @clients\n end", "def create\n @client = Client.new(client_params)\n\n respond_to do |format|\n begin\n ActiveRecord::Base.transaction do\n @client.save!\n @address = Address.new(address_params)\n @address.client_id = @client.id\n @address.save!\n end\n\n format.html { redirect_to @client, notice: 'Client was successfully created.' }\n format.json { render :show, status: :created, location: @client }\n rescue\n format.html { render :new }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @client = current_client\n @session = @client.session\n debug { \"SessionsController#create - #{@session.inspect}\"}\n raise \"ResourceOwner from token != session.owner\" if doorkeeper_token.resource_owner_id != @session.owner.id\n\n @client.update_attributes!(client_params)\n render json: @client, status: :created, serializer: Sso::ClientSerializer\n end", "def client_params\n params.require(:client).permit(:nombre, :direccion, :telefono, :email)\n end", "def create\n @cliente = Cliente.new(params[:cliente])\n \n respond_to do |format|\n if @cliente.save\n format.html { redirect_to edit_cliente_path(@cliente), notice: 'Cliente was successfully created.' }\n format.json { render json: @cliente , status: :created, location: @cliente }\n else\n format.html { render action: \"new\" }\n format.json { render json: @cliente.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @cliente = Cliente.new(params[:cliente])\n\n respond_to do |format|\n if @cliente.save\n format.html { redirect_to @cliente, notice: 'Cliente criado com sucesso.' }\n format.json { render json: @cliente, status: :created, location: @cliente }\n else\n format.html { render action: \"new\" }\n format.json { render json: @cliente.errors, status: :unprocessable_entity }\n end\n end\n end", "def client_params\n params.require(:client).permit!\n end", "def client_params\n params.require(:client).permit!\n end", "def create_client(client, options={})\n if !client || !client.is_a?(Invoicexpress::Models::Client)\n raise ArgumentError, \"Need a Invoicexpress::Models::Client instance\"\n end\n\n if !client.name\n raise ArgumentError, \"Client's name is required\"\n end\n\n params = { :body => client, :klass => Invoicexpress::Models::Client }\n post(\"clients.xml\", params.merge(options))\n end", "def create\n\n @client = Client.new(client_params)\n if @client.save\n respond_to do |format|\n format.html { redirect_to(clients_path, :notice => 'Le client « ' + @client.Prenom + ' ' + @client.Nom + ' » a été crée') }\n end\n else\n render :new\n end\n end", "def index\n @clients = Client.all\n @uuid = params[:uuid]\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @clients }\n end\n end", "def update\n @client.update(client_params)\n render json: @client\n end", "def create_client\n\nend", "def create\n @client = Client.new(client_params)\n if @client.save\n redirect_to client_path(@client)\n else\n render ‘new’\n end\n end", "def create\n @cliente = Cliente.new(cliente_params)\n\n respond_to do |format|\n if @cliente.save\n format.html { redirect_to @cliente, notice: 'El cliente se creó exitosamente.' }\n format.json { render :show, status: :created, location: @cliente }\n else\n format.html { render :new }\n format.json { render json: @cliente.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @cliente = Cliente.new(cliente_params)\n\n respond_to do |format|\n if @cliente.save\n format.html { redirect_to @cliente, notice: 'Cliente criado com sucesso.' }\n format.json { render :show, status: :created, location: @cliente }\n else\n format.html { render :new }\n format.json { render json: @cliente.errors, status: :unprocessable_entity }\n end\n end\n end", "def add_client\n\n\t\t@clients = Client.new(client_params)\n\t\tif @clients.save\n\t\t\tredirect_to '/details'\n\t\telse\n\t\t\trender 'index'\n\t\tend\n\tend", "def create\n @client_user = ClientUser.new(client_user_params)\n\n respond_to do |format|\n if @client_user.save\n format.html { redirect_to @client_user, notice: 'Client user was successfully created.' }\n format.json { render :show, status: :created, location: @client_user }\n else\n format.html { render :new }\n format.json { render json: @client_user.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @player_client = PlayerClient.new(params[:player_client])\n\n respond_to do |format|\n if @player_client.save\n format.html { redirect_to @player_client, notice: 'Player client was successfully created.' }\n format.json { render json: @player_client, status: :created, location: @player_client }\n else\n format.html { render action: \"new\" }\n format.json { render json: @player_client.errors, status: :unprocessable_entity }\n end\n end\n end", "def client_params\n params.require(:client).permit(:name, :password, :password_confirmation)\n end", "def create\n @client = Client.new(params[:client])\n respond_to do |format|\n if @client.save\n @user = @client.complete_user\n flash[:notice] = 'Client was successfully created.'\n set_login_cookie(@user.get_psv)\n format.html { redirect_to(settings_path()) }\n format.xml { render :xml => @client, :status => :created, :location => @client }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @client.errors, :status => :unprocessable_entity }\n end\n end\n end", "def new\n @client = Client.new\n @account = current_user.account\n @user = current_user\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @client }\n end\n end", "def create\n @qa_client = QaClient.new(params[:qa_client])\n\n respond_to do |format|\n if @qa_client.save\n format.html { redirect_to @qa_client, notice: 'Qa client was successfully created.' }\n format.json { render json: @qa_client, status: :created, location: @qa_client }\n else\n format.html { render action: \"new\" }\n format.json { render json: @qa_client.errors, status: :unprocessable_entity }\n end\n end\n end", "def add_client\n name = get_answer_to(\"What is the client\\'s name?\")\n age = get_answer_to(\"What is the client\\'s age?\")\n new_client = Clients.new(name, age)\n @clients << new_client\n end" ]
[ "0.72085994", "0.71753484", "0.7120956", "0.7116921", "0.710099", "0.6981326", "0.6981326", "0.6981326", "0.6979284", "0.6971666", "0.6971666", "0.6971666", "0.6970004", "0.69603", "0.6956069", "0.69386387", "0.69206727", "0.691133", "0.689539", "0.6878896", "0.6864519", "0.68514645", "0.6848104", "0.68280786", "0.68258786", "0.67249995", "0.6631503", "0.6616964", "0.6615913", "0.6600805", "0.65753627", "0.6568949", "0.65436697", "0.65353733", "0.65334564", "0.6531048", "0.6502263", "0.6499667", "0.64883107", "0.64827263", "0.6479907", "0.647583", "0.6469023", "0.64618635", "0.64546674", "0.6445776", "0.64390033", "0.6424845", "0.6421493", "0.6417318", "0.64138657", "0.63861483", "0.6379262", "0.6379262", "0.6379262", "0.6379262", "0.6357731", "0.63550496", "0.63400084", "0.632291", "0.63123393", "0.62888896", "0.6285559", "0.62848794", "0.6259729", "0.62461823", "0.6243193", "0.6238357", "0.6233286", "0.6227824", "0.62261456", "0.6218333", "0.62095124", "0.61974883", "0.61974883", "0.6196421", "0.6193734", "0.61913884", "0.6187541", "0.61777097", "0.61735517", "0.6149281", "0.6141443", "0.6135297", "0.6135297", "0.61311144", "0.6123147", "0.61173683", "0.6108032", "0.6104324", "0.6098371", "0.6091657", "0.6085008", "0.60848856", "0.60817873", "0.6080912", "0.606868", "0.60654974", "0.60625815", "0.60587716", "0.6055919" ]
0.0
-1
PUT /clients/1 PUT /clients/1.json
def update @client = Client.find(params[:id]) respond_to do |format| if @client.update_attributes(params[:client]) format.html { redirect_to @client, notice: 'Client was successfully updated.' } format.json { head :no_content } else format.html { render action: "edit" } format.json { render json: @client.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @client.update(client_params)\n render json: @client\n end", "def update\n @client = Client.find(params[:id])\n\n respond_to do |format|\n if @client.update_attributes(params[:client])\n format.html { redirect_to clients_path, notice: 'Client was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @client = Client.find(params[:id])\n\n respond_to do |format|\n if @client.update_attributes(params[:client])\n format.html { redirect_to clients_path, notice: 'Client was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @client = Client.find(params[:id])\n\n respond_to do |format|\n if @client.update_attributes(params[:client])\n format.html { redirect_to @client, notice: 'Client was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @client = Client.find(params[:id])\n\n respond_to do |format|\n if @client.update_attributes(params[:client])\n format.html { redirect_to @client, :notice => 'El cliente se ha actualizado correctamente.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @client.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n if @client.update(client_params)\n head(:ok)\n else\n render json: @client.errors.full_messages, status: :unprocessable_entity\n end\n end", "def update\n @client = Client.find(params[:id])\n\n respond_to do |format|\n if @client.update_attributes(params[:client])\n format.html { redirect_to @client, :notice => 'Klijent je uspjesno izmjenjen.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @client.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @clients = get_clients\n @client = Client.find(params[:id])\n\n respond_to do |format|\n if @client.update_attributes(params[:client])\n @clients = get_clients\n #format.html { redirect_to @client, notice: 'Client was successfully updated.' }\n format.json { head :no_content }\n format.js\n else\n #format.html { render action: \"index\" }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n format.js\n end\n end\n end", "def update\r\n params[:client][:version] = ENV[\"VERSION\"]\r\n params[:client][:username] = current_user.username\r\n @client = Client.find(params[:id])\r\n\r\n respond_to do |format|\r\n if @client.update_attributes(client_params)\r\n format.html { redirect_to @client, notice: 'Client was successfully updated.' }\r\n format.json { head :no_content }\r\n else\r\n format.html { render action: \"edit\" }\r\n format.json { render json: @client.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "def update\n @client = current_user.clients.find(params[:id])\n\n respond_to do |format|\n if @client.update_attributes(client_params)\n format.html { redirect_to @client, notice: 'Event was successfully updated.' }\n format.json { render :show, status: :ok, location: @client }\n else\n format.html { render :edit }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n authorize @client\n respond_to do |format|\n if @client.update(client_params)\n format.html { redirect_back_or_default clients_url, t('Record has been saved') }\n format.json { render :show, status: :ok, location: @client }\n else\n format.html { render :edit }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end", "def put(type, info)\n path, info = type_info(type, :path), force_case(info)\n ida = type == :client ? 'client_id' : 'id'\n raise ArgumentError, \"info must include #{ida}\" unless id = info[ida]\n hdrs = headers\n if info && info['meta'] && (etag = info['meta']['version'])\n hdrs.merge!('if-match' => etag)\n end\n reply = json_parse_reply(@key_style,\n *json_put(@target, \"#{path}/#{Addressable::URI.encode(id)}\", info, hdrs))\n\n # hide client endpoints that are not quite scim compatible\n type == :client && !reply ? get(type, info['client_id']): reply\n end", "def update\n client=Client.find_by_id params[:id]\n if client!= nil\n client.cedula=params[:cedula] ? params[:cedula]: client.cedula\n client.sector=params[:sector] ? params[:sector]: client.sector\n client.nombre=params[:nombre] ? params[:nombre]: client.nombre\n client.telefono=params[:telefono] ? params[:telefono]: client.telefono\n client.pagina=params[:pagina] ? params[:pagina]: client.pagina\n client.direccion=params[:direccion] ? params[:direccion]: client.direccion\n if client.save\n render(json: client, status: 201)\n end \n else\n render(json: client.errors, status: 404)\n end \n end", "def update\n @client = Client.find(params[:id])\n authorize! :update, @client\n\n respond_to do |format|\n if @client.update_attributes(client_params)\n format.html { redirect_to @client, :notice => 'Client was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @client.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @client = Client.find(params[:id])\n\n respond_to do |format|\n if @client.update_attributes(params[:client])\n format.html { redirect_to user_url(@client.id), notice: 'Client was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { redirect_to edit_user_url(@client.id)}\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n \n respond_to do |format|\n if @client.update(client_params)\n format.html { redirect_to @client, notice: 'Client was successfully updated.' }\n format.json { render :show, status: :ok, location: @client }\n else\n format.html { render :edit }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @client.update(client_params)\n format.html { redirect_to clients_url, notice: 'La información del cliente se actualizó correctamente.' }\n format.json { render :index, status: :ok, location: @client }\n else\n format.html { render :edit }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n\n params[:client][:contact_ids] ||= []\n @client = Client.find(params[:id])\n\n respond_to do |format|\n if @client.update_attributes(params[:client])\n format.html { redirect_to @client, notice: 'Client was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n\n if @client.update(client_params)\n format.html { redirect_to clients_path, notice: 'Client was successfully updated.' }\n format.json { render :show, status: :ok, location: @client }\n else\n format.html { render :edit }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @client.update(client_params)\n format.html { redirect_to @client, notice: \"Client was successfully updated.\" }\n format.json { render :show, status: :ok, location: @client }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n authorize! :update, Client\n load_client\n build_client\n save_client or render :edit\n end", "def update\n respond_to do |format|\n if @client.update(client_params)\n format.html { redirect_to @client, notice: 'Client record was successfully updated.' }\n format.json { render :show, status: :ok, location: @client }\n else\n format.html { render :edit }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_client\n\t\t@client = Client.find(params[:id])\n\n\t \trespond_to do |format|\n\t\t if @client.update_attributes(client_update_params)\n\t\t format.html { redirect_to(@client, :notice => 'Entry was successfully updated.') }\n\t\t format.json { respond_with_bip(@client) }\n\t\t else\n\t\t format.html { render :action => \"edit\" }\n\t\t format.json { respond_with_bip(@client) }\n\t\t end\n\n \t end\n\tend", "def update\n respond_to do |format|\n if @client.update(client_params)\n format.html { redirect_to @client, notice: 'Client was successfully updated.' }\n format.json { render :show, status: :ok, location: @client }\n else\n format.html { render :edit }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @client.update(client_params)\n format.html { redirect_to @client, notice: 'Client was successfully updated.' }\n format.json { render :show, status: :ok, location: @client }\n else\n format.html { render :edit }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @client.update(client_params)\n format.html { redirect_to @client, notice: 'Client was successfully updated.' }\n format.json { render :show, status: :ok, location: @client }\n else\n format.html { render :edit }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @client.update(client_params)\n format.html { redirect_to @client, notice: 'Client was successfully updated.' }\n format.json { render :show, status: :ok, location: @client }\n else\n format.html { render :edit }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @client.update(client_params)\n format.html { redirect_to @client, notice: 'Client was successfully updated.' }\n format.json { render :show, status: :ok, location: @client }\n else\n format.html { render :edit }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @client.update(client_params)\n format.html { redirect_to @client, notice: 'client was successfully updated.' }\n format.json { render :show, status: :ok, location: @client }\n else\n format.html { render :edit }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @client.update(client_params)\n format.html { redirect_to @client, notice: 'client was successfully updated.' }\n format.json { render :show, status: :ok, location: @client }\n else\n format.html { render :edit }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n id = shift_argument || raise(Heroku::Command::CommandFailed, \"Usage: clients:update [ID] [options]\")\n\n if options.empty?\n raise(Heroku::Command::CommandFailed, \"Missing options\")\n end\n\n validate!(options[:url]) if options[:url]\n shell = options.delete(:shell)\n options[:redirect_uri] = options.delete(:url)\n\n client = request do\n api.request(\n :body => encode_json(options),\n :expects => 200,\n :headers => headers,\n :method => :patch,\n :path => \"/oauth/clients/#{CGI.escape(id)}\"\n ).body\n end\n\n if shell\n puts \"HEROKU_OAUTH_ID=#{client[\"id\"]}\"\n puts \"HEROKU_OAUTH_SECRET=#{client[\"secret\"]}\"\n else\n styled_header(%{Updated client \"#{client[\"name\"]}\".})\n styled_hash(client)\n end\n end", "def update\n @client = Client.find(params[:id])\n flash[:notice] = 'Client was successfully updated.' if @client.update_attributes(params[:client])\n respond_with(@client)\n end", "def update\n @client = Client.find(params[:id])\n\n respond_to do |format|\n if @client.update_attributes(params[:client])\n format.html { redirect_to(client_url, :notice => 'Client was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @client.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @client.update(client_params)\n format.html { redirect_to @client, notice: 'Cliente atualizado com sucesso!' }\n format.json { render :show, status: :ok, location: @client }\n else\n format.html { render :edit }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @client.update(client_params)\n format.html { redirect_to @client, notice: 'Cliente atualizado com sucesso.' }\n format.json { render :show, status: :ok, location: @client }\n else\n format.html { render :edit }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @client.update(client_params)\n\n format.html { redirect_to @client, notice: 'Client was successfully updated.' }\n\n format.json { render :show, status: :ok, location: @client }\n\n else\n\n format.html { render :edit }\n\n format.json { render json: @client.errors, status: :unprocessable_entity }\n\n end\n end\n end", "def update\n respond_to do |format|\n if @client.update(client_params)\n format.html { redirect_to @client, notice: 'Client a été mise à jour.' }\n format.json { render :show, status: :ok, location: @client }\n else\n format.html { render :edit }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @client = Client.find(params[:id])\n \n respond_to do |format|\n if @client.update_attributes(params[:client])\n flash[:notice] = 'Client was successfully updated.'\n format.html { redirect_to client_url(@role) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @client.errors.to_xml }\n end\n end\n end", "def update\n @client = Client.find(params[:id])\n respond_to do |format|\n if @client.update_attributes(params[:client])\n \n flash[:notice] = 'Client was successfully updated.'\n format.html { redirect_to(@client) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @client.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @client = Client.find(params[:id])\n\n respond_to do |format|\n if @client.update_attributes(params[:client])\n format.html { redirect_to(@client, :notice => 'Client was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @client.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @client = clients.find(params[:id])\n\n if @client.update_attributes(params[:client])\n flash[:notice] = 'Client was successfully updated.'\n redirect_to(user_company_clients_url(current_company))\n else\n render :action => \"edit\"\n end\n end", "def update_client\n\t\tif(request.method == \"OPTIONS\")\n\t\t\trespond({status: 0})\n\t\telsif request.method == \"POST\"\n\t\t\trespond(update_user_client(params))\n\t\tend\n\tend", "def update\n @client = Client.find(params[:id])\n respond_to do |format|\n if @client.update_attributes(client_params)\n format.html { redirect_to(@client, :notice => 'Client was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @client.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n succeess_redirect_path = URI(request.referer).path.gsub 'edit', ''\n if @client.update(client_params)\n format.html { redirect_to succeess_redirect_path, notice: 'Client was successfully updated.' }\n format.json { render :show, status: :ok, location: @client }\n else\n format.html { redirect_to URI(request.referer).path }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @client = Client.find(params[:id])\n flash[:success] = \"Cliente editado exitosamente\" if @client.update_attributes(params[:client])\n respond_with(@client)\n end", "def update\n # NOTE: API V1 dropped support for updating client keys via update (aka PUT),\n # but this code never supported key updating in the first place. Since\n # it was never implemented, we will simply ignore that functionality\n # as it is being deprecated.\n # Delete this comment after V0 support is dropped.\n payload = { name: name }\n payload[:validator] = validator unless validator.nil?\n\n # DEPRECATION\n # This field is ignored in API V1, but left for backwards-compat,\n # can remove after API V0 is no longer supported.\n payload[:admin] = admin unless admin.nil?\n\n begin\n new_client = chef_rest_v1.put(\"clients/#{name}\", payload)\n rescue Net::HTTPClientException => e\n # rescue API V0 if 406 and the server supports V0\n supported_versions = server_client_api_version_intersection(e, SUPPORTED_API_VERSIONS)\n raise e unless supported_versions && supported_versions.include?(0)\n\n new_client = chef_rest_v0.put(\"clients/#{name}\", payload)\n end\n\n Chef::ApiClientV1.from_hash(new_client)\n end", "def update\n @client = Client.find(params[:id])\n\n respond_to do |format|\n if @client.update_attributes(client_params)\n format.html { redirect_to(@client, :notice => 'Les informations du client ont été mises à jour.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @client.errors, :status => :unprocessable_entity }\n end\n end\n end", "def edit_client\n\t\t@client = Client.find(params[:id])\n\tend", "def update_resources(client_id)\n response = self.class.put(\"https://app.klipfolio.com/api/1.0/clients/#{client_id}/resources\", basic_auth: @auth, headers: { \"Content-Type\" => \"application/json\" },\n body: {\n \"resources\": [{\"name\":\"dashboard.tabs.total\", \"value\":1}]\n }.to_json)\n puts response.body\n puts \"Client's resources were updated.\" if response.success?\n end", "def update\n @api_client = ApiClient.find(params[:id])\n\n respond_to do |format|\n if @api_client.update_attributes(params[:api_client])\n format.html { redirect_to @api_client, notice: 'Api client was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @api_client.errors, status: :unprocessable_entity }\n end\n end\n end", "def update(id, client)\n @client = Locomotive::Client.get(id)\n raise NotFound unless @client\n if @client.update_attributes(client)\n redirect resource(@client), :message => {:notice => \"Client was successfully updated\"}\n else\n display @client, :edit\n end\n end", "def update\n respond_to do |format|\n begin\n ActiveRecord::Base.transaction do\n @client.update!(client_params)\n @client.address.update!(address_params)\n end\n format.html { redirect_to @client, notice: 'Client was successfully updated.' }\n format.json { render :show, status: :ok, location: @client }\n rescue\n format.html { render :edit }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_client(client)\n raise ArgumentError, 'Cannot update without id' if client.id.nil?\n resp = put \"#{CLIENT_API_PATH}/#{client.id}\", params: client.as_json\n process_response(resp)\n true\n rescue Errors::UnprocessableEntity\n false\n end", "def update\n @client.update_attributes(client_params)\n @clients = Client.all\n flash[:notice]=\"Client Modifier avec succès!!!\"\n end", "def update\n @client = Client.find(params[:id])\n\n respond_to do |format|\n if @client.update_attributes(params[:client])\n format.html { redirect_to(@client, :notice => \"Client was successfully updated. #{undo_link}\") }\n else\n format.html { render :action => \"edit\" }\n end\n end\n end", "def update\n\t @client = User.find(params[:id])\n\t\tif @client.update(clients_params)\n flash[:success] = \"Record updated successfully\"\n\t\t\tredirect_to clients_path\n\t\telse\n flash[:error] = \"Record not updated\"\n\t\t\tredirect_to new_client_path\n\t end\n end", "def update\n @client = Client.find(params[:id])\t\t\n if @client.update_attributes(params[:client])\n redirect_to @client, notice: 'Client was successfully updated!'\n else\n render action: \"edit\"\n end\n end", "def update\n @client = Client.find(params[:id])\n @uuid = params[:uuid]\n respond_to do |format|\n if @client.update_attributes(params[:client])\n format.html { redirect_to :controller => 'ads', :action => 'admin_dash', :id => 1, :uuid => @uuid, notice: 'Client was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @client = Client.find params[:id]\n respond_to do |format|\n if @client.update_attributes(client_params)\n format.html { redirect_to client_path(@client), notice: 'Cliente fue Actualizado correctamente.' }\n else\n format.html { render :edit }\n end\n end\n end", "def update\n\tif signed_in?\n\t\tif params[:client][:encrypted_password_confirmation].blank?\n\t\t\tparams[:client].delete(\"encrypted_password\")\n\t\t\tparams[:client].delete(\"encrypted_password_confirmation\")\n\t\tend\n\t\t@current_client = current_user.username\n\t\tif current_user.username == 'admin'\n\t\t\t@client = Client.find(params[:id])\n\t\telse\n\t\t\tredirect_to home_path\n\t\tend\n\telse\n\t\tredirect_to signin_path\n\tend\n respond_to do |format|\n if @client.update_attributes(params[:client])\n format.html { redirect_to clients_path}\n else\n format.html { render action: \"edit\" }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @clientsOffers = ClientsOffers.find(params[:id])\n\n respond_to do |format|\n if @clientsOffers.update_attributes(params[:clientsOffers])\n format.html { redirect_to @clientsOffers, notice: 'ClientsOffers was succesfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @clientsOffers.errors, status: :unprocesable_entity }\n end\n end\n end", "def destroy\n @client = Client.find(params[:id])\n authorize! :update, @client\n @client.destroy\n\n respond_to do |format|\n format.html { redirect_to clients_url }\n format.json { head :ok }\n end\n end", "def set_client\n @client = Client.find(params[:id])\n end", "def update\n if @client.update(client_params)\n redirect_to clients_path\n else\n render :edit\n end\n end", "def update(url, data)\n RestClient.put url, data, :content_type => :json\nend", "def set_client\n @client = Client.find(params[:id])\n end", "def set_client\n @client = Client.find(params[:id])\n end", "def set_client\n @client = Client.find(params[:id])\n end", "def set_client\n @client = Client.find(params[:id])\n end", "def set_client\n @client = Client.find(params[:id])\n end", "def update\n @qa_client = QaClient.find(params[:id])\n\n respond_to do |format|\n if @qa_client.update_attributes(params[:qa_client])\n format.html { redirect_to @qa_client, notice: 'Qa client was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @qa_client.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @client = Client.find(params[:id])\n @client.name = @client.name.upcase\n if session[:user].nil? \n redirect_to :controller => \"login\", :action => \"new\"\n else\n @client.updated_by = session[:user]\n end\n\n respond_to do |format|\n if @client.update_attributes(params[:client])\n format.html { redirect_to clients_path(:clientid => @client.id), notice: 'Client was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_client\n @client = Client.find(params[:id])\n end", "def update\n @user = User.find(params[:id])\n @client = Client.find(params[:id])\n if @client.update(client_params)\n # Save the item successfully\n redirect_to @client\n else\n render :action => \"edit\"\n end\n\n\n end", "def patch(type, info)\n path, info = type_info(type, :path), force_case(info)\n ida = type == :client ? 'client_id' : 'id'\n raise ArgumentError, \"info must include #{ida}\" unless id = info[ida]\n hdrs = headers\n if info && info['meta'] && (etag = info['meta']['version'])\n hdrs.merge!('if-match' => etag)\n end\n reply = json_parse_reply(@key_style,\n *json_patch(@target, \"#{path}/#{Addressable::URI.encode(id)}\", info, hdrs))\n\n # hide client endpoints that are not quite scim compatible\n type == :client && !reply ? get(type, info['client_id']): reply\n end", "def update\n if @client.update(client_params)\n redirect_to client_path(@client)\n else\n render :edit\n end\n end", "def set_client\r\n @client = Client.find(params[:id])\r\n end", "def set_client\r\n @client = Client.find(params[:id])\r\n end", "def set_client\n \t@client = Client.find(params[:id])\n end", "def set_client\n @client = Client.find(params[:id] || params[:client_id])\n end", "def set_client\n @client = Client.find(params[:id])\n \n end", "def set_client\n\t @client = Client.find(params[:id])\n\tend", "def set_client\n @client = Client.find(params[:id])\n end", "def update\n if @client.update(client_params)\n redirect_to show_clients_path(@client), notice: 'Client was successfully updated.'\n else\n render :edit\n end\n end", "def update\n\n #se não aguardar carregar os dados\n if client_params[:state] == '...'\n sweetalert_warning('Você precisa informar o CEP e aguardar os dados do endereço serem preenchidos.', 'Aviso!', useRejections: false)\n redirect_to edit_client_path(@client) and return\n end\n\n respond_to do |format|\n\n if @client.update(client_params)\n format.html { redirect_to @client, notice: 'Cliente atualizado com sucesso.' }\n format.json { render :show, status: :ok, location: @client }\n sweetalert_success('Cliente atualizado com sucesso.', 'Sucesso!', useRejections: false)\n else\n format.html { render :edit }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end", "def updateClients request\n @clients.each do |client|\n unless client == @lastClient\n client.socket.write request\n end\n end\n end", "def update\n @client = Client.find(params[:id])\n\n respond_to do |format|\n \tif params[:client][:logo].blank?\n \t\tparams[:client][:logo] = @client.logo\n \telse\n \t\tnew_file_name = upload_file(params[:client][:logo], \"/public/files/logo_files/\")\n\t \tFileUtils.rm Dir[\"#{Rails.root}/public/files/logo_files/\"+@client.logo.to_s]\n\t \tparams[:client][:logo] = new_file_name\n \tend\n\t \tparams[:client][:updated_by] = current_user.id\n @client.attributes = params[:client]\n if @client.save\n format.html { redirect_to clients_path, notice: 'Client was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_client\n @client = Client.find(params[:id])\n end", "def set_client\n @client = Client.find(params[:id])\n end", "def set_client\n @client = Client.find(params[:id])\n end", "def set_client\n @client = Client.find(params[:id])\n end", "def set_client\n @client = Client.find(params[:id])\n end", "def set_client\n @client = Client.find(params[:id])\n end", "def set_client\n @client = Client.find(params[:id])\n end", "def set_client\n @client = Client.find(params[:id])\n end", "def set_client\n @client = Client.find(params[:id])\n end", "def set_client\n @client = Client.find(params[:id])\n end", "def set_client\n @client = Client.find(params[:id])\n end", "def set_client\n @client = Client.find(params[:id])\n end" ]
[ "0.74382377", "0.6906038", "0.6906038", "0.688342", "0.6853038", "0.6845028", "0.6813453", "0.67778057", "0.6769948", "0.6766596", "0.676636", "0.67412317", "0.6728952", "0.6726424", "0.67103064", "0.6692573", "0.6692084", "0.66644424", "0.6654053", "0.66500646", "0.66369826", "0.6634739", "0.66321826", "0.6628799", "0.6628799", "0.6628799", "0.6628799", "0.6628799", "0.6627717", "0.6627717", "0.6609833", "0.6560333", "0.6554939", "0.65521705", "0.6547079", "0.6538999", "0.65358657", "0.6530017", "0.6525512", "0.6525416", "0.6481656", "0.6475663", "0.64662135", "0.64640087", "0.6453756", "0.64403707", "0.641721", "0.6400851", "0.6381261", "0.6374745", "0.63708806", "0.63507664", "0.6345655", "0.63304996", "0.6317077", "0.63155055", "0.63147503", "0.6301795", "0.62706625", "0.6259614", "0.62438846", "0.62409985", "0.62371236", "0.6227126", "0.6217239", "0.6208644", "0.6208644", "0.6208644", "0.6208644", "0.6208644", "0.620271", "0.6201783", "0.61973673", "0.6193507", "0.61730194", "0.61721903", "0.61712354", "0.6163722", "0.6162879", "0.61620176", "0.6161715", "0.6145271", "0.6142525", "0.61378425", "0.61321914", "0.6122966", "0.612015", "0.6117793", "0.6117793", "0.6117793", "0.6117793", "0.6117793", "0.6117793", "0.6117793", "0.6117793", "0.6117793", "0.6117793", "0.6117793", "0.6117793" ]
0.68509334
6
DELETE /clients/1 DELETE /clients/1.json
def destroy @client = Client.find(params[:id]) @client.destroy respond_to do |format| format.html { redirect_to clients_url } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @client = Client.find(params[:id])\n @client.destroy\n\n respond_to do |format|\n format.html { redirect_to clients_url }\n format.json { head :ok }\n end\n end", "def destroy\n @client = Client.find(params[:id])\n @client.destroy\n\n respond_to do |format|\n format.html { redirect_to clients_url }\n format.json { head :ok }\n end\n end", "def destroy\n @client.destroy\n respond_to do |format|\n format.html { redirect_to clients_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @client = Client.find(params[:id])\n @client.destroy\n respond_to do |format|\n format.html { redirect_to clients_url }\n format.json { head :no_content }\n end\n end", "def destroy\r\n @client = Client.find(params[:id])\r\n @client.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to clients_url }\r\n format.json { head :no_content }\r\n end\r\n end", "def destroy\n @client = Client.find(params[:id])\n authorize! :update, @client\n @client.destroy\n\n respond_to do |format|\n format.html { redirect_to clients_url }\n format.json { head :ok }\n end\n end", "def destroy\n chef_rest_v1.delete(\"clients/#{@name}\")\n end", "def destroy\n @client = Client.find(params[:id])\n @client.destroy\n \n respond_to do |format|\n format.html { redirect_to clients_url }\n format.xml { head :ok }\n end\n end", "def destroy\n @client.destroy\n respond_to do |format|\n format.html { redirect_to clients_url, notice: 'Client record was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @client.destroy\n respond_to do |format|\n format.html { redirect_to clients_url, notice: 'Client a été supprimer.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @client.destroy\n respond_to do |format|\n format.html { redirect_to clients_url, notice: 'Client was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @client.destroy\n respond_to do |format|\n format.html { redirect_to clients_url, notice: 'Client was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @client.destroy\n respond_to do |format|\n format.html { redirect_to clients_url, notice: 'Client was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @client.destroy\n respond_to do |format|\n format.html { redirect_to clients_url, notice: 'Client was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @client.destroy\n respond_to do |format|\n format.html { redirect_to clients_url, notice: 'Client was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @client.destroy\n respond_to do |format|\n format.html { redirect_to clients_url, notice: 'Client was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @client.destroy\n respond_to do |format|\n format.html { redirect_to clients_url, notice: 'Client was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @client.destroy\n respond_to do |format|\n format.html { redirect_to clients_url, notice: \"Client was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def destroy\n @client.destroy\n respond_to do |format|\n format.html { redirect_to clients_url, notice: 'El Cliente fue Eliminado Exitosamente.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @client.destroy\n respond_to do |format|\n format.html { redirect_to clients_url, notice: 'Данные по клиенту удалены.' }\n format.json { head :no_content }\n end\n end", "def destroy\n authorize @client\n @client.destroy\n respond_to do |format|\n format.html { redirect_back_or_default clients_url, t('Record has been deleted') }\n format.json { head :no_content }\n end\n end", "def destroy\n @client.destroy\n\n respond_to do |format|\n format.html { redirect_to clients_url, notice: 'Client was successfully destroyed.' }\n\n format.json { head :no_content }\n end\n end", "def destroy\n client=Client.find_by_id(params[:id])\n if client != nil\n if client.destroy\n head 204\n end\n else\n head 404\n end\n end", "def destroy\n @client = Client.find(params[:id])\n @client.destroy\n\n respond_to do |format|\n format.html { redirect_to(clients_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @client = Client.find(params[:id])\n @client.destroy\n\n respond_to do |format|\n format.html { redirect_to(clients_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @client = Client.find(params[:id])\n @client.destroy\n\n respond_to do |format|\n format.html { redirect_to(clients_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @client.destroy\n respond_to do |format|\n format.html { redirect_to clients_url, notice: 'Cliente apagado com sucesso.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @client = Client.find(params[:id])\n @client.destroy\n\n respond_to do |format|\n format.html { redirect_to(clients_url) }\n end\n end", "def destroy\n @client = Client.find(params[:id])\n @client.destroy\n\n respond_to do |format|\n format.html { redirect_to(clients_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @client.destroy\n respond_to do |format|\n format.html { redirect_to clients_url, notice: 'Cliente excluído com sucesso!' }\n format.json { head :no_content }\n end\n end", "def destroy\n @client = Client.find(params[:id])\n \n if @client.deleted_at.blank?\n @client.destroy\n else\n @client.revive\n end\n \n respond_to do |format|\n format.html { redirect_to :back }\n format.json { head :ok }\n end\n end", "def delete\n client.delete(\"/#{id}\")\n end", "def destroy\n @client = Client.find(params[:id])\n @client.destroy\n respond_with(@client)\n end", "def destroy\n @api_client = ApiClient.find(params[:id])\n @api_client.destroy\n\n respond_to do |format|\n format.html { redirect_to api_clients_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @client = Client.find(params[:id])\n @client.destroy\n @uuid = params[:uuid]\n respond_to do |format|\n format.html { redirect_to :controller => 'ads', :action => 'admin_dash', :id => 1, :uuid => @uuid }\n format.json { head :no_content }\n end\n end", "def destroy\n @client = Client.find(params[:id])\n @client.destroy\n redirect_to clients_url\n end", "def destroy\n @secubat_client = SecubatClient.find(params[:id])\n @secubat_client.destroy\n\n respond_to do |format|\n format.html { redirect_to secubat_clients_url }\n format.json { head :ok }\n end\n end", "def destroy\n @otg_client.destroy\n respond_to do |format|\n format.html { redirect_to otg_clients_url, notice: 'Otg client was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n clients_delete(@entity)\n @entity.destroy\n respond_to do |format|\n format.html { redirect_to clients_path }\n format.json { render json: {success: true} }\n end\n end", "def destroy\n @client_info.destroy\n respond_to do |format|\n format.html { redirect_to client_infos_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @client_info.destroy\n respond_to do |format|\n format.html { redirect_to client_infos_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @qa_client = QaClient.find(params[:id])\n @qa_client.destroy\n\n respond_to do |format|\n format.html { redirect_to qa_clients_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @my_studio_client = MyStudio::Client.find(params[:id])\n @my_studio_client.destroy\n\n respond_to do |format|\n format.html { redirect_to my_studio_clients_url }\n format.json { head :ok }\n end\n end", "def destroy\n @user = current_user\n @client = Client.find(params[:id])\n @client.destroy\n\n respond_to do |format|\n format.html { redirect_to clients_path(@user) }\n format.xml { head :ok }\n end\n end", "def destroy\n @client = Client.find(params[:id])\n @client.destroy\n @clients = get_clients\n @client = Client.new\n\n respond_to do |format|\n #format.html { redirect_to clients_url }\n format.json { head :no_content }\n format.js\n end\n end", "def destroy\n @client = clients.find(params[:id])\n @client.destroy\n redirect_to(user_company_clients_url(current_company))\n end", "def delete(client_id)\n id = client_id.to_s\n Client.collection.filter(:id => id).delete\n AuthRequest.collection.filter(:client_id => id).delete\n AccessGrant.collection.filter(:client_id => id).delete\n AccessToken.collection.filter(:client_id => id).delete\n end", "def destroy\n id = shift_argument || raise(Heroku::Command::CommandFailed, \"Usage: clients:destroy [ID]\")\n client = request do\n api.request(\n :expects => 200,\n :headers => headers,\n :method => :delete,\n :path => \"/oauth/clients/#{CGI.escape(id)}\"\n ).body\n end\n puts \"Deregistered client '#{client[\"name\"]}'.\"\n end", "def destroy\n\n\tif signed_in?\n\t\tif current_user.username == 'admin'\n\t\t\t@client = Client.find(params[:id])\n\t\t\t@client.destroy\n\t\telse\n\t\t\tredirect_to home_path\n\t\tend\n\telse\n\t\tredirect_to signin_path\n\tend\n respond_to do |format|\n format.html { redirect_to clients_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @client = Client.find params[:id]\n @client.destroy\n respond_to do |format|\n format.html { redirect_to clients_url, notice: 'Cliente fue Eliminado correctamente.' }\n end\n end", "def destroy\n @client.destroy\n redirect_to index_clients_path, notice: 'Client was successfully destroyed.'\n end", "def destroy\n @client.delete( name )\n end", "def delete\n client.delete(url)\n @deleted = true\nend", "def destroy\n @client.destroy\n redirect_to clients_url, notice: 'Client was successfully destroyed.'\n end", "def destroy\n orden@client.destroy\n end", "def destroy\n @client.destroy\n respond_to do |format|\n format.html { redirect_to clients_url, notice: 'Cliente foi excluido.' }\n format.json { head :no_content }\n sweetalert_success('Cliente excluido com sucesso.', 'Sucesso!', useRejections: false)\n end\n end", "def delete(username)\n perform_request({:action => \"client-delete\", :username => username})\n end", "def destroy\n @client.delete(@name)\n end", "def destroy\n @live_client.destroy\n respond_to do |format|\n format.html { redirect_to live_clients_url, notice: 'Live client was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy(id)\n @client = Locomotive::Client.get(id)\n raise NotFound unless @client\n if @client.destroy\n redirect resource(:clients)\n else\n raise InternalServerError\n end\n end", "def destroy\n @clientsOffers = ClientsOffers.find(params[:id])\n @clientsOffers.destroy\n\n respond_to do |format|\n format.html { redirect_to clientsOffers_url }\n format.json { head :no_content }\n end\n end", "def delete_client\n\t\t@client = Client.find(params[:id])\n\n\t\tif @client.destroy\n\t\t\tredirect_to \"/details\"\n\t\telse\n\t\t\treder :action => \"delete_client\"\n\t\tend\n\tend", "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", "def destroy\n @client = Client.find(params[:id])\n @client.campaign_id = session[:campaign_id]\n @client.destroy\n\n respond_to do |format|\n format.html { redirect_to clients_url }\n format.json { head :no_content }\n end\n end", "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", "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", "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", "def destroy\n @members_client.destroy\n respond_to do |format|\n format.html { redirect_to members_clients_url, notice: 'Members client was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @authorized_client.destroy\n respond_to do |format|\n format.html {redirect_to authorized_clients_url, notice: 'Authorized client was successfully destroyed.'}\n format.json {head :no_content}\n end\n end", "def destroy\n begin\n @client = Client.find(params[:id])\n @client.destroy\n rescue Exception => e\n flash[:notice]= \"There is no any client regarding this ID.\"\n end\n redirect_to clients_path\n end", "def destroy\n authorize! :destroy, Client\n load_client\n destroy_client\n\n redirect_to clients_url\n end", "def destroy\n @blocking_client = BlockingClient.find(params[:id])\n @blocking_client.destroy\n\n respond_to do |format|\n format.html { redirect_to blocking_clients_url }\n format.json { head :no_content }\n end\n end", "def delete(path)\n RestClient.delete request_base+path\n end", "def destroy\n @client.destroy\n respond_to do |format|\n format.html { redirect_to admin_clients_url(search: params[:search], page: params[:page]),\n notice: 'Клиент удален.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @invoice_client.destroy\n respond_to do |format|\n format.html { redirect_to invoice_clients_url, notice: 'Invoice client was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @group_client.destroy\n respond_to do |format|\n format.html { redirect_to group_clients_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @evclient = Evclient.find(params[:id])\n @evclient.destroy\n\n respond_to do |format|\n format.html { redirect_to evclients_url }\n format.json { head :ok }\n end\n end", "def destroy\n @client = Client.find(params[:id])\n @client.destroy\n\n respond_to do |format|\n format.html { redirect_to(search_results_url, :notice => \"Client was successfully destroyed. #{undo_link}\") }\n end\n end", "def destroy\n @clientz.destroy\n respond_to do |format|\n format.html { redirect_to clientzs_url, notice: 'Clientz was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @clientes_servico.destroy\n respond_to do |format|\n format.html { redirect_to clientes_servicos_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @oauth_client = OauthClient.find(params[:id])\n @oauth_client.destroy\n\n respond_to do |format|\n format.html { redirect_to oauth_clients_url }\n format.json { head :no_content }\n format.xml { head :no_content }\n end\n end", "def destroy\n @player_client = PlayerClient.find(params[:id])\n @player_client.destroy\n\n respond_to do |format|\n format.html { redirect_to player_clients_url }\n format.json { head :ok }\n end\n end", "def destroy\n @client_need = ClientNeed.find(params[:id])\n @client_need.destroy\n\n respond_to do |format|\n format.html { redirect_to client_needs_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @client.destroy\n #redirect_to clients_url, notice: 'Client was successfully destroyed.'\n respond_with(status: 200)\n end", "def delete\n url = prefix + \"delete\"\n return response(url)\n end", "def delete\n url = prefix + \"delete\"\n return response(url)\n end", "def destroy\n @client_transaction = ClientTransaction.find(params[:id])\n @client_transaction.destroy\n\n respond_to do |format|\n format.html { redirect_to client_transactions_url }\n format.json { head :ok }\n end\n end", "def delete(*args)\n prepare_request(:delete, args)\n @@client.add(:delete, @path, *args)\n end", "def destroy\n @client = Client.find(params[:id])\n Client.transaction do\n FileUtils.rm Dir[\"#{Rails.root}/public/files/logo_files/\"+@client.logo.to_s]\n @client.destroy\n\n respond_to do |format|\n format.html { redirect_to clients_url, notice: 'Client was successfully deleted.' }\n format.json { head :no_content }\n end\n end\n end", "def destroy\n @potential_client.destroy\n respond_to do |format|\n format.html { redirect_to potential_clients_url, notice: 'Potential client was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @invoice = Invoice.find(params[:invoice_id])\n @client = @invoice.clients.find(params[:id])\n @client.destroy\n redirect_to invoice_path(@invoice)\n end", "def destroy\n @client_type = ClientType.find(params[:id])\n @client_type.destroy\n\n respond_to do |format|\n format.html { redirect_to client_types_url }\n format.json { head :no_content }\n end\n end" ]
[ "0.7798913", "0.7798913", "0.7783736", "0.77692276", "0.7714563", "0.76365036", "0.7623739", "0.75873184", "0.7583132", "0.7539502", "0.7536981", "0.7536981", "0.7536981", "0.7536981", "0.7536981", "0.7536981", "0.7536981", "0.7533958", "0.7527346", "0.75249654", "0.7523737", "0.7522907", "0.752107", "0.75145686", "0.75144434", "0.75144434", "0.7494138", "0.74911094", "0.7479653", "0.7479583", "0.74792016", "0.7450063", "0.74499816", "0.7391771", "0.7376258", "0.7363675", "0.73280764", "0.73230577", "0.7296184", "0.728577", "0.7285494", "0.72831696", "0.72669363", "0.7264924", "0.72458136", "0.72099286", "0.71819836", "0.71657884", "0.7148505", "0.71427417", "0.7129054", "0.71143264", "0.71115047", "0.70970774", "0.70922464", "0.70884657", "0.7083385", "0.7082502", "0.70806617", "0.7077914", "0.7074834", "0.7070227", "0.7062707", "0.7045277", "0.7029115", "0.7029115", "0.7029115", "0.7018176", "0.70035046", "0.69967824", "0.69879806", "0.69833684", "0.6973293", "0.69630533", "0.69423985", "0.6939873", "0.6938404", "0.6933287", "0.69278896", "0.69185555", "0.6917192", "0.6912441", "0.69093424", "0.6908535", "0.6905532", "0.6905532", "0.6872447", "0.6855846", "0.6854474", "0.6835467", "0.6830295", "0.6822912" ]
0.77730614
10
`t` is relative to the beginning of the production
def alive_at?(t) t.between?(t1, t2) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tpr(i)\n [ @tp[i].quo(@tp[i] + @n[i] - @tn[i]), 1 ].min\n end", "def t\n end", "def tdist(n, t); p_t(n, t); end", "def t\n return @L if a < 0\n round ((t1 / @P) +@L)\n end", "def tt; end", "def tld; end", "def tld; end", "def q(t)\n \n end", "def evaluate(t, vars)\n t # Right now, time vars must simply return t.\n end", "def production_curtailment; end", "def trd; end", "def build_timing; end", "def lbu(t, s, c)\n\n end", "def ct(t,w) u=t.length;r=w-(l=w/2-u/2)-u;' '*l+t+' '*r end", "def t2\n tc('t2.vs')\nend", "def k_times!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 37 )\n\n\n\n type = K_TIMES\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 401:4: 'times'\n match( \"times\" )\n\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 37 )\n\n\n end", "def p_t(df, t)\r\n c2 = df.to_f / (df + t * t);\r\n s = Math.sqrt(1.0 - c2)\r\n s = -s if t < 0.0\r\n p = 0.0;\r\n i = df % 2 + 2\r\n while i <= df\r\n p += s\r\n s *= (i - 1) * c2 / i\r\n i += 2\r\n end\r\n if df & 1 != 0\r\n 0.5+(p*Math.sqrt(c2)+Math.atan(t/Math.sqrt(df)))/Math::PI\r\n else\r\n (1.0 + p) / 2.0\r\n end\r\n end", "def lh(t, s, c)\n\n end", "def t_min\n @temp.min\n end", "def calc_short (g, a, t, c)\n t = 4.0*(g+c)+2.0*(a+t)\n return t\nend", "def traction\n 1 - @traction\n end", "def start_time=(_arg0); end", "def phase; end", "def t(temp=$tempHistory.pop)\n $oven.runMode= RUN_MODE_RUN\n if temp && temp.to_f.zero?\n $oven.setpointValue= 0.0\n else\n $tempHistory.push($oven.setpointValue)\n $oven.goToTemperature(temp || 30.0)\n end\n end", "def txs()\n puts 'TXS'\n @s = @x\n end", "def start_time; end", "def ftoc(temp)\n\t(temp - 32) * 5.0/9.0\nend", "def ftoc(temp)\n\t(temp - 32) * 5/9.0\nend", "def t1\n _absolute(enter)\n end", "def terpene; end", "def t\n\n h.fields['t'] ||= {}\n end", "def default_ttr\n @@default_ttr ||= 120\n end", "def total_time=(_arg0); end", "def productionTime\n\tself.item.base_blueprint.productionTime\nend", "def fpr(i)\n begin\n [ (@p[i] - @tp[i]).quo(@p[i] - @tp[i] + @tn[i]), 1 ].min\n rescue ZeroDivisionError => e\n STDERR.puts \"TP axis: #{tp_axis.inspect}\"\n STDERR.puts \"P axis: #{p_axis.inspect}\"\n STDERR.puts \"TN axis: #{tn_axis.inspect}\"\n STDERR.puts \"N axis: #{n_axis.inspect}\"\n raise ZeroDivisionError, \"i=#{i}, p[i]=#{@p[i]}, tp[i]=#{@tp[i]}, tn[i]=#{@tn[i]}\"\n end\n end", "def anatomy_past_tense; end", "def transition_at; end", "def transition_at; end", "def pred_time\n @time = (@time - @delta).max(0)\n end", "def prevping(t)\n $seed = $initseed;\n # Starting at the beginning of time, walk forward computing next pings\n # until the next ping is >= t.\n nxtping = 1184083200 # the birth of timepie/tagtime!\n lstping = nxtping\n lstseed = $seed\n while nxtping < t\n lstping = nxtping\n lstseed = $seed\n nxtping = nextping(nxtping)\n end\n $seed = lstseed\n lstping\nend", "def sb(t, s, c)\n\n end", "def derivata2(t)\n y=6*t-6\n return y\nend", "def transition_time\n end", "def guilt_trip\n \"how much of the 10000 hours have you put\"\n end", "def lowerTemp( step )\n if step < 0.0 then raiseTemp( -1.0 * step )\n else\n val = @value - step\n if isValid( val, @unit ) then\n @value = val\n end \n end \n self\n end", "def eta; end", "def sw(t, s, c)\n\n end", "def past; end", "def raiseTemp( step ) \n if step < 0.0 then lowerTemp( -1.0 * step )\n else\n @value += step\n end \n self\n end", "def ftoc(temp)\n return (temp-32)*5/9\nend", "def acceleration(state_object, t)\n k = 10\n b = 1\n (- k * state_object.x) - (b * state_object.v)\nend", "def sha1_kt(t)\n if t < 20\n 1_518_500_249\n elsif t < 40\n 1_859_775_393\n elsif t < 60\n -1_894_007_588\n else\n -899_497_514\n end\n end", "def tr(p0, p1) end", "def sha1_kt(t)\n return (t < 20) ? 1518500249 : (t < 40) ? 1859775393 :\n (t < 60) ? -1894007588 : -899497514\n end", "def sTemperatur()\n @len = @seq.length\n # Falls die Länge ungleich 0 ist\n # rechnen wir was nötig ist\n if @len\n # Falls die Länge der Zeichenkette kleiner oder gleich 14 ist \n # rechnen wir das ein bisschen anders\n if(@len <= 14)\n\treturn 4.0 * (occ(@seq, 'G') + occ(@seq, 'C')) + 2 * (occ(@seq, 'A') + occ(@seq, 'T'))\n # Falls die Länget des DNAs relativ gross ist \n # dann rechnen wir das auch anders\n else \n\treturn 64.9 + 41.0 * (occ(@seq, 'G') + occ(@seq, 'C') - 16.4) / @len\n end\n end \n return NIL\n end", "def t__17!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 6 )\n\n type = T__17\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 22:9: 't'\n match( 0x74 )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 6 )\n\n end", "def restore_times; end", "def restore_times; end", "def tr_base_name\n \"#{@stage}-#{crit}-#{phylo_prog}-#{thres}-#{hgt_type.to_s}-tr\"\n end", "def next2(t) \n @start1 = t \n return @start1 \n end", "def production(unit = :mj)\n case unit\n when :mj\n load_curve.sum * 3600\n when :mwh\n load_curve.sum\n else\n raise \"Unknown unit: #{unit}\"\n end\n end", "def ttt()\n @b = true\n return self\n end", "def calc_pa_iers2003(t)\n return (0.024381750 + 0.00000538691 * t) * t\n rescue => e\n raise\n end", "def tt\n autofill I18n.t('.')\n end", "def ta_Sun() \r\n Celes.anp(@ma + eqc( @ma, @ta ))\t\r\n end", "def min() time[1] end", "def stime=(*) end", "def f2c(t)\n\treturn (t - 32) * 5.fdiv(9)\nend", "def compute_Delta(_T)\n #equation 13\n #kPa/C\n _Delta = 4098.0 * (0.6108 * Math.exp(17.27 * _T / (_T + 237.3))) / (_T + 237.3) ** 2\nend", "def cold_start_time\n Time.now\nend", "def min\n return @t_min\n end", "def start_traction(step_name)\n\n scriptstart_time = Time.now\n\nend", "def timestamp t\n\n\t\t::Pantheios::Core.timestamp t, nil\n\tend", "def correction_with_test(t)\n end", "def t(k)\n k = k.to_f\n output = 0.0\n if k < @M\n output = 1/(k*@M)\n elsif k == @M\n r = @N/@M\n output = Math.log(r/DELTA)/@M\n else\n output = 0.0\n end\n return output\n end", "def stepMinus()\r\n #puts \"Entered stepMinus\"\r\n if (@crtTime != 0)\r\n if ((@crtTime - 2*@avgInterval) < @minTime)\r\n #puts \"crtTime set to min\"\r\n @crtTime = @minTime\r\n else\r\n @crtTime = @crtTime - 2*(@avgInterval)\r\n end\r\n end\r\n #puts \"crtTime - =\"+ @crtTime.to_s\r\n end", "def flight_time; end", "def prep_time_passed\n return \"7:34\"\n end", "def setup_unit_vars\n super\n @initial = @starting.beginning_of_year\n @final = @ending.next_year.beginning_of_year\n @pages = @last = @final.year - @initial.year\n @from = starting_time_for(@page)\n @to = @from.next_year\n end", "def test2\n puts $t\nend", "def tarjan\n @t_index = 0\n @t_stack = []\n @tg_index = {}\n @tg_lowlink = {}\n @t_result = []\n \n @t_pstack = []\n @t_forindex = Hash.new(0)\n @t_onstack = Hash.new(false)\n @g.each_key do |k|\n if @tg_index[k] == nil\n tarjan_iter(k)\n end\n end\n @t_result.sort!.reverse!\n end", "def ctau\n @ctau ||= @lifetime == 0.0 ? 0.0 : SPEED_OF_LIGHT * lifetime\n end", "def time=(_arg0); end", "def time=(_arg0); end", "def time=(_arg0); end", "def time=(_arg0); end", "def time=(_arg0); end", "def time=(_arg0); end", "def tgr; sparam(0); end", "def sub(d, s, t)\n reg_w(d, reg_r(s) - reg_r(t))\n adv_pc\n end", "def acceleration(state_object, t)\n k = 10\n b = 1\n (- k * state_object.position) - (b * state_object.velocity)\nend", "def tt(time, format=:short); '13:37'; end", "def start=(time); end", "def zetta\n big_self * ZETTA\n end", "def get_run_time(ant)\n end", "def total_time; end", "def cstime=(*) end", "def prep_time_end\n return \"1545\";\n end", "def quarter_wind; end", "def lb(t, s, c)\n\n end", "def restore_times=(_arg0); end" ]
[ "0.60234684", "0.59898734", "0.59122366", "0.5752115", "0.5722987", "0.571017", "0.571017", "0.56276375", "0.56019264", "0.5555247", "0.5474507", "0.538331", "0.5365684", "0.53624415", "0.53434587", "0.53382766", "0.5323178", "0.5314425", "0.5291562", "0.5264904", "0.52391285", "0.52183443", "0.51980585", "0.5196561", "0.515694", "0.5144854", "0.51248175", "0.5116381", "0.51148254", "0.5100796", "0.50757754", "0.50470525", "0.5044625", "0.50421697", "0.5035184", "0.5029475", "0.5024086", "0.5024086", "0.5022383", "0.50143325", "0.50116175", "0.50084186", "0.50007516", "0.49865067", "0.49820527", "0.49792224", "0.4978378", "0.4977662", "0.49635208", "0.49602404", "0.49565864", "0.4955592", "0.49466076", "0.4938967", "0.493496", "0.49252945", "0.49185163", "0.49185163", "0.49121362", "0.4911064", "0.4910179", "0.4906082", "0.48998702", "0.48942554", "0.48850477", "0.48847905", "0.4876722", "0.4865528", "0.48575813", "0.48449048", "0.48404098", "0.4837913", "0.48369035", "0.48287877", "0.48283124", "0.48211068", "0.48155516", "0.48069635", "0.47989255", "0.47972962", "0.47971237", "0.47963333", "0.47911242", "0.47911242", "0.47911242", "0.47911242", "0.47911242", "0.47911242", "0.47881687", "0.47842446", "0.47781345", "0.47767764", "0.47761124", "0.47732934", "0.47684067", "0.47681454", "0.4765097", "0.47637856", "0.47571948", "0.4756131", "0.4753454" ]
0.0
-1
Return start time for this element, relative to the beginning of the production.
def t1 _absolute(enter) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def start_time\n return @start_time\n end", "def start_time\n @start_time\n end", "def get_start_time()\n return process_stamp(@start_time)\n end", "def start_time\n @internal_data.start_time\n end", "def start_time\n @parts.first.start_time\n end", "def start_time\n start\n end", "def start_time\n data.start_time\n end", "def start_time\n data.start_time\n end", "def start_time\n eval(start) if start.present?\n end", "def start_time\n if ev = start_event.last\n ev.time\n end\n end", "def start_time\n if ev = start_event.last\n ev.time\n end\n end", "def start_date\n\t \tTime.at(self.start_time) rescue nil\n\t end", "def start_date_time\n return @start_date_time\n end", "def start_date_time\n return @start_date_time\n end", "def start_date_time\n return @start_date_time\n end", "def start_date_time\n return @start_date_time\n end", "def start_date_time\n return @start_date_time\n end", "def start_date_time\n return @start_date_time\n end", "def start_date_time\n return @start_date_time\n end", "def start_date_time\n return @start_date_time\n end", "def start_date_time\n return @start_date_time\n end", "def start_date_time\n return @start_date_time\n end", "def start_time\n dtstart.to_datetime\n end", "def start_time\n dtstart_property ? dtstart.to_datetime : nil\n end", "def start_date_time\n return @start_date_time\n end", "def start_time\n plan_rebuilder.start_time\n end", "def start_formatted\n display_time read_attribute(:start)\n end", "def start_time\n self.day\n end", "def start_time\n\t\t\treturn @start_time.strftime('%H:%M')\n\t\tend", "def start_t\n self.start_time.strftime(\"%I:%M\") if self.start_time\n end", "def start_time; end", "def start_time\n begin_date\n end", "def js_start_time\n time = read_attribute :start_time\n time_format(time)\n end", "def started_date_time\n return @started_date_time\n end", "def started_at\n Convert.millis_to_time @gapi.statistics.start_time\n end", "def start_time\n self.date\n end", "def start_time\n start_at.strftime(\"%F\") if start_at\n end", "def start_time\n by_date\n end", "def start_time=(value)\n @start_time = value\n end", "def started_at\n Time.parse @gapi.start_time\n rescue StandardError\n nil\n end", "def retrieve_start_timestamp(experiment)\n if timestamp = get(experiment.handle.to_s, 'started_at')\n Time.parse(timestamp)\n end\n end", "def start_date\n return start\n end", "def start_time\n start_time_config.pattern_matches[:time]\n end", "def start_at\n @attributes[:start_at]\n end", "def start_at\n @attributes[:start_at]\n end", "def starts\n starts = nil\n @doc.find(\"/dwml/data/time-layout/start-valid-time/text()\").map do |node|\n t = Time.parse(node.to_s)\n starts = t if !starts || t < starts\n end\n @starts = starts\n end", "def start_time_in_seconds\n @start_time_in_seconds ||= seconds_from_time(start_time)\n end", "def start_time\n item_hash.deep_find([:listing_details, :start_time])\n end", "def set_start_time\n @start_time = Time.now.to_f\n end", "def set_start_time\n @start_time = Time.now.to_f\n end", "def cycle_start_time\n if stats[:start] && stats[:actual_start]\n Time.at(*stats[:start]) + stats[:actual_start]\n end\n end", "def run_start_time\n @data['controls'].map { |control| control['results'].map { |result| DateTime.parse(result['start_time']) } }.flatten.min\n end", "def cycle_start_time\n if stats[:start] && stats[:real_start]\n Time.at(*stats[:start]) + stats[:real_start]\n end\n end", "def start\n attributes.fetch(:start)\n end", "def start\n attributes.fetch(:start)\n end", "def start_time\n return \"1530\";\n end", "def start\n starts_at.strftime(\"%R\")\n end", "def start_time\n Date.today\n end", "def starts_at\n Time.at(start_time_millis / 1000).utc.to_datetime\n end", "def start_time(person_or_type = nil)\n attribute_for_audience_with_generic(:start_time, person_or_type)\n end", "def start_time\n session[:start_time] ||= (Time.now).to_s\n end", "def start_time_to_s\n\t \tself.start_date.try(:strftime, '%H:%M:%S')\n\t end", "def start_time(ride)\n return nil unless ride.points.any?\n ride.points.first.time\n end", "def StartTime()\r\n ret = _getproperty(1610743808, [], [])\r\n @lastargs = WIN32OLE::ARGV\r\n ret\r\n end", "def start_date\n Time.parse(@start_date) if @start_date\n end", "def started_at\n # from TAI to Unix\n @started_at ||= @raw ? Time.at((@raw[0] << 32) + @raw[1] - 4611686018427387914) : nil\n end", "def start\n @start_time = Time.now.utc\n end", "def start_datetime\n d = date\n t = start_time || Time.new.midnight\n DateTime.new(d.year, d.month, d.day, t.hour, t.min, t.sec)\n end", "def start(value = nil)\n return @start unless value\n @start = _parse_time(value)\n end", "def started_at\n Time.parse(self.result_payload[\"started_at\"]) if self.result_payload && self.result_payload[\"started_at\"]\n end", "def start_at\n today = Time.now\n Time.new(today.year, today.month, today.day, 9,0,0)\n end", "def start(value)\n merge(cmstart: value.iso8601)\n end", "def run_time\n return nil unless self.start_time\n (self.end_time || Time.now) - self.start_time\n end", "def StartTime()\r\n ret = @dispatch._getproperty(1610743808, [], [])\r\n @lastargs = WIN32OLE::ARGV\r\n ret\r\n end", "def start_date_time\n return nil unless start_date && start_time\n DateTime.new(start_date.year, start_date.month, start_date.day, start_time.hour, start_time.min, start_time.sec, start_time.zone)\n end", "def start_time=(_arg0); end", "def start_time\n if (start_time = @host.at('tag[name=HOST_START]'))\n DateTime.strptime(start_time.inner_text, fmt='%a %b %d %H:%M:%S %Y')\n else\n false\n end\n end", "def start(value)\n merge(ucstart: value.iso8601)\n end", "def start_time(*args)\n raw = starts_at || shift.starts_at\n raw = Time.local date.year, date.month, date.day, raw.hour, raw.min\n return raw if args.include? :raw\n raw.to_s(:meridian_time).strip\n end", "def start_date\n @raw.first.date\n end", "def utc_start_time\n @time.utc.strftime(\"%Y-%m-%dT%H:%M:%S.000Z\")\n end", "def started_at; end", "def started_at; end", "def started_at; end", "def started_at; end", "def started_at; end", "def starttime; Time.parse(@starttime_str); end", "def starting_at\n @starting_at ||= parse_or_at(@attrs[:starting_at]) if @attrs[:starting_at]\n end", "def local_start_at\n Timestamp.new(@timestamp_value, 0, @offset.utc_total_offset)\n end", "def start_time\n # API results are in milliseconds since the unix epoch\n epoch_msec = raw_result.fetch('time')\n epoch_sec = epoch_msec / 1000\n\n Time.at(epoch_sec).ctime\n end", "def s_time\n to_form_time(start_time.getlocal)\n end", "def start_time_string\n date_component = self.start_time.strftime(\"%b %-d\")\n time_component = self.start_time.strftime(\"%-l:%M%P %Z(%:z)\")\n\n \"#{date_component} at #{time_component}\"\n end", "def expected_start\n val = super\n val = DatelessTime.new val unless val.blank?\n val\n end", "def start_timestamp=(time)\n @start_timestamp = time.is_a?(Time) ? time.to_f : time\n end", "def start_timestamp=(time)\n @start_timestamp = time.is_a?(Time) ? time.to_f : time\n end", "def start_timestamp=(time)\n @start_timestamp = time.is_a?(Time) ? time.to_f : time\n end", "def query_start_time\n start_time - 1.hour\n end", "def get_start_date(page)\n page.css(WebScraper::JOB_DETAILS_SELECTOR)[WebScraper::JOB_START_DATE_POS].content.strip\n end", "def start_date\n earliest_date_phase = (self.phases).min_by { |s| s.start_date} if !self.phases.empty?\n if earliest_date_phase.present?\n earliest_date_phase.start_date\n else\n nil\n end\n end", "def display_time\n @display_time || start_time\n end", "def time_min; Time.now.min; end" ]
[ "0.82547283", "0.8158939", "0.81584513", "0.80315775", "0.80276", "0.7977008", "0.78999317", "0.78999317", "0.78714585", "0.7850189", "0.7850189", "0.7690866", "0.764593", "0.764593", "0.764593", "0.764593", "0.764593", "0.764593", "0.764593", "0.764593", "0.764593", "0.764593", "0.7599917", "0.75905764", "0.755568", "0.75350815", "0.74949646", "0.7488998", "0.7463355", "0.7410586", "0.73551226", "0.7344819", "0.72873396", "0.72800535", "0.7254528", "0.7140134", "0.71309537", "0.7100934", "0.70976895", "0.7021378", "0.69971514", "0.69937706", "0.69800335", "0.69673175", "0.69673175", "0.6930598", "0.6907676", "0.6902328", "0.68971306", "0.68971306", "0.6890505", "0.68694705", "0.68557626", "0.6829193", "0.6829193", "0.67941207", "0.6790508", "0.678828", "0.67360336", "0.67265975", "0.6707603", "0.67026126", "0.6686548", "0.66841966", "0.6660972", "0.66566944", "0.6652645", "0.6623888", "0.6618699", "0.65857154", "0.65666175", "0.6534407", "0.653144", "0.650238", "0.6492945", "0.649208", "0.64840615", "0.6468959", "0.6466878", "0.64566904", "0.6445682", "0.64349025", "0.64349025", "0.64349025", "0.64349025", "0.64349025", "0.64303976", "0.6427772", "0.6427062", "0.6420904", "0.6413393", "0.6412281", "0.6392717", "0.63894004", "0.63894004", "0.63894004", "0.6385174", "0.63748056", "0.635678", "0.634607", "0.6343257" ]
0.0
-1
Return exit time for this element, relative to the beginning of the production.
def t2 _absolute(exit) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def duration\n TingYun::Helper.time_to_millis(@exit_timestamp - @entry_timestamp)\n end", "def end_time\n if ev = stop_event.last\n ev.time\n end\n end", "def end_time\n if ev = stop_event.last\n ev.time\n end\n end", "def finish_time\n prop = finish_property\n prop ? prop.to_finish_time : nil\n end", "def end_time\n return nil if empty?\n @start_time + (@v.size-1).hours\n end", "def end_time\n eval(self.end) if self.end.present?\n end", "def end_time\n @parts.last.end_time\n end", "def time\n end_time - start_time\n end", "def end_time\n data.end_time\n end", "def stop_time\n Time.at(super.to_i)\n end", "def launched_time\n\n @root_expression && @root_expression.created_time\n end", "def run_time\n return nil unless self.start_time\n (self.end_time || Time.now) - self.start_time\n end", "def last_entry_time\n last_entry = db.last_entry_temp.flatten.first\n last_entry ? Time.at(last_entry) : nil\n end", "def time\n entry(MANIFEST).time\n end", "def building_time\n @process.instance_variable_get(:@building_time).total\n end", "def run_time_or_time_elapsed\n if self.end_time \n return Time.at(self.end_time - self.start_time)\n else\n return Time.at(Time.now - self.start_time)\n end\n end", "def end_time\n\t\tstart + 1.day\n\tend", "def running_time\n rt = @item_attributes.first.running_time.first\n \"#{rt.to_s} #{rt.attrib['units']}\"\n end", "def js_finish_time\n time = read_attribute :finish_time\n time_format(time)\n end", "def end_time\n item_hash.deep_find([:listing_details, :end_time])\n end", "def clock_out_time\n \treturn nil if self.is_in_progress?\n \tself.updated_at.strftime(\"%H:%M %p\")\n end", "def finished_at\n (@finished_at || Time.now).to_s[0..-7] # HACK: to remove offset (e.g. + 01:00)\n end", "def max_exit_date\n local_range.end\n end", "def finished_at\n return nil unless self.started?\n return self.started_at + self.time_needed.seconds\n end", "def finished_at\n return nil unless self.started?\n return self.started_at + self.time_needed.seconds\n end", "def end_time\n start_time + treatment.duration.minutes\n end", "def last_out_time\n Out.last(:order => \"time ASC\").time rescue nil\n end", "def start_time\n if ev = start_event.last\n ev.time\n end\n end", "def start_time\n if ev = start_event.last\n ev.time\n end\n end", "def current_time\r\n return @owner.timestamp.to_i - @start.to_i\r\n end", "def burned_time\n minutes_to_human_readable_time(entries.internal.sum :duration)\n end", "def up_time\n (Process.clock_gettime(Process::CLOCK_MONOTONIC) - (@start[:time] || Time.now)).round(3)\n end", "def end_time\n return @start_time + @seconds_to_expiry\n end", "def entry_duration(entry)\n (entry.scheduled_datetime - entry.completed_datetime) / 1.hour\n end", "def time\n return @time\n end", "def remaining_time()\n return @total_time_units - @done_time_units\n end", "def get_time_running\n\tu = get_unix_time\n\tt = -9\n\tif @TIME > 0\n\t\tt = u - @TIME\n\tend\nend", "def end_formatted\n display_time read_attribute(:end)\n end", "def end_time\n ConfigVariable.new(name: 'END_TIME', pattern: TIME_PATTERN, human_pattern: \"HH:MM\").value\n end", "def get_elapse_time\n @start_time ||= @time_now\n return @time_now - @start_time\n end", "def end_date\n\t \tTime.at(self.end_time) rescue nil\n\t end", "def duration\n self.end - time\n end", "def get_time_delta\n return(@rundate - @histodate)\n end", "def elapsed_time\n if @start_time && @end_time\n @end_time - @start_time\n else\n nil\n end\n end", "def end_date_time\n return @end_date_time\n end", "def end_date_time\n return @end_date_time\n end", "def end_date_time\n return @end_date_time\n end", "def end_date_time\n return @end_date_time\n end", "def end_date_time\n return @end_date_time\n end", "def end_date_time\n return @end_date_time\n end", "def end_date_time\n return @end_date_time\n end", "def end_time\n start_time + event.event_type.length.minutes\n end", "def get_cleaning_time_str\n end_datetime = Time.current\n unless self.finished_at.blank?\n end_datetime = self.finished_at\n end\n get_time_diff_string(self.started_at, end_datetime)\n end", "def entry_duration(entry)\n if !entry.completed_datetime.nil?\n (entry.completed_datetime - entry.scheduled_datetime) / 1.hour\n else\n 0.0\n end\n end", "def last_trip_end_time\n return nil if @driven_trips.empty?\n return @driven_trips.max_by { |item| item.end_time }.end_time\n end", "def ended_at\n Convert.millis_to_time @gapi.statistics.end_time\n end", "def end_date_time\n return @end_date_time\n end", "def get_time()\n return @noko.css(\"li.g:first-of-type table table\")[0].text\n end", "def get_duration\n ((finish - start) / 60 / 60) - (break_length / 60)\n end", "def launch_time\n data[:launch_time]\n end", "def dwell_time\n return nil if created_at.nil? || down_at.nil?\n\n # Convert the created at Time to date.\n created_at_date = Date.new(\n created_at.year,\n created_at.month,\n created_at.day\n )\n\n (down_at - created_at_date).to_i.abs\n end", "def finalized_at\n @attributes[:finalized_at]\n end", "def get_completion_time()\n return process_stamp(@end_time)\n end", "def display_run_time\n if self.end_time \n return run_time_or_time_elapsed.gmtime.strftime('%R:%S')\n else\n return \"Run has not completed.\"\n end\n end", "def timetoend\n endat - nowat\n end", "def build_time\n return nil if self.received_at.blank?\n self.created_at - self.received_at\n end", "def time\n building_time + execution_time\n end", "def runtime\n details.at(\"div.subtext time[itemprop='duration']\")['datetime'].gsub(/[^\\d+]/, '').to_i rescue nil\n end", "def calc_finished_date\n\t\t\t\tspeed = @static_building.speed\n\t\t\t\tlevel = current_user.user_info.level\n\t\t\t\tTime.now + speed.days - level.hours\n\t\t\tend", "def time\n @time\n end", "def last_in_time\n In.last(:order => \"time ASC\").time rescue nil\n end", "def time\r\n @time ||= @last_build_file.modification_time\r\n end", "def write_exit_time\n begin\n File.open(exit_time_file, 'wb') do |f|\n f.write(Time.now.to_f)\n end\n rescue\n warn(\"Failed to write exit_time.tmp: #{$!}\")\n end\n end", "def stop_time\n if (stop_time = @host.at('tag[name=HOST_END]'))\n DateTime.strptime(stop_time.inner_text, fmt='%a %b %d %H:%M:%S %Y')\n else\n false\n end\n end", "def pred_time\n @time = (@time - @delta).max(0)\n end", "def departure_time\n arrival_time\n end", "def time\n @time ||= incorporate_utc_offset(@utc, utc_offset)\n end", "def self_time\n self.measurement.self_time\n end", "def prep_time_passed\n return \"7:34\"\n end", "def start_time\n start\n end", "def endTimeFromNow() ;\n return endTimeFrom(Time.new()) ;\n end", "def last_uptime\n @root.attributes[\"n\"].to_i\n end", "def time_ended\n return @time_ended\n end", "def estimated_stop_time\n result = 0\n recipe.schedule.tasks.each do |t|\n result += t.duration + t.ramp_estimate\n end\n\n start_time + result.seconds\n end", "def estimatedEndServerTime \n \"estimatedEndServerTime\" \n end", "def time_survived\n return 0 if self.is_oz\n tag = self.killing_tag\n real_begins = self.game.game_begins - self.game.utc_offset\n return [0, tag.datetime - real_begins].max unless tag.nil?\n return [0, Game.now(self.game) - real_begins].max\n end", "def end_time\n start_time + duration\n end", "def current_time\n @definition.current_time\n end", "def horizon_time\n Time.now - horizon\n end", "def total_time; end", "def expiration_time\n Time.at(0, expiration_date, :millisecond)\n end", "def elapsed_time\n @internal_data.elapsed_time\n end", "def total_time\n minutes_to_human_readable_time(entries.internal.sum(:duration) + expected_remaining_work * 60)\n end", "def prep_time_end\n return \"1545\";\n end", "def tau\n [current_time - last_updated, 1].max\n end", "def to_unit\n timemap.last\n end", "def productionTime\n\tself.item.base_blueprint.productionTime\nend", "def calculate_time\n if @event.present? && @event.ends != nil\n event_time = @event.ends - @event.starts\n \n if event_time < 3600\n difference = ((event_time / 60) % 60)\n @event_difference = \"#{difference.round(0)} minutes\"\n else\n difference = event_time / (60 * 60)\n if difference == 1 \n @event_difference = \"#{difference.round(0)} hour\"\n else\n @event_difference = \"#{difference.round(1)} hours\"\n end\n end\n end\n end", "def time_spent\n return nil if self.finished_at.nil?\n# if self.completed?\n self.finished_at - self.started_at\n# else\n# Time.now - self.started_at\n# end\n end", "def end_time\n end_at.strftime(\"%F\") if end_at\n end", "def launch_time\n DateTime.parse(\"2015-02-04 13:00:00 UTC\")\n end" ]
[ "0.69723284", "0.6793387", "0.6793387", "0.6746913", "0.6685164", "0.65341544", "0.6291045", "0.6286001", "0.6230943", "0.6192343", "0.6181741", "0.6153685", "0.611721", "0.60857975", "0.6075967", "0.60359967", "0.6027863", "0.60192806", "0.59939355", "0.5980202", "0.59691286", "0.5967844", "0.59663355", "0.5926651", "0.5926651", "0.5904241", "0.58874726", "0.58874565", "0.58874565", "0.5880309", "0.587471", "0.58563703", "0.58498263", "0.5836324", "0.58346456", "0.5825054", "0.5824138", "0.58227056", "0.5817782", "0.5813508", "0.58065236", "0.5804041", "0.5802357", "0.5790286", "0.577804", "0.577804", "0.577804", "0.577804", "0.577804", "0.577804", "0.577804", "0.57728493", "0.5772474", "0.57649064", "0.5759891", "0.5746706", "0.5737977", "0.5735623", "0.5730959", "0.57233554", "0.5710469", "0.57084167", "0.5702304", "0.5688633", "0.568815", "0.5679533", "0.56723285", "0.5663327", "0.56532", "0.56424606", "0.5636376", "0.56355304", "0.5634548", "0.56295735", "0.5628544", "0.56277806", "0.5616857", "0.5616202", "0.5610858", "0.55986863", "0.5596015", "0.559289", "0.55899966", "0.55888087", "0.55860174", "0.5577582", "0.55746925", "0.55718714", "0.55672246", "0.5559085", "0.555853", "0.555836", "0.55551946", "0.5552298", "0.5551573", "0.55502445", "0.5547424", "0.554412", "0.55435354", "0.55401945", "0.553814" ]
0.0
-1
Specify or return the start time for this element, relative to the beginning of the scene.
def enter(t = nil) if t @enter = _convert(t) self else @enter end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def start_time\n @start_time\n end", "def set_start_time\n @start_time = Time.now.to_f\n end", "def set_start_time\n @start_time = Time.now.to_f\n end", "def start_time\n start\n end", "def start_time\n return @start_time\n end", "def start_time=(value)\n @start_time = value\n end", "def start_time\n if ev = start_event.last\n ev.time\n end\n end", "def start_time\n if ev = start_event.last\n ev.time\n end\n end", "def start_date\n\t \tTime.at(self.start_time) rescue nil\n\t end", "def start_time\n eval(start) if start.present?\n end", "def start_time\n @parts.first.start_time\n end", "def start_time\n data.start_time\n end", "def start_time\n data.start_time\n end", "def start_t\n self.start_time.strftime(\"%I:%M\") if self.start_time\n end", "def start_time\n @internal_data.start_time\n end", "def start_time\n dtstart_property ? dtstart.to_datetime : nil\n end", "def get_start_time()\n return process_stamp(@start_time)\n end", "def start_formatted\n display_time read_attribute(:start)\n end", "def start(value = nil)\n return @start unless value\n @start = _parse_time(value)\n end", "def start_time; end", "def start_time\n\t\t\treturn @start_time.strftime('%H:%M')\n\t\tend", "def js_start_time\n time = read_attribute :start_time\n time_format(time)\n end", "def start\n @start_time = Time.now.utc\n end", "def setStart\n @start = Time.now\n end", "def start_time=(*_args)\n raise_invalid_argument(property_name: :start_time)\n end", "def start_time\n plan_rebuilder.start_time\n end", "def start_time\n begin_date\n end", "def start_timestamp=(time)\n @start_timestamp = time.is_a?(Time) ? time.to_f : time\n end", "def start_timestamp=(time)\n @start_timestamp = time.is_a?(Time) ? time.to_f : time\n end", "def start_timestamp=(time)\n @start_timestamp = time.is_a?(Time) ? time.to_f : time\n end", "def start_time\n self.day\n end", "def start_time\n self.date\n end", "def start_time\n dtstart.to_datetime\n end", "def start_date_time\n return @start_date_time\n end", "def start_date_time\n return @start_date_time\n end", "def start_date_time\n return @start_date_time\n end", "def start_date_time\n return @start_date_time\n end", "def start_date_time\n return @start_date_time\n end", "def start_date_time\n return @start_date_time\n end", "def start_date_time\n return @start_date_time\n end", "def start_date_time\n return @start_date_time\n end", "def start_date_time\n return @start_date_time\n end", "def start_date_time\n return @start_date_time\n end", "def start_date_time\n return @start_date_time\n end", "def StartTime()\r\n ret = _getproperty(1610743808, [], [])\r\n @lastargs = WIN32OLE::ARGV\r\n ret\r\n end", "def start\r\n\t\t@time.start\r\n\t\treturn self\r\n\tend", "def start_time\n by_date\n end", "def start_time\n start_time_config.pattern_matches[:time]\n end", "def start_time=(_arg0); end", "def start_time_in_seconds\n @start_time_in_seconds ||= seconds_from_time(start_time)\n end", "def start_time=(value)\n if value.is_a?(Time) || value.is_a?(DateTime)\n @start_time = value.to_time\n else\n raise TypeError, \"A Duration's start_time must be a Time or DateTime object.\"\n end\n end", "def start_time=(value)\n if value.is_a?(Time) || value.is_a?(DateTime)\n @start_time = value.to_time\n else\n raise TypeError, \"A Duration's start_time must be a Time or DateTime object.\"\n end\n end", "def started_at\n Convert.millis_to_time @gapi.statistics.start_time\n end", "def start\n attributes.fetch(:start)\n end", "def start\n attributes.fetch(:start)\n end", "def StartTime()\r\n ret = @dispatch._getproperty(1610743808, [], [])\r\n @lastargs = WIN32OLE::ARGV\r\n ret\r\n end", "def started_at\n Time.parse @gapi.start_time\n rescue StandardError\n nil\n end", "def starts\n starts = nil\n @doc.find(\"/dwml/data/time-layout/start-valid-time/text()\").map do |node|\n t = Time.parse(node.to_s)\n starts = t if !starts || t < starts\n end\n @starts = starts\n end", "def start_time\n start_at.strftime(\"%F\") if start_at\n end", "def start_clock\n @start_time = Time.now\n end", "def start_time(time)\n if time < time.set_time_to( @opening_time )\n time.set_time_to( @opening_time )\n else\n time\n end\n end", "def start_time\n return \"1530\";\n end", "def start_at\n @attributes[:start_at]\n end", "def start_at\n @attributes[:start_at]\n end", "def start_time(person_or_type = nil)\n attribute_for_audience_with_generic(:start_time, person_or_type)\n end", "def start_date_time=(value)\n @start_date_time = value\n end", "def start_date_time=(value)\n @start_date_time = value\n end", "def start_date_time=(value)\n @start_date_time = value\n end", "def start_date_time=(value)\n @start_date_time = value\n end", "def start_date_time=(value)\n @start_date_time = value\n end", "def start_date_time=(value)\n @start_date_time = value\n end", "def start_date_time=(value)\n @start_date_time = value\n end", "def start_date_time=(value)\n @start_date_time = value\n end", "def start_date_time=(value)\n @start_date_time = value\n end", "def start_date_time=(value)\n @start_date_time = value\n end", "def js_start_time=(time)\n if time.present?\n write_attribute :start_time, parse_us_time(time)\n else\n write_attribute :start_time, time\n end\n end", "def cycle_start_time\n if stats[:start] && stats[:real_start]\n Time.at(*stats[:start]) + stats[:real_start]\n end\n end", "def display_time\n @display_time || start_time\n end", "def setup_start_at\n return unless start_at.blank?\n \n self.start_at = Time.now\n end", "def setup_start_at\n return unless start_at.blank?\n \n self.start_at = Time.now\n end", "def start_date_time=(value)\n @start_date_time = value\n end", "def start_time(ride)\n return nil unless ride.points.any?\n ride.points.first.time\n end", "def start(value)\n merge(cmstart: value.iso8601)\n end", "def start(value)\n merge(ucstart: value.iso8601)\n end", "def cycle_start_time\n if stats[:start] && stats[:actual_start]\n Time.at(*stats[:start]) + stats[:actual_start]\n end\n end", "def start(value)\n merge(rvstart: value.iso8601)\n end", "def start_time\n Date.today\n end", "def start_time(*args)\n raw = starts_at || shift.starts_at\n raw = Time.local date.year, date.month, date.day, raw.hour, raw.min\n return raw if args.include? :raw\n raw.to_s(:meridian_time).strip\n end", "def starts_at\n Time.at(start_time_millis / 1000).utc.to_datetime\n end", "def set_current_time\n current_time = Time.zone.now.strftime(\"%B %e at %I:%M %p\")\n self.start_time = current_time\n end", "def start\n starts_at.strftime(\"%R\")\n end", "def expected_start\n val = super\n val = DatelessTime.new val unless val.blank?\n val\n end", "def start_time\n item_hash.deep_find([:listing_details, :start_time])\n end", "def started_date_time\n return @started_date_time\n end", "def start_timer\n @start_time = Time.now\n end", "def run_start_time\n @data['controls'].map { |control| control['results'].map { |result| DateTime.parse(result['start_time']) } }.flatten.min\n end", "def start\n @start_time, @stop_time = Time.now, nil\n end", "def start_time\n session[:start_time] ||= (Time.now).to_s\n end", "def start(value)\n merge(lestart: value.iso8601)\n end", "def start_time=(val)\n if val.kind_of?(Time) || val.kind_of?(DateTime)\n self.start_minute_of_a_day = val.minute_of_a_day\n elsif val.kind_of?(String)\n self.start_minute_of_a_day = Time.zone.parse(val).minute_of_a_day\n end\n end", "def start_at\n today = Time.now\n Time.new(today.year, today.month, today.day, 9,0,0)\n end" ]
[ "0.7678431", "0.7618756", "0.7618756", "0.7617907", "0.7583595", "0.7571923", "0.7247722", "0.7247722", "0.7228195", "0.7221751", "0.721993", "0.71760607", "0.71760607", "0.7136239", "0.7062417", "0.7035593", "0.7033041", "0.7028682", "0.70214206", "0.698388", "0.69774", "0.6947318", "0.69433326", "0.6922932", "0.6898809", "0.6897149", "0.68642634", "0.68475485", "0.68475485", "0.68475485", "0.6843646", "0.6834187", "0.67941946", "0.6790751", "0.6788227", "0.6788227", "0.6788227", "0.6788227", "0.6788227", "0.6788227", "0.6788227", "0.6788227", "0.6788227", "0.6788227", "0.675393", "0.6726589", "0.6700412", "0.6692472", "0.6682073", "0.6635584", "0.6633775", "0.6633775", "0.65958655", "0.6574115", "0.6574115", "0.65671206", "0.65586317", "0.6552613", "0.65391845", "0.65355986", "0.6535291", "0.6530439", "0.6514712", "0.6514712", "0.65119433", "0.6502171", "0.6502171", "0.6502171", "0.6502171", "0.6502171", "0.6502171", "0.6502171", "0.6502171", "0.6502171", "0.6502171", "0.6486986", "0.648643", "0.6481644", "0.64772713", "0.64772713", "0.64624876", "0.6456663", "0.644231", "0.6427981", "0.6416436", "0.6409967", "0.64071417", "0.6403468", "0.6400082", "0.63760734", "0.6375764", "0.6374093", "0.6371666", "0.63654166", "0.63050216", "0.6300032", "0.6285291", "0.6275041", "0.6274266", "0.62670654", "0.626701" ]
0.0
-1
Specify or return the exit time for this element, relative to the beginning of the scene.
def exit(t = nil) if t @exit = _convert(t) self else @exit end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def duration\n TingYun::Helper.time_to_millis(@exit_timestamp - @entry_timestamp)\n end", "def end_time\n if ev = stop_event.last\n ev.time\n end\n end", "def end_time\n if ev = stop_event.last\n ev.time\n end\n end", "def finish_time\n prop = finish_property\n prop ? prop.to_finish_time : nil\n end", "def time\n set_function_and_argument(:time, nil)\n end", "def end_time\n return nil if empty?\n @start_time + (@v.size-1).hours\n end", "def stop_time\n Time.at(super.to_i)\n end", "def time\n end_time - start_time\n end", "def end_time\n eval(self.end) if self.end.present?\n end", "def js_finish_time\n time = read_attribute :finish_time\n time_format(time)\n end", "def run_time_or_time_elapsed\n if self.end_time \n return Time.at(self.end_time - self.start_time)\n else\n return Time.at(Time.now - self.start_time)\n end\n end", "def end_time\n ConfigVariable.new(name: 'END_TIME', pattern: TIME_PATTERN, human_pattern: \"HH:MM\").value\n end", "def duration\n self.end - time\n end", "def clock_out_time\n \treturn nil if self.is_in_progress?\n \tself.updated_at.strftime(\"%H:%M %p\")\n end", "def end_time\n start_time + duration\n end", "def end_time\n @parts.last.end_time\n end", "def end_time=(*_args)\n raise_invalid_argument(property_name: :end_time)\n end", "def hold_time\n game_type == 'zones' ? config.time || 99999999 : nil\n end", "def run_time\n return nil unless self.start_time\n (self.end_time || Time.now) - self.start_time\n end", "def time_to_finish\n past_time = Time.now - self[:start_time]\n seconds_to_go = past_time * self[:max] / self[:current] - past_time\n puts \"time to go: #{seconds_to_go.round}s\"\n end", "def end_time\n data.end_time\n end", "def end_time\n\t\tstart + 1.day\n\tend", "def end_time_input\n @end_time_input || end_time.try(:strftime, \"%H:%M\")\n end", "def time\n super\n end", "def time\n entry(MANIFEST).time\n end", "def launched_time\n\n @root_expression && @root_expression.created_time\n end", "def when_to_run\n time - @@REMINDER_TIME\n end", "def write_exit_time\n begin\n File.open(exit_time_file, 'wb') do |f|\n f.write(Time.now.to_f)\n end\n rescue\n warn(\"Failed to write exit_time.tmp: #{$!}\")\n end\n end", "def time_elapsed\n if !self.finished.blank?\n ((self.finished - self.started) / 60).to_i\n end\n end", "def finished_at\n (@finished_at || Time.now).to_s[0..-7] # HACK: to remove offset (e.g. + 01:00)\n end", "def after( time )\n\t\treturn time + self\n\tend", "def after( time )\n\t\treturn time + self\n\tend", "def finished_at\n return nil unless self.started?\n return self.started_at + self.time_needed.seconds\n end", "def finished_at\n return nil unless self.started?\n return self.started_at + self.time_needed.seconds\n end", "def end_time\n start_time + treatment.duration.minutes\n end", "def end_date\n\t \tTime.at(self.end_time) rescue nil\n\t end", "def timetoend\n endat - nowat\n end", "def end_time\n item_hash.deep_find([:listing_details, :end_time])\n end", "def time_ended\n return @time_ended\n end", "def elapsed_time\n if @start_time && @end_time\n @end_time - @start_time\n else\n nil\n end\n end", "def time\n @time\n end", "def end_time=(val)\n write_attribute :end_time, val\n end", "def puttime\n return if gameover?\n\n setpos(TIMELINE, 0)\n addstr(\"#{Time.now.to_i - @start} sec\")\n end", "def end_formatted\n display_time read_attribute(:end)\n end", "def prep_time_passed\n return \"7:34\"\n end", "def get_elapse_time\n @start_time ||= @time_now\n return @time_now - @start_time\n end", "def max_time\n @max_time ||= 0.2\n end", "def time\n return @time\n end", "def time\n end", "def thisTime\n Gosu::milliseconds - @initTime/@delay\n end", "def thisTime\n Gosu::milliseconds - @initTime/@delay\n end", "def thisTime\n Gosu::milliseconds - @initTime/@delay\n end", "def thisTime\n Gosu::milliseconds - @initTime/@delay\n end", "def thisTime\n Gosu::milliseconds - @initTime/@delay\n end", "def thisTime\n Gosu::milliseconds - @initTime/@delay\n end", "def thisTime\n Gosu::milliseconds - @initTime/@delay\n end", "def thisTime\n Gosu::milliseconds - @initTime/@delay\n end", "def thisTime\n Gosu::milliseconds - @initTime/@delay\n end", "def thisTime\n Gosu::milliseconds - @initTime/@delay\n end", "def thisTime\n Gosu::milliseconds - @initTime/@delay\n end", "def thisTime\n Gosu::milliseconds - @initTime/@delay\n end", "def thisTime\n Gosu::milliseconds - @initTime/@delay\n end", "def thisTime\n Gosu::milliseconds - @initTime/@delay\n end", "def thisTime\n Gosu::milliseconds - @initTime/@delay\n end", "def thisTime\n Gosu::milliseconds - @initTime/@delay\n end", "def thisTime\n Gosu::milliseconds - @initTime/@delay\n end", "def thisTime\n Gosu::milliseconds - @initTime/@delay\n end", "def thisTime\n Gosu::milliseconds - @initTime/@delay\n end", "def thisTime\n Gosu::milliseconds - @initTime/@delay\n end", "def thisTime\n Gosu::milliseconds - @initTime/@delay\n end", "def thisTime\n Gosu::milliseconds - @initTime/@delay\n end", "def thisTime\n Gosu::milliseconds - @initTime/@delay\n end", "def thisTime\n Gosu::milliseconds - @initTime/@delay\n end", "def thisTime\n Gosu::milliseconds - @initTime/@delay\n end", "def thisTime\n Gosu::milliseconds - @initTime/@delay\n end", "def thisTime\n Gosu::milliseconds - @initTime/@delay\n end", "def thisTime\n Gosu::milliseconds - @initTime/@delay\n end", "def thisTime\n Gosu::milliseconds - @initTime/@delay\n end", "def thisTime\n Gosu::milliseconds - @initTime/@delay\n end", "def horizon_time\n Time.now - horizon\n end", "def cutoff\n Time.now - (60 * 60 * HOURS)\n end", "def remain_time\n rem_time = $time - Time.new\n rem_time.to_i\nend", "def end_time_check\n if self.event_type == \"Script\" || self.event_type == \"Gamecall\"\n if end_time > start_time\n self.end_time = start_time\n end\n end\n end", "def endTimeFromNow() ;\n return endTimeFrom(Time.new()) ;\n end", "def pred_time\n @time = (@time - @delta).max(0)\n end", "def end\n @end_time = Time.now.utc\n end", "def end_time\n start_time + event.event_type.length.minutes\n end", "def puttime\n if gameover?\n return\n end\n setpos(TIMELINE,0)\n addstr( (Time.now.to_i - @start).to_s + \" sec\")\n end", "def max_exit_date\n local_range.end\n end", "def time\n [self.game_begins, [self.game_ends, Time.now].min].max\n end", "def ended_at\n Convert.millis_to_time @gapi.statistics.end_time\n end", "def time_elapsed\n\t\treturn Time.now - self.start_time\n\tend", "def display_run_time\n if self.end_time \n return run_time_or_time_elapsed.gmtime.strftime('%R:%S')\n else\n return \"Run has not completed.\"\n end\n end", "def lifetime\n if running?\n Time.now - start_time\n elsif finished?\n end_time - start_time\n end\n end", "def lifetime\n if running?\n Time.now - start_time\n elsif finished?\n end_time - start_time\n end\n end", "def last_out_time\n Out.last(:order => \"time ASC\").time rescue nil\n end", "def end_of_hour\n change(min: 59, sec: 59.999)\n end", "def end_date_time\n return @end_date_time\n end", "def display_time\n @display_time || start_time\n end", "def add_time\n\t\tif self.event_type == \"Install\" || self.event_type == \"Script\" || self.event_type == \"Gamecall\"\n\t\t\tself.end_time = self.end_time + 10.seconds\n\t\tend\n\tend", "def lifetime\n\t\t\t\tClock.runtime() - @start\n\t\t\tend" ]
[ "0.6462086", "0.6356982", "0.6356982", "0.6264477", "0.5941877", "0.59163207", "0.5897695", "0.589158", "0.5877107", "0.5817365", "0.5790553", "0.57628226", "0.56954104", "0.56803817", "0.56780267", "0.5667649", "0.5636055", "0.5610557", "0.55989003", "0.5591684", "0.5586325", "0.5573448", "0.554086", "0.55399466", "0.55339426", "0.55230045", "0.55174977", "0.55095345", "0.5494784", "0.54883933", "0.5483939", "0.5483939", "0.5479333", "0.5479333", "0.5473479", "0.5459109", "0.5448987", "0.5435444", "0.5427914", "0.5415208", "0.53990173", "0.5396053", "0.5395193", "0.5393997", "0.5390778", "0.5362535", "0.5357848", "0.53524125", "0.53474724", "0.53440756", "0.53440756", "0.53440756", "0.53440756", "0.53440756", "0.53440756", "0.53440756", "0.53440756", "0.53440756", "0.53440756", "0.53440756", "0.53440756", "0.53440756", "0.53440756", "0.53440756", "0.53440756", "0.53440756", "0.53440756", "0.53440756", "0.53440756", "0.53440756", "0.53440756", "0.53440756", "0.53440756", "0.53440756", "0.53440756", "0.53440756", "0.53440756", "0.53440756", "0.53440756", "0.5339093", "0.5336979", "0.5336912", "0.5333516", "0.53330266", "0.5325221", "0.5324444", "0.5322405", "0.53170264", "0.5316882", "0.5293724", "0.52926236", "0.52879745", "0.52730495", "0.52615595", "0.52615595", "0.525052", "0.52503824", "0.5249531", "0.5245207", "0.52438116", "0.52423" ]
0.0
-1
`t` is the global time value, relative to the beginning of the production.
def render_at(t, canvas) _evaluate_attributes!(t) alpha = attributes[:alpha] || 1.0 size = attributes[:size] || production.resolution position = attributes[:position] || Castaway::Point.new(0, 0) return if alpha <= 0.0 || size.empty? canvas.stack do |stack| _prepare_canvas(t, stack) stack.geometry size.to_geometry _transform(stack) stack.geometry position.to_geometry unless position.zero? end _composite(canvas, alpha) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cold_start_time\n Time.now\nend", "def evaluate(t, vars)\n t # Right now, time vars must simply return t.\n end", "def start_time=(_arg0); end", "def timestamp t\n\n\t\t::Pantheios::Core.timestamp t, nil\n\tend", "def fmt_time(t)\n if t.present?\n ApplicationHelper.localtime(t).strftime(ApplicationHelper.gen_time_fmt)\n end\n end", "def current_time\n @c_t ||= Time.now\n end", "def time\n set_function_and_argument(:time, nil)\n end", "def start_time; end", "def time; end", "def time; end", "def time; end", "def time; end", "def time; end", "def time; end", "def time; end", "def time; end", "def time; end", "def cstime=(*) end", "def start_time\n return \"1530\";\n end", "def total_time=(_arg0); end", "def time=(_arg0); end", "def time=(_arg0); end", "def time=(_arg0); end", "def time=(_arg0); end", "def time=(_arg0); end", "def time=(_arg0); end", "def time_min; Time.now.min; end", "def time\n @time ||= Time.at( timestamp / 1_000_000.0 )\n end", "def sbv_time(t)\r\n i = t.to_i\r\n \"%d:%02d:%02d.%03d\" % [i/3600, i/60%60, i%60, (t*1000).to_i%1000]\r\nend", "def current_timestamp\n @c_tstmp ||= current_time.to_i\n end", "def to_time(t=nil)\n t ||=Time.now\n Time.new(t.year,t.month,t.day,@hours,@minutes,0)\n end", "def base_time\n BASE_TIME\n end", "def get_time_required\n 1.0\n end", "def build_timing; end", "def p(s) puts \"-- #{Time.now.strftime('[%H:%M:%S]')} #{s}\" end", "def p(s) puts \"-- #{Time.now.strftime('[%H:%M:%S]')} #{s}\" end", "def get_running_time(t_info) \n c_time_full = Time.now().localtime(\"+00:00\")\n r_time_sec = c_time_full.to_i+t_info[\"duration\"]\n ap \"Running Time: #{r_time_sec} seconds or #{Time.at(r_time_sec).utc.strftime(\"%H:%M:%S\")}\" if @debug\n return r_time_sec.to_i \n end", "def playtime_forever\r\n\t raw_app['playtime_forever']\r\n\t end", "def local(*values)\n values << 0 until values.count == 6\n Time.new(*values, to_s)\n end", "def start_time\n eval(start) if start.present?\n end", "def ctime() end", "def ctime() end", "def ctime() end", "def min() time[1] end", "def prep_time_passed\n return \"7:34\"\n end", "def total_time; end", "def since t\n t.to_now\n end", "def start_time\n start\n end", "def time\n return Time.new(@t_year, @t_month, @t_day, @t_hour, @t_min, @t_sec)\n end", "def time\n y = Date.today.year\n m = rand(12) + 1\n d = rand(31) + 1\n Time.local(y,m,d)\n end", "def start=(time); end", "def report_time time\n end", "def time_base\n\t if @time_base.empty?\n\t\tTime.at(0)\n\t else\n\t\t@time_base.last[1] \n\t end\n\tend", "def utime=(*) end", "def tnow\n Updater::Update.time.now.to_i\n end", "def get_setup_time(ant)\n end", "def stamp(args)\n vars = {:year => @t_year, :month => @t_month, :day => @t_day, :hour => @t_hour, :min => @t_min, :sec => @t_sec, :usec => @t_usec}\n \n args.each do |key, value|\n vars[key.to_sym] = value.to_i if key != :datet\n end\n \n time = Time.local(vars[:year], vars[:month], vars[:day], vars[:hour], vars[:min], vars[:sec], vars[:usec])\n \n if !args.key?(:datet) or args[:datet]\n return Datet.new(time)\n end\n \n return time\n end", "def get_run_time(ant)\n end", "def restore_times; end", "def restore_times; end", "def time\n (1 + Time.now.to_i/10).ceil * 10\n end", "def sec\n return @t_sec\n end", "def now\n VoltTime.new\n end", "def flight_time; end", "def deb_time(proc)\n cur_time = Time.now\n proc.call\n return Time.now-cur_time\nend", "def print_time()\n puts \"\", @time_info\n end", "def time_class; end", "def now\n Time.really_now - time_travel_offsets.inject(0, :+)\n end", "def time_sec; Time.now.sec; end", "def server_timing=(_arg0); end", "def cstime(*) end", "def ctime\n end", "def at_local(*args)\n extract_and_create_local_time(args, true)\n end", "def at ts\n spawn :@trange, time_to_long(ts)\n end", "def time\n tstart = Time.now.to_f\n yield\n tend = Time.now.to_f\n tend - tstart\nend", "def no_time\n no_define\n end", "def request_time\n @request_time ||= Time.now.utc\n end", "def modify_time(); @modify_time ||= Time.now; end", "def print_currenTime\n\t\t \"*** #{@time} ***\"\n\tend", "def sleep_until(t)\n dt = (t - Time.zone.now).ceil \n blather(\"sleep_until #{t} (#{dt} seconds)\")\n sleep(dt) if dt > 0.0\n end", "def set_start_time\n @start_time = Time.now.to_f\n end", "def set_start_time\n @start_time = Time.now.to_f\n end", "def from_now(t = Time.now); t + self; end", "def from_now(t = Time.now); t + self; end", "def tt(time, format=:short); '13:37'; end", "def up_time\n (Process.clock_gettime(Process::CLOCK_MONOTONIC) - (@start[:time] || Time.now)).round(3)\n end", "def time(opts = {})\n ts = Time.now.utc \n ts = opts[:ts] if !opts[:ts].nil?\n ts = beginning(ts)\n ts += opts[:diff].to_i.send(@period) if !opts[:diff].nil?\n ts\n end", "def stime=(*) end", "def srs_tt(t=Time.now.utc)\n Base64.encode64((t.to_i / (60*60*24) % 210).to_s)[0,2]\n end", "def time_global_pheromone_at_time(value_of_objective)\n\t# where q = [time=10, cost= 10_000, quality=0.0005]\n\t((1 - GLOBAL_EVAPORATION_RATE) * pheromone_at_t_minus_1) + time_changed_pheromone(value_of_objective)\nend", "def test_time\n assert_equal(nil, Config.time('T'))\n=begin\n set_env 'T', '2000'\n assert_equal(Time.utc(2000), Config.time(:t))\n set_env 'T', '2000-2'\n assert_equal(Time.utc(2000,2), Config.time(:t))\n=end\n set_env 'T', '2000-2-2'\n assert_equal(Time.new(2000,2,2), Config.time(:t))\n\n set_env 'T', '2000-2-2T11:11'\n assert_equal(Time.new(2000,2,2,11,11), Config.time(:t))\n\n set_env 'T', nil\n assert_equal(nil, Config.time(:t))\n\n set_env 'T', 'derp'\n assert_raises(ArgumentError){ Config.time(:t) }\n end", "def hitimes_duration_t1\n Hitimes::TimedMetric.now('duration_t1').stop\nend", "def time_unit\n @time_unit ||= PERIOD_MAPPING[@name]\n end", "def time # :nodoc:\n @time ||= day_fraction_to_time day_fraction\n end", "def fmt_miltime(t)\n if t.present?\n ApplicationHelper.localtime(t).strftime(ApplicationHelper.time_fmt)\n end\n end", "def timescale\n put('l^')\n get.strip.to_i\n end", "def s_time\n to_form_time(start_time.getlocal)\n end", "def pred_time\n @time = (@time - @delta).max(0)\n end", "def productionTime\n\tself.item.base_blueprint.productionTime\nend", "def time\n super\n end", "def now=(_arg0); end" ]
[ "0.6217947", "0.60945517", "0.60709155", "0.6068327", "0.59893614", "0.59629416", "0.5868513", "0.5866598", "0.5837131", "0.5837131", "0.5837131", "0.5837131", "0.5837131", "0.5837131", "0.5837131", "0.5837131", "0.5837131", "0.5825585", "0.5779032", "0.57724434", "0.57608175", "0.57608175", "0.57608175", "0.57608175", "0.57608175", "0.57608175", "0.5760771", "0.57295924", "0.57168823", "0.5701849", "0.56982267", "0.5695684", "0.5695346", "0.5682771", "0.56762797", "0.56762797", "0.5673471", "0.5658613", "0.56556296", "0.565494", "0.5652921", "0.5652921", "0.5652737", "0.5649794", "0.5646682", "0.56367147", "0.56105644", "0.56041247", "0.5592287", "0.5582735", "0.55753833", "0.5569637", "0.55632323", "0.55549085", "0.5554213", "0.55525553", "0.5547075", "0.55393654", "0.5528585", "0.5528585", "0.55213165", "0.55206245", "0.5517923", "0.55096143", "0.5503882", "0.55018115", "0.5497308", "0.54944867", "0.5493664", "0.5480667", "0.54768944", "0.54700464", "0.54673153", "0.5466905", "0.54567516", "0.54507846", "0.5448297", "0.54479146", "0.5435047", "0.5433701", "0.54199785", "0.54199785", "0.5417649", "0.5417649", "0.5416282", "0.5412408", "0.5411607", "0.5411478", "0.5408119", "0.54029524", "0.54016066", "0.5394738", "0.5372329", "0.53665686", "0.5356845", "0.53536665", "0.53493357", "0.5340096", "0.5339767", "0.5337245", "0.5333888" ]
0.0
-1
Problems in exercism evolve over time, as we find better ways to ask questions. The version number refers to the version of the problem you solved, not your solution. Define a constant named VERSION inside of the top level BookKeeping module, which may be placed near the end of your file. In your file, it will look like this: module BookKeeping VERSION = 1 Where the version number matches the one in the test. end If you are curious, read more about constants on RubyDoc:
def test_bookkeeping skip assert_equal 2, BookKeeping::VERSION end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_bookkeeping\n assert_equal 3, BookKeeping::VERSION\n end", "def test_bookkeeping\n assert_equal 1, BookKeeping::VERSION\n end", "def test_bookkeeping\n assert_equal 1, BookKeeping::VERSION\n end", "def test_version\n skip\n assert_equal 2, BookKeeping::VERSION\n end", "def test_bookkeeping\n skip\n assert_equal 3, BookKeeping::VERSION\n end", "def test_bookkeeping\n skip\n assert_equal 3, BookKeeping::VERSION\n end", "def test_bookkeeping\n skip\n assert_equal 4, BookKeeping::VERSION\n end", "def test_bookkeeping\n skip\n assert_equal 1, BookKeeping::VERSION\n end", "def test_bookkeeping\n skip\n assert_equal 1, BookKeeping::VERSION\n end", "def test_bookkeeping\n skip\n assert_equal 1, BookKeeping::VERSION\n end", "def test_bookkeeping\n skip\n assert_equal 1, BookKeeping::VERSION\n end", "def test_bookkeeping\n skip\n assert_equal 1, BookKeeping::VERSION\n end", "def test_bookkeeping\n skip\n assert_equal 1, BookKeeping::VERSION\n end", "def test_bookkeeping\n skip\n assert_equal 1, BookKeeping::VERSION\n end", "def test_bookkeeping\n # skip\n assert_equal 1, BookKeeping::VERSION\n end", "def test_bookkeeping\n assert_equal 1, Pangram::VERSION\n end", "def test_version\n assert Snarl.version >= '1.1'\n end", "def test_bookkeeping\n assert_equal 1, RunLengthEncoding::VERSION\n end", "def test_that_it_should_bump_versions\r\n v = Bumper::Version.new\r\n assert_equal '1', v.bump_build\r\n assert_equal '0.0.0.1', v.to_s\r\n assert_equal 1, v.bump_patch\r\n assert_equal '0.0.1.0', v.to_s\r\n assert_equal 1, v.bump_minor\r\n assert_equal '0.1.0.0', v.to_s\r\n assert_equal 1, v.bump_major\r\n assert_equal '1.0.0.0', v.to_s\r\n end", "def test_that_it_has_a_version_number\n refute_nil ::Malody::VERSION\n end", "def version_helper; end", "def version_helper; end", "def version_helper; end", "def version_helper; end", "def version!\r\n fail\r\n end", "def def_version; end", "def version\n puts \"v0.3\"\n end", "def version; end", "def version; end", "def version; end", "def version; end", "def version; end", "def version; end", "def version; end", "def version; end", "def version; end", "def version; end", "def version; end", "def version; end", "def version; end", "def version; end", "def version; end", "def version; end", "def version; end", "def version; end", "def version; end", "def version; end", "def version; end", "def version; end", "def version; end", "def test_get_version_number\n assert_equal 3, ChangeLogs.get_version_number(1,'test')\n end", "def test_redcloth_has_version\n assert RedCloth.included_modules.include?(RedClothVersion)\n assert RedClothVersion.const_defined?(\"VERSION\")\n assert_equal RedClothVersion::VERSION, RedCloth::VERSION\n end", "def version\n @version ||= '1.0'\n end", "def test_accepts_version_through_constructor\n Crd::Spec.new 'Testing', '1.0.4' do |s|\n assert_equal( '1.0.4', s.version )\n end\n end", "def test_author_can_add_book\n @fifth_season = @nk_jemisin.add_book(\"The Fifth Season\", \"November 3, 2015\")\n assert_equal @fifth_season, @nk_jemisin.books\n end", "def version\n puts \"Version 1.1\"\nend", "def default_version; end", "def version\n spec.version\n end", "def test_that_bumping_with_prereleases\r\n v = Bumper::Version.new\r\n assert_equal '0.0.0.0', v.to_s\r\n assert_equal 1, v.bump_minor\r\n assert_equal '0.1.0.0', v.to_s\r\n assert_equal 'beta', v.bump_patch_tag('beta')\r\n assert_equal '0.1.1-beta.0', v.to_s\r\n assert_equal 'beta2', v.bump_patch_tag('beta')\r\n assert_equal '0.1.1-beta2.0', v.to_s\r\n assert_equal '1', v.bump_build\r\n assert_equal '0.1.1-beta2.1', v.to_s\r\n assert_equal 'rc', v.bump_patch_tag('rc') # replaces tag\r\n assert_equal '0.1.1-rc.0', v.to_s\r\n assert_equal 'rc2', v.bump_patch_tag('rc')\r\n assert_equal '0.1.1-rc2.0', v.to_s\r\n assert_equal 1, v.bump_patch # drops tag\r\n assert_equal '0.1.1.0', v.to_s\r\n assert_equal 2, v.bump_patch\r\n assert_equal '0.1.2.0', v.to_s\r\n assert_equal 2, v.bump_minor\r\n assert_equal '0.2.0.0', v.to_s\r\n assert_equal 'alpha', v.bump_patch_tag('alpha')\r\n assert_equal '0.2.1-alpha.0', v.to_s\r\n assert_equal 3, v.bump_minor\r\n assert_equal '0.3.0.0', v.to_s\r\n v.build = 'rc1'\r\n assert_equal '0.3.0.rc1', v.to_s\r\n assert_equal 'rc2', v.bump_build\r\n assert_equal '0.3.0.rc2', v.to_s\r\n end", "def test_has_version_number\n assert_not_nil(Tree::VERSION)\n end", "def test_version_arg\n assert_equal 0, go_with_args(%w(-v))\n assert_match(/Ruby BlackBag version #{Rbkb::VERSION}/, @stdout_io.string)\n end", "def version_helper=(_arg0); end", "def version_helper=(_arg0); end", "def version_helper=(_arg0); end", "def test_add_new_book\n library_plus_new_book = @compiled_library.add_new_book(\"Nineteen Eighty Four\")\n assert_equal(@compiled_library.books, library_plus_new_book)\n end", "def test_method_prereleasep\n value_ = ::Versionomy.create([1, 9, 2, 'a2'], :semver)\n assert_equal(true, value_.prerelease?)\n value_ = ::Versionomy.create([1, 9, 2], :semver)\n assert_equal(false, value_.prerelease?)\n end", "def version\n 1\n end", "def test_version\n\n #prepare\n subject=Xcider::Xcodebuild.new\n\n #test\n v=subject.version\n\n #verify\n assert_not_nil v\n\n end", "def test_versions\n tidy = TidyExe.new\n assert_not_nil(tidy.version, 'version returned nil.')\n assert_not_nil(tidy.version_major, 'version_major returned nil.')\n assert_not_nil(tidy.version_minor, 'version_minor returned nil.')\n assert_not_nil(tidy.version_patch, 'version_patch returned nil.')\n assert_not_nil(tidy.version_plain, 'version_plain returned nil.')\n end", "def version\n @version ||= '1.0'\n end", "def test_update_rental_details #THIS IS A BAD TEST!\n library_plus_updated_book = @compiled_library.update_rental_details(\"His Dark Materials\", \"Pete\", \"01/12/18\")\n assert_equal(@compiled_library.books, library_plus_updated_book)\n end", "def test_arbitrary_value\n value_ = ::Versionomy.create([1, 9, 2, 'pre2'], :semver)\n assert_equal(1, value_.major)\n assert_equal(9, value_.minor)\n assert_equal(2, value_.patch)\n assert_equal('pre2', value_.prerelease_suffix)\n end", "def has_version?; end", "def version\n VERSION\n end", "def version\n VERSION\n end", "def version\n VERSION\n end", "def version\n \"0.2.0\"\n end", "def target_version; end", "def test_method_prereleasep\n value_ = ::Versionomy.create([1, 9, 2, 'a', 2], :rubygems)\n assert_equal(true, value_.prerelease?)\n value_ = ::Versionomy.create([1, 9, 2, 2], :rubygems)\n assert_equal(false, value_.prerelease?)\n end", "def version(version)\n abstract!\n end", "def test_default_version_is_set_if_no_version_is_provided_in_constructor\n Crd::Spec.new 'Testing' do |s|\n assert_equal( Crd::Spec::UNVERSIONED, s.version )\n end\n end", "def current_version\r\n version = File.read(\"VERSION\").strip\r\n fail \"Invalid version information\" unless version =~ /\\./\r\n version\r\nend", "def test_get_loaf_stock\n assert_equal(24, @bakery.get_loaf_stock(\"sourdough\"))\n end", "def test_version_message\n Repository.create()\n FileUtils.touch('.test_file1')\n a = ['.test_file1']\n Repository.add(a) \n Repository.commit()\n #Repository.version()\n end", "def version\n '1.5.1.2' # Version number <major>.<minor>.<patch>.<monthly commit>\n end", "def rubocop_version; end", "def test_that_it_has_a_version_number\n refute_nil ::Paddingoracle::VERSION\n end", "def test_update_loaf_stock\n assert_equal(28, @bakery.update_loaf_stock(4,\"sourdough\"))\n end", "def major_version; end", "def version\n Faker::Number.between(from: 1, to: 1000)\n end", "def test_library_has_standards\n library = Library.new 'San Francisco Public Library'\n book = Book.new 'Cat in the Hat', 'Dr. Seuss', 61\n library.add book\n assert_equal library.books, []\n end", "def version_mismatch_detected\n end", "def test_get_book_instance\n book_by_title = @library1.get_book_instance(\"catch_22\")\n assert_equal(@book2, book_by_title)\n end", "def version_file\n \"lib/#{repo_name}/common/version.rb\"\nend", "def current_version\n version_number rev\n end" ]
[ "0.79813254", "0.79248947", "0.79248947", "0.7861686", "0.7822919", "0.7822919", "0.77796483", "0.7732682", "0.7732682", "0.7732682", "0.7732682", "0.7732682", "0.7732682", "0.7732682", "0.7611245", "0.65245193", "0.63514304", "0.6241997", "0.6071279", "0.6035757", "0.5898936", "0.5898936", "0.5898936", "0.5898936", "0.58609706", "0.5805411", "0.5776495", "0.576719", "0.576719", "0.576719", "0.576719", "0.576719", "0.576719", "0.576719", "0.576719", "0.576719", "0.576719", "0.576719", "0.576719", "0.576719", "0.576719", "0.576719", "0.576719", "0.576719", "0.576719", "0.576719", "0.576719", "0.576719", "0.576719", "0.576719", "0.5755503", "0.5666569", "0.5625053", "0.559227", "0.55828035", "0.5575749", "0.5515432", "0.5496546", "0.5442778", "0.5439284", "0.5433353", "0.5431486", "0.5431486", "0.5431486", "0.5417301", "0.5405941", "0.5395173", "0.53928864", "0.5388567", "0.53818", "0.53728664", "0.53709644", "0.5370603", "0.53413606", "0.53413606", "0.53413606", "0.53108144", "0.53063476", "0.5306149", "0.53006434", "0.529515", "0.5294283", "0.52937454", "0.5291094", "0.52872884", "0.5284494", "0.52728486", "0.5261734", "0.5259585", "0.52548933", "0.5241837", "0.5240561", "0.5233779", "0.5230392", "0.52146107" ]
0.775525
12
Now I Know my ABCs
def block_word?(string) hash = { 'B' => 'O', 'G' => 'T', 'V' => 'I', 'X' => 'K', 'R' => 'E', 'L' => 'Y', 'D' => 'Q', 'F' => 'S', 'Z' => 'M', 'C' => 'P', 'J' => 'W', 'N' => 'A', 'H' => 'U'} banned_letters = [] bool = true letters = string.upcase.chars letters.each do |letter| if hash.has_key?(letter) banned_letters << hash[letter] elsif hash.has_value?(letter) banned_letters << hash.key(letter) end end banned_letters.each do |letter| if letters.include?(letter) bool = false break else next end end bool end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def who_we_are\r\n end", "def anatomy; end", "def lookups; end", "def getKnowledge\n\t\t\n\tend", "def info; end", "def info; end", "def known_identities; end", "def getAdvocacy\n\t\t\n\tend", "def scientist; end", "def info()\n #This is a stub, used for indexing\n end", "def demo1\n a = Animal.new\n c = Cephalopod.new\n o = Octopus.new\n m = MutantOctopus.new\n puts a.description\n puts c.description\n puts o.description \n puts m.description \n puts o.tentacles\n puts m.tentacles\nend", "def my_info\r\n end", "def what_is\n end", "def details; end", "def accessibility; end", "def _autonyms\n @autonyms\n end", "def informational?; end", "def get_info\n end", "def get_info\n end", "def get_info\n end", "def identifiers; end", "def aon; end", "def names; end", "def names; end", "def names; end", "def names; end", "def names; end", "def names; end", "def names; end", "def identify; end", "def masteries; end", "def buzzword; end", "def buzzword; end", "def getc()\n #This is a stub, used for indexing\n end", "def appraisals; end", "def appraisals; end", "def mechanics\n cars.map {|c| c.mechanic}\n end", "def feruchemist; end", "def unusual_sport; end", "def accessible_name; end", "def used_names; end", "def about_us; end", "def notations; end", "def instances; end", "def instances; end", "def faq\n\n end", "def educational_attainment; end", "def build_easy_access(clss)\n clss.active.each do |object_instance|\n if object_instance.respond_to?('short_name=')\n unless object_instance.short_name.empty?\n short_name = object_instance.short_name\n self.class.send(:attr_accessor, short_name)\n instance_variable_set(\"@#{short_name}\", object_instance)\n end\n end\n end\n end", "def all_names; end", "def all_names; end", "def specie; end", "def specie; end", "def specie; end", "def specie; end", "def jack_handey; end", "def implausible_common_name; end", "def info\n\tend", "def getinfo\n coind.getinfo\n end", "def ismn; end", "def all_cops?; end", "def knowledge\n @knowledge\n end", "def in_law; end", "def mechanics\n Mechanic.all.select{|mechanic|mechanic.specialty == self.classification}\n end", "def Com6 # Recuperation Info\n \n end", "def internship_passed; end", "def owners_of_cars_serviced\n self.personal_mechanic_of.map{|owner_obj| owner_obj.name}\nend", "def purpose\n \"Intern seeking #{category_name.capitalize} position\"\n end", "def info\n raise \"Not yet implemented\"\n end", "def people; end", "def description\n @cafePred.description \n end", "def classes; end", "def nature; end", "def ca; end", "def list_animals \n puts \"Here are the current animals in shelter: \"\n @animals_in_shelter.each do |animal|\n puts animal.get_animal_info\n end\n end", "def apis; end", "def biome; end", "def catalog; end", "def the_doctor; end", "def kids_musical; end", "def mechanics\n cars.map do |car|\n car.mechanic \n end\n end", "def private; end", "def look\n @gc.d_print(\"You are in \" + @curr_place.get_name)\n @gc.d_print(\"Around you, you see: \")\n # print(@curr_place.get_objects())\n @curr_place.get_objects().each do |object|\n @gc.d_print(\" > \" + object.get_description)\n end\n if @curr_place.get_objects().length == 0\n @gc.d_print(\" - Nothing important.\")\n end\n end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end", "def name; end" ]
[ "0.60811454", "0.59465194", "0.59139854", "0.58393383", "0.58142215", "0.58142215", "0.5680013", "0.5658929", "0.56078935", "0.5603612", "0.55929106", "0.55883366", "0.55831116", "0.55687404", "0.5559011", "0.5552435", "0.55514306", "0.5546846", "0.5546846", "0.5546846", "0.5542191", "0.5538603", "0.5526857", "0.5526857", "0.5526857", "0.5526857", "0.5526857", "0.5526857", "0.5526857", "0.55041414", "0.5481632", "0.5478774", "0.5478774", "0.5421575", "0.5411104", "0.5411104", "0.5397736", "0.53942376", "0.5362906", "0.5357758", "0.53278315", "0.5318766", "0.5278243", "0.5259514", "0.5259514", "0.525078", "0.5246169", "0.52385736", "0.5226524", "0.5226524", "0.52236545", "0.52236545", "0.52236545", "0.52236545", "0.52171904", "0.5215371", "0.52147764", "0.52081376", "0.5200255", "0.51974696", "0.5195976", "0.5194735", "0.5191506", "0.5189363", "0.5188744", "0.5182621", "0.5182388", "0.51776916", "0.51750726", "0.51720685", "0.51685077", "0.5166905", "0.5160182", "0.5159573", "0.5158924", "0.5154693", "0.5140998", "0.5135772", "0.5133843", "0.5128081", "0.5127198", "0.5125099", "0.51250637", "0.51250637", "0.51250637", "0.51250637", "0.51250637", "0.51250637", "0.51250637", "0.51250637", "0.51250637", "0.51250637", "0.51250637", "0.51250637", "0.51250637", "0.51250637", "0.51250637", "0.51250637", "0.51250637", "0.51250637", "0.51250637" ]
0.0
-1
Next Featured Number Higher than a Given Value
def featured(number) featured = 0 loop do number += 1 if number % 7 == 0 && number.odd? && number.to_s.length == number.to_s.chars.uniq.length featured = number break end if number.to_s.length > 10 puts "Invalid" featured = 0 break end end featured end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def higher(n)\n self > n ? self : n\n end", "def pick_value(random_number, prev_value)\n\tnext_value = @frequencies[prev_value]\n\tif next_value.nil? then\n\t\tnext_value = @frequencies[nil]\n\tend\n\n succ_list = next_value.sort_by{|key, value| value}\n freq_counter = 0.0\n \n succ_list.each { |succ_value, freq|\n freq_counter += freq\n return succ_value if freq_counter >= random_number\n }\n end", "def highest_value\n @values.inject { |highest, val| highest = (val < 21 && val > highest) ? val : highest }\n end", "def max_data_value n\n significant = n.to_s[0].to_i + 1\n plus = [1]\n (n.to_s.size - 1).times{\n plus << 0\n }\n if n % plus.join.to_i == 0\n return n\n else\n plus[0] = plus[0] * significant\n return plus.join.to_i\n end\n end", "def next_level_threshold\n self.next ? self.next.experience_points_threshold : experience_points_threshold\n end", "def next_value(num_items = @items)\n if(num_items > @items)\n @zetan = zeta(num_items, @theta, @count_for_zeta, @zetan)\n @eta = (1 - ((2.0 / num_items) ** (1 - @theta))) / (1 - @zeta2theta/@zetan)\n end\n\n u = rand()\n uz = u * @zetan\n\n if(uz < 1.0)\n return 0\n end\n\n if(uz < 1.0+(0.5**@theta))\n return 1\n end\n\n @last_value = (@items * ((@eta*u - @eta + 1) ** @alpha)).to_i\n end", "def featured(num)\n # next_num = 7 # assume input is only positive\n closer_num = num / 7 * 7 # to start closer to the next required number instead of starting from 7\n next_num = closer_num.odd? ? closer_num : closer_num + 7 # so that next_num is odd and we can increment by 14 in the while loop\n\n while next_num < 9_999_999_999\n if next_num % 7 == 0 \\\n && next_num.to_s.size == next_num.to_s.chars.uniq.size \\\n && next_num > num\n return next_num\n else\n next_num += 14\n end\n end\nend", "def how_high(energy)\n energy * energy\nend", "def close_higher_than(number)\n load_data.select{ |row| row[4].to_f > number }\n end", "def max_value(our_array)\n\treference = -100000\n\tour_array.each do |number|\n\t\tif number > reference\n\t\t\treference = number\n\t\tend\n\tend\n\treference\nend", "def next_value(value, array)\n i = value > 0 ? 0 : 1\n index = value == -1 ? 1 : false\n sum = 0\n while i < 100\n if array[i].abs <= value.abs\n sum += array[i].abs\n i += 2\n index = i\n next\n end\n method = sum >= value.abs ? :sum : :cut\n return [index, method]\n end\n method = sum >= value.abs ? :sum : :cut\n return [index, method]\nend", "def top_value\n @relevant_data ? points.maximum_value : nil\n end", "def featured(n)\n # The next 2 lines guarantees we start with odd multiples of 7 that is higher than n\n n += 1\n n += 1 until n.odd? && n % 7 == 0\n\n while n < 9_876_543_201\n return n if featured?(n)\n n += 14 # this hastens the loop - we only iterate odd multiples of 7\n end\n raise StandardError, \"No more featured number available\"\nend", "def max\r\n temp = @first\r\n maxValue = -99999\r\n\r\n while !temp.nil?\r\n if temp.value > maxValue then\r\n maxValue = temp.value \r\n end \r\n temp = temp.next\r\n end \r\n maxValue\r\nend", "def min_next_bid_amount\n highest_bid_value = self.highest_bid.bid_amount \n if highest_bid_value.present? \n highest_bid_value+highest_bid_value*0.05\n else\n self.cost\n end\n end", "def find_greatest(numbers)\n saved_number = nil\n\n\n numbers.each do |num|\n saved_number ||= num\n if saved_number >= num\n next\n else\n saved_number = num\n end\n end\n\n\nsaved_number\nend", "def greatest_factor(num)\n\n return num / 2\n\nend", "def establish_high_number(array)\n if array[0] > array[1]\n return array [0]\n else array[0] < array[1]\n return array [1]\n end\nend", "def max\n temp = @first\n maxValue = -999999\n while !temp.nil?\n if temp.value > maxValue\n maxValue = temp.value\n end\n temp = temp.next\n end\n maxValue\n end", "def max\r\n temp = @first\r\n maxValue = -99999\r\n while !temp.nil?\r\n if temp.value > maxValue\r\n maxValue = temp.value\r\n end\r\n temp = temp.next\r\n end\r\n return maxValue\r\n end", "def max\n temp = @first\n maxValue = -999999\n while !temp.nil?\n if temp.value > maxValue\n maxValue = temp.value\n end\n temp = temp.next\n end\n return maxValue\n end", "def max\r\n temp = @first\r\n maxValue = -999999\r\n while !temp.nil?\r\n if temp.value > maxValue\r\n maxValue = temp.value\r\n end\r\n temp = temp.next\r\n end\r\n maxValue\r\n end", "def happiest_num max=Max\n max_rank = 1\n happiest_num = 1\n (1..max).each do |number|\n rank = rank_of_happiess number\n if rank > max_rank\n max_rank = rank\n happiest_num = number\n end\n end\n [happiest_num, max_rank]\n end", "def highest_prime_number_under(number)\n\nend", "def max\r\n temp = @first\r\n max_value = @first.value\r\n while !temp.nil?\r\n if temp.value > max_value\r\n max_value = temp.value\r\n end\r\n temp = temp.next\r\n end\r\n return max_value\r\n end", "def next_bigger(input) \n\treturn -1 if input <= 10\n\treversed_input = input.to_s.split(\"\").reverse.map { |m| m.to_i } # = [7,1,0,2]\n\treversed_input.each_with_index do |m,i|\n if m > reversed_input[i+1] # 7 > 1 then switch and break\n \tswitch = reversed_input[i+1]\n \treversed_input[i+1] = m\n \treversed_input[i] = switch\n \tbreak\n end \n\tend # reversed_input = [1,7,0,2] \n reversed_input.reverse.join(\"\").to_i # returns 2071\nend", "def next_greater_element(nums)\n res = []\n nums.each_with_index do |num, idx|\n\n pushed = false\n (nums.length - 1).times do |step|\n current_idx = (idx + step + 1) % nums.length\n\n if nums[current_idx] > num\n res.push(nums[current_idx])\n pushed = true\n break\n end\n\n end\n\n res.push(-1) unless pushed\n end\n\n res\nend", "def next_largest_number (array, given_number)\n array.find {|number| number > given_number}\nend", "def find_max_value(array)\nx = 0 \n array.length.times { |index|\n if array[index] > x \n x = array[index]\n end\n }\n x\n end", "def splitOn?\r\n\t\tmaxGain = 0\r\n\t\tbestFeature = nil\r\n\t\tfor i in 0..self.featureCount-1\r\n\t\t\tgain = self.gain(i)\r\n\t\t\tif gain >= maxGain\r\n\t\t\t\tmaxGain = gain\r\n\t\t\t\tbestFeature = i\r\n\t\t\tend\r\n\t\tend\r\n\t\tif maxGain == 0\r\n\t\t\tbestFeature = rand(0..self.featureCount-1)\r\n\t\tend\r\n\t\treturn bestFeature\r\n\tend", "def splitOn?\r\n\t\tmaxGain = 0\r\n\t\tbestFeature = nil\r\n\t\tfor i in 0..self.featureCount-1\r\n\t\t\tgain = self.gain(i)\r\n\t\t\tif gain >= maxGain\r\n\t\t\t\tmaxGain = gain\r\n\t\t\t\tbestFeature = i\r\n\t\t\tend\r\n\t\tend\r\n\t\tif maxGain == 0\r\n\t\t\tbestFeature = rand(0..self.featureCount-1)\r\n\t\tend\r\n\t\treturn bestFeature\r\n\tend", "def stock_prices(arr)\n min = arr[0]\n max = arr[0]\n big_gain = 0\n\n arr.each do |n|\n if n < min\n min = n\n max = n\n elsif n > max\n max = n\n end\n big_gain = max - min if max - min > big_gain\n end\n\n big_gain\nend", "def find_greatest(numbers)\n saved_number = nil\n\n numbers.each do |num|\n saved_number ||= num # assign to first value\n if saved_number >= num\n next\n else\n saved_number = num\n end\n end\n\n saved_number\nend", "def lead_value\n club? ? rank : rank + 13\n end", "def how_high\n energy * energy\nend", "def decay_value(value)\n value - 1\n end", "def getSpecialValue\n maxBonus\n end", "def greatest_number(num_array)\n saved_number = num_array[0]\n\n num_array.each do |num|\n\n if saved_number >= num\n next\n else\n saved_number = num\n end\n end\n\n saved_number\nend", "def find_greatest(numbers)\n saved_number = nil\n\n numbers.each do |num|\n saved_number = numbers[0]\n if saved_number >= num\n next\n else\n saved_number = num\n end\n end\n p saved_number\nend", "def max\r\n\ttemp = @first\r\n\tmaxValue = nil\r\n\tif !temp.nil? then\r\n\t\tmaxValue = temp.value\r\n\t\ttemp = temp.next\r\n\tend\r\n\twhile !temp.nil?\r\n\t\tif temp.value > maxValue then\r\n\t\t\tmaxValue = temp.value\r\n\t\tend\r\n\t\ttemp = temp.next\r\n\tend\r\n\treturn maxValue\r\n end", "def nextping(prev)\n [prev+1, (prev+exprand()).round].max\nend", "def probability_greater_than(value)\n probability_for_sides(:>, value)\n end", "def high\n @range_high\n end", "def high_card\n high_value = 0\n @grip.each do |card|\n new_value = FACE_VALUES.find_index(card.value)\n if new_value > high_value\n high_value = new_value\n end\n end\n FACE_VALUES[high_value]\n end", "def next(price)\n i = @array.bsearch_index { |ele| ele > price } || @array.size\n @array.insert(i, price)\n @index.insert(i, @k)\n @k += 1\n maxi = @index[i+1..-1].max\n maxi.nil? ? @array.size : @k - maxi - 1\n end", "def highest_prime_number_under(number)\n until is_prime?(number)\n number -= 1\n end\n number\nend", "def pred\n self - 1\n end", "def kth_largest(node, k)\n largest = BinarySearchTree.maximum(node)\n return largest if (k==1)\n\n (1...k).each do\n largest = next_largest(largest)\n end\n \n largest\nend", "def probability_lower_than(value)\n probability_for_sides(:<, value)\n end", "def step_divisor\n 10 + features_sum(:anger_mantain)\n end", "def find_greatest(numbers)\n saved_number = numbers[0]\n\n numbers.each do |num|\n if saved_number >= num\n next\n else\n saved_number = num\n end\n end\n\n saved_number\nend", "def find_max_value(array)\n x = 0\n array.length.times { |index| x = array[index] if array[index] > x }\n x\nend", "def game_value\n [VALUES.index(value) + 2, 10].min\n end", "def weighted_max_score\n max_score * weight\n end", "def maxValue(fred)\n\tputs fred.sort.last\nend", "def greatest_factor(num)\n (2...num).reverse_each { |i| return i if num % i == 0}\nend", "def find_max_value(array)\n x = array[0]\narray.length.times {|index|\n if array[index] > x\n x = array[index]\n end\n\n}\nx\nend", "def first_greater_value(node, target, curr_greater = nil)\n return curr_greater unless node\n \n if node.val <= target\n first_greater_value(node.right, target, curr_greater)\n else\n if curr_greater.nil? || node.val - target < curr_greater - target\n curr_greater = node.val\n end\n\n first_greater_value(node.left, target, curr_greater)\n end\nend", "def future_given_present(present_value, interest, term)\n (present_value.to_f * (1 + interest.to_f) ** term).round(4)\n end", "def largest_value\n values.max\n end", "def find_next_greater_element(array)\n (0...array.length).each do |i|\n smallest_after = 100000\n (i...array.length).each do |j|\n if array[j] > array[i] && array[j] < smallest_after\n smallest_after = array[j]\n end\n end\n puts \"Next greatest for #{array[i]} is #{smallest_after}\"\n end\n\n\n\nend", "def value_anneal\n value_anneal_iteration(@iteration)\n end", "def probability_greater_than_or_equal(value)\n probability_for_sides(:>=, value)\n end", "def find_max_value(array)\n \n (find_max_value(scale)).to eq(5)\n (find_max_value(scale_2)).to eq(6)\n (find_max_value(hill)).to eq(5)\n (find_max_value(valley)).to eq(5)\n (find_max_value(zig_zag)).to eq(1000)\n end", "def pick\n float = BigDecimal.new(@rnd.uniform.to_s)\n from = to = BigDecimal.new(\"0.0\")\n value = nil\n @distribution.each do |value, probabillity|\n to += probabillity\n if float >= from && float < to\n return value\n end\n from = to\n end\n\n throw \"probabillity sum not 1.0, was #{to} for #{@distribution}\" if to < 0.999\n return value\n end", "def next_greater_element(nums1, nums2)\n stack = []\n # create new hash where default is -1 when key is not found\n next_greater_ele = Hash.new(-1)\n result = []\n\n# create hash with nums2 as keys and their value is the next grater element of the same array\n nums2.each { |n|\n #while stask and stack.last is smaller than current item\n while( stack.any? && stack.last < n )\n # add last item in stack as key and the next greater item as value on the hash\n next_greater_ele[stack.pop] = n\n end\n stack.push(n)\n }\n nums1.each { |n|\n result << next_greater_ele[n]\n }\n result\nend", "def next_greater_element(find_nums, nums)\n output = []\n \n find_nums.each do |num|\n next_greatest = -1\n for i in nums.index(num)+1..nums.length-1 do\n if nums[i] > num\n next_greatest = nums[i]\n break\n end\n end\n output << next_greatest\n end\n output\nend", "def current_high_bid\n list_of_bids = bids.order(amount: :desc)\n if list_of_bids.blank? \n return 0\n elsif list_of_bids.length == 1\n return 1\n end\n\n return list_of_bids[1].amount + 1 #add $1 to the 2nd highest bid\n end", "def desired_xp\n return (200 * level * (level + 1)).to_i\n end", "def next_greater_element(find_nums, nums)\n result = []\n find_nums.each do |num|\n i = nums.length - 1\n closest_greater_num = -1\n while nums[i] != num do\n if nums[i] > num\n closest_greater_num = nums[i]\n end\n\n i -= 1\n end\n result << closest_greater_num\n end\n\n result\nend", "def next_largest(node)\n if node.right\n return left_most(node.right)\n end\n greater_parent(node.parent,node.value)\nend", "def find_max_number(any_array)\n\treference = any_array[1]\n\tany_array.each do |number|\n\t\tif number > reference\n\t\treference = number\n\t\tend\n\tend \n\treference\nend", "def find_max\n loc = find_max_locator and loc.value\n end", "def next(price)\n stocks.push(price) \n (stocks.size - 1).downto(0) do |i|\n while !stack.empty? && stocks[stack[-1]] <= price\n stack.pop\n end\n span = stack.empty? ? (i+1) : i - stack[-1]\n stack.push(i)\n return span \n end\n end", "def get_inflation_rate()\r\n #assume a inflation rate between 2% and 7%\r\n inflation_rate=(rand(7)*0.01)\r\n if inflation_rate > 0.02\r\n return inflation_rate\r\n else\r\n return 0.02\r\n end\r\nend", "def t_max\n @temp.max\n end", "def point_value\n return 500 if flush?\n return 300 if three_kind?\n return 200 if two_kind?\n return highest_card.numeric_rank\n end", "def precision_at_fraction_recall val\n @p.each_index do |i|\n return actual_precision(i) if tpr(i) < val\n end\n 0.0\n end", "def score_upper_category(value)\n \tvalue * @dice.inject(0) { |count, die| die == value ? count + 1 : count }\n end", "def prt_next_greater_element(ary)\n\tstack = [ary.shift]\n\tresult = {} \n\tary.each do |e|\n\n\t\twhile (stack.size > 0) && e > stack[-1]\n\t\t\tresult[stack.pop] = e\n\t\tend\n\n\t\tstack << e\n\tend\n\n\tstack.each do |e|\n\t\tresult[e] = -1\n\tend\n\tresult\nend", "def probability_lower_than_or_equal(value)\n probability_for_sides(:<=, value)\n end", "def hp_on_kill\n (maxhp * features_sum(:hp_on_kill)).to_i\n end", "def fudge(stat)\n stat * rand(0.8..1.2)\n end", "def get_high_order(num1,num2)\n num1/num2\nend", "def sup_limit(max)\n (1..Float::INFINITY).lazy.map{|i| [i,Prime.take(i).reduce(:+)]}.detect{|i,sum| sum >= max}.first\nend", "def solve (input)\n output = 0\n mult_five = 5\n curr_val = 3\n\n while curr_val < input\n if curr_val > mult_five\n output += mult_five\n mult_five += 5\n elsif curr_val == mult_five\n mult_five += 5\n end\n\n output += curr_val\n curr_val += 3\n end\n\n return output\nend", "def check_new_max(product)\n if product > @max\n @max = product\n end \nend", "def bottom_value\n @relevant_data ? points.minimum_value : nil\n end", "def maximumToys(prices, k)\n counter = 0\n prices.sort.each do |price|\n if (price <= k)\n counter += 1\n k -= price\n else\n break\n end\n end\n counter\nend", "def best(n)\n @score.sort{|a,b| b[1][0] <=> a[1][0]}[0..n-1]\n end", "def high(x)\r\n x.split.max_by{|x| score_word(w)} end", "def max_rank\n num_above + num_below + 1\n end", "def high_five; end", "def mp_on_kill\n (maxmp * features_sum(:mp_on_kill)).to_i\n end", "def heaviest_rock(rock_array)\n max_rock = 0\n\n rocks.each do |rock|\n max_rock = rock if max_rock < rock \n end\nend", "def decent_num num\n\n arr = []\n\n if num % 5 == 0\n arr << (\"3\"*num).to_i\n end\n\n num.downto(1).each do |fi|\n th = num - fi\n if th % 5 == 0 && fi % 3 == 0\n arr << (\"5\"*fi + \"3\"*th).to_i\n break\n end\n end\n\n\n if arr.empty?\n -1\n else\n arr.max\n end\n\nend", "def max_of(a, b)\r\n return a >= b ? a : b\r\n end", "def find_nb(m)\n sum = 0\n x = 1\n while true\n sum += x ** 3\n if sum == m\n return x\n elsif sum > m\n return -1\n end\n x += 1\n end\nend", "def extrema\n return Features.extrema(@data)\n end", "def max_score\n problem.weight\n end", "def key_for_min_value(hash)\n if hash.count < 2\n return hash[0]\n else \n num = 42\n hash.each do |key, value|\n if value <= num\n num = value\n end\n end\n hash.invert[num] \n end\nend" ]
[ "0.6525721", "0.6194821", "0.6079245", "0.6041829", "0.60179055", "0.5999514", "0.5983866", "0.5968499", "0.59534675", "0.5947692", "0.5895796", "0.5893031", "0.5873366", "0.5857065", "0.58431315", "0.580838", "0.5807935", "0.5806526", "0.5779731", "0.5768964", "0.5734192", "0.57283866", "0.57229835", "0.5714132", "0.56819916", "0.56778693", "0.5667425", "0.5652063", "0.56518376", "0.5647905", "0.5647905", "0.5645352", "0.5641991", "0.56352335", "0.56341946", "0.5625884", "0.5622702", "0.56198794", "0.56087935", "0.5596362", "0.55960464", "0.55951464", "0.55856687", "0.557484", "0.5570537", "0.55690634", "0.55560666", "0.55491775", "0.5547517", "0.55431545", "0.5542899", "0.5522813", "0.552095", "0.55186963", "0.5513668", "0.5513243", "0.5512171", "0.5510935", "0.5502902", "0.54991734", "0.54946715", "0.54836196", "0.54835063", "0.54683506", "0.5459529", "0.5444592", "0.54445267", "0.5430095", "0.542151", "0.54092914", "0.54061913", "0.54030716", "0.5402612", "0.5399994", "0.5397842", "0.53936285", "0.53881884", "0.5382212", "0.5379797", "0.5374506", "0.5372875", "0.5361875", "0.5351521", "0.53437936", "0.5343019", "0.53423226", "0.53325504", "0.533138", "0.53312665", "0.53310394", "0.5324111", "0.5310604", "0.5306909", "0.53052884", "0.5292848", "0.5289289", "0.5288407", "0.52845335", "0.5284424", "0.5281813", "0.5281415" ]
0.0
-1
Sum Square Square Sum
def sum_square_difference(number) squared_sum = 1.upto(number).inject(:+)**2 sum_squares = 0 1.upto(number).each {|num| sum_squares += num**2} squared_sum - sum_squares end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sum_of_squares\n\t\t\tinject(0) do |sum, elem|\n\t\t\t\tsum + (elem ** 2)\n\t\t\tend\n\t\tend", "def square_sum\n self.inject(0.0){|accum, i| accum +i**2 }\n end", "def sum_of_squares\n self.inject(0) { |sos, n| sos + n**2 }\n end", "def square_of_sum\n\t\t@n**2*(@n+1)**2/4\n\tend", "def square_of_sum\n end", "def square_of_sums\n return (@n * (@n + 1) / 2)**2\n end", "def square_of_sums\n sum=((@num**2+@num)/2)**2\n end", "def square_of_sums\n square(sum(sequence))\n end", "def sum_of_the_squares\n sum = 0\n (1..self).each do |n|\n sum += n**2\n end\n sum\n end", "def squareSum(numbers)\n numbers.map { |n| n*n}.reduce(:+)\nend", "def sum_of_squares\n sum(square(sequence))\n end", "def squareSum(numbers)\n numbers.map { |n| n*n }.reduce(:+)\nend", "def squareSum(numbers)\n numbers.map { |i| i ** 2 }.reduce(:+)\nend", "def sum_of_squares\n end", "def square_of_sum(vals)\n vals.reduce(:+) ** 2\nend", "def square_root_sum\n inject(nil) { |sum, x| sum ? sum + x ** 2 : x ** 2 }\n end", "def square_of_sum\n\tsquare_of = 0\n\n\t(1..100).each do |x|\n\t\tsquare_of += x\n\tend\n\tsquare_of = square_of**2\n\tsquare_of\nend", "def sum_of_squares values\n values.collect { |v| v**2 }.reduce(:+)\nend", "def sum_squares(n)\nsums = [] \n for i in (1..n)\n i_squared = i**2\n sums.push i_squared \n end\n p sums.reduce(:+)\nend", "def sum_of_squares\n return @n * (@n + 1) * (2 * @n + 1) / 6\n end", "def sum_of_squares\n @range.sum { |n| n**2 }\n end", "def squareSum(numbers)\n numbers.reduce(0){|sum, x| sum + (x ** 2)}\nend", "def square_of_sum(n)\n sum = 0\n (1..n).each {|i| sum = sum + i}\n sum * sum\n end", "def sum_of_squares\n range.reduce { |a, e| a + e**2 }\n end", "def sum_square_array(arr)\n arr.reduce(:+) ** 2\nend", "def sum_of_squares n\n (n**3)/3 + (n**2)/2 + n/6 \nend", "def sumOfSquares(max)\n out = 0\n max.times do |i|\n out += (i+1)**2\n end\n out\nend", "def square_sum(numbers)\n squares = numbers.map{|number| number * number}\n squares.reduce(0){|num, sum| num + sum}\nend", "def square_of_the_sum\n (1..self).inject(&:+)**2\n end", "def square_of_sums\n range.reduce(:+)**2\n end", "def sum_of_squares\n squares = differences_from_mean.map { |diff| diff ** 2 }\n squares.reduce(:+)\n end", "def sum_of_squares\n @number_range.sum {|n| n**2}\n end", "def squareSum(numbers) \r\n numbers.map{|num| num ** 2}.sum \r\n \r\nend", "def sum_of_squares(n)\n sum = 0\n (1..n).each {|i| sum = sum + (i*i)}\n sum\n end", "def sum_of_squares(array)\n array.each.map{|num total += num*num}.reduce(:+) #is like fold_left. reduce works on array or collection of enumerables\nend", "def sum_of_squares(numbers)\n numbers.map { |x| x * x }.reduce(0) { |acc, x| acc + x }\nend", "def sums num\n\tsum_of_squares = 0\n\tsum = 0\n\t1.upto num do |n|\n\t\tsum_of_squares += n*n\n\t\tsum += n\n\tend\n\tsum**2 - sum_of_squares \nend", "def sum_square(x, y)\n\tx**2 + y**2\nend", "def square_of_sum (my_array, proc_square, proc_sum)\n sum = proc_sum.call(my_array)\n proc_square.call(sum)\n end", "def sum_of_squares \n size==0 ? 0 : inject(0){|sum,x|sum+(x*x)}\n end", "def square_of_sum\n @number_range.sum**2\n end", "def square_of_sum(array, proc_square, proc_sum)\n\tproc_square.call(proc_sum.call(array))\nend", "def sum_of_squares(max)\n sum = 0\n (1..max).each do|current|\n sum = sum + current**2\n end\n return sum\nend", "def sum_of_squares(n)\n sum = 0\n for i in 1..n\n sum+= i*i\n end \n sum\nend", "def square_of_sum\n @range.sum**2\n end", "def total\n squares = (1..64).map{|i| square(i)}\n squares.inject(:+)\n end", "def squareSum(numbers)\n numbers.inject(0) { |sum, n| sum + n*n }\nend", "def sum_of_squares(numbers)\n result = []\n sum = []\n numbers.map do |number|\n result = number*number\n sum.push result\nend\nsum.sum\nend", "def sum_square_difference(num)\n 1.upto(num).sum**2 - 1.upto(num).reduce(0) { |total, n| total + n**2 }\nend", "def sum_square_difference(num)\n square_of_sum = 0\n sum_of_squares = 0\n\n 1.upto(num) do |i| \n square_of_sum += i\n sum_of_squares += i**2\n end\n\n square_of_sum**2 - sum_of_squares\nend", "def sum_square_difference(num)\n square_of_the_sum = 0\n sum_of_the_squares = 0\n \n 1.upto(num) do |num|\n square_of_the_sum += num\n sum_of_the_squares += (num ** 2)\n end\n\n total = (square_of_the_sum ** 2) - sum_of_the_squares\n total\nend", "def sum_up_to_squared n=100\r\n (2 * n + 1) * (n + 1) * n / 6\r\nend", "def arith_sum_squares(max)\n max * (max+1) * (2*max+1) / 6\nend", "def solution(num)\n sum_of_squares = 0\n\n (1..num).each do |number|\n sum_of_squares += number**2\n end\n\n square_of_sums = (1..num).inject(:+) ** 2\n\n p (square_of_sums - sum_of_squares).abs\nend", "def sum_square_difference(num)\n sum = 0\n square_sum = 0\n\n 1.upto(num) do |n|\n sum += n\n square_sum += n**2\n end\n\n sum**2 - square_sum\nend", "def squared_sum(a, b)\n # Q1 CODE HERE\n return (a + b) ** 2\nend", "def sum_square_difference(n)\n sum = 0\n sums_squared = 0\n 1.upto(n) do |num|\n sum += num\n sums_squared += num**2\n end\n sum**2 - sums_squared\nend", "def squareSum(numbers)\n\n # Create an empty array to store our sum in\n sum = []\n # Assign our total variable to 0 so we can return this at the end with the\n # sum total\n total = 0\n\n # Iterate through the array given in the argument, squaring each number passed\n # in, and then appending that to our new array sum\n numbers.each do |n|\n sum << (n * n)\n end\n\n # Now that we have our new array with the squared digits, we can iterate through\n # and add each elemtn together to our new variable total.\n sum.each do |el|\n total += el\n end\n\n # Return the total of each squared number from the original array\n total\nend", "def sum_square_difference(n)\n \n sum = 0 \n for i in 0..n\n sum += i\n end\n \n sq_sum = 0\n for i in 0..n\n sq_sum += (i**2)\n end \n \n (sum*sum) - sq_sum\nend", "def sum_sq_diff(n)\n nums_in_range = (1..n)\n # square_sums = nums_in_range.sum ** 2\n square_sums = nums_in_range.sum.pow(2)\n sums_square = nums_in_range.map { |n| n ** 2 }.sum\n square_sums - sums_square\nend", "def sum_of_squares(n)\n (1..n).inject(0) do |total, i|\n total += i**2\n end\nend", "def sum_of_the_squares max_number\n sum = 0\n (1..max_number).each { |i| sum += (i ** 2) }\n sum\nend", "def sum_sq(n)\n cnt = 1\n sum = 0\n while cnt <= n\n sum += cnt * cnt\n cnt += 1\n end \n puts sum\nend", "def sum_square_difference(n)\r\n square_total = 0\r\n sum_square = 0\r\n 1.upto(n) {|x| square_total += x}\r\n 1.upto(n) {|x| sum_square += (x**2)}\r\n square_sum = square_total**2\r\n square_sum - sum_square\r\nend", "def sum_square_difference(num)\n square_of_sum = 1.upto(num).to_a.reduce(:+) ** 2\n sum_of_squares = 1.upto(num).to_a.map{ |n| n ** 2 }.reduce(:+)\n square_of_sum - sum_of_squares\nend", "def sum_of_square(range)\n\trange.inject(0) { |sum, i| sum + i**2 }\nend", "def total\n (1..64).inject {|sum, square| sum + square(square)}\n end", "def squareOfSum n\n return triangularNumber(n)**2\nend", "def square_sum(numbers)\n numbers.map! {|num| num ** 2}.inject {|sum, x| sum + x }\nend", "def total\n (1..64).reduce { |sum, space_number| sum + square(space_number) }\n end", "def sum_square_diff(num)\n sum_of_squares = 0\n square_of_sum = 0\n\n (1..num).each do |i|\n squared = i**2\n sum_of_squares += squared\n square_of_sum += i\n end\n\n square_of_sum **= 2\n\n difference = square_of_sum - sum_of_squares\n\n puts difference\nend", "def sum_square_difference(num)\n\n sum_squared = (1..num).to_a.sum ** 2\n\n squares = []\n\n (1..num).each { |n| squares << n ** 2 }\n\n squared_sum = squares.sum\n\n sum_squared - squared_sum\nend", "def sum_of_squares(x)\n sum_of_squares = 0\n (1..x).each do |f|\n sum_of_squares += f**2\n end\n return sum_of_squares\nend", "def sum_square_difference(a_num)\r\n first_block = (1..a_num).to_a.reduce(&:+)\r\n first_block **=2\r\n\r\n second_block = (1..a_num).to_a.map { |number| number ** 2 }\r\n second_block = second_block.reduce(&:+)\r\n\r\n first_block - second_block\r\nend", "def sum_square_difference(n)\n ((1..n).reduce(:+)**2) - (1..n).reduce{ |sum, i| sum + i**2 }\nend", "def sum_squares(n)\n (1..n).inject { |sum, i| sum += i**2 }\nend", "def sum_of_squares(number)\n \n result = 0\n i = 1\n while i <= number\n result += (i ** 2) \n i += 1\n end\n\n result\nend", "def sum_square_diff(n)\r\n sq_of_sum = (1..n).to_a.sum ** 2\r\n sum_of_sq = (1..n).to_a.map{ |num| num *= num }.sum\r\n (sq_of_sum - sum_of_sq).abs\r\nend", "def square_sums(n)\n Array(1..n).sum**2\nend", "def sum_square_difference(num)\n (1..num).inject(:+)**2 - (1..num).map{|x| x**2}.inject(:+)\nend", "def sum_square_difference(num)\n (1..num).sum ** 2 - (1..num).map {|num| num ** 2 }.sum\nend", "def each_value_square_sum(range)\n (1..range).inject {|sum, num| sum += num * num }\n end", "def diff_squares(num)\r\n sum_of_nums = (1..num).inject { |sum, x| sum + x }\r\n sum_of_sq = (1..num).inject { |sum, x| sum + x**2 }\r\n sum_of_nums**2 - sum_of_sq\r\nend", "def sum_square_difference(integer)\n array = []\n 1.upto(integer) { |num| array << num }\n sum_squared = array.reduce(:+)**2\n\n array = []\n 1.upto(integer) { |num| array << num**2 }\n squared_sums = array.reduce(:+)\n\n sum_squared - squared_sums\nend", "def sum_square_difference(num)\r\n arr = (1..num).to_a\r\n sum1 = arr.sum ** 2\r\n sum2 = arr.inject { |sum, number| sum + number**2 }\r\n sum1 - sum2\r\nend", "def sum_square_difference(n)\n # square_of_sum = (1..n).reduce(:+) ** 2\n # sum_of_squares = (1..n).reduce { |sum, num| sum + num * num }\n # square_of_sum - sum_of_squares\n # (1..n).reduce(:+)**2 - (1..n).reduce { |sum, num| sum + num * num }\n\n (1..n).sum**2 - (1..n).sum { |num| num**2 }\nend", "def sum_square_difference(int)\n first_n_ints = (1..int).to_a\n\n sum_1 = first_n_ints.sum\n\n sum_2 = first_n_ints.map{|int| int**2}.sum\n\n (sum_1**2) - sum_2\nend", "def has_square_sum(num)\n\nend", "def sum_of_squares(numbers)\n sum = 0;\n\n squared = numbers.map do |x|\n x = x**2\n sum = sum + x\n end\n sum\nend", "def sum_square_difference(num)\n square_of_sum = (0..num).inject(:+) ** 2\n sum_of_square = (0..num).map { |num| num ** 2}.inject(:+)\n square_of_sum - sum_of_square\nend", "def sum_square_difference(num)\n arr = (1..num).to_a\n square_of_arr_summed = (arr.sum) ** 2\n square_of_each_num = arr.reduce(0) { |sum, n| sum + n**2 }\n\n # Alternatively\n # square_of_each_num = 0\n # arr.each { |element| square_of_each_num += element **2 }\n\n return square_of_arr_summed - square_of_each_num\nend", "def sum_square_difference(num)\n total_square = 0\n num_square = 0\n\n 1.upto(num) do |number|\n total_square += number\n end\n\n 1.upto(num) do |fig|\n num_square += fig**2\n end\n\n product_total = total_square ** 2\n square_difference = product_total - num_square\n square_difference\nend", "def difference_between_sum_sq_and_sq_sum(n)\n square_sum(n) - sum_squares(n)\nend", "def sum_square_difference(n)\n n_integers = (1..n).to_a\n square_of_sum = n_integers.inject(:+)**2\n sum_of_squares = n_integers.map {|n|n**2}.inject(:+)\n square_of_sum - sum_of_squares\nend", "def sum_square_difference(num)\n sum = sum(num)\n square = square(num)\n p sum - square\nend", "def square_sum_up_to n=100\r\n (n * (n + 1) / 2)**2\r\nend", "def sum_square_difference(integer)\n sum = 0\n square_sum = 0\n 1.upto(integer) { |i| sum += i }\n 1.upto(integer) { |i| square_sum += i**2 }\n sum**2 - square_sum\nend", "def sum_square_difference(integer)\n (1..integer).reduce(:+)**2 - 1.upto(integer).map { |i| i**2 }.reduce(:+)\nend", "def p6\n\trange = (1..100).to_a\n\tsquare_of_sum = range.reduce(:+) ** 2\n\tsum_of_square = (range.map{|x| x ** 2}).reduce(:+)\n\tsquare_of_sum - sum_of_square\nend", "def sum_square_difference(n)\n integers = (1..n).to_a\n\n square_of_sum = integers.sum ** 2\n sum_of_squares = integers.map { |n| n ** 2 }.sum\n\n square_of_sum - sum_of_squares\nend" ]
[ "0.8410559", "0.8214191", "0.8073652", "0.8046577", "0.79860216", "0.7918175", "0.7889149", "0.7844171", "0.78209805", "0.7707787", "0.77009046", "0.76886505", "0.7669717", "0.7668815", "0.76598954", "0.75784105", "0.7574576", "0.7514405", "0.74935305", "0.74680746", "0.74210095", "0.7413724", "0.73666793", "0.735596", "0.73493296", "0.7347701", "0.73454326", "0.73412955", "0.7299266", "0.7293003", "0.72756046", "0.7270686", "0.72389036", "0.7235766", "0.72249687", "0.7213873", "0.71994233", "0.71908087", "0.71880615", "0.7185125", "0.71818995", "0.71671957", "0.71519524", "0.7131836", "0.71296424", "0.7103963", "0.7098289", "0.7096283", "0.70909756", "0.70865893", "0.70834965", "0.70675343", "0.706537", "0.70644397", "0.70451355", "0.7041848", "0.7034631", "0.7014237", "0.69939375", "0.6983641", "0.6951593", "0.6943031", "0.6920553", "0.69186383", "0.69119155", "0.68994504", "0.6898102", "0.68862", "0.6885545", "0.6879636", "0.6875704", "0.68618023", "0.68582326", "0.68453836", "0.68428046", "0.6828002", "0.6824929", "0.6821821", "0.6817884", "0.6813399", "0.6811903", "0.68111676", "0.68040663", "0.6777389", "0.6761346", "0.67125916", "0.6709236", "0.6692461", "0.6690605", "0.66887", "0.6680007", "0.66785485", "0.6667501", "0.66669405", "0.6663391", "0.66509813", "0.6649336", "0.6634833", "0.6624383", "0.65889823" ]
0.6714385
85
if no PayPal button was hit, send mail with all details to Amavat contact person
def no_paypal_account_email(order) @order = order mail(to: ENV['NO_PAYPAL_EMAIL_ADDRESS'], subject: 'Kein PayPal Konto für Amavat Bestellung') end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def payment_upcoming\n @greeting = \"Hi\"\n\n mail to: \"to@example.org\"\n end", "def setup_email(user, payment)\n mail = Mail.deliver do\n to user.email\n from 'FoodCircles <hey@joinfoodcircles.org>'\n subject \"Got your Voucher for #{payment.offer.venue.name}\"\n reply_to 'used@inbound.foodcircles.net'\n html_part do\n content_type 'text/html; charset=UTF-8'\n body \"<table width = '550px'><tr><td style = font-size:12pt; font-family:Arial><p style= text-align: justify;>Print this email or just show it off on a fancy electronic device.</p>\n <p style= text-align: justify>\n <b>confirmation code:</b> #{payment.code}<br>\n <b>good for:</b> #{payment.offer.name}<br>\n <b>only at:</b> #{payment.offer.venue.name}<br>\n <b>with a minimum of:</b> #{payment.offer.min_diners} diners<br>\n <b>expiring:</b> #{30.days.from_now.to_date}</p><br>\n <b>3 steps to redeem:</b>\n <p>\n <b>1)</b> Show server this message before you order. They should jot your code down and confirm.<br>\n <b>2)</b> Order regular food or drink for each person in party.<br>\n <b>3)</b> Mark Voucher used by following this link! <a href=\\\"http://staging.foodcircles.net/payment/used?code=#{payment.code}&source=email\\\">Mark Voucher Used</a></br>\n </p><br><br>\n Enjoy!<br><br>\n Contact support at <b>support@joinfoodcircles.org</b> if you have any concerns or questions whatsoever.<br><br><br>\n <h3><u>FOR SERVERS:</u></h3>\n <p style= text-align: justify;><b>Write down the confirmation code on the table's receipt or your POS system</b>. Place a \\\"Buy One, Feed One\\\" placard on the guest's table, and mark a tally on your chalkboard (if available). Call us at 312 945 8627 with any questions!</p></td></tr></table>\"\n end\n end\n end", "def sent_wholesale_inquiry(contact)\n @contact = contact\n mail(:to => @contact.email, :subject => \"Your wholesale inquiry has been sent to Feya Candle\")\n end", "def wholesale_inquiry(contact)\n @contact = contact\n @url = contacts_path\n mail(:to => \"feyacandle@gmail.com\", :subject => \"Wholesale inquiry\")\n end", "def reminder_email2(all_payments)\n @all_payments = all_payments\n @url = generate_url(User.find_by_email(@all_payments.first.email))\n #loaner_email = User.find(@all_payments.first.user_id).email\n\n mail(:to => @all_payments.first.email, :subject => \"Reminder that you owe some money\")\n end", "def sent_volunteer_inquiry(contact)\n @contact = contact\n mail(:to => @contact.email, :subject => \"Your volunteer inquiry has been sent to Feya Candle\")\n end", "def paid(order)\n @order = order\n\n mail :to => order.billing_address.email\n end", "def order_budget()\n \n @greeting = \"Hi\"\n\n mail :to => \"docs1006@prodigy.net.mx\", :subject => 'Pragmatic Store Order Confirmation'\n end", "def welcome_email(payment)\n @payment = payment\n @url = generate_url(User.find_by_email(@payment.email))\n loaner_email = User.find(@payment.user_id).email\n\n mail(:to => @payment.email, :subject => \"Yo, you owe some money!\", :cc => loaner_email)\n end", "def order_received(order)\n@order=order\nmail(:to => order.email, :subject => 'Pragmatic Toy Shop Order Confirmation')\nend", "def purchase_email\n @greeting = \"Hi\"\n\n mail to: \"to@example.org\"\n end", "def donate_email(user, payment_option)\n \t@user = user\n \t@payment_option = payment_option\n mail( :to => user.email,\n :subject => \"Your contribution to Coderise\" )\n end", "def paid_email(payment)\n @payment = payment\n\n mail(:to => User.find(@payment.user_id).email, :subject => \"You've been paid back!\", :cc => @payment.email)\n end", "def activate(deal)\n @deal, @merchant = deal, deal.merchant\n @deal_url = merchant_promo_url(@merchant, @deal)\n\n mail :to => @merchant.email\n end", "def business_contact(contact)\n @contact = contact\n @url = \"http://localhost:3000/admin/login\"\n mail(:to => [\"trey@treytucker.com\", \"paul@bigblockdeals.com\"], \n :subject => \"New Business Contact\")\n end", "def send_signup_email(taxpayer)\n @taxpayer = taxpayer\n mail( :to => @taxpayer.email,\n :subject => 'Thanks for signing up for our amazing app' )\n end", "def order_confirmation(buyer)\n @order = Order.last\n @buyer = buyer\n\n mail to: @buyer, subject: \"Order Completed!\", cc: \"foodbylags@gmail.com\"\n end", "def payment_notification(options={})\n options = options.symbolize_keys\n receivers = fetch_payment_receivers(options)\n @amount = ((options[:amount].to_f)/100)\n @conn_count = options[:connection_count]\n @last4 = options[:last4]\n mail(:to => receivers, :subject => \"Payment Successful!\")\n end", "def order_shipped\n @greeting = \"Hi\"\n\n mail to: \"to@example.org\"\n end", "def order_shipped\n @greeting = \"Hi\"\n\n mail to: \"to@example.org\"\n end", "def order_shipped\n @greeting = \"Hi\"\n\n mail to: \"to@example.org\"\n end", "def order_shipped\n @greeting = \"Hi\"\n\n mail to: \"to@example.org\"\n end", "def reminder_email(payment)\n @payment = payment\n @url = generate_url(User.find_by_email(@payment.email))\n #loaner_email = User.find(@payment.user_id).email\n\n mail(:to => @payment.email, :subject => \"Reminder that you owe some money\")\n end", "def deliverForm data\n @fromContact = data['fromContact']\n @data = data\n tomail = data['toEmail'].length > 0 ? data['toEmail'] : 'saisagarkache@gmail.com'\n\n mail(to: tomail, subject: data['fromContact'] || 'Want to be a Partner')\n end", "def new_review_email(user, business)\n @user = user\n @business = business\n mail(:to => @user.email, :subject => \"Your review has been posted on CONSIGN.NYC\")\n end", "def recap_loan_confirm\n to = params['emailAddress']\n from = 'recap@library.columbia.edu'\n confirm_bcc = APP_CONFIG[:recap_loan][:confirm_bcc]\n recap_subject = 'Offsite Pick-Up Confirmation'\n recap_subject += \" [#{params['titleIdentifier']}]\" if params['titleIdentifier']\n recap_subject += \" (#{Rails.env})\" if Rails.env != 'valet_prod'\n subject = recap_subject\n # Make params available within template by using an instance variable\n @params = params\n mail_params = {to: to, from: from, subject: subject}\n mail_params[:bcc] = confirm_bcc if confirm_bcc\n mail(mail_params)\n end", "def shipped(order)\n @order = order\n mail to: order.email, subject: 'Заказ из Card Shop отправлен'\nend", "def review_request(user)\n @greeting = \"Hi\"\n\n mail to: \"to@example.org\"\n end", "def approve\n @greeting = \"Hi\"\n\n mail to: \"to@example.org\"\n end", "def product_back_in_inventory\n @greeting = \"Hi\"\n\n mail to: \"to@example.org\"\n end", "def send_email(payment, bill)\n Admin.all.each do |admin|\n Pony.mail :to => admin.email,\n :from => payment.contributor_email,\n :subject => I18n.t(:upload_receipt_subject),\n :html_body => erb(:\"/mails/payment_confirmation\",\n :locals => {:receipt => payment, :bill => bill },\n :layout => false),\n :via => :smtp\n\n end\nend", "def contact_confirmation(contact)\n @contact = contact\n\n mail to: \"hello@meme.menu\", subject: \"New Contact Submission\"\n end", "def repayment_notification(user)\n @user = user\n\n mail to: user.email, subject: \"Scholarship Confirmation\"\n end", "def contact_confirmation(first_name,second_name,email,phone,camp,inquire_type,message)\n @first_name=first_name \n @second_name=second_name\n @email=email\n @phone=phone\n @camp=camp\n @inquire_type=inquire_type\n @message=message\n\n mail to: \"fjqz50@gmail.com\", subject: \"Contact \"\n end", "def response(email)\n @greeting = \"Hi\"\n\n mail(to:email, subject:\"You received a payment\")\n end", "def product_sold\n @greeting = \"Hi\"\n\n mail to: \"to@example.org\"\n end", "def final_price(order)\n @greeting = \"Hi\"\n @order = order;\n\n mail to: order.email\n end", "def sendmail\n puts \"send mail \"\n puts @manifest.code \n\n @company = @manifest.company\n\n ActionCorreo.st_email(@manifest).deliver_now \n end", "def booked_not_confirmed\n @greeting = \"Hi\"\n\n mail to: \"to@example.org\"\n end", "def send_store_review_email\n if (business.admin_email != nil && business.admin_email != \"\")\n Mailer.store_review_email(user, content, business, rating).deliver\n end\n end", "def volunteer_inquiry(contact)\n @contact = contact\n @url = contacts_path\n mail(:to => \"feyacandle@gmail.com\", :subject => \"Volunteer inquiry\")\n end", "def new_place_notification (merchant)\n @merchant = merchant\n mail to: \"sales@halalfoodhunt.com\", subject: \"A Place Has Been Listed\"\n end", "def receipt\n mail(\n to: \"smnrwebster5@gmail.com\",\n subject: \"New for review for your commute\"\n )\n end", "def send_new_listing_notification(merchant)\n @merchant = merchant\n mail to: \"sales@halalfoodhunt.com\", subject: \"A New Merchant has Subscribed!\"\n end", "def booking_confirmed\n @greeting = \"Hi\"\n\n mail to: \"to@example.org\"\n end", "def send_service_email(checkout, order_items)\n @checkout = checkout\n @associate = @checkout.associate\n @order_items = order_items\n @email = Email.find(1)\n mail(:to => @associate.email, :subject => \"Customer Accessories Request [ \" + @checkout.customer_name + \" ]\",\n\n :cc => [@email.address])\n end", "def send_signup_email(enquiry)\n @enquiry = enquiry\n mail( :to => 'info@refunction.ca',\n :subject => 'Customer Enquiry' )\n end", "def order_in_progress\n @greeting = \"Hi\"\n\n mail to: \"to@example.org\"\n end", "def send_thx_email\n @user = User.where(:uid => self.uid).first\n if !@user.nil? && !@user.email.nil?\n Services::Mandrill.mail(@user.email, 'PicsforPets_2013_Reportback', 'How to get puppies adopted')\n end\n end", "def confirm(viper)\n @viper = viper\n if @viper.app_type == \"vip\"\n mail(to: @viper.email,\n subject: \"您的参展申请已经审核通过\",\n from: \"fair@ewatch.cn\",\n date: Time.now,\n content_type: \"text/html\",\n body: \"亲爱的买家:\n恭喜您!您所提交的资料已经审核通过,随后我们将会安排相关的工作人员与您联系,请您携带有效证件(身份证及名片)到展会现场VIP接待处领取VIP买家证。\n\n\n展览时间:\n2015-06-25 至 2015-06-28 \n\n展览地点: \n深圳会展中心(1、9号馆) \n\n参观规则: \n §Exhibit_Rule§ \n\n如果您需要更多的信息,请您同我们联络,我们希望能够在“2015中国(深圳)国际钟表展览会 ”与您见面。 \n\n主办信息:\n2015中国(深圳)国际钟表展览会 \n电话:0755-82945180\n传真:0755-82941162 \n通信地址:深圳市福田保税区市花路福年广场B栋302室\n邮箱:davy@ewatch.cn\n\n\"\n )\n else\n mail( to: @viper.email,\n subject: \"您的申请已经审核通过\",\n from: \"fair@ewatch.cn\",\n date: Time.now,\n body: \"亲爱的客户:\n恭喜您!您所提交的资料已经审核通过,随后我们将会安排相关的工作人员与您联系,请您携带有效证件(身份证、参展商证)到展会现场领取晶品荟招待卡。\n\n\n\n\n展览时间:\n2015-06-25 至 2015-06-28 \n\n展览地点: \n深圳会展中心(1、9号馆) \n\n参观规则: \n §Exhibit_Rule§ \n\n如果您需要更多的信息,请您同我们联络,我们希望能够在“2015中国(深圳)国际钟表展览会 ”与您见面。 \n\n主办信息:\n2015中国(深圳)国际钟表展览会 \n电话:0755-82945180\n传真:0755-82941162 \n通信地址:深圳市福田保税区市花路福年广场B栋302室\n邮箱:davy@ewatch.cn\n\")\n end\n end", "def basic(customer,template)\n @body = Liquid::Template.parse(template.body)\n .render(\"person\" => customer.attributes)\n mail to: customer.email, subject: template.title\n end", "def investment_email(investor,investment_opportunity)\n @investor = investor\n @investment_opportunity = investment_opportunity\n mail(from: \"visitor@emergingfrontiers.com\",to: \"info@emergingfrontiers.com\",reply_to: @investor.email, subject: \"Emerging Frontiers Investment Inquiry\")\n end", "def admin_order_inform\n @greeting = \"Hi\"\n\n mail to: \"to@example.org\"\n end", "def send_home_form_email(lead)\n @lead = lead\n mail( :to => @lead.email,\n :subject => \"The answer you seek\" )\n end", "def allow_mails_from_merchant\n end", "def call(user, email, reward, shipping_address)\n @user = user\n @reward = reward\n # admin = \"astropowerbox@gmail.com\"\n admin = \"news.article.sysetm@gmail.com\"\n @shipping_address = shipping_address\n mail to: email, subject: 'Redemption details'\n end", "def send_to_paypal\n @cart = find_cart\n @order = session[:order]\n dump_cart_items(@order, @cart)\n Postoffice.deliver_new_order(@order, current_user.email)\n clear_session\n end", "def shipped(order)\r\n @order = order\r\n mail to: order.email, subject: 'Заказ из Pragmatic Store отправлен'\r\n end", "def order_shipped\n@greeting = \"Hi\"\nmail :to => \"to@example.org\"\nend", "def send_new_purchase_email(user)\n @user = user\n mail( :to => @user.email,\n :subject => 'Thank you for your purchase!')\n end", "def paypal_ipn\n notify = Paypal::Notification.new(request.raw_post)\n \n if notify.acknowledge\n transaction = Transaction.where(order_id: notify.params['invoice']).first\n if notify.complete? and transaction.gross_amount.to_s == notify.params['mc_gross']\n transaction.fee = notify.params['mc_fee']\n transaction.completed!\n else\n transaction.failed!\n end\n if transaction.save\n Mailatron4000::Orders.confirmation_email(transaction.order) rescue Rails.logger.warn(\"PayPal IPN: Order #{transaction.order.id} confirmation email failed to send\")\n end\n end\n\n render nothing: true\n end", "def payment_new(payment, payable, company_phone)\n @payment = payment\n @payable = payable\n @company_phone = company_phone\n @company = Company.find_by!(\n id: company_phone[:company_id]\n )\n emails = company_phone.extensions.admin\n mail(\n to: emails.map(&:email),\n subject: '¡En GurúComm hemos recibido tu pago!'\n )\n end", "def contact_owner(user)\n @user = user\n mail(to: 'christiansalas96@gmail.com', subject: 'Contact Us Form | Someone Reached Out!')\n end", "def confirm_booksbymail_email(user, bib, values)\n @to = \"bkbymail@pobox.upenn.edu\"\n @from = \"#{user.name} <#{user.data['email']}>\"\n @subject = \"Books by Mail Request\"\n\n @title = values['title']\n @bibid = values['bibid']\n @author = values['author']\n @publication = values['publication']\n @callno = values['call_no']\n @volume = values['volume']\n @comments = values[:comments]\n @patronname = user.name \n @patronemail = values['email']\n @pennid = user.data['penn_id']\n\n if Rails.env.development?\n @subject = \"TEST \" + @subject + \" (to: #{@to}, from: #{@from})\"\n @to = ENV['DEVELOPMENT_EMAIL']\n @from = ENV['DEVELOPMENT_EMAIL']\n end\n\n mail(to: @to,\n from: @from,\n subject: @subject,\n template_name: 'confirm_booksbymail')\n end", "def send_signup_email(user)\n @user = user\n @appointment = Appointment.where(id: @user.appointment_id).first\n mail(\n :to => @user.email,\n :bcc => \"acecprsd@gmail.com\",\n :subject => \"Ace CPR SD Sign-Up Confirmation ##{@user.id}\"\n )\n end", "def order_shipped(order)\n @order = order\n\n mail(to: @order.user.email , subject: 'Order Confirmation')\n end", "def order_confirmation_buyer(order)\n @order = order\n\n mail(\n to: @order.user.email,\n subject: \" Chouette, tu as commandé #{@order.meal.menu_name}!\"\n )\n end", "def reject(deal)\n @deal, @merchant = deal, deal.merchant\n @deal_url = merchant_promo_url(@merchant, @deal)\n \n mail :to => deal.merchant.email\n end", "def invoice\n @greeting = \"Hi\"\n\n mail to: \"ajayashok.01@gmail.com\"\n end", "def post_email(to_email, user)\n \tif user.name && user.full_name\n \t\ttext = \"#{user.full_name} (#{user.name}) posted to #{user.provider.capitalize} using Coupon Sociable!\"\n \telse\n \t\ttext = \"#{user.full_name} posted to #{user.provider.capitalize} using Coupon Sociable!\"\n \tend\n \t\n mail( :to => to_email, \n :subject => text,\n :body => text)\n end", "def shipped\n @greeting = \"Hi\"\n\n mail to: \"tariq.sulehir@khaleef.com\"\n end", "def produkt_bestilling_bekreftelse(order)\n @id = order.id\n @fullt_navn = \"#{order.company_detail.first_name} #{order.company_detail.last_name}\"\n @epost = order.company_detail.email\n @telefon = order.company_detail.phone\n @produkt = order.product.name\n @pris = order.total\n @adresse = order.company_detail.address\n @postnummer = order.company_detail.zip_code\n @design = order.design\n\n\n mail(to: \"logomakern@gmail.com\", subject: 'Ny produktbestilling er lagt inn på Logo Maker\\'n')\n end", "def received (payment)\n @payment = payment\n\n mail to: payment.user.email, subject: \"Подтверждение пополнения баланса на kupibazar.com\"\n end", "def received(order)\n @order = order\n mail to: order.email, subject: 'Подтверждение заказа в Card Shop'\nend", "def email_for_no_pto(full_name, pto, pto_type) \n Mail.defaults do\n delivery_method :smtp,\n address: \"email-smtp.us-east-1.amazonaws.com\",\n port: 587,\n :user_name => ENV['a3smtpuser'],\n :password => ENV['a3smtppass'],\n :enable_ssl => true\n end\n email_body = \"#{full_name[0]} #{full_name[1]} tried to request #{pto_type}and they have #{pto}PTO days left to request.<a href= 'https://wv-timesheet-clock.herokuapp.com/'> To Reply Click Here . </a>\"\n mail = Mail.new do\n from ENV['from']\n to 'wvtimeclockdev@gmail.com'\n subject \"PTO Request with no days to request\"\n \n html_part do\n content_type 'text/html'\n body email_body\n end\n end\n mail.deliver!\nend", "def tradeya_postponed(n)\n @tradeya = n.trade.item\n @offer = n.trade.offer\n headers['X-SMTPAPI'] = '{\"category\": \"TradeYa postponed offerer copy\"}'\n mail(:to => @offer.user.email, :subject => 'TradeYa has been Postponed', :from => 'TradeYa <jared@tradeya.com>', :content_type => \"text/html\")\n end", "def user_new_item_confirmation\n @greeting = \"Hi\"\n\n mail to: \"to@example.org\", subject: \"Item Confirmation\"\n end", "def confirmation_email(user, trip)\n @trip=Trip.find_by(:id => trip)\n @user= User.find_by(:id => user)\n @fbo= Fbo.find_by(:id => @trip.fbo_id)\n @airport = Airport.find_by(:id => @fbo.airport_id)\n @cost=@trip.cost\n @url = 'http://chartair.us/trips'\n mail(to: @user.email, subject: 'Trip Confirmation')\n end", "def fbo_email_fees(fbo, fbo_info)\n #information needed for email\n @fbo=fbo\n @email_from_fbo=fbo_info\n \n mail(to: 'madison@chartair.us', subject: 'FBO Price Information')\n end", "def order_send(order)\n @greeting = \"Hi\"\np 1111111111\np order\n @orde_email = order.email\n\n mail(:to => order.email, :subject => \"Your Order\")\n end", "def issued\n @greeting = \"Hi\"\n\n mail to: \"to@example.org\"\n end", "def thank_you\n # debugger\n @order_date = DateTime.now\n @shipping = 20000\n @total = order_subtotal + @shipping\n order = {\n \"total\" => @total,\n \"shipping\" => @shipping,\n \"items\" => session[:purchase]\n }\n # debugger\n OrderMailer.order_confirmation(session[:address], order).deliver_now\n end", "def food_mail(email)\n\n @url = 'http://foodcircles.net/?app=mobile_email'\n mail(:to => email, :reply_to => 'jk@joinfoodcircles.org', :subject => \"Your appetite is powerful.\")\n end", "def first_contact\n\n mail(\n to:\n cc:\n subject: \"We will contact you soon!\"\n )\n end", "def general_account_information(person, options = {})\n @person = person\n\n mail(:to => [@person.personal_email],\n :subject => options[:subject] || \"Account information (\" + @person.email + \")\",\n :date => Time.now)\n\n end", "def order_shipped\n @greeting = \"Hi\"\n\n mail :to => order.email , :subject => 'Congratulations Your Order is Succesfully Shipped..... Thanks for Shopping with us!!!!!'\n end", "def problem (payment)\n @payment = payment\n\n mail to: payment.user.email, subject: \"Ууупс, проблема с подтверждением Вашего платежа на kupibazar.com\"\n end", "def send_email\n true\n end", "def payment_request_to_buyer(order_param, atts = {})\n around_mail_action(:payment_request_to_buyer, order_param, atts) do\n return true unless EffectiveOrders.mailer[:send_payment_request_to_buyer]\n\n @order = (order_param.kind_of?(Effective::Order) ? order_param : Effective::Order.find(order_param))\n @user = @order.user\n\n @subject = subject_for(@order, :payment_request_to_buyer, \"Request for Payment: Invoice ##{@order.to_param}\")\n\n mail({to: @order.email, cc: @order.cc, subject: @subject}.compact)\n end\n end", "def guest_fbo_email(airport, fbo, state, city, employee_name, email)\n \n @airport=airport\n @fbo=fbo\n @state=state\n @city=city\n @employee_name=employee_name\n @email=email\n \n mail(to: 'madison@chartair.us', subject: 'FBO Price Information')\n end", "def shipped (order)\n @order=order\n\n mail to: order.email, subject: \"You are receiveing the first Mail from Depot App\"\n end", "def confirm\n @greeting = \"Hi\"\n\n mail to: \"proales@proales.com\"\n end", "def sent_suggest_inquiry(contact)\n @contact = contact\n mail(:to => @contact.email, :subject => \"Your suggestion has been sent to Feya Candle\")\n end", "def inquiry(member)\n @member = member\n mail to: @member.email\n end", "def send_cart_mail(user)\n \n mail to: user.email, subject: \"Cart\", from:'charlienoreply@gmail.com'\n end", "def site_page_form\n @greeting = \"Hi\"\n\n mail :to => \"sale@putivetra.ru\"\n end", "def send_order_email\n\t mail( :to => 'ashley@asiancomco.com',\n\t :subject => 'Order' )\n\t end", "def order_received\n @greeting = \"Hi\"\n\n mail to: \"to@example.org\"\n end", "def reservation_confirmation\n @greeting = \"Hi\"\n\n mail to: \"to@example.org\"\n end", "def acceptance_email ucr\n extract_variables ucr\n\n mail to: @user.email\n end" ]
[ "0.7228104", "0.69622606", "0.6925633", "0.691114", "0.68244267", "0.6745754", "0.67181855", "0.66886914", "0.6684846", "0.6678822", "0.66547906", "0.6645421", "0.6624651", "0.6618962", "0.66142327", "0.6586017", "0.65782166", "0.65730214", "0.65532655", "0.65532655", "0.65532655", "0.65532655", "0.6550752", "0.6549299", "0.65430695", "0.6541887", "0.65314364", "0.6529096", "0.65200603", "0.65184057", "0.6497096", "0.6487127", "0.6466643", "0.64583004", "0.6455436", "0.64547163", "0.64431274", "0.6440781", "0.6434324", "0.6425491", "0.64163333", "0.64159137", "0.6411343", "0.63934016", "0.6390922", "0.6384826", "0.63803566", "0.63776165", "0.6376142", "0.6373788", "0.6373484", "0.6371191", "0.6365032", "0.63642955", "0.63640773", "0.63609123", "0.63560855", "0.6355339", "0.63499403", "0.6344872", "0.634201", "0.63408124", "0.63402843", "0.6334954", "0.6331955", "0.633078", "0.63264704", "0.63250476", "0.6323821", "0.63089705", "0.6302184", "0.62971175", "0.62930024", "0.6291657", "0.6291582", "0.6288106", "0.6282821", "0.62794566", "0.62780136", "0.6276718", "0.6276454", "0.6275099", "0.62742907", "0.6272726", "0.6271503", "0.62668824", "0.6259851", "0.6251183", "0.6239988", "0.6236946", "0.62343603", "0.62339747", "0.6232335", "0.6232045", "0.6231245", "0.6226113", "0.62234926", "0.62191194", "0.62166184", "0.62166137" ]
0.6705325
7
GET /user_work_skills GET /user_work_skills.json
def index @user_work_experience_role = UserWorkExperienceRole.find_by(id: params[:user_work_experience_role_id]) @user_work_experience = UserWorkExperience.find_by(id: @user_work_experience_role.user_work_experience_id) @skill_inventories = SkillInventory.includes(:user_work_skills,:skill_category).where(:"user_work_skills.user_work_experience_role_id" => @user_work_experience_role.id) render layout: 'home' end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_skills\n @user = User.find(params[:id])\n @user_skill = UserSkill.where(\"user_id = @user.id\")\n end", "def index\n if params[:id]\n @skills = Skill.where(id:params[:id])\n elsif params[:user_id]\n @skills = Skill.where(user_id:params[:user_id])\n elsif params[:name]\n @skills = Skill.where(name:params[:name])\n else\n @skills = Skill.includes(:user).all() #fix n+1 query\n end\n render json: @skills\n end", "def index\n @skills = current_user.skills.all\n end", "def list_skills\n\t\trender json: Skill.where(language_id: params[:language_id]).to_json\n\tend", "def skills(id={}, options={})\n options = parse_id(id, options)\n path = \"#{profile_path(options, false)}/skills\"\n get(path, options)\n end", "def index\n @skills = @user.skills\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @skills }\n end\n end", "def index\n @skills = Skill.all\n\n render json: @skills\n end", "def index\n @issue_skills = IssueSkill.all\n render json: @issue_skills\n end", "def test_get_skills_route\n render :json => get_profile_skills_for_profile(\"https://www.linkedin.com/in/marissamayer\").to_json\n end", "def show\n @user_skill = UserSkill.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user_skill }\n end\n end", "def set_user\n @user = User.find(params[:id])\n @skills = Skill.all\n @my_skills = @user.skills.all.map { |k| k[:name] }\n end", "def show\n if params[:user_id]\n @user = User.find(params[:user_id])\n @skill = @user.skills.where(id:params[:id])\n render json: @skill\n elsif params[:id]\n @skill = Skill.where(id:params[:id])\n render json: @skill\n elsif params[:name]\n @skill = Skill.where(name:params[:name])\n render json: @skill\n else\n render json: {result:'nothing found'}\n end\n end", "def index\n @skills_users = SkillsUser.all\n end", "def skills\n respond_with get_tags_for_contexts([\"skills\", \"reject_skills\"], params[:exclude_tags])\n end", "def index\n @skill_user_profiles = SkillUserProfile.all\n\n render json: @skill_user_profiles\n end", "def index\n @myskills = Myskill.all\n end", "def index\n\t\tauthorize! :read, Skill\n\t\t\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @skills }\n end\n end", "def set_user_work_skill\n @user_work_skill = UserWorkSkill.find(params[:id])\n end", "def show\n @skill = @user.skills.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @skill }\n end\n end", "def show\n @skill = @user.skills.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @skill }\n end\n end", "def index\n @desired_skills = DesiredSkill.all\n end", "def show\n render json: @skill_user_profile\n end", "def skills\n\t\t[]\n\tend", "def set_skills_user\n @skills_user = SkillsUser.find(params[:id])\n end", "def index\n @skills = Skill.all\n skills = Skill.all.map { |skill| [skill.name, skill.id] }\n @options = skills.unshift(['指定なし', nil])\n\n if params[:skill_id].present?\n @users = User.joins(:skills).where(skills: { id: params[:skill_id] })\n else\n @users = User.all\n end\n end", "def desired_skill_params\n params.require(:desired_skill).permit(:user_id, :skill_id)\n end", "def create\n respond_to do |format|\n begin\n if params[\"skills_user\"][\"user_id\"]\n skill_id = params[\"skills_user\"][\"skill_id\"]\n user_ids = params[\"skills_user\"][\"user_id\"].reject{ |c| c.empty? }\n user_ids.each do |user_id|\n SkillsUser.create(skill_id: skill_id, user_id: user_id)\n end\n format.html { redirect_to skills_users_path, notice: 'Skills user was successfully created.' }\n end\n rescue\n format.html { render :new }\n format.json { render json: @skills_user.errors, status: :unprocessable_entity }\n end\n end\n end", "def skills_user_params\n # params.fetch(:skills_user, {})\n params.require(:skills_user).permit(:user_id, :skill_id)\n end", "def user_work_skill_params\n params.require(:user_work_skill).permit(:total_experience, :last_time_used, :last_time_used_duration_years, :refresher, :notes,:user_work_experience_role_id,:skill_inventory_id,:id)\n end", "def index\n @admin_skills = Admin::Skill.all\n\n render json: @admin_skills\n end", "def skills_view(skills)\n skills.map { |skill| skill_view(skill) }\n end", "def index\n\t@skills = Skill.all\n end", "def index\n @skills = Skill.all\n end", "def index\n @skills = Skill.all\n end", "def user_skill_params\n params.fetch(:user_skill, {})\n end", "def index\n @projects_skills = ProjectsSkill.all\n end", "def show\n render json: @skill\n end", "def index\n @user = User.find(params[:user_id])\n unless can? :index, @user\n authorize! :index, WorkingExperience, :message => 'Not authorized as an administrator.'\n end\n @working_experiences = @user.working_experiences\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @working_experiences }\n end\n end", "def index\n @computer_skills = current_user.computer_skills.all\n @computerSkillList = ComputerSkillList.all\n @skillLevel = SkillLevel.all\n end", "def show\n @skill = Skill.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @skill }\n end\n end", "def index\n @current_skills = CurrentSkill.all\n end", "def index\n @users = User.where(banned: false).order(:name).includes(:skills)\n\n @users = @users.ilike(:name, params[:query]) unless params[:query].blank?\n @users = @users.tagged_with(params[:skills]) unless params[:skills].blank?\n\n @tags = User.tag_counts_on(:skills)\n @latest_users = User.where(banned: false).limit(3).order('created_at desc')\n\n respond_to do |format|\n format.html { render :index }\n format.json { render json: @users }\n end\n end", "def create\n @skill = @user.skills.new(params[:skill])\n\n respond_to do |format|\n if @skill.save\n flash[:notice] = 'Skill was successfully created.'\n format.html { redirect_to(user_skills_path(@user)) }\n else\n format.html { render :action => \"new\" }\n end\n end\n end", "def index\n @s_skills = SSkill.all\n end", "def current_skill_params\n params.require(:current_skill).permit(:user_id, :skill_id)\n end", "def show\n @mostsmallskill = Mostsmallskill.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @mostsmallskill }\n end\n end", "def index\n @special_skills = SpecialSkill.all\n end", "def index\n @profession_skills = ProfessionSkill.all\n end", "def update\n @skill = @user.skills.find(params[:id])\n\n respond_to do |format|\n if @skill.update_attributes(params[:skill])\n flash[:notice] = 'Skill was successfully updated.'\n format.html { redirect_to(user_skills_path(@user)) }\n else\n format.html { render :action => \"edit\" }\n end\n end\n end", "def create\n @saved_skills, @unsaved_skills = [], []\n Skill.parse(params[:skills]).each do |skill|\n s = Skill.new(:name => skill, :user => current_user)\n begin\n s.save!\n @saved_skills << skill\n rescue\n @unsaved_skills << skill\n end\n end\n\n respond_to do |format|\n if @saved_skills.size > 0\n flash[:notice] = \"Skills successfully created: #{@saved_skills.join(', ')}\"\n unless @unsaved_skills.empty?\n flash[:warning] = \"Couldn't save the following skills: #{@unsaved_skills.join(', ')}\"\n end\n format.html { redirect_to(user_skills_path(current_user)) }\n format.xml { render :xml => @saved_skills, :status => :created }\n else\n flash[:error] = \"Couldn't save the following skills: #{@unsaved_skills.join(', ')}\"\n format.html { render :action => \"new\" }\n format.xml { render :xml => @unsaved_skills, :status => :unprocessable_entity }\n end\n end\n end", "def index\n @user_skills = UserSkill.all.where(user_id: current_user)\n @result = @user_skills\n @result_first = @user_skills.first\n end", "def update\n respond_to do |format|\n if @user_work_skill.update(user_work_skill_params)\n format.html { redirect_to action:\"index\",:user_work_experience_role_id=>@user_work_skill.user_work_experience_role_id }\n format.json { render :show, status: :ok, location: @user_work_skill }\n else\n format.html { render :edit }\n format.json { render json: @user_work_skill.errors, status: :unprocessable_entity }\n end\n end\n end", "def get_routing_skills_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: RoutingApi.get_routing_skills ...\"\n end\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n # resource path\n local_var_path = \"/api/v2/routing/skills\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n query_params[:'pageSize'] = opts[:'page_size'] if opts[:'page_size']\n query_params[:'pageNumber'] = opts[:'page_number'] if opts[:'page_number']\n query_params[:'name'] = opts[:'name'] if opts[:'name']\n query_params[:'id'] = @api_client.build_collection_param(opts[:'id'], :multi) if opts[:'id']\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n local_header_accept = ['application/json']\n local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result\n\n # HTTP header 'Content-Type'\n local_header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n auth_names = ['PureCloud OAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SkillEntityListing')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: RoutingApi#get_routing_skills\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def new\n @user_skill = UserSkill.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user_skill }\n end\n end", "def user_skill_params\n params.require(:user_skill_form).permit(:skill_3380,:skill_3388)\n end", "def get_users_bo_skills\n self.work_subtypes.find(:all ,:include =>[:work_type=>[:category]], :conditions =>{:work_types =>{:categories =>{:has_complexity=>'true'}}})\n end", "def get_skills_with_scores \n self.skills.map do |skill|\n score = skill.grades.find_by(user_id: self.id).score\n {skill: skill, score: score}\n end\n end", "def update\n respond_to do |format|\n if @skills_user.update(skills_user_params)\n format.html { redirect_to @skills_user, notice: 'Skills user was successfully updated.' }\n format.json { render :show, status: :ok, location: @skills_user }\n else\n format.html { render :edit }\n format.json { render json: @skills_user.errors, status: :unprocessable_entity }\n end\n end\n end", "def skillsNeeded\n\t\t[]\n\tend", "def create\n @user_skill = UserSkill.new(params[:user_skill])\n\n respond_to do |format|\n if @user_skill.save\n format.html { redirect_to @user_skill, notice: 'User skill was successfully created.' }\n format.json { render json: @user_skill, status: :created, location: @user_skill }\n else\n format.html { render action: \"new\" }\n format.json { render json: @user_skill.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @buildskills = Buildskill.all\n end", "def get_routing_skills_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: RoutingApi.get_routing_skills ...\"\n end\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n # resource path\n local_var_path = \"/api/v2/routing/skills\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n query_params[:'pageSize'] = opts[:'page_size'] if opts[:'page_size']\n query_params[:'pageNumber'] = opts[:'page_number'] if opts[:'page_number']\n query_params[:'name'] = opts[:'name'] if opts[:'name']\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n local_header_accept = ['application/json']\n local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result\n\n # HTTP header 'Content-Type'\n local_header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n auth_names = ['PureCloud Auth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SkillEntityListing')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: RoutingApi#get_routing_skills\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def index\n @culinary_skills = CulinarySkill.all\n end", "def set_user_skill\n @user_skill = UserSkill.find(params[:id])\n end", "def skill_params\n params.require(:skill).permit(:profile_id, :name, :level, :logo)\n end", "def index\n @skill_levels = SkillLevel.all\n end", "def pick_skills_for_lilly\n assigned_skills = []\n unassigned_skills = []\n unless params[:sp_id].nil? or params[:sp_id].blank?\n assigned_skills = ServiceProvider.find(params[:sp_id]).skills.collect {|e| e.skill}\n unassigned_skills = Physical::Liviaservices::SkillType.find(:all).find_all {|e| !assigned_skills.include?(e)}\n end\n\t\tsp_list = ServiceProvider.find(:all)\n sp_id = params[:sp_id]\n\t\trender :partial => \"assign_skill\", :locals=> {:sp_list=>sp_list, :sp_id=>sp_id, :assigned_skills=>assigned_skills,:unassigned_skills=>unassigned_skills}\n\tend", "def proficiency_for(skill)\n SkillsUser.find_by_user_id_and_skill_id(self.id, skill.id).skill_level\n end", "def skill_params\n params.require(:skill).permit(:name,:user_id)\n end", "def update\n @skill = current_user.skills.find(params[:id])\n\n respond_to do |format|\n if @skill.update_attributes(params[:skill])\n flash[:notice] = 'Skill was successfully updated.'\n format.html { redirect_to(user_skills_path(current_user)) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @skill.errors, :status => :unprocessable_entity }\n end\n end\n end", "def show\n @employee = Employee.find(params[:id], :include=> :skills)\n end", "def show\n render json: @admin_skill\n end", "def skill_params\n params.permit(:name, :assignee_id, :assignee_name, :user_id) #.require(:skill) figure out what this does\n end", "def update\n @user_skill = UserSkill.find(params[:id])\n\n respond_to do |format|\n if @user_skill.update_attributes(params[:user_skill])\n format.html { redirect_to @user_skill, notice: 'User skill was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user_skill.errors, status: :unprocessable_entity }\n end\n end\n end", "def show\n @user = User.includes(:skill_tags,:industry_tags).find(params[:id])\n \n end", "def set_skill\n @skill = @project.skills.find(params[:skillId])\n end", "def index\n @opening_skills = OpeningSkill.all\n end", "def show\n @skill_tag = SkillTag.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @skill_tag }\n end\n end", "def index\n @crew_skills = CrewSkill.all\n end", "def create\n user_work_experience_role_id = params[:user_work_skill][:user_work_experience_role_id]\n\n @user_work_experience_role = UserWorkExperienceRole.find_by_id(user_work_experience_role_id)\n @user_work_skill = @user_work_experience_role.user_work_skills.new(user_work_skill_params)\n\n respond_to do |format|\n puts \"ACTION: ATTEMPTING TO SAVE\" \n \n if @user_work_skill.save\n puts \"SAVED: SAVED SUCCESS\"\n format.html { redirect_to action: \"index\", :user_work_experience_role_id => user_work_experience_role_id}\n format.json { render :show, status: :created, location: @user_work_skill }\n else\n @user_work_skill.errors.full_messages.each do |message|\n puts \"ERROR : #{message}\"\n end\n\n\n format.html { render :new }\n format.json { render json: @user_work_skill.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n if !skill_already_exists?(skill_params)\n ## Find Skill in db , if it already exists, just take that otherwise create new\n @skill = Skill.all.where(title: skill_params[:title]).where(level: skill_params[:level]).first\n if @skill == nil\n @skill = Skill.new(skill_params)\n respond_to do |format|\n if @skill.save\n current_user.skills << @skill\n\n format.html { redirect_to @skill, notice: 'Skill was successfully created.' }\n format.json { render :show, status: :created, location: @skill }\n else\n format.html { render :new }\n format.json { render json: @skill.errors, status: :unprocessable_entity }\n end\n end\n else\n current_user.skills << @skill\n respond_to do |format|\n format.html { redirect_to @skill, notice: 'Skill was successfully added to your Profile. ' }\n format.json { render :show, status: :created, location: @skill }\n end\n end\n else\n respond_to do |format|\n format.html { redirect_to skills_path, :flash => { :error => \"This Skill already Exists\" } }\n end\n end\n end", "def index\n @skill_categories = SkillCategory.includes(:skills)\n # @skills = Skill.all\n end", "def show\n @skill_set = SkillSet.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @skill_set }\n end\n end", "def set_user_skill\n @user_skill = UserSkill.find_by(id: user_skill_params[:user_skill_id])\n end", "def show\n @skill = Skill.find(params[:id])\n\t\tauthorize! :read, Skill\n\t\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @skill }\n end\n end", "def index\n @users = User.where(banned: false, public_profile: true).order(:name).includes(:skills)\n\n @users = @users.ilike(:name, params[:query]) unless params[:query].blank?\n @users = @users.tagged_with(params[:skills]) unless params[:skills].blank?\n\n @tags = User.tag_counts_on(:skills).order('taggings_count DESC')\n end", "def new\n @skill = @user.skills.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @skill }\n end\n end", "def index\n @skill_lists = SkillList.all\n end", "def index\n @resumes = Resume.all\n render json: @resumes, include: %i[headers educations work_experiences skills]\n end", "def show\n @individual_skill_record = IndividualSkillRecord.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @individual_skill_record }\n end\n end", "def create\n @current_user = current_user\n @user_work_experience = @current_user.user_work_experiences.new(user_work_experience_params)\n\n respond_to do |format|\n if @user_work_experience.save\n format.html { redirect_to action: \"index\", notice: 'User work experience was successfully created.' }\n format.json { render :show, status: :created, location: @user_work_experience }\n else\n format.html { render :new }\n format.json { render json: @user_work_experience.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n # params = params.permit(:skills = [])\n # skills = params[:skills]\n # skills = skills.delete_if { |s| s.blank? }\n #\n # @projects = Project.where( # TODO\n\n @projects = Project.all\n end", "def index\n\n @skills = Skill.all\n @engineers = Engineer.select_engineer_with_skills.page(params[:page])\n @jobs = Job.all\n @desire_to_works = DesireToWork.all\n\n end", "def set_skill\n @skill = @character.skills.find(params[:id])\n end", "def set_myskill\n @myskill = Myskill.find(params[:id])\n end", "def skill_params\n params.require(:skill).permit(:skill_name, :skill_category_id)\n end", "def show\n @skillinstance = Skillinstance.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @skillinstance }\n end\n end", "def show\n @crew_member_skill = CrewMemberSkill.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @crew_member_skill }\n end\n end", "def skill_params\n params.require(:skill).permit(:name)\n end", "def index\n @warriors = Warrior.all\n render :json => @warriors, :include => [:skills, :equipment_lists,]\n\n end" ]
[ "0.7509374", "0.71328115", "0.70986575", "0.69688535", "0.6967232", "0.69478595", "0.6845694", "0.68431205", "0.68178016", "0.6808735", "0.6794626", "0.67935795", "0.6763454", "0.673417", "0.66102004", "0.66086113", "0.66054326", "0.6598565", "0.65531975", "0.65531975", "0.6529707", "0.6529599", "0.65093404", "0.6494353", "0.64919835", "0.64138335", "0.6413005", "0.6408088", "0.6406379", "0.6398986", "0.63889986", "0.637584", "0.6374488", "0.6374488", "0.63313437", "0.62797093", "0.6277146", "0.62515193", "0.6229886", "0.6220057", "0.620052", "0.6189685", "0.6146314", "0.6111035", "0.60961205", "0.6085775", "0.6081856", "0.6058623", "0.6045071", "0.6042065", "0.6034661", "0.60312694", "0.60278964", "0.6024064", "0.60176677", "0.6015902", "0.60147965", "0.60032314", "0.60017776", "0.59857535", "0.597365", "0.5973106", "0.5957069", "0.5956693", "0.59357625", "0.5929029", "0.59193593", "0.5915925", "0.5904642", "0.5903347", "0.58895594", "0.5886104", "0.58789134", "0.5871606", "0.58587205", "0.5847692", "0.5844657", "0.5835948", "0.5830415", "0.58250403", "0.58169293", "0.581128", "0.5799808", "0.5797997", "0.57942635", "0.5779337", "0.57788223", "0.57763547", "0.57644904", "0.5752582", "0.5732538", "0.57246333", "0.5724329", "0.57234997", "0.5722348", "0.5720745", "0.5715754", "0.57146466", "0.57081187", "0.5703228" ]
0.57295173
91
GET /user_work_skills/1 GET /user_work_skills/1.json
def show render layout: 'home' end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_skills\n @user = User.find(params[:id])\n @user_skill = UserSkill.where(\"user_id = @user.id\")\n end", "def index\n if params[:id]\n @skills = Skill.where(id:params[:id])\n elsif params[:user_id]\n @skills = Skill.where(user_id:params[:user_id])\n elsif params[:name]\n @skills = Skill.where(name:params[:name])\n else\n @skills = Skill.includes(:user).all() #fix n+1 query\n end\n render json: @skills\n end", "def show\n @user_skill = UserSkill.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user_skill }\n end\n end", "def index\n @issue_skills = IssueSkill.all\n render json: @issue_skills\n end", "def index\n @skills = current_user.skills.all\n end", "def index\n @skills = Skill.all\n\n render json: @skills\n end", "def show\n if params[:user_id]\n @user = User.find(params[:user_id])\n @skill = @user.skills.where(id:params[:id])\n render json: @skill\n elsif params[:id]\n @skill = Skill.where(id:params[:id])\n render json: @skill\n elsif params[:name]\n @skill = Skill.where(name:params[:name])\n render json: @skill\n else\n render json: {result:'nothing found'}\n end\n end", "def set_user_work_skill\n @user_work_skill = UserWorkSkill.find(params[:id])\n end", "def list_skills\n\t\trender json: Skill.where(language_id: params[:language_id]).to_json\n\tend", "def index\n @skills = @user.skills\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @skills }\n end\n end", "def skills(id={}, options={})\n options = parse_id(id, options)\n path = \"#{profile_path(options, false)}/skills\"\n get(path, options)\n end", "def test_get_skills_route\n render :json => get_profile_skills_for_profile(\"https://www.linkedin.com/in/marissamayer\").to_json\n end", "def set_user\n @user = User.find(params[:id])\n @skills = Skill.all\n @my_skills = @user.skills.all.map { |k| k[:name] }\n end", "def show\n @skill = @user.skills.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @skill }\n end\n end", "def show\n @skill = @user.skills.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @skill }\n end\n end", "def index\n @myskills = Myskill.all\n end", "def show\n render json: @skill_user_profile\n end", "def index\n @skill_user_profiles = SkillUserProfile.all\n\n render json: @skill_user_profiles\n end", "def index\n @skills_users = SkillsUser.all\n end", "def index\n\t\tauthorize! :read, Skill\n\t\t\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @skills }\n end\n end", "def index\n @desired_skills = DesiredSkill.all\n end", "def desired_skill_params\n params.require(:desired_skill).permit(:user_id, :skill_id)\n end", "def show\n @skill = Skill.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @skill }\n end\n end", "def user_work_skill_params\n params.require(:user_work_skill).permit(:total_experience, :last_time_used, :last_time_used_duration_years, :refresher, :notes,:user_work_experience_role_id,:skill_inventory_id,:id)\n end", "def index\n @admin_skills = Admin::Skill.all\n\n render json: @admin_skills\n end", "def set_skills_user\n @skills_user = SkillsUser.find(params[:id])\n end", "def skills\n respond_with get_tags_for_contexts([\"skills\", \"reject_skills\"], params[:exclude_tags])\n end", "def index\n @skills = Skill.all\n skills = Skill.all.map { |skill| [skill.name, skill.id] }\n @options = skills.unshift(['指定なし', nil])\n\n if params[:skill_id].present?\n @users = User.joins(:skills).where(skills: { id: params[:skill_id] })\n else\n @users = User.all\n end\n end", "def show\n @mostsmallskill = Mostsmallskill.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @mostsmallskill }\n end\n end", "def show\n render json: @skill\n end", "def index\n @user_skills = UserSkill.all.where(user_id: current_user)\n @result = @user_skills\n @result_first = @user_skills.first\n end", "def index\n @skills = Skill.all\n end", "def index\n @skills = Skill.all\n end", "def index\n\t@skills = Skill.all\n end", "def create\n respond_to do |format|\n begin\n if params[\"skills_user\"][\"user_id\"]\n skill_id = params[\"skills_user\"][\"skill_id\"]\n user_ids = params[\"skills_user\"][\"user_id\"].reject{ |c| c.empty? }\n user_ids.each do |user_id|\n SkillsUser.create(skill_id: skill_id, user_id: user_id)\n end\n format.html { redirect_to skills_users_path, notice: 'Skills user was successfully created.' }\n end\n rescue\n format.html { render :new }\n format.json { render json: @skills_user.errors, status: :unprocessable_entity }\n end\n end\n end", "def skills\n\t\t[]\n\tend", "def update\n respond_to do |format|\n if @user_work_skill.update(user_work_skill_params)\n format.html { redirect_to action:\"index\",:user_work_experience_role_id=>@user_work_skill.user_work_experience_role_id }\n format.json { render :show, status: :ok, location: @user_work_skill }\n else\n format.html { render :edit }\n format.json { render json: @user_work_skill.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @projects_skills = ProjectsSkill.all\n end", "def skills_user_params\n # params.fetch(:skills_user, {})\n params.require(:skills_user).permit(:user_id, :skill_id)\n end", "def current_skill_params\n params.require(:current_skill).permit(:user_id, :skill_id)\n end", "def skills_view(skills)\n skills.map { |skill| skill_view(skill) }\n end", "def index\n @current_skills = CurrentSkill.all\n end", "def create\n @skill = @user.skills.new(params[:skill])\n\n respond_to do |format|\n if @skill.save\n flash[:notice] = 'Skill was successfully created.'\n format.html { redirect_to(user_skills_path(@user)) }\n else\n format.html { render :action => \"new\" }\n end\n end\n end", "def user_skill_params\n params.fetch(:user_skill, {})\n end", "def index\n @user = User.find(params[:user_id])\n unless can? :index, @user\n authorize! :index, WorkingExperience, :message => 'Not authorized as an administrator.'\n end\n @working_experiences = @user.working_experiences\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @working_experiences }\n end\n end", "def create\n user_work_experience_role_id = params[:user_work_skill][:user_work_experience_role_id]\n\n @user_work_experience_role = UserWorkExperienceRole.find_by_id(user_work_experience_role_id)\n @user_work_skill = @user_work_experience_role.user_work_skills.new(user_work_skill_params)\n\n respond_to do |format|\n puts \"ACTION: ATTEMPTING TO SAVE\" \n \n if @user_work_skill.save\n puts \"SAVED: SAVED SUCCESS\"\n format.html { redirect_to action: \"index\", :user_work_experience_role_id => user_work_experience_role_id}\n format.json { render :show, status: :created, location: @user_work_skill }\n else\n @user_work_skill.errors.full_messages.each do |message|\n puts \"ERROR : #{message}\"\n end\n\n\n format.html { render :new }\n format.json { render json: @user_work_skill.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @user_skill = UserSkill.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user_skill }\n end\n end", "def update\n @skill = @user.skills.find(params[:id])\n\n respond_to do |format|\n if @skill.update_attributes(params[:skill])\n flash[:notice] = 'Skill was successfully updated.'\n format.html { redirect_to(user_skills_path(@user)) }\n else\n format.html { render :action => \"edit\" }\n end\n end\n end", "def index\n @special_skills = SpecialSkill.all\n end", "def index\n @computer_skills = current_user.computer_skills.all\n @computerSkillList = ComputerSkillList.all\n @skillLevel = SkillLevel.all\n end", "def create\n @user_skill = UserSkill.new(params[:user_skill])\n\n respond_to do |format|\n if @user_skill.save\n format.html { redirect_to @user_skill, notice: 'User skill was successfully created.' }\n format.json { render json: @user_skill, status: :created, location: @user_skill }\n else\n format.html { render action: \"new\" }\n format.json { render json: @user_skill.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_skill\n @skill = @project.skills.find(params[:skillId])\n end", "def show\n @individual_skill_record = IndividualSkillRecord.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @individual_skill_record }\n end\n end", "def index\n @profession_skills = ProfessionSkill.all\n end", "def index\n @s_skills = SSkill.all\n end", "def get_users_bo_skills\n self.work_subtypes.find(:all ,:include =>[:work_type=>[:category]], :conditions =>{:work_types =>{:categories =>{:has_complexity=>'true'}}})\n end", "def show\n @skill_set = SkillSet.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @skill_set }\n end\n end", "def create\n if !skill_already_exists?(skill_params)\n ## Find Skill in db , if it already exists, just take that otherwise create new\n @skill = Skill.all.where(title: skill_params[:title]).where(level: skill_params[:level]).first\n if @skill == nil\n @skill = Skill.new(skill_params)\n respond_to do |format|\n if @skill.save\n current_user.skills << @skill\n\n format.html { redirect_to @skill, notice: 'Skill was successfully created.' }\n format.json { render :show, status: :created, location: @skill }\n else\n format.html { render :new }\n format.json { render json: @skill.errors, status: :unprocessable_entity }\n end\n end\n else\n current_user.skills << @skill\n respond_to do |format|\n format.html { redirect_to @skill, notice: 'Skill was successfully added to your Profile. ' }\n format.json { render :show, status: :created, location: @skill }\n end\n end\n else\n respond_to do |format|\n format.html { redirect_to skills_path, :flash => { :error => \"This Skill already Exists\" } }\n end\n end\n end", "def set_user_skill\n @user_skill = UserSkill.find(params[:id])\n end", "def update\n @user_skill = UserSkill.find(params[:id])\n\n respond_to do |format|\n if @user_skill.update_attributes(params[:user_skill])\n format.html { redirect_to @user_skill, notice: 'User skill was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user_skill.errors, status: :unprocessable_entity }\n end\n end\n end", "def show\n @skillinstance = Skillinstance.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @skillinstance }\n end\n end", "def show\n @create_request_skill = CreateRequestSkill.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @create_request_skill }\n end\n end", "def show\n render json: @admin_skill\n end", "def user_skill_params\n params.require(:user_skill_form).permit(:skill_3380,:skill_3388)\n end", "def skill_params\n params.require(:skill).permit(:name,:user_id)\n end", "def update\n @skill = current_user.skills.find(params[:id])\n\n respond_to do |format|\n if @skill.update_attributes(params[:skill])\n flash[:notice] = 'Skill was successfully updated.'\n format.html { redirect_to(user_skills_path(current_user)) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @skill.errors, :status => :unprocessable_entity }\n end\n end\n end", "def index\n @buildskills = Buildskill.all\n end", "def set_myskill\n @myskill = Myskill.find(params[:id])\n end", "def show\n @skill_tag = SkillTag.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @skill_tag }\n end\n end", "def show\n @employee = Employee.find(params[:id], :include=> :skills)\n end", "def set_skill\n @skill = @character.skills.find(params[:id])\n end", "def skill_params\n params.require(:skill).permit(:profile_id, :name, :level, :logo)\n end", "def get_routing_skills_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: RoutingApi.get_routing_skills ...\"\n end\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n # resource path\n local_var_path = \"/api/v2/routing/skills\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n query_params[:'pageSize'] = opts[:'page_size'] if opts[:'page_size']\n query_params[:'pageNumber'] = opts[:'page_number'] if opts[:'page_number']\n query_params[:'name'] = opts[:'name'] if opts[:'name']\n query_params[:'id'] = @api_client.build_collection_param(opts[:'id'], :multi) if opts[:'id']\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n local_header_accept = ['application/json']\n local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result\n\n # HTTP header 'Content-Type'\n local_header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n auth_names = ['PureCloud OAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SkillEntityListing')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: RoutingApi#get_routing_skills\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def update\n respond_to do |format|\n if @skills_user.update(skills_user_params)\n format.html { redirect_to @skills_user, notice: 'Skills user was successfully updated.' }\n format.json { render :show, status: :ok, location: @skills_user }\n else\n format.html { render :edit }\n format.json { render json: @skills_user.errors, status: :unprocessable_entity }\n end\n end\n end", "def pick_skills_for_lilly\n assigned_skills = []\n unassigned_skills = []\n unless params[:sp_id].nil? or params[:sp_id].blank?\n assigned_skills = ServiceProvider.find(params[:sp_id]).skills.collect {|e| e.skill}\n unassigned_skills = Physical::Liviaservices::SkillType.find(:all).find_all {|e| !assigned_skills.include?(e)}\n end\n\t\tsp_list = ServiceProvider.find(:all)\n sp_id = params[:sp_id]\n\t\trender :partial => \"assign_skill\", :locals=> {:sp_list=>sp_list, :sp_id=>sp_id, :assigned_skills=>assigned_skills,:unassigned_skills=>unassigned_skills}\n\tend", "def show\n @skill = Skill.find(params[:id])\n\t\tauthorize! :read, Skill\n\t\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @skill }\n end\n end", "def index\n @culinary_skills = CulinarySkill.all\n end", "def show\n @crew_member_skill = CrewMemberSkill.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @crew_member_skill }\n end\n end", "def proficiency_for(skill)\n SkillsUser.find_by_user_id_and_skill_id(self.id, skill.id).skill_level\n end", "def create\n @saved_skills, @unsaved_skills = [], []\n Skill.parse(params[:skills]).each do |skill|\n s = Skill.new(:name => skill, :user => current_user)\n begin\n s.save!\n @saved_skills << skill\n rescue\n @unsaved_skills << skill\n end\n end\n\n respond_to do |format|\n if @saved_skills.size > 0\n flash[:notice] = \"Skills successfully created: #{@saved_skills.join(', ')}\"\n unless @unsaved_skills.empty?\n flash[:warning] = \"Couldn't save the following skills: #{@unsaved_skills.join(', ')}\"\n end\n format.html { redirect_to(user_skills_path(current_user)) }\n format.xml { render :xml => @saved_skills, :status => :created }\n else\n flash[:error] = \"Couldn't save the following skills: #{@unsaved_skills.join(', ')}\"\n format.html { render :action => \"new\" }\n format.xml { render :xml => @unsaved_skills, :status => :unprocessable_entity }\n end\n end\n end", "def skill_params\n params.permit(:name, :assignee_id, :assignee_name, :user_id) #.require(:skill) figure out what this does\n end", "def new\n @skill = @user.skills.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @skill }\n end\n end", "def index\n @skill_levels = SkillLevel.all\n end", "def get_routing_skills_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: RoutingApi.get_routing_skills ...\"\n end\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n # resource path\n local_var_path = \"/api/v2/routing/skills\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n query_params[:'pageSize'] = opts[:'page_size'] if opts[:'page_size']\n query_params[:'pageNumber'] = opts[:'page_number'] if opts[:'page_number']\n query_params[:'name'] = opts[:'name'] if opts[:'name']\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n local_header_accept = ['application/json']\n local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result\n\n # HTTP header 'Content-Type'\n local_header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n auth_names = ['PureCloud Auth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SkillEntityListing')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: RoutingApi#get_routing_skills\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n @desired_skill = DesiredSkill.new(desired_skill_params)\n\n respond_to do |format|\n if @desired_skill.save\n format.html { redirect_to @desired_skill, notice: 'Desired skill was successfully created.' }\n format.json { render :show, status: :created, location: @desired_skill }\n else\n format.html { render :new }\n format.json { render json: @desired_skill.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @myskill = Myskill.new(myskill_params)\n respond_to do |format|\n if @myskill.save\n format.html { redirect_to @myskill, notice: 'Myskill was successfully created.' }\n format.json { render :show, status: :created, location: @myskill }\n else\n format.html { render :new }\n format.json { render json: @myskill.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @current_user = current_user\n @user_work_experience = @current_user.user_work_experiences.new(user_work_experience_params)\n\n respond_to do |format|\n if @user_work_experience.save\n format.html { redirect_to action: \"index\", notice: 'User work experience was successfully created.' }\n format.json { render :show, status: :created, location: @user_work_experience }\n else\n format.html { render :new }\n format.json { render json: @user_work_experience.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @users = User.where(banned: false).order(:name).includes(:skills)\n\n @users = @users.ilike(:name, params[:query]) unless params[:query].blank?\n @users = @users.tagged_with(params[:skills]) unless params[:skills].blank?\n\n @tags = User.tag_counts_on(:skills)\n @latest_users = User.where(banned: false).limit(3).order('created_at desc')\n\n respond_to do |format|\n format.html { render :index }\n format.json { render json: @users }\n end\n end", "def update\n respond_to do |format|\n if @desired_skill.update(desired_skill_params)\n format.html { redirect_to @desired_skill, notice: 'Desired skill was successfully updated.' }\n format.json { render :show, status: :ok, location: @desired_skill }\n else\n format.html { render :edit }\n format.json { render json: @desired_skill.errors, status: :unprocessable_entity }\n end\n end\n end", "def show\n @skill_suggestion = SkillSuggestion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @skill_suggestion }\n end\n end", "def skillsNeeded\n\t\t[]\n\tend", "def skill_params\n params.require(:skill).permit(:skill_name, :skill_category_id)\n end", "def skill_params\n params.require(:skill).permit(:name)\n end", "def create\n @skill = Skill.new(skill_params)\n\n if @skill.save\n render json: @skill, status: :created, location: @skill\n else\n render json: @skill.errors, status: :unprocessable_entity\n end\n end", "def index\n @skill_lists = SkillList.all\n end", "def index\n @user_work_experience_role = UserWorkExperienceRole.find_by(id: params[:user_work_experience_role_id])\n @user_work_experience = UserWorkExperience.find_by(id: @user_work_experience_role.user_work_experience_id)\n @skill_inventories = SkillInventory.includes(:user_work_skills,:skill_category).where(:\"user_work_skills.user_work_experience_role_id\" => @user_work_experience_role.id)\n render layout: 'home'\n end", "def get_skills_with_scores \n self.skills.map do |skill|\n score = skill.grades.find_by(user_id: self.id).score\n {skill: skill, score: score}\n end\n end", "def set_user_skill\n @user_skill = UserSkill.find_by(id: user_skill_params[:user_skill_id])\n end", "def set_skill\n @skill = Skill.all.find(params[:id])\n end", "def index\n @skill_categories = SkillCategory.includes(:skills)\n # @skills = Skill.all\n end", "def set_skill\n @skill = Skill.find(params[:id])\n end" ]
[ "0.7304121", "0.714873", "0.6937032", "0.68924606", "0.6878287", "0.6857654", "0.6837119", "0.6822634", "0.68094826", "0.6794314", "0.6773726", "0.66820616", "0.66520387", "0.664569", "0.664569", "0.66118103", "0.660106", "0.659733", "0.6573303", "0.6570311", "0.6542668", "0.65030247", "0.6471716", "0.64689636", "0.64251053", "0.6418555", "0.641804", "0.64045817", "0.6383575", "0.6382057", "0.6375805", "0.6360312", "0.6360312", "0.635319", "0.6349614", "0.6342074", "0.63212216", "0.6301007", "0.62334675", "0.6225923", "0.6203246", "0.61981153", "0.61980087", "0.61888963", "0.61835366", "0.61781365", "0.61652076", "0.6165026", "0.6147121", "0.61445045", "0.6127007", "0.6114658", "0.61004454", "0.60924625", "0.6071194", "0.60706383", "0.6069313", "0.60655653", "0.6064367", "0.60576487", "0.6055976", "0.60509425", "0.6049725", "0.604722", "0.6032284", "0.6026698", "0.60252416", "0.60211164", "0.6010377", "0.5994838", "0.59823644", "0.5978689", "0.5978306", "0.59737825", "0.5965537", "0.59652966", "0.5965112", "0.5963203", "0.59553546", "0.5946731", "0.5915427", "0.5907937", "0.5906336", "0.5901026", "0.5890161", "0.58847594", "0.5878136", "0.58716065", "0.5865226", "0.5860033", "0.5855129", "0.5853721", "0.5850288", "0.58405906", "0.58402294", "0.5835936", "0.5833112", "0.5818519", "0.58138293", "0.5810164", "0.58093756" ]
0.0
-1
POST /user_work_skills POST /user_work_skills.json
def create user_work_experience_role_id = params[:user_work_skill][:user_work_experience_role_id] @user_work_experience_role = UserWorkExperienceRole.find_by_id(user_work_experience_role_id) @user_work_skill = @user_work_experience_role.user_work_skills.new(user_work_skill_params) respond_to do |format| puts "ACTION: ATTEMPTING TO SAVE" if @user_work_skill.save puts "SAVED: SAVED SUCCESS" format.html { redirect_to action: "index", :user_work_experience_role_id => user_work_experience_role_id} format.json { render :show, status: :created, location: @user_work_skill } else @user_work_skill.errors.full_messages.each do |message| puts "ERROR : #{message}" end format.html { render :new } format.json { render json: @user_work_skill.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n respond_to do |format|\n begin\n if params[\"skills_user\"][\"user_id\"]\n skill_id = params[\"skills_user\"][\"skill_id\"]\n user_ids = params[\"skills_user\"][\"user_id\"].reject{ |c| c.empty? }\n user_ids.each do |user_id|\n SkillsUser.create(skill_id: skill_id, user_id: user_id)\n end\n format.html { redirect_to skills_users_path, notice: 'Skills user was successfully created.' }\n end\n rescue\n format.html { render :new }\n format.json { render json: @skills_user.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @skill = @user.skills.new(params[:skill])\n\n respond_to do |format|\n if @skill.save\n flash[:notice] = 'Skill was successfully created.'\n format.html { redirect_to(user_skills_path(@user)) }\n else\n format.html { render :action => \"new\" }\n end\n end\n end", "def create\n @user_skill = UserSkill.new(params[:user_skill])\n\n respond_to do |format|\n if @user_skill.save\n format.html { redirect_to @user_skill, notice: 'User skill was successfully created.' }\n format.json { render json: @user_skill, status: :created, location: @user_skill }\n else\n format.html { render action: \"new\" }\n format.json { render json: @user_skill.errors, status: :unprocessable_entity }\n end\n end\n end", "def user_work_skill_params\n params.require(:user_work_skill).permit(:total_experience, :last_time_used, :last_time_used_duration_years, :refresher, :notes,:user_work_experience_role_id,:skill_inventory_id,:id)\n end", "def desired_skill_params\n params.require(:desired_skill).permit(:user_id, :skill_id)\n end", "def create\n @saved_skills, @unsaved_skills = [], []\n Skill.parse(params[:skills]).each do |skill|\n s = Skill.new(:name => skill, :user => current_user)\n begin\n s.save!\n @saved_skills << skill\n rescue\n @unsaved_skills << skill\n end\n end\n\n respond_to do |format|\n if @saved_skills.size > 0\n flash[:notice] = \"Skills successfully created: #{@saved_skills.join(', ')}\"\n unless @unsaved_skills.empty?\n flash[:warning] = \"Couldn't save the following skills: #{@unsaved_skills.join(', ')}\"\n end\n format.html { redirect_to(user_skills_path(current_user)) }\n format.xml { render :xml => @saved_skills, :status => :created }\n else\n flash[:error] = \"Couldn't save the following skills: #{@unsaved_skills.join(', ')}\"\n format.html { render :action => \"new\" }\n format.xml { render :xml => @unsaved_skills, :status => :unprocessable_entity }\n end\n end\n end", "def skills_user_params\n # params.fetch(:skills_user, {})\n params.require(:skills_user).permit(:user_id, :skill_id)\n end", "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", "def user_skill_params\n params.require(:user_skill_form).permit(:skill_3380,:skill_3388)\n end", "def create\n @desired_skill = DesiredSkill.new(desired_skill_params)\n\n respond_to do |format|\n if @desired_skill.save\n format.html { redirect_to @desired_skill, notice: 'Desired skill was successfully created.' }\n format.json { render :show, status: :created, location: @desired_skill }\n else\n format.html { render :new }\n format.json { render json: @desired_skill.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @skill = Skill.new(skill_params)\n\n if @skill.save\n render json: @skill, status: :created, location: @skill\n else\n render json: @skill.errors, status: :unprocessable_entity\n end\n end", "def create\n @user_skill_form = UserSkillForm.new(user_skill_params)\n\n respond_to do |format|\n if @user_skill_form.save(get_current_user_id)\n format.html { redirect_to user_skills_url, notice: 'User skill was successfully updated.' }\n format.json { render :index, status: :created, location: @user_skill_form }\n else\n format.html { render :index }\n format.json { render json: @user_skill_form.errors, status: :unprocessable_entity }\n end\n end\n end", "def skill_params\n params.permit(:name, :assignee_id, :assignee_name, :user_id) #.require(:skill) figure out what this does\n end", "def skill_params\n params.require(:skill).permit(:name,:user_id)\n end", "def create\n @myskill = Myskill.new(myskill_params)\n respond_to do |format|\n if @myskill.save\n format.html { redirect_to @myskill, notice: 'Myskill was successfully created.' }\n format.json { render :show, status: :created, location: @myskill }\n else\n format.html { render :new }\n format.json { render json: @myskill.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @current_user = current_user\n @user_work_experience = @current_user.user_work_experiences.new(user_work_experience_params)\n\n respond_to do |format|\n if @user_work_experience.save\n format.html { redirect_to action: \"index\", notice: 'User work experience was successfully created.' }\n format.json { render :show, status: :created, location: @user_work_experience }\n else\n format.html { render :new }\n format.json { render json: @user_work_experience.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n if !skill_already_exists?(skill_params)\n ## Find Skill in db , if it already exists, just take that otherwise create new\n @skill = Skill.all.where(title: skill_params[:title]).where(level: skill_params[:level]).first\n if @skill == nil\n @skill = Skill.new(skill_params)\n respond_to do |format|\n if @skill.save\n current_user.skills << @skill\n\n format.html { redirect_to @skill, notice: 'Skill was successfully created.' }\n format.json { render :show, status: :created, location: @skill }\n else\n format.html { render :new }\n format.json { render json: @skill.errors, status: :unprocessable_entity }\n end\n end\n else\n current_user.skills << @skill\n respond_to do |format|\n format.html { redirect_to @skill, notice: 'Skill was successfully added to your Profile. ' }\n format.json { render :show, status: :created, location: @skill }\n end\n end\n else\n respond_to do |format|\n format.html { redirect_to skills_path, :flash => { :error => \"This Skill already Exists\" } }\n end\n end\n end", "def skill_params\n params.require(:skill).permit(:name, :experience, :typeOfSkill)\n end", "def set_user_work_skill\n @user_work_skill = UserWorkSkill.find(params[:id])\n end", "def skill_params\n params.require(:skill).permit(:profile_id, :name, :level, :logo)\n end", "def skill_params\n params.require(:skill).permit(:skill_name, :skill_category_id)\n end", "def skill_params\n params.require(:skill).permit(:name)\n end", "def create\n @projects_skill = ProjectsSkill.new(projects_skill_params)\n\n respond_to do |format|\n if @projects_skill.save\n format.html { redirect_to @projects_skill, notice: 'Projects skill was successfully created.' }\n format.json { render :show, status: :created, location: @projects_skill }\n else\n format.html { render :new }\n format.json { render json: @projects_skill.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n byebug\n @admin_skill = Admin::Skill.new(admin_skill_params)\n\n if @admin_skill.save\n render json: @admin_skill, status: :created, location: @admin_skill\n else\n render json: @admin_skill.errors, status: :unprocessable_entity\n end\n end", "def current_skill_params\n params.require(:current_skill).permit(:user_id, :skill_id)\n end", "def create\n @special_skill = SpecialSkill.new(special_skill_params)\n\n respond_to do |format|\n if @special_skill.save\n format.html { redirect_to @special_skill, notice: 'Special skill was successfully created.' }\n format.json { render :show, status: :created, location: @special_skill }\n else\n format.html { render :new }\n format.json { render json: @special_skill.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @user = User.find(session[:user_id])\n @proyecto = Proyecto.new(proyecto_params)\n @user.proyectos << @proyecto\n @proyecto.update(empresa_id: @user.id)\n #it gets values from skill \n params[:proskill][:skill_ids] ||= []\n skills = params[:proskill][:skill_ids]\n skills.each do |skill|\n @proskill = Proskill.new(skill_id: skill, proyecto_id: @proyecto.id)\n @proskill.save\n end\n\n respond_to do |format|\n if @proyecto.save\n format.html { redirect_to @proyecto, notice: 'Proyecto was successfully created.' }\n format.json { render :show, status: :created, location: @proyecto }\n else\n format.html { render :new }\n format.json { render json: @proyecto.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @skill = Skill.new(params[:skill])\n\n respond_to do |format|\n if @skill.save\n format.html { redirect_to @skill, notice: 'Skill was successfully created.' }\n format.json { render json: @skill, status: :created, location: @skill }\n else\n format.html { render action: \"new\" }\n format.json { render json: @skill.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @issue_skill = IssueSkill.new(issue_skill_params)\n @issue_skill.save\n render json: @issue_skill\n\n # respond_to do |format|\n # if @issue_skill.save\n # format.html { redirect_to @issue_skill, notice: \"Issue skill was successfully created.\" }\n # format.json { render :show, status: :created, location: @issue_skill }\n # else\n # format.html { render :new, status: :unprocessable_entity }\n # format.json { render json: @issue_skill.errors, status: :unprocessable_entity }\n # end\n # end\n end", "def create\n\t\t@skill = @resume.skills.new({\n\t\t\t:name => 'Name',\n\t\t\t:level_id => 1,\n\t\t\t:start_date_string => Date.today.to_s,\n\t\t\t:end_date_string => Date.today.to_s\n\t\t})\n\t\t@skill.save!\n\trescue\n\t\tflash.now[:error] = 'Skill creation FAILED!'\n\t\trender :text => ''\n\tend", "def create\n skill = Skill.new(skill_params)\n \n if skill.save\n render json: {status: 'SUCCESS', message:'Saved skill', data:skill},status: :ok\n else\n render json: {status: 'ERROR', message:'Skill not saved', data:skill.errors},status: :unprocessable_entity\n end\n end", "def skill_params\n params.require(:skill).permit(:title, :percen_utilized)\n end", "def create\n @profession_skill = ProfessionSkill.new(profession_skill_params)\n\n respond_to do |format|\n if @profession_skill.save\n format.html { redirect_to @profession_skill, notice: 'Profession skill was successfully created.' }\n format.json { render :show, status: :created, location: @profession_skill }\n else\n format.html { render :new }\n format.json { render json: @profession_skill.errors, status: :unprocessable_entity }\n end\n end\n end", "def skill_params\n params.require(:skill).permit( :name, :skill_category_id )\n end", "def skill_params\n params.require(:skill).permit(:title, :percent_used, :badge)\n end", "def skill_params\n params.require(:skill).permit(:name, :description)\n end", "def skill_params\n params.require(:skill).permit(:e_no, :battle_type, :set_no, :skill_id, :name)\n end", "def user_skill_params\n params.fetch(:user_skill, {})\n end", "def learnable_skill_params\n params.require(:learnable_skill).permit(:chara_type, :job_id, :skill_no, :sp, :skill_id)\n end", "def skill_params\n params.require(:skill).permit(:skill_category_id, :name, :description, :approved)\n end", "def skill_params\n params.require(:skill).permit(:title, :level)\n end", "def create\n @currency = Currency.all\n @time_unity = TimeUnity.all\n @project = current_user.projects.build(project_params)\n\n # Create ProjectSkill\n params[:skills][:id].each do |skill|\n if !skill.empty?\n @project.project_skills.build(skill_id: skill)\n end\n end\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to project_show_path(@project), notice: 'Project was successfully created.' }\n format.json { render :show, status: :created, location: project_show_path(@project)}\n else\n format.html { render :new, alert: 'Error.' }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @skill = Skill.new(skill_params)\n\n respond_to do |format|\n if @skill.save\n format.html { redirect_to admin_skills_path, \n notice: 'Skill was successfully added.' }\n else\n format.html { render :new }\n end\n end\n end", "def crew_skill_params\n params.require(:crew_skill).permit(:crew_id, :skill_id)\n end", "def skill_params\n params.require(:skill).permit(:character_id, :name, :ability, :proficient)\n end", "def skill_params\n params.require(:skill).permit(:e_no, :set_no, :skill_type_id, :type_id, :nature_id, :skill_id, :name, :timing_id)\n end", "def set_skills_user\n @skills_user = SkillsUser.find(params[:id])\n end", "def find_skills\n @user = User.find(params[:id])\n @user_skill = UserSkill.where(\"user_id = @user.id\")\n end", "def add_skills(skill_names,created_by_id)\r\n job_seeker = JobSeeker.find(created_by_id)\r\n JobSeekerProficiency.delete_all(\"job_seeker_id = '#{self.id}'\")\r\n \r\n for skill in skill_names\r\n\r\n skill_split = skill.split(\"__\");\r\n skill_obj = Proficiency.find_by_name(skill_split[0])\r\n if skill_obj.nil?\r\n skill_obj = Proficiency.create({:name=>skill_split[0],:created_by=>created_by_id,:activated=>\"0\"})\r\n end\r\n\r\n JobSeekerProficiency.create!(:job_seeker_id => created_by_id, :proficiency_id => skill_obj.id, :education_id => skill_split[1].split(\"_\")[0], :skill_id => skill_split[2].split(\"_\")[0])\r\n\r\n end\r\n end", "def new_skill_params\n params.require(:new_skill).permit(:skill_id)\n end", "def create\n @mostsmallskill = Mostsmallskill.new(params[:mostsmallskill])\n\n respond_to do |format|\n if @mostsmallskill.save\n format.html { redirect_to @mostsmallskill, notice: 'Mostsmallskill was successfully created.' }\n format.json { render json: @mostsmallskill, status: :created, location: @mostsmallskill }\n else\n format.html { render action: \"new\" }\n format.json { render json: @mostsmallskill.errors, status: :unprocessable_entity }\n end\n end\n end", "def myskill_params\n params.require(:myskill).permit(:title)\n end", "def s_skill_params\n params.require(:s_skill).permit(:name, :desc, :difficulty, :first_attribute, :second_attribute)\n end", "def create\n @computer_skill = ComputerSkill.new(computer_skill_params)\n\n respond_to do |format|\n if @computer_skill.save\n format.html { redirect_to user_computer_skills_path, notice: 'Computer skill was successfully created.' }\n format.json { render :show, status: :created, location: @computer_skill }\n else\n format.html { render :new }\n format.json { render json: @computer_skill.errors, status: :unprocessable_entity }\n end\n end\n end", "def issue_skill_params\n params.require(:issue_skill).permit(:issue_id, :skill_id)\n end", "def create\n @create_request_skill = CreateRequestSkill.new(params[:create_request_skill])\n\n respond_to do |format|\n if @create_request_skill.save\n format.html { redirect_to @create_request_skill, notice: 'Create request skill was successfully created.' }\n format.json { render json: @create_request_skill, status: :created, location: @create_request_skill }\n else\n format.html { render action: \"new\" }\n format.json { render json: @create_request_skill.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @crew_skill = CrewSkill.new(crew_skill_params)\n\n respond_to do |format|\n if @crew_skill.save\n format.html { redirect_to @crew_skill, notice: 'Crew skill was successfully created.' }\n format.json { render :show, status: :created, location: @crew_skill }\n else\n format.html { render :new }\n format.json { render json: @crew_skill.errors, status: :unprocessable_entity }\n end\n end\n end", "def skill_params\n params.require(:skill).permit(:description, :name, :characteristic)\n\n end", "def create\n @skill_list = SkillList.new(skill_list_params)\n @skill_list.user_id = current_user.id\n respond_to do |format|\n if @skill_list.save\n format.html { redirect_to @skill_list, notice: 'Skill list was successfully created.' }\n format.json { render :show, status: :created, location: @skill_list }\n else\n format.html { render :new }\n format.json { render json: @skill_list.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_user\n @user = User.find(params[:id])\n @skills = Skill.all\n @my_skills = @user.skills.all.map { |k| k[:name] }\n end", "def create\n @current_skill = CurrentSkill.new(current_skill_params)\n\n respond_to do |format|\n if @current_skill.save\n format.html { redirect_to @current_skill, notice: 'Current skill was successfully created.' }\n format.json { render :show, status: :created, location: @current_skill }\n else\n format.html { render :new }\n format.json { render json: @current_skill.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @project = Project.new(params[:project])\n @project.skills = params[:skills]\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { render json: @project, status: :created, location: @project }\n else\n format.html { render action: \"new\" }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @s_skill = SSkill.new(s_skill_params)\n\n respond_to do |format|\n if @s_skill.save\n format.html { redirect_to @s_skill, notice: 'S skill was successfully created.' }\n format.json { render :show, status: :created, location: @s_skill }\n else\n format.html { render :new }\n format.json { render json: @s_skill.errors, status: :unprocessable_entity }\n end\n end\n end", "def projects_skill_params\n params.require(:projects_skill).permit(:id, :project_id, :skill_id, :created_at, :updated_at)\n end", "def skillset_params\n params.require(:skillset).permit(:skill, :hours_studied, :code, :subject_id)\n end", "def create\n @skill = Skill.new(params[:skill])\n\t\tauthorize! :create, Skill\n\t\n respond_to do |format|\n if @skill.save\n format.html { redirect_to skills_path, notice: 'Skill was successfully created.' }\n format.json { render json: @skill, status: :created, location: @skill }\n else\n format.html { render action: \"new\" }\n format.json { render json: @skill.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @person = Person.new(person_params)\n @person.user_id= current_user.id \n respond_to do |format|\n if @person.save\n if params[:skillid]!=nil\n params[:skillid].each do |i| \n\t\t @person.skills << Skill.find_by_id(i)\n\t\tend\n\t\tend\n format.html { redirect_to @person }\n format.json { render :show, status: :created, location: @person }\n else\n org=Organization.where( :user_id =>current_user.id)\n\t\tif org.nil?\n\t\t@groups=org.first.groups\n\t\t@skills=@groups.first.skills\n\t\telse\n\t\t@groups=Group.where( :user_id =>current_user.id)\n\t\t@skills=Skill.where( :user_id =>current_user.id)\n end\n format.html { render :new }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "def special_skill_params\n params.require(:special_skill).permit(:skill)\n end", "def create\n @opening_skill = OpeningSkill.new(opening_skill_params)\n\n respond_to do |format|\n if @opening_skill.save\n format.html { redirect_to @opening_skill, notice: 'Opening skill was successfully created.' }\n format.json { render :show, status: :created, location: @opening_skill }\n else\n format.html { render :new }\n format.json { render json: @opening_skill.errors, status: :unprocessable_entity }\n end\n end\n end", "def add_skills(skill_hash)\n char_skill_levels = self.skill_levels\n \n update_hash = Hash.new\n \n # For each character skill_level, index the \n # skill_level object with the skill name\n char_skill_levels.each do |sk|\n update_hash[sk.skill.name] = sk\n end\n\n skill_hash.each do |name, value|\n begin\n update_hash[name].level = value\n rescue NoMethodError\n sk = Skill.find_by_name( name )\n sl = SkillLevel.new\n sl.level = value\n sl.skill = sk\n skill_levels << sl\n end\n end\n \n update_hash.each do |k,v|\n v.save if v.changed?\n end\n end", "def exceller_skill_params\n params.require(:exceller_skill).permit(:exceller_id, :skill_id, :proficiency, :created_by, :modified_by, :deleted_at)\n end", "def create\n @buildskill = Buildskill.new(buildskill_params)\n\n respond_to do |format|\n if @buildskill.save\n format.html { redirect_to @buildskill, notice: 'Buildskill was successfully created.' }\n format.json { render :show, status: :created, location: @buildskill }\n else\n format.html { render :new }\n format.json { render json: @buildskill.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n # 検証。同一スキルカテゴリIDかつ同一スキル名を持っている場合はエラー\n @exist = Skill.where(skill_category_id: skill_params[:skill_category_id]).where(skill_name: skill_params[:skill_name])\n\n @skill = Skill.new(skill_params)\n @skill.has_learning_level=true\n \n logger.debug(\"skill\")\n logger.debug(@skill)\n\n if @exist.present? \n render json:{errors: 'already exists.', status: :unprocessable_entity }\n else\n if @skill.save\n render json:{skill: @skill}\n else\n render json:{errors: @skill.errors, status: :unprocessable_entity }\n end\n end\n\n end", "def update\n respond_to do |format|\n if @user_work_skill.update(user_work_skill_params)\n format.html { redirect_to action:\"index\",:user_work_experience_role_id=>@user_work_skill.user_work_experience_role_id }\n format.json { render :show, status: :ok, location: @user_work_skill }\n else\n format.html { render :edit }\n format.json { render json: @user_work_skill.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @exceller_skill = ExcellerSkill.new(exceller_skill_params)\n\n respond_to do |format|\n if @exceller_skill.save\n format.html { redirect_to @exceller_skill, notice: 'Exceller skill was successfully created.' }\n format.json { render :show, status: :created, location: @exceller_skill }\n else\n format.html { render :new }\n format.json { render json: @exceller_skill.errors, status: :unprocessable_entity }\n end\n end\n end", "def skill_params\n params[:skill].permit(:music_id, :user_id, :kind, :rate, :isfc, :comment) # define right permission\n end", "def computer_skill_params\n params.require(:computer_skill).permit!\n end", "def create\n @skill = Skill.new(skill_params)\n respond_to do |format|\n if @skill.save\n if @skill.approved == true # approved value is true if it is created by the Admin user\n format.html { redirect_to skill_categories_path, notice: 'Skill was successfully created.' }\n format.json { render :show, status: :created, location: @skill }\n else # approved value is false if it's created by the Host or Candidate, and it requires Admin's approval\n @candidate_skill = CandidateSkill.create(user_id: current_user.id, skill_id: @skill.id)\n @candidate_skill.save!\n NewlyAddedSkillMailer.approve_new_skill(@skill.id, current_user.id).deliver_now\n # format.html { redirect_to @skill, notice: 'Skill was successfully created.' }\n if params[:oppo_id].present?\n format.html { redirect_to required_skills_path(oppo_id: params[:oppo_id]), notice: 'Skill was successfully created.' }\n format.json { render :show, status: :created, location: @skill }\n else\n format.html { redirect_to my_skills_path, notice: 'Skill was successfully created.' }\n format.json { render :show, status: :created, location: @skill }\n end\n end\n else\n format.html { render :new }\n format.json { render json: @skill.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @skills_user.update(skills_user_params)\n format.html { redirect_to @skills_user, notice: 'Skills user was successfully updated.' }\n format.json { render :show, status: :ok, location: @skills_user }\n else\n format.html { render :edit }\n format.json { render json: @skills_user.errors, status: :unprocessable_entity }\n end\n end\n end", "def skill_name_params\n params.require(:skill_name).permit(:name)\n end", "def create\n @skill_name = SkillName.new(skill_name_params)\n\n respond_to do |format|\n if @skill_name.save\n format.html { redirect_to :back, notice: 'Skill name was successfully created.' }\n format.json { render :show, status: :created, location: @skill_name }\n else\n format.html { render :new }\n format.json { render json: @skill_name.errors, status: :unprocessable_entity }\n end\n end\n end", "def opening_skill_params\n params.require(:opening_skill).permit(:opening_id, :skill_id)\n end", "def create\n @culinary_skill = CulinarySkill.new(culinary_skill_params)\n\n respond_to do |format|\n if @culinary_skill.save\n format.html { redirect_to culinary_skills_path, notice: 'Culinary skill was successfully created.' }\n format.json { render :show, status: :created, location: @culinary_skill }\n format.js\n else\n format.html { render :new }\n format.json { render json: @culinary_skill.errors, status: :unprocessable_entity }\n format.js\n end\n end\n end", "def create\n @skill_level = SkillLevel.new(skill_level_params)\n\n respond_to do |format|\n if @skill_level.save\n format.html { redirect_to @skill_level, notice: 'Skill level was successfully created.' }\n format.json { render :show, status: :created, location: @skill_level }\n else\n format.html { render :new }\n format.json { render json: @skill_level.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_user_skill\n @user_skill = UserSkill.find_by(id: user_skill_params[:user_skill_id])\n end", "def skills\n respond_with get_tags_for_contexts([\"skills\", \"reject_skills\"], params[:exclude_tags])\n end", "def create\n @user = User.new(user_params)\n\n respond_to do |format|\n if @user.save\n session[:user_skill_ids] = params[:skill_ids] unless session[:user_is_admin?]\n LocationsSkillsUsers.create(@user.id, @user.location_id, params[:skill_ids]) if params[:skill_ids]\n\n format.html { redirect_to @user, notice: 'User was successfully created.' }\n format.json { render :show, status: :created, location: @user }\n else\n format.html { render :new }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @user_skill = UserSkill.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user_skill }\n end\n end", "def create\n\n @work = Work.new(work_params)\n @user = User.find(session[:user_id]) \n \n respond_to do |format|\n if @work.save\n @user.works << @work\n format.html { redirect_to @work, notice: 'La actividad se registro con exito.' }\n format.json { render :show, status: :created, location: @work }\n else\n format.html { render :new }\n format.json { render json: @work.errors, status: :unprocessable_entity }\n end\n end\n\n end", "def set_user_skill\n @user_skill = UserSkill.find(params[:id])\n end", "def skill_list_params\n params.require(:skill_list).permit(:title, :experience_length, :user_rating, :admin_rating, :user_notes, :admin_notes, :date_rated, :link)\n end", "def update\n @user_skill = UserSkill.find(params[:id])\n\n respond_to do |format|\n if @user_skill.update_attributes(params[:user_skill])\n format.html { redirect_to @user_skill, notice: 'User skill was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user_skill.errors, status: :unprocessable_entity }\n end\n end\n end", "def upload_skills\n puts 'Uploading Skills'\n\n skills_file = 'lib/textfiles/skills.txt'\n skills = []\n text = File.open(skills_file).read\n text.each_line do |line|\n tokens = line.split(\"\\t\").map(&:chomp)\n skills << Skill.new(category: tokens[0], name: tokens[1])\n end\n Skill.import(skills)\n end", "def create\n @other_skill = OtherSkill.new(other_skill_params)\n\n respond_to do |format|\n if @other_skill.save\n format.html { redirect_to other_skills_url, notice: 'Other skill was successfully created.' }\n else\n format.html { render :new }\n end\n end\n end", "def create\n @crew_member_skill = CrewMemberSkill.new(params[:crew_member_skill])\n\n respond_to do |format|\n if @crew_member_skill.save\n format.html { redirect_to @crew_member_skill, notice: 'Crew member skill was successfully created.' }\n format.json { render json: @crew_member_skill, status: :created, location: @crew_member_skill }\n else\n format.html { render action: \"new\" }\n format.json { render json: @crew_member_skill.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @skill = @user.skills.find(params[:id])\n\n respond_to do |format|\n if @skill.update_attributes(params[:skill])\n flash[:notice] = 'Skill was successfully updated.'\n format.html { redirect_to(user_skills_path(@user)) }\n else\n format.html { render :action => \"edit\" }\n end\n end\n end", "def skill_assessment_params\n params.require(:skill_assessment).permit(:user_id, :analytical_problem_solving_score, :conflict_management_score, :continuous_learning_score, :creativity_score, :customer_service_score, :decision_making_score, :diplomacy_score, :empathy_score, :employee_development_score, :flexibility_score, :futuristic_thinking_score, :goal_orientation_score, :interpersonal_skills_score, :leadership_score, :management_score, :negotiation_score, :personal_effectiveness_score, :persuasion_score, :planning_score, :presenting_score, :self_management_score, :teamwork_score, :written_communication_score)\n end", "def profession_skill_params\n params.require(:profession_skill).permit(:title)\n end", "def create\n @individual_skill_record = IndividualSkillRecord.new(params[:individual_skill_record])\n\n respond_to do |format|\n if @individual_skill_record.save\n format.html { redirect_to @individual_skill_record, :notice => 'Individual skill record was successfully created.' }\n format.json { render :json => @individual_skill_record, :status => :created, :location => @individual_skill_record }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @individual_skill_record.errors, :status => :unprocessable_entity }\n end\n end\n end", "def function_skill_params\n params.require(:function_skill).permit(:min, :recomended, :skill_id, :function_id, :cancel_url, :redirect_url)\n end" ]
[ "0.731443", "0.73023045", "0.7213907", "0.7183761", "0.71397376", "0.7125107", "0.6841065", "0.68301046", "0.68299854", "0.6799575", "0.67919403", "0.67768073", "0.67762285", "0.67728066", "0.67399436", "0.67308784", "0.66867733", "0.66721106", "0.6668681", "0.66686535", "0.66246283", "0.6611517", "0.6594563", "0.65831494", "0.6573248", "0.655061", "0.65497977", "0.6548528", "0.65465075", "0.65437937", "0.6542617", "0.6533398", "0.6528485", "0.6528439", "0.6524409", "0.6523586", "0.65213335", "0.6520325", "0.6509633", "0.6499819", "0.6493477", "0.6490408", "0.64838666", "0.64734805", "0.6452845", "0.6436831", "0.64226586", "0.640879", "0.6399334", "0.6390445", "0.6388969", "0.63798285", "0.63613576", "0.63565797", "0.6334322", "0.63174826", "0.6316665", "0.631526", "0.63045084", "0.62993765", "0.6282752", "0.62799644", "0.6249013", "0.623328", "0.62317634", "0.6223112", "0.6217956", "0.61593586", "0.6158231", "0.61569685", "0.6135369", "0.61332566", "0.61248803", "0.6123367", "0.6122495", "0.6110614", "0.61033654", "0.6102666", "0.610242", "0.6084928", "0.60769814", "0.6076446", "0.6073783", "0.60735583", "0.60734916", "0.6068898", "0.60675627", "0.6062097", "0.60602814", "0.6059389", "0.603147", "0.6029379", "0.6012055", "0.6010448", "0.6010357", "0.5998631", "0.5995013", "0.59871304", "0.5957049", "0.59491193" ]
0.69891775
6
PATCH/PUT /user_work_skills/1 PATCH/PUT /user_work_skills/1.json
def update respond_to do |format| if @user_work_skill.update(user_work_skill_params) format.html { redirect_to action:"index",:user_work_experience_role_id=>@user_work_skill.user_work_experience_role_id } format.json { render :show, status: :ok, location: @user_work_skill } else format.html { render :edit } format.json { render json: @user_work_skill.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @user_skill = UserSkill.find(params[:id])\n\n respond_to do |format|\n if @user_skill.update_attributes(params[:user_skill])\n format.html { redirect_to @user_skill, notice: 'User skill was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user_skill.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @skill = @user.skills.find(params[:id])\n\n respond_to do |format|\n if @skill.update_attributes(params[:skill])\n flash[:notice] = 'Skill was successfully updated.'\n format.html { redirect_to(user_skills_path(@user)) }\n else\n format.html { render :action => \"edit\" }\n end\n end\n end", "def update\n respond_to do |format|\n if @desired_skill.update(desired_skill_params)\n format.html { redirect_to @desired_skill, notice: 'Desired skill was successfully updated.' }\n format.json { render :show, status: :ok, location: @desired_skill }\n else\n format.html { render :edit }\n format.json { render json: @desired_skill.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @skill = Skill.find(params[:id])\n\n if @skill.update(skill_params)\n head :no_content\n else\n render json: @skill.errors, status: :unprocessable_entity\n end\n end", "def update\n @skill = current_user.skills.find(params[:id])\n\n respond_to do |format|\n if @skill.update_attributes(params[:skill])\n flash[:notice] = 'Skill was successfully updated.'\n format.html { redirect_to(user_skills_path(current_user)) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @skill.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @skills_user.update(skills_user_params)\n format.html { redirect_to @skills_user, notice: 'Skills user was successfully updated.' }\n format.json { render :show, status: :ok, location: @skills_user }\n else\n format.html { render :edit }\n format.json { render json: @skills_user.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @skill = Skill.find(params[:id])\n\n respond_to do |format|\n if @skill.update_attributes(params[:skill])\n format.html { redirect_to @skill, notice: 'Skill was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @skill.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @create_request_skill = CreateRequestSkill.find(params[:id])\n\n respond_to do |format|\n if @create_request_skill.update_attributes(params[:create_request_skill])\n format.html { redirect_to @create_request_skill, notice: 'Create request skill was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @create_request_skill.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @admin_skill = Admin::Skill.find(params[:id])\n\n if @admin_skill.update(admin_skill_params)\n head :no_content\n else\n render json: @admin_skill.errors, status: :unprocessable_entity\n end\n end", "def update\n @skill_user_profile = SkillUserProfile.find(params[:id])\n\n if @skill_user_profile.update(skill_user_profile_params)\n head :no_content\n else\n render json: @skill_user_profile.errors, status: :unprocessable_entity\n end\n end", "def update\n respond_to do |format|\n if @myskill.update(myskill_params)\n format.html { redirect_to @myskill, notice: 'Myskill was successfully updated.' }\n format.json { render :show, status: :ok, location: @myskill }\n else\n format.html { render :edit }\n format.json { render json: @myskill.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @skill.update(skill_params)\n format.html { redirect_to @skill, notice: 'Skill was successfully updated.' }\n format.json { render :show, status: :ok, location: @skill }\n else\n format.html { render :edit }\n format.json { render json: @skill.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @skill.update(skill_params)\n format.html { redirect_to @skill, notice: 'Skill was successfully updated.' }\n format.json { render :show, status: :ok, location: @skill }\n else\n format.html { render :edit }\n format.json { render json: @skill.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @mostsmallskill = Mostsmallskill.find(params[:id])\n\n respond_to do |format|\n if @mostsmallskill.update_attributes(params[:mostsmallskill])\n format.html { redirect_to @mostsmallskill, notice: 'Mostsmallskill was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @mostsmallskill.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @issue_skill.update(issue_skill_params)\n render json: @issue_skill\n # respond_to do |format|\n # if @issue_skill.update(issue_skill_params)\n # format.html { redirect_to @issue_skill, notice: \"Issue skill was successfully updated.\" }\n # format.json { render :show, status: :ok, location: @issue_skill }\n # else\n # format.html { render :edit, status: :unprocessable_entity }\n # format.json { render json: @issue_skill.errors, status: :unprocessable_entity }\n # end\n # end\n end", "def update\n respond_to do |format|\n if @profession_skill.update(profession_skill_params)\n format.html { redirect_to @profession_skill, notice: 'Profession skill was successfully updated.' }\n format.json { render :show, status: :ok, location: @profession_skill }\n else\n format.html { render :edit }\n format.json { render json: @profession_skill.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @user_work_experience.update(user_work_experience_params)\n format.html { redirect_to action: \"index\", notice: 'User work experience was successfully updated.' }\n format.json { render :show, status: :ok, location: @user_work_experience }\n else\n format.html { render :edit }\n format.json { render json: @user_work_experience.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @current_skill.update(current_skill_params)\n format.html { redirect_to @current_skill, notice: 'Current skill was successfully updated.' }\n format.json { render :show, status: :ok, location: @current_skill }\n else\n format.html { render :edit }\n format.json { render json: @current_skill.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @special_skill.update(special_skill_params)\n format.html { redirect_to @special_skill, notice: 'Special skill was successfully updated.' }\n format.json { render :show, status: :ok, location: @special_skill }\n else\n format.html { render :edit }\n format.json { render json: @special_skill.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @projects_skill.update(projects_skill_params)\n format.html { redirect_to @projects_skill, notice: 'Projects skill was successfully updated.' }\n format.json { render :show, status: :ok, location: @projects_skill }\n else\n format.html { render :edit }\n format.json { render json: @projects_skill.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @skill = Skill.find(params[:id])\n\t\tauthorize! :update, Skill\n\t\t\n respond_to do |format|\n if @skill.update_attributes(params[:skill])\n format.html { redirect_to skills_path, notice: 'Skill was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @skill.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\r\n @project_request = ProjectRequest.find(params[:id])\r\n @current_date = DateTime.now\r\n\r\n @project_request.relevant_skill = params[:relevant_skill].to_a\r\n @project_request.relevant_skill = @project_request.relevant_skill.join(\", \")\r\n @skills = Skill.all \r\n respond_to do |format|\r\n if @project_request.update_attributes(params[:project_request])\r\n @project_request.update_request_status(@project_request) \r\n format.html { redirect_to _my_requests_path }\r\n format.json { head :no_content }\r\n else\r\n format.html { render action: \"edit\" }\r\n format.json { render json: @project_request.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "def update\n @talent = Talent.find(params[:id])\n \n # Check if the array exists\n if params[:talent][:skill_ids]\n # Unset skills that have not been selected\n params[:talent][:skill_ids] ||= []\n else\n # if the array doesn't exist then delete all the skills associated\n # If it doesn't exist then the user un-checked all the skills\n @talent.skills.delete_all\n end \n \n respond_to do |format|\n if @talent.update_attributes(params[:talent])\n format.html { redirect_to @talent, :notice => 'Talent was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @talent.errors, :status => :unprocessable_entity }\n end\n end\n end", "def set_user_work_skill\n @user_work_skill = UserWorkSkill.find(params[:id])\n end", "def update\n authorize! :update, WorkingExperience, :message => 'Not authorized as an administrator.'\n @user = User.find(params[:user_id])\n @working_experience = @user.working_experiences.find(params[:id])\n\n respond_to do |format|\n if @working_experience.update_attributes(params[:working_experience])\n format.html { redirect_to user_working_experiences_path, notice: 'Working experience was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @working_experience.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @skill.update(skill_params)\n format.html { redirect_to admin_skills_path, \n notice: 'Skill was successfully updated.' }\n else\n format.html { render :edit }\n end\n end\n end", "def update\n respond_to do |format|\n if @computer_skill.update(computer_skill_params)\n format.html { redirect_to user_computer_skills_path, notice: 'Computer skill was successfully updated.' }\n format.json { render :show, status: :ok, location: @computer_skill }\n else\n format.html { render :edit }\n format.json { render json: @computer_skill.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @skill_set = SkillSet.find(params[:id])\n\n respond_to do |format|\n if @skill_set.update_attributes(params[:skill_set])\n format.html { redirect_to @skill_set, notice: 'Skill set was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @skill_set.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @person.update(person_params)\n @person.skills.delete_all\n if params[:skillid]!= nil\n params[:skillid].each do |i| \n\t\t @person.skills << Skill.find_by_id(i)\n\t\tend\n\t\tend\n format.html { redirect_to @person }\n format.json { render :show, status: :ok, location: @person }\n else\n @groups=@person.group.organization.groups.all\n @skills=@person.group.skills.all\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @skill_name.update(skill_name_params)\n format.html { redirect_to @skill_name, notice: 'Skill name was successfully updated.' }\n format.json { render :show, status: :ok, location: @skill_name }\n else\n format.html { render :edit }\n format.json { render json: @skill_name.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @crew_skill.update(crew_skill_params)\n format.html { redirect_to @crew_skill, notice: 'Crew skill was successfully updated.' }\n format.json { render :show, status: :ok, location: @crew_skill }\n else\n format.html { render :edit }\n format.json { render json: @crew_skill.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @s_skill.update(s_skill_params)\n format.html { redirect_to @s_skill, notice: 'S skill was successfully updated.' }\n format.json { render :show, status: :ok, location: @s_skill }\n else\n format.html { render :edit }\n format.json { render json: @s_skill.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @exceller_skill.update(exceller_skill_params)\n format.html { redirect_to @exceller_skill, notice: 'Exceller skill was successfully updated.' }\n format.json { render :show, status: :ok, location: @exceller_skill }\n else\n format.html { render :edit }\n format.json { render json: @exceller_skill.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @other_skill.update(other_skill_params)\n format.html { redirect_to other_skills_url, notice: 'Other skill was successfully updated.' }\n else\n format.html { render :edit }\n end\n end\n end", "def user_work_skill_params\n params.require(:user_work_skill).permit(:total_experience, :last_time_used, :last_time_used_duration_years, :refresher, :notes,:user_work_experience_role_id,:skill_inventory_id,:id)\n end", "def update\n @individual_skill_record = IndividualSkillRecord.find(params[:id])\n\n respond_to do |format|\n if @individual_skill_record.update_attributes(params[:individual_skill_record])\n format.html { redirect_to @individual_skill_record, :notice => 'Individual skill record was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @individual_skill_record.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @skill.update(skill_params)\n format.html { redirect_to @skill, notice: 'Blog was successfully updated.' } \n else\n format.html { render :edit }\n \n end\n end\n end", "def update\n respond_to do |format|\n if @buildskill.update(buildskill_params)\n format.html { redirect_to @buildskill, notice: 'Buildskill was successfully updated.' }\n format.json { render :show, status: :ok, location: @buildskill }\n else\n format.html { render :edit }\n format.json { render json: @buildskill.errors, status: :unprocessable_entity }\n end\n end\n end", "def desired_skill_params\n params.require(:desired_skill).permit(:user_id, :skill_id)\n end", "def update\n respond_to do |format|\n if @opening_skill.update(opening_skill_params)\n format.html { redirect_to @opening_skill, notice: 'Opening skill was successfully updated.' }\n format.json { render :show, status: :ok, location: @opening_skill }\n else\n format.html { render :edit }\n format.json { render json: @opening_skill.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @request = @skill.requests.find(params[:id])\n\n respond_to do |format|\n if @request.update_attributes(params[:request])\n format.html { redirect_to myrequests_path, notice: 'request was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @request.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @employee_skill = EmployeeSkill.find(params[:id])\n\n respond_to do |format|\n if @employee_skill.update_attributes(params[:employee_skill])\n format.html { redirect_to(@employee_skill, :notice => 'EmployeeSkill was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @employee_skill.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @crew_member_skill = CrewMemberSkill.find(params[:id])\n\n respond_to do |format|\n if @crew_member_skill.update_attributes(params[:crew_member_skill])\n format.html { redirect_to @crew_member_skill, notice: 'Crew member skill was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @crew_member_skill.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @skill_level.update(skill_level_params)\n format.html { redirect_to @skill_level, notice: 'Skill level was successfully updated.' }\n format.json { render :show, status: :ok, location: @skill_level }\n else\n format.html { render :edit }\n format.json { render json: @skill_level.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @culinary_skill.update(culinary_skill_params)\n format.html { redirect_to @culinary_skill, notice: 'Culinary skill was successfully updated.' }\n format.json { render :show, status: :ok, location: @culinary_skill }\n format.js\n else\n format.html { render :edit }\n format.json { render json: @culinary_skill.errors, status: :unprocessable_entity }\n format.js\n end\n end\n end", "def update\n\n respond_to do |format|\n errors = Work.update(current_user, params[:id], work_params)\n if !errors\n format.json { render json: {}, status: :ok }\n else\n format.json { render json: { error: errors }, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @skillset.update(skillset_params)\n format.html { redirect_to @skillset, notice: 'Skillset was successfully updated.' }\n format.json { render :show, status: :ok, location: @skillset }\n else\n format.html { render :edit }\n format.json { render json: @skillset.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @skill_tag = SkillTag.find(params[:id])\n\n respond_to do |format|\n if @skill_tag.update_attributes(params[:skill_tag])\n format.html { redirect_to @skill_tag, :notice => 'Hidden job was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @skill_tag.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @skillinstance = Skillinstance.find(params[:id])\n\n respond_to do |format|\n if @skillinstance.update_attributes(params[:skillinstance])\n format.html { redirect_to @skillinstance, notice: 'Skillinstance was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @skillinstance.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @skill_list.update(skill_list_params)\n format.html { redirect_to @skill_list, notice: 'Skill list was successfully updated.' }\n format.json { render :show, status: :ok, location: @skill_list }\n else\n format.html { render :edit }\n format.json { render json: @skill_list.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @skill_suggestion = SkillSuggestion.find(params[:id])\n\n respond_to do |format|\n if @skill_suggestion.update_attributes(params[:skill_suggestion])\n format.html { redirect_to @skill_suggestion, notice: 'Skill suggestion was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @skill_suggestion.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @areas_skill.update(areas_skill_params)\n format.html { redirect_to @areas_skill, notice: 'Areas skill was successfully updated.' }\n format.json { render :show, status: :ok, location: @areas_skill }\n else\n format.html { render :edit }\n format.json { render json: @areas_skill.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @employee.skills.destroy_all\n employee_find_skills\n set_avatar\n\n respond_to do |format|\n if @employee.update(employee_params)\n format.html { redirect_to @employee, notice: 'Employee was successfully updated.' }\n format.json { render :show, status: :ok, location: @employee }\n else\n format.html { render :edit }\n format.json { render json: @employee.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @work.update(work_params)\n format.html { redirect_to user_work_path(@user.id, @work.id), notice: 'Work was successfully updated.' }\n format.json { render :show, status: :ok, location: @work }\n else\n format.html { render :edit }\n format.json { render json: @work.errors, status: :unprocessable_entity }\n end \n end\n end", "def update\n @work = Work.find(params[:id])\n\n respond_to do |format|\n if @work.update_attributes(params[:work])\n format.html { redirect_to @work, notice: 'Work was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @work.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @player_ball_skill.update(player_ball_skill_params)\n format.html { redirect_to @player_ball_skill, notice: 'Player ball skill was successfully updated.' }\n format.json { render :show, status: :ok, location: @player_ball_skill }\n else\n format.html { render :edit }\n format.json { render json: @player_ball_skill.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @work = Work.find(params[:id])\n\n respond_to do |format|\n if @work.update_attributes(params[:work])\n format.html { redirect_to action: 'index', flash: {notice: 'Work item was successfully updated.' }}\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @work.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @skill_catagory.update(skill_catagory_params)\n format.html { redirect_to @skill_catagory, notice: 'Skill catagory was successfully updated.' }\n format.json { render :show, status: :ok, location: @skill_catagory }\n else\n format.html { render :edit }\n format.json { render json: @skill_catagory.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @working_experience.update(working_experience_params)\n format.html { redirect_to @working_experience, notice: 'Working experience was successfully updated.' }\n format.json { render :show, status: :ok, location: @working_experience }\n else\n format.html { render :edit }\n format.json { render json: @working_experience.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @my_posted_homework = MyPostedHomework.find(params[:id])\n\n respond_to do |format|\n if @my_posted_homework.update_attributes(params[:my_posted_homework])\n format.html { redirect_to @my_posted_homework, notice: 'My posted homework was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @my_posted_homework.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @howitwork.update(howitwork_params)\n format.html { redirect_to admin_howitwork_url(@howitwork), notice: 'Howitwork was successfully updated.' }\n format.json { render :show, status: :ok, location: @howitwork }\n else\n format.html { render :edit }\n format.json { render json: @howitwork.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @skill_slot.update(skill_slot_params)\n format.html { redirect_to @skill_slot, notice: 'Skill slot was successfully updated.' }\n format.json { render :show, status: :ok, location: @skill_slot }\n else\n format.html { render :edit }\n format.json { render json: @skill_slot.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @skill_assessment.update(skill_assessment_params)\n format.html { redirect_to @skill_assessment, notice: 'Skill assessment was successfully updated.' }\n format.json { render :show, status: :ok, location: @skill_assessment }\n else\n format.html { render :edit }\n format.json { render json: @skill_assessment.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_skills_user\n @skills_user = SkillsUser.find(params[:id])\n end", "def current_skill_params\n params.require(:current_skill).permit(:user_id, :skill_id)\n end", "def update\n respond_to do |format|\n if @workpermit.update(workpermit_params)\n format.html { redirect_to @workpermit, notice: 'Workpermit was successfully updated.' }\n format.json { render :show, status: :ok, location: @workpermit }\n else\n format.html { render :edit }\n format.json { render json: @workpermit.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_desired_skill\n @desired_skill = DesiredSkill.find(params[:id])\n end", "def set_skill\n @skill = @project.skills.find(params[:skillId])\n end", "def update\n respond_to do |format|\n if @applicant.update(applicant_params)\n update_skills\n format.html { redirect_to @applicant, notice: 'Applicant was successfully updated.' }\n format.json { render :show, status: :ok, location: @applicant }\n else\n format.html { render :edit }\n format.json { render json: @applicant.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @skill_level = SkillLevel.find(params[:id])\n\n respond_to do |format|\n if @skill_level.update_attributes(params[:skill_level])\n format.html { redirect_to(@skill_level, :notice => 'SkillLevel was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @skill_level.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @skill_tag = SkillTag.find(params[:id])\n\n respond_to do |format|\n if @skill_tag.update_attributes(params[:skill_tag])\n flash[:notice] = 'SkillTag was successfully updated.'\n format.html { redirect_to(@skill_tag) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @skill_tag.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update_skills(pokemon)\n pokemon.skills_set.compact!\n @skills.each_with_index do |skill_stack, index|\n skill_stack.data = pokemon.skills_set[index]\n end\n end", "def update\n params[:workout][:workout_date] = \"#{params[:workout][:workout_date]} #{params[:workout][:time]}\"\n params[:workout] = params[:workout].slice(:workout_date, :exercises_attributes)\n @lift_name = params[:workout][:exercises_attributes][\"0\"][:lift_id]\n params[:workout][:exercises_attributes][\"0\"][:lift_id] = Lift.find_by_lift_name(@lift_name).id\n @workout = Workout.find(params[:id])\n\n respond_to do |format|\n if @workout.update_attributes(params[:workout])\n format.html { redirect_to @workout, notice: 'Workout was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @workout.errors, status: :unprocessable_entity }\n end\n end\n end", "def skill_params\n params.require(:skill).permit(:name,:user_id)\n end", "def user_skill_params\n params.require(:user_skill_form).permit(:skill_3380,:skill_3388)\n end", "def update\n respond_to do |format|\n if @user.update(user_params)\n unless session[:user_is_admin?]\n session[:user_skill_ids] = params[:skill_ids].nil? ? nil : params[:skill_ids].map{ |elem| elem.to_i }\n session[:user_email] = params[:user_email]\n end\n LocationsSkillsUsers.update(@user.id, @user.location_id, params[:skill_ids]) if params[:skill_ids]\n\n format.html { redirect_to @user, notice: 'User was successfully updated.' }\n format.json { render :show, status: :ok, location: @user }\n else\n format.html { render :edit }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n @skills = Skill.all\n if @engineer.update(engineer_params)\n skills = []\n params['skills'].each do |skill|\n if skill[1]['year'].to_i > 0 || skill[1]['level'].to_i > 0\n skills.push({\n :skill_id => skill[1]['id'].to_i,\n :engineer_id => @engineer.id,\n :years_of_experience => skill[1]['year'],\n :level => skill[1]['level'] \n })\n end\n end\n pp skills\n EngineerSkill.insert_engineer_skills(skills)\n format.html { redirect_to @engineer, notice: 'プロフィールが正常に更新されました' }\n else\n @errors = @engineer.errors\n format.html { render :edit, notice: @errors }\n end\n end\n end", "def update\r\n @second_work = SecondWork.find(params[:id])\r\n\r\n respond_to do |format|\r\n if @second_work.update_attributes(params[:second_work])\r\n format.html { redirect_to @second_work, notice: 'Second work was successfully updated.' }\r\n format.json { head :no_content }\r\n else\r\n format.html { render action: \"edit\" }\r\n format.json { render json: @second_work.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "def update\r\n @academic_work = AcademicWork.find(params[:id])\r\n\r\n respond_to do |format|\r\n if @academic_work.update_attributes(params[:academic_work])\r\n format.html { redirect_to @academic_work, notice: 'Academic work was successfully updated.' }\r\n format.json { head :no_content }\r\n else\r\n format.html { render action: \"edit\" }\r\n format.json { render json: @academic_work.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "def issue_skill_params\n params.require(:issue_skill).permit(:issue_id, :skill_id)\n end", "def set_user_skill\n @user_skill = UserSkill.find(params[:id])\n end", "def update\n respond_to do |format|\n if @work.update(work_params)\n format.html { redirect_to @work, notice: 'Work was successfully updated.' }\n format.json { render :show, status: :ok, location: @work }\n else\n format.html { render :edit }\n format.json { render json: @work.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @work.update(work_params)\n format.html { redirect_to @work, notice: 'Work was successfully updated.' }\n format.json { render :show, status: :ok, location: @work }\n else\n format.html { render :edit }\n format.json { render json: @work.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @work.update(work_params)\n format.html { redirect_to @work, notice: 'Work was successfully updated.' }\n format.json { render :show, status: :ok, location: @work }\n else\n format.html { render :edit }\n format.json { render json: @work.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @work.update(work_params)\n format.html { redirect_to @work, notice: 'Work was successfully updated.' }\n format.json { render :show, status: :ok, location: @work }\n else\n format.html { render :edit }\n format.json { render json: @work.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @skill.sp = calc_sp(@skill)\n if @skill.update_attributes(skill_params)\n @skill.sp = calc_sp(@skill)\n @skill.update_attributes(skill_params)\n\n flash[:success] = \"スキルを更新しました。 難易度: #{ApplicationController.helpers.show_kind(@skill.kind)} #{@skill.music.name} 達成率: #{@skill.rate} SP: #{calc_sp(@skill)}\"\n if (@skill.kind.between?(0, 3))\n ApplicationController.helpers.updatedrum(@skill.user_id)\n redirect_to drum_user_path(@skill.user_id)\n else\n ApplicationController.helpers.updateguitar(@skill.user_id)\n redirect_to guitar_user_path(@skill.user_id)\n end\n else\n render 'edit'\n end\n end", "def update\n respond_to do |format|\n if @work_profile.update_attributes(params[:work_profile])\n format.html { redirect_to([:edit, @person, :work_profile], :notice => 'Work profile was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @work_profile.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @work = Work.find(params[:id])\n if not (@current_user.mine?(@work) || @current_user.admin? || @current_user.produce? )\n redirect_to @current_user\n else\n\n @users = User.find(:all)\n @projects = Project.find(:all)\n @job_types = JobType.find(:all)\n @places = Place.find(:all)\n respond_to do |format|\n if @work.update_attributes(params[:work])\n flash[:notice] = 'Work was successfully updated.'\n format.html { redirect_to(@work) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @work.errors, :status => :unprocessable_entity }\n end\n end\n end\n end", "def set_myskill\n @myskill = Myskill.find(params[:id])\n end", "def skills_user_params\n # params.fetch(:skills_user, {})\n params.require(:skills_user).permit(:user_id, :skill_id)\n end", "def update\n respond_to do |format|\n if @work.update_attributes(params[:work])\n flash[:notice] = t('controller.successfully_updated', :model => t('activerecord.models.work'))\n format.html { redirect_to work_url(@work) }\n format.json { head :no_content }\n else\n prepare_options\n format.html { render :action => \"edit\" }\n format.json { render :json => @work.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @work = Work.find(params[:id])\n work_params = params[:work]\n work_params.delete('progress')\n respond_to do |format|\n if @work.update_attributes(work_params)\n format.html { redirect_to @work, notice: 'Work was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @work.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @job_post_skill_set.update(job_post_skill_set_params)\n format.html { redirect_to @job_post_skill_set, notice: 'Job post skill set was successfully updated.' }\n format.json { render :show, status: :ok, location: @job_post_skill_set }\n else\n format.html { render :edit }\n format.json { render json: @job_post_skill_set.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_skill\n @skill = @character.skills.find(params[:id])\n end", "def update\n @workobject = Workobject.find(params[:id])\n\n respond_to do |format|\n if @workobject.update_attributes(params[:workobject])\n format.html { redirect_to @workobject, notice: 'Workobject was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @workobject.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @user_profession.update(user_profession_params)\n format.html { redirect_to @user_profession, notice: 'User profession was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @user_profession.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @user = User.find(current_user.id)\n\n #Are we updating experience?\n if( params[:experience_update] )\n @user.experiences.destroy_all #Remove all previous experience.\n\n if( !params[:experience].nil? )\n params[:experience].each do | theatre_id, experience_types |\n experience_types.each do | experience_type_id, val|\n experience = Experience.create(\n theatre_id: theatre_id,\n experience_type_id: experience_type_id,\n user_id: @user.id\n )\n end\n end\n end\n\n end\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to request.referer , flash: { success: 'User was successfully updated.' } }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @myworkout = Myworkout.find(params[:id])\n\n respond_to do |format|\n if @myworkout.update_attributes(params[:myworkout])\n format.html { redirect_to @myworkout, :notice => 'Myworkout was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @myworkout.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @work.update(work_params)\n format.html { redirect_to @work, notice: '修改成功!' }\n format.json { render :show, status: :ok, location: @work }\n else\n format.html { render :edit }\n format.json { render json: @work.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @mostsmallskillcategory = Mostsmallskillcategory.find(params[:id])\n\n respond_to do |format|\n if @mostsmallskillcategory.update_attributes(params[:mostsmallskillcategory])\n format.html { redirect_to @mostsmallskillcategory, notice: 'Mostsmallskillcategory was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @mostsmallskillcategory.errors, status: :unprocessable_entity }\n end\n end\n end" ]
[ "0.73432004", "0.7312003", "0.7224675", "0.721832", "0.7188362", "0.71461034", "0.70388323", "0.6989368", "0.69759834", "0.69737285", "0.6963536", "0.6942745", "0.6942745", "0.6894826", "0.6891755", "0.6876254", "0.6868217", "0.6856555", "0.6851883", "0.68247133", "0.67911756", "0.67809147", "0.6735941", "0.673016", "0.66834724", "0.66810554", "0.6634584", "0.6617754", "0.6599983", "0.65867984", "0.6583726", "0.6570611", "0.6567249", "0.65474874", "0.65143913", "0.65000004", "0.64847934", "0.6470648", "0.6470595", "0.64670014", "0.64459985", "0.643901", "0.6438107", "0.6424265", "0.6402381", "0.63682556", "0.6351069", "0.63426024", "0.6341533", "0.6303685", "0.62739986", "0.62570965", "0.62473464", "0.6209578", "0.6167581", "0.6158446", "0.6149783", "0.61477864", "0.6131586", "0.6127471", "0.6127386", "0.60959005", "0.60918605", "0.6091292", "0.6065781", "0.6058413", "0.60516036", "0.6051521", "0.6028521", "0.60283035", "0.60154337", "0.6010364", "0.6007622", "0.6000481", "0.6000077", "0.59944665", "0.5977213", "0.5973504", "0.59720445", "0.5963313", "0.595718", "0.59463495", "0.59463495", "0.59463495", "0.59463495", "0.5945208", "0.5942371", "0.5938902", "0.5936406", "0.59357834", "0.5932367", "0.59290123", "0.5928819", "0.5912679", "0.5901396", "0.59004414", "0.58917975", "0.5888671", "0.5886186", "0.5880693" ]
0.73636067
0
DELETE /user_work_skills/1 DELETE /user_work_skills/1.json
def destroy @user_work_skill.destroy respond_to do |format| format.html { redirect_to action:"index", :user_work_experience_role_id=> @user_work_skill.user_work_experience_role_id } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @user_skill = UserSkill.find(params[:id])\n @user_skill.destroy\n\n respond_to do |format|\n format.html { redirect_to user_skills_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @person.skills.delete_all\n \n @person.destroy\n respond_to do |format|\n format.html { redirect_to people_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @skill = @user.skills.find(params[:id])\n @skill.destroy\n\n respond_to do |format|\n format.html { redirect_to(user_skills_url(@user)) }\n format.xml { head :ok }\n end\n end", "def destroy\n @skill = Skill.find(params[:id])\n @skill.destroy\n\n respond_to do |format|\n format.html { redirect_to skills_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @skills_user.destroy\n respond_to do |format|\n format.html { redirect_to skills_users_url, notice: 'Skills user was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @skill = current_user.skills.find(params[:id])\n @skill.destroy\n\n respond_to do |format|\n flash[:notice] = 'Skill deleted.'\n format.html { redirect_to(user_skills_path(current_user)) }\n format.xml { head :ok }\n end\n end", "def destroy\n @desired_skill.destroy\n respond_to do |format|\n format.html { redirect_to desired_skills_url, notice: 'Desired skill was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @create_request_skill = CreateRequestSkill.find(params[:id])\n @create_request_skill.destroy\n\n respond_to do |format|\n format.html { redirect_to create_request_skills_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @mostsmallskill = Mostsmallskill.find(params[:id])\n @mostsmallskill.destroy\n\n respond_to do |format|\n format.html { redirect_to mostsmallskills_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @skill.destroy\n\n head :no_content\n end", "def destroy\n @skill_user_profile.destroy\n\n head :no_content\n end", "def destroy\n @myskill.destroy\n respond_to do |format|\n format.html { redirect_to myskills_url, notice: 'Myskill was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @user_work_experience.destroy\n respond_to do |format|\n format.html { redirect_to user_work_experiences_url, notice: 'User work experience was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @individual_skill_record = IndividualSkillRecord.find(params[:id])\n @individual_skill_record.destroy\n\n respond_to do |format|\n format.html { redirect_to individual_skill_records_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @admin_skill.destroy\n\n head :no_content\n end", "def destroy\n @skill = Skill.find(params[:id])\n\t\tauthorize! :destroy, Skill\n\t\t\n @skill.destroy\n\n respond_to do |format|\n format.html { redirect_to skills_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @s_skill.destroy\n respond_to do |format|\n format.html { redirect_to s_skills_url, notice: 'S skill was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @skill.destroy\n respond_to do |format|\n format.html { redirect_to skills_url, notice: 'Blog was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @special_skill.destroy\n respond_to do |format|\n format.html { redirect_to special_skills_url, notice: 'Special skill was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @issue_skill.destroy\n respond_to do |format|\n format.html { redirect_to issue_skills_url, notice: \"Issue skill was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def destroy\n @current_skill.destroy\n respond_to do |format|\n format.html { redirect_to current_skills_url, notice: 'Current skill was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @projects_skill.destroy\n respond_to do |format|\n format.html { redirect_to projects_skills_url, notice: 'Projects skill was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @crew_member_skill = CrewMemberSkill.find(params[:id])\n @crew_member_skill.destroy\n\n respond_to do |format|\n format.html { redirect_to crew_member_skills_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @other_skill.destroy\n respond_to do |format|\n format.html { redirect_to other_skills_url, notice: 'Other skill was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @crew_skill.destroy\n respond_to do |format|\n format.html { redirect_to crew_skills_url, notice: 'Crew skill was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profession_skill.destroy\n respond_to do |format|\n format.html { redirect_to profession_skills_url, notice: 'Profession skill was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @exceller_skill.destroy\n respond_to do |format|\n format.html { redirect_to exceller_skills_url, notice: 'Exceller skill was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @request = @skill.requests.find(params[:id])\n @request.destroy\n\n respond_to do |format|\n format.html { redirect_to myrequests_path }\n format.json { head :no_content }\n end\n end", "def destroy\n @skill_set = SkillSet.find(params[:id])\n @skill_set.destroy\n\n respond_to do |format|\n format.html { redirect_to skill_sets_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @buildskill.destroy\n respond_to do |format|\n format.html { redirect_to buildskills_url, notice: 'Buildskill was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @skillinstance = Skillinstance.find(params[:id])\n @skillinstance.destroy\n\n respond_to do |format|\n format.html { redirect_to skillinstances_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @skill_level.destroy\n respond_to do |format|\n format.html { redirect_to skill_levels_url, notice: 'Skill level was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @skillset.destroy\n respond_to do |format|\n format.html { redirect_to skillsets_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @skill.destroy\n respond_to do |format|\n format.html { redirect_to skill_categories_path, notice: 'Skill was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @skill_tag = SkillTag.find(params[:id])\n @skill_tag.destroy\n\n respond_to do |format|\n format.html { redirect_to skill_tags_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @opening_skill.destroy\n respond_to do |format|\n format.html { redirect_to opening_skills_url, notice: 'Opening skill was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @skill_name.destroy\n respond_to do |format|\n format.html { redirect_to skill_names_url, notice: 'Skill name was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n profileSkill = ProfileManager.find_by_skill_id(@skill.id)\n if profileSkill.destroy\n respond_to do |format|\n format.html { redirect_to skills_url, notice: 'Skill was successfully destroyed.' }\n format.json { head :no_content }\n end\n else\n respond_to do |format|\n format.html { redirect_to root_path, :flash => { :error => \"Profile Skill was not deleted\" } }\n end\n end\n end", "def destroy\n @computer_skill.destroy\n respond_to do |format|\n format.html { redirect_to user_computer_skills_path, notice: 'Computer skill was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @skill.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_skills_path, \n notice: 'Skill was successfully deleted.' }\n end\n end", "def remove(skillName)\n\n end", "def destroy\n @skill_list.destroy\n respond_to do |format|\n format.html { redirect_to skill_lists_url, notice: 'Skill list was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @skill_level = SkillLevel.find(params[:id])\n @skill_level.destroy\n\n respond_to do |format|\n format.html { redirect_to(skill_levels_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @employee_skill = EmployeeSkill.find(params[:id])\n @employee_skill.destroy\n\n respond_to do |format|\n format.html { redirect_to(employee_skills_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @mostsmallskillcategory = Mostsmallskillcategory.find(params[:id])\n @mostsmallskillcategory.destroy\n\n respond_to do |format|\n format.html { redirect_to mostsmallskillcategories_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @skillset.destroy\n respond_to do |format|\n format.html { redirect_to employees_url, notice: 'Skillset was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @culinary_skill.destroy\n respond_to do |format|\n format.html { redirect_to culinary_skills_url, notice: 'Culinary skill was successfully destroyed.' }\n format.json { head :no_content }\n format.js\n end\n end", "def destroy\n @areas_skill.destroy\n respond_to do |format|\n format.html { redirect_to areas_skills_url, notice: 'Areas skill was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @user_quest = UserQuest.find(params[:id])\n @user_quest.destroy\n\n respond_to do |format|\n format.html { redirect_to user_quests_url }\n format.json { head :no_content }\n end\n end", "def destroy\n authorize! :destroy, WorkingExperience, :message => 'Not authorized as an administrator.'\n @working_experience = WorkingExperience.find(params[:id])\n @working_experience.destroy\n\n respond_to do |format|\n format.html { redirect_to user_working_experiences_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @player_ball_skill.destroy\n respond_to do |format|\n format.html { redirect_to player_ball_skills_url, notice: 'Player ball skill was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @skill_catagory.destroy\n respond_to do |format|\n format.html { redirect_to skill_catagories_url, notice: 'Skill catagory was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @skill.destroy\n if (@skill.kind.between?(0, 3))\n ApplicationController.helpers.updatedrum(@skill.user_id)\n redirect_to drum_user_path(@skill.user_id), :flash => {:success => \"スキル (#{@skill.music.name}) を削除しました.\"}\n else\n ApplicationController.helpers.updateguitar(@skill.user_id)\n redirect_to guitar_user_path(@skill.user_id), :flash => {:success => \"スキル (#{@skill.music.name}) を削除しました.\"}\n end\n end", "def destroy\n @skillset.destroy\n respond_to do |format|\n format.html { redirect_to skillsets_url, notice: 'Skillset was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @homework = Homework.find(params[:id])\n\t@homework.homework_users.each do |hu|\n\t\thu.destroy\n\tend\n @homework.destroy\n\n respond_to do |format|\n format.html { redirect_to homeworks_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @exam_user = ExamUser.find(params[:id])\n @exam_user.destroy\n\n respond_to do |format|\n format.html { redirect_to exam_users_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @user_interest = UserInterest.find(params[:id])\n @user_interest.destroy\n \n if @user_interest.save\n render json: {\n status: 200,\n message: \"Successfully deleted user interest\",\n user_interests: @user_interest\n }.to_json\n else\n render json: {\n status: 500,\n message: \"Couldn't delete user interest.\",\n errors: @user_interest.errors\n }.to_json\n end\n end", "def destroy\n @skill_suggestion = SkillSuggestion.find(params[:id])\n @skill_suggestion.destroy\n\n respond_to do |format|\n format.html { redirect_to skill_suggestions_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @reqdifficulty.destroy\n respond_to do |format|\n format.html { redirect_to reqdifficulties_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @skill_assessment.destroy\n respond_to do |format|\n format.html { redirect_to skill_assessments_url, notice: 'Skill assessment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @my_posted_homework = MyPostedHomework.find(params[:id])\n @my_posted_homework.destroy\n\n respond_to do |format|\n format.html { redirect_to my_posted_homeworks_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @user_profession.destroy\n respond_to do |format|\n format.html { redirect_to user_professions_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @my_exam = MyExam.find(params[:id])\n @my_exam.destroy\n\n respond_to do |format|\n format.html { redirect_to my_exams_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @working_experience.destroy\n respond_to do |format|\n format.html { redirect_to working_experiences_url, notice: 'Working experience was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @vip_skill.destroy\n respond_to do |format|\n format.html { redirect_to(admin_vip_skills_url) }\n format.xml { head :ok }\n end\n website.add_log(user: current_user, action: \"Deleted a amx vip skill: #{@vip_skill.name}\")\n end", "def destroy\n @skill_category.destroy\n respond_to do |format|\n format.html { redirect_to skill_categories_url, notice: 'Skill category was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @howitwork.destroy\n respond_to do |format|\n format.html { redirect_to admin_howitworks_url, notice: 'Howitwork was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @smalluser = Smalluser.find(params[:id])\n @smalluser.destroy\n\n respond_to do |format|\n format.html { redirect_to smallusers_url }\n format.json { head :no_content }\n end\n end", "def destroy\r\n @academic_work = AcademicWork.find(params[:id])\r\n @academic_work.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to academic_works_url }\r\n format.json { head :no_content }\r\n end\r\n end", "def destroy\n @work.destroy\n respond_to do |format|\n format.html { redirect_to user_works_url, notice: 'Work was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @education_service_provided_typology.destroy\n respond_to do |format|\n format.html { redirect_to education_service_provided_typologies_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @user_hour_requirement = UserHourRequirement.find(params[:id])\n @user_hour_requirement.destroy\n\n respond_to do |format|\n format.html { redirect_to user_hour_requirements_url }\n format.json { head :ok }\n end\n end", "def destroy\n @skill_slot.destroy\n respond_to do |format|\n format.html { redirect_to skill_slots_url, notice: 'Skill slot was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @skill_tag = SkillTag.find(params[:id])\n @skill_tag.destroy\n\n respond_to do |format|\n format.html { redirect_to(skill_tags_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @workpermit.destroy\n respond_to do |format|\n format.html { redirect_to workpermits_url, notice: 'Workpermit was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @user_competency_level.destroy\n respond_to do |format|\n format.html { redirect_to user_competency_levels_url, notice: 'User competency level was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n Workphase.find(params[:id]).destroy\n #@workphase.destroy\n respond_to do |format|\n format.html { redirect_to workphases_url, notice: 'Workphase was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\r\n @second_work = SecondWork.find(params[:id])\r\n @second_work.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to second_works_url }\r\n format.json { head :no_content }\r\n end\r\n end", "def destroy\n @thirtyfife.destroy\n respond_to do |format|\n format.html { redirect_to thirtyfives_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @requisition.destroy\n respond_to do |format|\n format.html { redirect_to :back }\n format.json { head :no_content }\n end\n end", "def destroy\n @addimition = Addimition.find(params[:id])\n @addimition.destroy\n\n respond_to do |format|\n format.html { redirect_to addimitions_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @tutorial_quest = Tutorial::Quest.find(params[:id])\n @tutorial_quest.destroy\n\n respond_to do |format|\n format.html { redirect_to tutorial_quests_url }\n format.json { head :ok }\n end\n end", "def destroy\n @skill_inventory.destroy\n respond_to do |format|\n format.html { redirect_to skill_inventories_url, notice: 'Skill inventory was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @health_professional = HealthProfessional.find(params[:id])\n @health_professional.destroy\n\n respond_to do |format|\n format.html { redirect_to health_professionals_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @exhibition = Exhibition.find(params[:id])\n @exhibition.destroy\n\n respond_to do |format|\n format.html { redirect_to exhibitions_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @homework_item = HomeworkItem.find(params[:id])\n @homework_item.destroy\n\n respond_to do |format|\n format.html { redirect_to homework_items_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @experience = Experience.find(params[:id])\n @experience.destroy\n\n respond_to do |format|\n format.html { redirect_to experiences_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @experience.destroy\n respond_to do |format|\n format.html { redirect_to root_path, notice: 'Experience was successfully deleted.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @Growth = Growth.find(params[:id])\n begin\n if(@Growth.destroy)\n render :json =>'Successfully'\n end\n rescue => e\n render :json => \"#{e}\", :status => :unprocessable_entity\n end\n end", "def destroy\n @research.destroy\n respond_to do |format|\n format.html { redirect_to menu_investigacion_3_path, notice: 'La actividad se elimino con exito.' }\n format.json { head :no_content }\n end\n\n end", "def destroy\n if @academic_work.destroy\n render json: nil, status: :ok\n else\n render json: nil, status: :internal_server_error\n end\n end", "def destroy\n @job_post_skill_set.destroy\n respond_to do |format|\n format.html { redirect_to job_post_skill_sets_url, notice: 'Job post skill set was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete_check\n if Skill.where(id:params[:id]).blank?\n render json: {result: 'couldnt process delete request'} #dont give extra failure info security-wise\n else\n @skill = Skill.find(params[:id])\n end\n end", "def destroy\n\n unless @workitem.user_id == current_user.id\n render json: \"unauthorized\", status: :unauthorized\n return\n end\n\n @workitem.destroy\n respond_to do |format|\n format.html { redirect_to workitems_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @myworkout = Myworkout.find(params[:id])\n @myworkout.destroy\n\n respond_to do |format|\n format.html { redirect_to myworkouts_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @hackplatformrelation = Hackplatformrelation.find(params[:id])\n @hackplatformrelation.destroy\n\n respond_to do |format|\n format.html { redirect_to hackplatformrelations_url }\n format.json { head :ok }\n end\n end", "def destroy\n @my_time_trial = MyTimeTrial.find(params[:id])\n @my_time_trial.destroy\n\n respond_to do |format|\n format.html { redirect_to my_time_trials_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @thirtyfour.destroy\n respond_to do |format|\n format.html { redirect_to thirtyfours_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @work_and_thema.destroy\n respond_to do |format|\n format.html { redirect_to work_and_themata_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @user_study.destroy\n respond_to do |format|\n format.html { redirect_to user_studies_url, notice: 'User study was successfully destroyed.' }\n format.json { head :no_content }\n end\n end" ]
[ "0.7760334", "0.76458406", "0.7583783", "0.74354345", "0.73909444", "0.7380749", "0.73618454", "0.7353754", "0.7329657", "0.72775155", "0.7243548", "0.72377294", "0.719272", "0.71708316", "0.7169053", "0.7113529", "0.7100926", "0.7079245", "0.7077078", "0.7071041", "0.7047798", "0.7020922", "0.7018344", "0.70147544", "0.70048046", "0.70001495", "0.6970125", "0.6958191", "0.6947772", "0.69436", "0.693967", "0.6925947", "0.69112575", "0.69086707", "0.6902611", "0.69001865", "0.68888766", "0.6886394", "0.6880068", "0.68425953", "0.68176246", "0.68137443", "0.67796665", "0.67695546", "0.6751697", "0.67513657", "0.67411536", "0.6692364", "0.6684412", "0.66827285", "0.66749203", "0.6671061", "0.66567665", "0.665635", "0.6640391", "0.66184276", "0.6603843", "0.6601115", "0.65614384", "0.6554544", "0.65332043", "0.6527156", "0.65168947", "0.6453265", "0.64496475", "0.6443827", "0.6439994", "0.6437193", "0.643576", "0.6432766", "0.64318913", "0.64180094", "0.64155436", "0.6410563", "0.641045", "0.6400326", "0.6397035", "0.6395489", "0.63902694", "0.6387893", "0.6387878", "0.6387571", "0.63852507", "0.6380813", "0.63734454", "0.63649416", "0.6358386", "0.63561785", "0.6353332", "0.6352275", "0.63517815", "0.6346754", "0.6346293", "0.63430434", "0.6339449", "0.6338183", "0.63378197", "0.6336936", "0.6332234", "0.63303256" ]
0.7621494
2
Use callbacks to share common setup or constraints between actions.
def set_user_work_skill @user_work_skill = UserWorkSkill.find(params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "def action_hook; end", "def run_actions; end", "def define_action_hook; end", "def actions; end", "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end", "def add_actions; end", "def callbacks; end", "def callbacks; end", "def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end", "def define_action_helpers; end", "def post_setup\n end", "def action_methods; end", "def action_methods; end", "def action_methods; end", "def before_setup; end", "def action_run\n end", "def execute(setup)\n @action.call(setup)\n end", "def define_action_helpers?; end", "def set_actions\n actions :all\n end", "def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end", "def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end", "def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end", "def before_actions(*logic)\n self.before_actions = logic\n end", "def setup_handler\n end", "def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end", "def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end", "def action; end", "def action; end", "def action; end", "def action; end", "def action; end", "def workflow\n end", "def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end", "def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end", "def before(action)\n invoke_callbacks *self.class.send(action).before\n end", "def process_action(...)\n send_action(...)\n end", "def before_dispatch(env); end", "def after_actions(*logic)\n self.after_actions = logic\n end", "def setup\n # override and do something appropriate\n end", "def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end", "def setup(_context)\n end", "def setup(resources) ; end", "def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end", "def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end", "def determine_valid_action\n\n end", "def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end", "def startcompany(action)\n @done = true\n action.setup\n end", "def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end", "def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end", "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end", "def define_tasks\n define_weave_task\n connect_common_tasks\n end", "def setup(&block)\n define_method(:setup, &block)\n end", "def setup\n transition_to(:setup)\n end", "def setup\n transition_to(:setup)\n end", "def action\n end", "def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend", "def config(action, *args); end", "def setup\n @setup_proc.call(self) if @setup_proc\n end", "def before_action \n end", "def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end", "def action\n end", "def matt_custom_action_begin(label); end", "def setup\n # override this if needed\n end", "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end", "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end", "def after(action)\n invoke_callbacks *options_for(action).after\n end", "def pre_task\n end", "def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end", "def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end", "def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end", "def setup_signals; end", "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end", "def initialize(*args)\n super\n @action = :set\nend", "def after_set_callback; end", "def setup\n #implement in subclass;\n end", "def lookup_action; end", "def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end", "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "def release_actions; end", "def around_hooks; end", "def save_action; end", "def setup(easy)\n super\n easy.customrequest = @verb\n end", "def action_target()\n \n end", "def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end", "def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end", "def before_setup\n # do nothing by default\n end", "def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end", "def default_action; end", "def setup(&blk)\n @setup_block = blk\n end", "def callback_phase\n super\n end", "def advice\n end", "def _handle_action_missing(*args); end", "def duas1(action)\n action.call\n action.call\nend", "def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end", "def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end", "def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend" ]
[ "0.6163163", "0.6045976", "0.5946146", "0.591683", "0.5890051", "0.58349305", "0.5776858", "0.5703237", "0.5703237", "0.5652805", "0.5621621", "0.54210985", "0.5411113", "0.5411113", "0.5411113", "0.5391541", "0.53794575", "0.5357573", "0.53402257", "0.53394014", "0.53321576", "0.53124547", "0.529654", "0.5296262", "0.52952296", "0.52600986", "0.52442724", "0.52385926", "0.52385926", "0.52385926", "0.52385926", "0.52385926", "0.5232394", "0.523231", "0.5227454", "0.52226824", "0.52201617", "0.5212327", "0.52079266", "0.52050185", "0.51754695", "0.51726824", "0.51710224", "0.5166172", "0.5159343", "0.51578903", "0.51522785", "0.5152022", "0.51518047", "0.51456624", "0.51398855", "0.5133759", "0.5112076", "0.5111866", "0.5111866", "0.5110294", "0.5106169", "0.509231", "0.50873137", "0.5081088", "0.508059", "0.50677156", "0.50562143", "0.5050554", "0.50474834", "0.50474834", "0.5036181", "0.5026331", "0.5022976", "0.5015441", "0.50121695", "0.5000944", "0.5000019", "0.4996878", "0.4989888", "0.4989888", "0.49864885", "0.49797225", "0.49785787", "0.4976161", "0.49683493", "0.4965126", "0.4958034", "0.49559742", "0.4954353", "0.49535993", "0.4952725", "0.49467874", "0.49423352", "0.49325448", "0.49282882", "0.49269363", "0.49269104", "0.49252945", "0.4923091", "0.49194667", "0.49174926", "0.49173003", "0.49171105", "0.4915879", "0.49155936" ]
0.0
-1
Never trust parameters from the scary internet, only allow the white list through.
def user_work_skill_params params.require(:user_work_skill).permit(:total_experience, :last_time_used, :last_time_used_duration_years, :refresher, :notes,:user_work_experience_role_id,:skill_inventory_id,:id) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "def allow_params_authentication!; end", "def allowed_params\n ALLOWED_PARAMS\n end", "def default_param_whitelist\n [\"mode\"]\n end", "def param_whitelist\n [:role, :title]\n end", "def expected_permitted_parameter_names; end", "def safe_params\n params.except(:host, :port, :protocol).permit!\n end", "def strong_params\n params.require(:team_member).permit(param_whitelist)\n end", "def permitir_parametros\n \t\tparams.permit!\n \tend", "def strong_params\n params.require(:community).permit(param_whitelist)\n end", "def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end", "def strong_params\n params.require(:education).permit(param_whitelist)\n end", "def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end", "def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end", "def param_whitelist\n [:rating, :review]\n end", "def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end", "def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end", "def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end", "def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end", "def valid_params_request?; end", "def strong_params\n params.require(:experience).permit(param_whitelist)\n end", "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end", "def allowed_params\n params.require(:allowed).permit(:email)\n end", "def permitted_params\n []\n end", "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end", "def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend", "def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end", "def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end", "def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end", "def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end", "def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end", "def safe_params\n params.require(:user).permit(:name)\n end", "def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend", "def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end", "def check_params; true; end", "def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end", "def quote_params\n params.permit!\n end", "def valid_params?; end", "def paramunold_params\n params.require(:paramunold).permit!\n end", "def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend", "def filtered_parameters; end", "def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end", "def filtering_params\n params.permit(:email, :name)\n end", "def check_params\n true\n end", "def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend", "def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend", "def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end", "def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end", "def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end", "def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend", "def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end", "def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end", "def active_code_params\n params[:active_code].permit\n end", "def filtering_params\n params.permit(:email)\n end", "def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end", "def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end", "def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end", "def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end", "def post_params\n if current_user.admin? \n params.permit(:title, :body, :city, :country, :gps_location, :privacy, :visible, :latitude, :longitude, images: [], files: [])\n else \n params.permit(:title, :body, :city, :country, :gps_location, :privacy,:latitude, :longitude, images: [], files: [])\n end \n end", "def list_params\n params.permit(:name)\n end", "def filter_parameters; end", "def filter_parameters; end", "def vineyard_params\n params.permit(:vineyard_name, :email, :website_url, :phone, :address, :city, :region, :postcode, :country, :specialty, :description, :pet_friendly, :holiday, :tours, :events, :family_friendly, :cover_image, :image_one, :image_two, :image_three, :image_four, :user_id, :base64)\n end", "def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end", "def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end", "def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end", "def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end", "def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end", "def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end", "def url_whitelist; end", "def admin_social_network_params\n params.require(:social_network).permit!\n end", "def filter_params\n params.require(:filters).permit(:letters)\n end", "def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end", "def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end", "def sensitive_params=(params)\n @sensitive_params = params\n end", "def permit_request_params\n params.permit(:address)\n end", "def user_params\n # Ensure a user can't give themselves admin priveleges\n params.delete(:admin) if current_user.admin?\n params.require(:user).permit(:name, :email, :admin, :image)\n end", "def secure_params\n params.require(:location).permit(:name)\n end", "def strong_params\n params.require( :setting ).\n permit( :global_scan_limit, :per_user_scan_limit,\n :target_whitelist_patterns, :target_blacklist_patterns )\n end", "def question_params\n params.require(:survey_question).permit(question_whitelist)\n end", "def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end", "def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end", "def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end", "def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end", "def url_params\n params[:url].permit(:full)\n end", "def backend_user_params\n params.permit!\n end", "def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend", "def speed_measurement_params\n\n #fuckit, to lazy to deal with permit crap right now\n ActionController::Parameters.permit_all_parameters = true\n\n params[:speed_measurement]\n end", "def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end", "def get_params\r\n #params.require(:article).permit(:title, :permalink, :content, :source_site, :introtext, :type_id, :order_by, :searchable, :created_by, :edited_by, :published_by, :published_on, :user_id)\r\n params.require(:article).permit!\r\n\r\n end", "def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end", "def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end", "def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end", "def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end", "def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end" ]
[ "0.69792545", "0.6781151", "0.67419964", "0.674013", "0.6734356", "0.6591046", "0.6502396", "0.6496313", "0.6480641", "0.6477825", "0.64565", "0.6438387", "0.63791263", "0.63740575", "0.6364131", "0.63192815", "0.62991166", "0.62978333", "0.6292148", "0.6290449", "0.6290076", "0.62894756", "0.6283177", "0.6242471", "0.62382483", "0.6217549", "0.6214457", "0.6209053", "0.6193042", "0.6177802", "0.6174604", "0.61714715", "0.6161512", "0.6151757", "0.6150663", "0.61461", "0.61213595", "0.611406", "0.6106206", "0.6105114", "0.6089039", "0.6081015", "0.6071004", "0.60620916", "0.6019971", "0.601788", "0.6011056", "0.6010898", "0.6005122", "0.6005122", "0.6001556", "0.6001049", "0.59943926", "0.5992201", "0.59909594", "0.5990628", "0.5980841", "0.59669393", "0.59589154", "0.5958826", "0.5957911", "0.5957385", "0.5953072", "0.59526145", "0.5943361", "0.59386164", "0.59375334", "0.59375334", "0.5933856", "0.59292704", "0.59254247", "0.5924164", "0.59167904", "0.59088355", "0.5907542", "0.59064597", "0.5906243", "0.5898226", "0.589687", "0.5896091", "0.5894501", "0.5894289", "0.5891739", "0.58860534", "0.5882406", "0.587974", "0.58738774", "0.5869024", "0.58679986", "0.5867561", "0.5865932", "0.5864461", "0.58639693", "0.58617616", "0.5861436", "0.5860451", "0.58602303", "0.5854586", "0.58537364", "0.5850427", "0.5850199" ]
0.0
-1
if user is logged in, return current_user, else return guest_user
def current_or_guest_user if current_user if session[:guest_user_id] && session[:guest_user_id] != current_user.id logging_in(guest_user_id) guest_user(with_retry = false).try(:destroy) session[:guest_user_id] = nil end current_user else guest_user end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def current_or_guest_user\n if current_user\n transfer_session_to_logged_in_user if session[:guest_user_id].present?\n current_user\n else\n guest_user\n end\n end", "def current_or_guest_user\n if user_signed_in? then current_user else guest_user end\n end", "def current_or_guest_user\n if current_user\n if session[:guest_user_id]\n logging_in\n guest_user_log_out\n end\n current_user\n else\n guest_user\n end\n end", "def current_or_guest_user\n if current_user\n if session[:guest_user_id] && session[:guest_user_id] != current_user.id\n logging_in\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end", "def current_or_guest_user\n current_user ? current_user : guest_user\n end", "def current_or_guest_user\n current_user || guest_user\n end", "def current_or_guest_user\n current_user || guest_user\n end", "def current_or_guest_user\n if current_user\n if session[:guest_user_id] && session[:guest_user_id] != current_user.id\n logging_in\n # reload guest_user to prevent caching problems before destruction\n #guest_user(with_retry = false).try(:reload).try(:destroy)\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end", "def current_or_guest_user!\n if current_user\n if cookies[:uuid]\n\n # Called when a guest user is converted to current user\n promote_guest_to_user(current_user)\n\n # destroy the guest user and the session\n destroy_guest_user\n end\n current_user\n else\n find_or_create_guest_user\n end\n end", "def current_or_guest_user\n if current_user\n if session[:guest_user_id] && session[:guest_user_id] != current_user.id\n\n logging_in\n # reload guest_user to prevent caching problems before destruction\n guest_user(with_retry = false).try(:reload).try(:destroy)\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end", "def current_or_guest_user\n if current_user\n if session[:guest_user_id] && session[:guest_user_id] != current_user.id\n logging_in\n # reload guest_user to prevent caching problems before destruction\n guest_user(with_retry = false).try(:reload).try(:destroy)\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end", "def current_or_guest_user\n if current_user\n if session[:guest_user_id] && session[:guest_user_id] != current_user.id\n logging_in\n # reload guest_user to prevent caching problems before destruction\n guest_user(with_retry = false).try(:reload).try(:destroy)\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end", "def current_or_guest_user\n if current_user\n if session[:guest_user_id] && session[:guest_user_id] != current_user.id\n logging_in\n guest_user(with_retry = false).try(:destroy)\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end", "def current_or_guest_user\n if current_user\n if session[:guest_user_id] && session[:guest_user_id] != current_user.id\n logging_in\n guest_user(with_retry = false).try(:destroy)\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end", "def current_or_guest_user\n if current_user\n if session[:guest_user_id]\n logging_in\n guest_user.destroy\n session[:guest_user_id] = nil\n end\n return current_user\n else\n return guest_user\n end\n end", "def current_or_guest_user\n if current_user\n if cookies.signed[:guest_user_email]\n logging_in\n guest_user.delete\n cookies.delete :guest_user_email\n end\n current_user\n else\n guest_user\n end\n end", "def get_current_user\n @current_user = current_or_guest_user\n end", "def current_or_guest_user\n if current_user\n if session[:guest_authentication_token] &&\n !current_user.matches_guest_authentication_token?(session[:guest_authentication_token])\n # transfer_guest_to_current_user\n guest_user(with_retry = false).try(:destroy)\n session[:guest_authentication_token] = nil\n end\n current_user\n else\n guest_user\n end\n end", "def current_or_guest_user\n current_user || User.find_by_lazy_id(cookies[:uuid])\n end", "def current_or_guest_user\n if current_user\n if session[:guest_user_id] && session[:guest_user_id] != current_user.id\n logging_in\n # reload guest_user to prevent caching problems before destruction\n guest_user(with_retry = false).reload.try(:destroy)\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end", "def current_or_guest_user\n if current_user\n if session[:guest_user_id] && session[:guest_user_id] != current_user.id\n logging_in\n # reload guest_user to prevent caching problems before destruction\n guest_user(with_retry = false).reload.try(:destroy)\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end", "def current_or_guest_user\n if current_user\n if session[:guest_user_id] && session[:guest_user_id] != current_user.id\n logging_in\n # reload guest_user to prevent caching problems before destruction\n guest_user(with_retry = false).reload.try(:destroy)\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end", "def current_or_guest_user\n if current_user\n if session[:guest_user_id] && session[:guest_user_id] != current_user.id\n logging_in\n guest_user(with_retry = false).try(:reload).try(:destroy)\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end", "def current_user\n # if a user is logged in we just use devise's implementation.\n super || guest_user\n end", "def current_or_guest_user\n\t\tif current_user\n\t\t\tif session[:guest_user_id] && session[:guest_user_id] != current_user.id\n\t\t\t\tlogging_in\n\t\t\t\tguest_user(with_retry = false).try(:destroy)\n\t\t\t\tsession[:guest_user_id] = nil\n\t\t\tend\n\t\t\tcurrent_user\n\t\telse\n\t\t\tguest_user\n\t\tend\n\tend", "def current_user\n if session[:user_id] != nil\n user = User.find(session[:user_id])\n elsif session[:guest_id] != nil\n user = User.find(session[:guest_id])\n else\n user = User.new(name: \"Guest\", authenticated: false)\n user.save\n session[:guest_id] = user.id\n end\n return user\n end", "def current_or_guest_user\n if current_user\n if session[:guest_user_id]\n logging_in\n #guest_user.destroy\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end", "def current_or_guest_user(params)\n if current_user\n if cookies[:uuid]\n unless current_user.guest?\n cookies.delete :uuid\n end\n end\n current_user\n else\n guest_user(params)\n end\n end", "def current_user\r\n super || guest_user\r\n end", "def current_or_guest_user\n if current_user\n if session[:guest_user_id]\n logging_in\n guest_user.destroy\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end", "def current_or_guest_user\n if current_user\n if session[:guest_user_id]\n logging_in\n guest_user.destroy\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end", "def current_user\r\n super || guest_user\r\n end", "def current_user_or_guest\n if current_user\n if session[:guest_user_id]\n logging_in\n guest_user.destroy\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end", "def current_or_guest_user\n if current_user\n if cookies[:uuid]\n logging_in # Look at this method to see how handing over works\n guest_user.destroy # Stuff have been handed over. Guest isn't needed anymore.\n cookies.delete :uuid # The cookie is also irrelevant now\n end\n current_user\n else\n guest_user\n end\n end", "def current_user\n super || guest_user\n end", "def current_user\n super || guest_user\n end", "def current_user\n super || guest_user\n end", "def current_or_guest_user(create_guest = false)\n @current_or_guest_user ||=\n (\n logger.debug 'ApplicationController:current_or_guest_user'\n if current_user\n if session[:guest_user_id] && session[:guest_user_id] != current_user.id\n remove_guest\n logger.debug \"ApplicationController:current_or_guest_user >>> current_user and guest_user session found -- guest_user remove and return current_user\"\n end\n current_user\n else\n logger.debug \"ApplicationController:current_or_guest_user >>> current_user not found -- switching to guest_user with create = #{create_guest}\"\n guest_user(create_guest)\n end\n )\n end", "def current_or_guest_user\n \tif current_user\n \t\tif session[:guest_user_id]\n \t\t\tlogging_in\n \t\t\tguest_user.destroy\n \t\t\tsession[:guest_user_id] = nil\n \t\tend\n \t\tcurrent_user\n \telse\n \t\tguest_user\n \tend \t\n end", "def current_user\n #super the main class of devise current_user\n super || guest_user\n end", "def current_user \n #will never return NIL, create a fake user\n #will return the super value (logged in user) OR the guest infos.\n super || guest_user\n end", "def current_or_guest_user\n Rails.logger.warn(\"current_or_guest_user is DEPRECATED - just use current_user\") \n current_user\n end", "def current_user( user = :get )\n if( user == :get )\n session[:user] ||= guest_account\n else\n session[:user] = user\n end\n end", "def current_or_guest_user\n if current_user\n if session[:guest_user_id]\n guest_user.destroy\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end", "def current_user\n \tsuper || guest_user\n \t#Super quiere decir que exactamente con los valores \n \t#del metodo original sin cambiar nada\n end", "def user_or_guest\n user or Guest.new(guest_uid, guest_name)\n end", "def guest_user\n @guest_user ||= User.where(guest: true).first || super\n end", "def guest_user\n guest_id = session[:guest_user_id]\n if guest_id.nil? || User.find(guest_id).nil?\n user = create_guest_user\n session[:guest_user_id] = user.id\n return User.find(user.id)\n end\n User.find(guest_id)\n end", "def current_user\n @current_user ||= User.find(session[:user_id])\n rescue ActiveRecord::RecordNotFound\n #login User.create_guest\n end", "def guest_user\n unless defined? @guest_user\n if session[:guest_user_id] && (user = User.where(:id => session[:guest_user_id]).first)\n @guest_user = user\n else\n @guest_user = create_guest_user!\n session[:guest_user_id] = @guest_user.id\n end\n end\n return @guest_user\n end", "def current_user\n # super: don't change anything, i just want the exact same behavior \n # as in the method that we are overriding\n\n # what this line means is that if the user is logged in, super is true,\n # then call super treat everything normal, and ignore right hand side\n # if super == false, call right hand side\n\n # super comes from devise class\n # meanwhile the r.h.s comes from open struct class\n super || guest_user\n end", "def current_user\n if devise_current_user\n if cookies[:guest_user_id]\n logging_in\n guest_user.destroy\n cookies.delete :guest_user_id\n end\n devise_current_user\n else\n guest_user\n end\n end", "def current_user\n User.find_by(uid: session[:user]) if logged_in?\n end", "def guest_user\n User.find(session[:guest_user_id].nil? ? session[:guest_user_id] = create_guest_user.id : session[:guest_user_id])\n end", "def guest_user\n @_guest ||= Guest.from_cookies(cookies) unless user_signed_in?\n end", "def current_user\n if session[:user_id]\n return User.find(session[:user_id])\n end\nend", "def current_user\n logged_in? ? User.find_by_id(session[:user_id]) : nil\n end", "def current_user_or_admin\n if current_user \n return current_user\n elsif current_admin \n return current_admin\n end \n end", "def current_user\n @user ||= User.find_by_id(session[:user_id])if logged_in?\n end", "def get_user\n @current_user = current_admin || current_user\n end", "def current_user\n User.find session[:user_id] if user_signed_in?\n end", "def current_user\n if session[:user_id]\n User.find(session[:user_id])\n else\n end\n end", "def get_or_create_user\n @user||=use_url_session? ? get_or_create_url_session_user : current_user_with_guest\n end", "def current_user\n if @user\n @user\n elsif session[:user_id]\n @user = User.find(session[:user_id])\n else\n redirect_to login_path and return\n end\n end", "def guest_user\n User.find_by_lazy_id(cookies[:uuid].nil? ? create_guest_user.lazy_id : cookies[:uuid])\n end", "def current_user\n # User.find would throw an error if we cannot find the user\n if session[:user_id]\n User.find_by({ id: session[:user_id] })\n else\n Dog.find_by({ id: session[:dog_id] })\n end\n end", "def current_user\n login_from_session || login_from_basic_auth \n end", "def current_user\n logger.debug 'ApplicationController:current_user'\n @current_user ||= super\n @current_user && @current_user.is_guest? ? nil : @current_user\n end", "def token_or_current_or_guest_user\n token_user || current_or_guest_user\n end", "def guest\n defaultuser = (\n case ActiveRecord::Base.connection.adapter_name\n when 'MySQL'\n 'defaultUser'\n else\n 'defaultuser'\n end\n )\n User.find(:first, :conditions => \"#{self.class.primary_key}=#{self.id} AND #{defaultuser} = true\" )\n end", "def current_user\n if session[:user_id]\n User.find(session[:user_id])\n end\nend", "def current_user\n User.find(session[:user_id]) if session[:user_id]\n end", "def current_user\n User.find(session[:user_id]) if session[:user_id]\n end", "def current_user\n begin\n unless @current_user.nil?\n return @current_user\n else\n if session[:user_id]\n return @current_user = User.find(session[:user_id])\n else\n return nil\n end\n end\n rescue\n return nil\n end\nend", "def current_user\n return unless session[:user_id]\n User.find(session[:user_id])\n end", "def current_user\n login_from_session || login_from_basic_auth\n end", "def current_user\n\t\tauthenticated(User)\n\tend", "def current_user\n return @current_user if @current_user.present?\n\n session_user_id = session[:user_id]\n @current_user = if session_user_id.present?\n User.find_by(id: session_user_id) || AdminUser.find_by(id: session_user_id)\n end\n end", "def current_user(id = session[:user_id])\n User.get_one id\n end", "def current_user # Check the current user\n @current_user ||= User.find(session[:user_id]) if session[:user_id]\n end", "def current_user\n User.find_by_id(session[:user_id]) if session[:user_id] \n end", "def current_user\n @current_user if logged_in?\n end", "def current_user\n @current_user if logged_in?\n end", "def current_user\n return nil unless session[:user_id]\n User.get(session[:user_id])\nend", "def guest_user\n begin\n if !@cached_guest_user\n session[:guest_user_id] ||= create_guest_user.id\n @cached_guest_user = User.find(session[:guest_user_id])\n end\n rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n session[:guest_user_id] = nil\n @cached_guest_user = nil\n guest_user\n end\n @cached_guest_user\n end", "def current_user\n @current_user ||= find_logged_in_user\n end", "def current_user\n \n # Normally we would look in the session to see if there is a user_id \n # to figure out if the user is loggged in.\n # For demo purposes this app randomly picks if the user is logged in\n if rand(100) > 20 \n User.last\n else\n nil\n end\n end", "def current_user\n # User.find would throw an error if we cannot find the user\n User.find_by({ id: session[:user_id] })\n end", "def current_user\n\tif session[:user_id].present?\n\t\tUser.find(session[:user_id])\t\n\tend\nend", "def current_user\n User.find(session[:user])\n end", "def current_user\n if session[:user_id] # if there is a session id, the current user is the one whose session id is the same as the user id \n @current_user ||= User.find_by(id: session[:user_id])\n end\n end", "def current_user\n @current_user ||= User.find(session[:user_id]) if session[:user_id] #find user in database based on id, if not already logged in. \n \n end", "def current_user\n User.find session[:id] if session[:id]\n end", "def current_user\n\tsession[:user_id] ? User.find(session[:user_id]) : nil\nend", "def current_user\n\tsession[:user_id] ? User.find(session[:user_id]) : nil\nend", "def current_user\n if !session[:user_id] then nil else User.find(session[:user_id]) end\n end", "def current_user\n User.get_user(session[:user_id]) if session[:user_id]\n end", "def find_current_user\n # adding if to prevent rails from checking user when logged out\n if is_logged_in?\n #save to a variable\n @current_user = User.find(session[:user_id]);\n else\n @current_user = nil\n end\n end", "def current_user\n @current_user || User.find(session[:user_id]) if session[:user_id]\n \tend", "def current_user\n @current_user ||= User.find(session[:user_id]) if user_signed_in?\n end" ]
[ "0.8973923", "0.8931811", "0.8853329", "0.8695554", "0.865321", "0.85355735", "0.85355735", "0.85148513", "0.8458254", "0.84193385", "0.8403974", "0.8403553", "0.8400531", "0.8400531", "0.839848", "0.837988", "0.83771473", "0.83707076", "0.83662665", "0.8357405", "0.8357405", "0.8357405", "0.83557385", "0.8355267", "0.83500236", "0.83038723", "0.82853657", "0.82760066", "0.82424897", "0.82379335", "0.82379335", "0.82120645", "0.81908315", "0.8177314", "0.8108502", "0.8108502", "0.8108502", "0.8091662", "0.8089462", "0.80014884", "0.7982465", "0.79796815", "0.7959387", "0.7840086", "0.7827112", "0.7812612", "0.78020877", "0.7780514", "0.7777643", "0.77334154", "0.77134186", "0.77063584", "0.77037704", "0.76904714", "0.76431435", "0.7627969", "0.7623749", "0.76132655", "0.7598508", "0.7597264", "0.75712436", "0.7565968", "0.75446355", "0.7539798", "0.75362116", "0.7532628", "0.7526418", "0.7519884", "0.7506702", "0.750461", "0.75036377", "0.750141", "0.750141", "0.7499257", "0.7487978", "0.74858505", "0.746922", "0.74675393", "0.74668515", "0.74587333", "0.7458241", "0.7457596", "0.7457596", "0.745616", "0.7455102", "0.7447642", "0.7442285", "0.7440887", "0.7434546", "0.7431268", "0.74287045", "0.7427477", "0.74228275", "0.74223894", "0.74223894", "0.7420857", "0.7413652", "0.7411678", "0.7410728", "0.7410022" ]
0.84001786
14
find guest_user object associated with the current session, creating one as needed
def guest_user(with_retry = true) # Cache the value the first time it's gotten. @cached_guest_user ||= User.find(session[:guest_user_id] ||= create_guest_user.id) rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid session[:guest_user_id] = nil guest_user if with_retry end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def guest_user\n User.find(session[:guest_user_id] ||= create_guest_user.id)\n\n rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n session[:guest_user_id] = nil\n guest_user\n end", "def guest_user\n User.find(session[:guest_user_id].nil? ? session[:guest_user_id] = create_guest_user.id : session[:guest_user_id])\n end", "def guest_user\n if session[:guest_user_id]\n guest = Guest.where(id: session[:guest_user_id]).first\n end\n guest ||= Guest.create\n session[:guest_user_id] = guest.id\n guest\n end", "def guest_user\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find(session[:guest_user_id] ||= create_guest_user.id)\n rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n session[:guest_user_id] = nil\n guest_user\n end", "def guest_user\n \t# Cache the value the first time it's gotten.\n \t@cached_guest_user ||= User.find(session[:guest_user_id] ||= create_guest_user.id)\n\n rescue ActiveRecord::RecordNotFound #if (session[:guest_user_id] invalid\n \tsession[:guest_user_id] = nil\n \tguest_user\n end", "def guest_user\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find(session[:guest_user_id] ||= create_guest_user.id)\n\n rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n session[:guest_user_id] = nil\n guest_user\n end", "def guest_user\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find(session[:guest_user_id] ||= create_guest_user.id)\n\n rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n session[:guest_user_id] = nil\n guest_user\n end", "def guest_user\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find(session[:guest_user_id] ||= create_guest_user.id)\n\n rescue Mongoid::Errors::DocumentNotFound # if session[:guest_user_id] invalid\n session[:guest_user_id] = nil\n guest_user\n end", "def guest_user\n begin\n if !@cached_guest_user\n session[:guest_user_id] ||= create_guest_user.id\n @cached_guest_user = User.find(session[:guest_user_id])\n end\n rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n session[:guest_user_id] = nil\n @cached_guest_user = nil\n guest_user\n end\n @cached_guest_user\n end", "def guest_user\n unless defined? @guest_user\n if session[:guest_user_id] && (user = User.where(:id => session[:guest_user_id]).first)\n @guest_user = user\n else\n @guest_user = create_guest_user!\n session[:guest_user_id] = @guest_user.id\n end\n end\n return @guest_user\n end", "def guest_user\n\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find(session[:guest_user_id] ||= create_guest_user.id)\n @cached_guest_user\n rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n session[:guest_user_id] = nil\n\n guest_user\n end", "def guest_user\n guest_id = session[:guest_user_id]\n if guest_id.nil? || User.find(guest_id).nil?\n user = create_guest_user\n session[:guest_user_id] = user.id\n return User.find(user.id)\n end\n User.find(guest_id)\n end", "def guest_user\n @cached_guest ||= create_guest_user\n end", "def create_guest_user\n logger.debug \"ApplicationController:create_guest_user >>> creating new guest_user record\"\n guest = User.new_guest_user\n session[:guest_user_id] = guest.id\n guest\n end", "def create_guest_user\n u = User.new(:name => \"guest\", :email => \"guest_#{Time.now.to_i}#{rand(100)}@example.com\", :guest => true)\n u.save!(:validate => false)\n session[:guest_user_id] = u.id\n u\n end", "def create_guest_user!\n # bah, this may not be entirely guaranteed to be unique\n # but it would be hard for it to collide, good enough. Actually\n # if the rails session id isn't unique, it's gonna cause problems\n # for more than just us, we should be good with just that even.\n unique_token = \"#{request.session_options[:id]}_#{(Time.now.to_f * 1000.0).to_i}_#{Process.pid}\"\n\n new_user = User.new.tap do |u|\n u.login = \"GUEST_USER_#{unique_token}\"\n u.guest = true\n u.save!\n end\n end", "def guest_user\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find(cookies[:guest_user_id] ||= create_guest_user.id)\n\n rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n cookies[:guest_user_id] = nil\n guest_user\n end", "def create_guest_user\n email = \"guest_#{Time.now.to_i}#{rand(99)}@example.com\"\n u = User.create(:email => email)\n u.save!(:validate => false)\n session[:guest_user_id] = u.id\n u\n end", "def guest_user\n User.find_by_lazy_id(cookies[:uuid].nil? ? create_guest_user.lazy_id : cookies[:uuid])\n end", "def guest_user(allow_create = false)\n if allow_create\n @cached_guest_user ||= User.find(session[:guest_user_id] || create_guest_user.id)\n else\n @cached_guest_user ||= User.find(session[:guest_user_id])\n end\n\n rescue ActiveRecord::RecordNotFound\n # only allow retry if allow_create == true\n session[:guest_user_id] = nil\n guest_user if allow_create\n end", "def guest_user(with_retry = true)\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find(session[:guest_user_id] ||= create_guest_user.id)\n # if session[:guest_user_id] invalid\n rescue ActiveRecord::RecordNotFound\n session[:guest_user_id] = nil\n guest_user if with_retry\n end", "def guest_user\n guest = GuestUser.new\n guest.name = \"friend\"\n guest.first_name = \"Visitor\"\n guest.last_name = \"User\"\n guest.email = \"guest@ptorrsmith.com\"\n \n # return guest\n guest\n end", "def guest_user(with_retry = true)\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find(session[:guest_user_id] ||= create_guest_user.id)\n rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n session[:guest_user_id] = nil\n guest_user if with_retry\n end", "def guest_user(with_retry = true)\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find(session[:guest_user_id] ||= create_guest_user.id)\n rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n session[:guest_user_id] = nil\n guest_user if with_retry\n end", "def guest_user(with_retry = true)\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find(session[:guest_user_id] ||= create_guest_user.id)\n\n rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n session[:guest_user_id] = nil\n guest_user if with_retry\n end", "def guest_user\r\n guest = GuestUser.new\r\n guest.name = 'Guest User'\r\n guest.first_name = 'Guest'\r\n guest.last_name = 'User'\r\n guest.email = 'guest@test.com'\r\n guest\r\n end", "def guest_user(with_retry = true)\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find(session[:guest_user_id] ||= create_guest_user.id)\n\n rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n session[:guest_user_id] = nil\n guest_user if with_retry\n end", "def guest_user(with_retry = true)\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find(session[:guest_user_id] ||= create_guest_user.id)\n\n rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n session[:guest_user_id] = nil\n guest_user if with_retry\n end", "def guest_user(with_retry = true)\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find(session[:guest_user_id] ||= create_guest_user.id)\n\n rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n session[:guest_user_id] = nil\n guest_user if with_retry\n end", "def guest_user(with_retry = true)\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find(session[:guest_user_id] ||= create_guest_user.id)\n\n rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n session[:guest_user_id] = nil\n guest_user if with_retry\n end", "def guest_user(with_retry = true)\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find(session[:guest_user_id] ||= create_guest_user.id)\n\n rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n session[:guest_user_id] = nil\n guest_user if with_retry\n end", "def guest_user(with_retry = true)\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find(session[:guest_user_id] ||= create_guest_user.id)\n\n rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n session[:guest_user_id] = nil\n guest_user if with_retry\n end", "def guest_user(with_retry = true)\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find(session[:guest_user_id] ||= create_guest_user.id)\n\n rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n session[:guest_user_id] = nil\n guest_user if with_retry\n end", "def new_guest_user\n if object.user && object.user.guest? && object.user.trips.count == 1\n {email: object.user.email, authentication_token: object.user.authentication_token}\n else\n nil\n end\n end", "def guest_user(params)\n if u = User.where(:lazy_id => true).where(:lazy_id => cookies[:uuid]).first\n u\n else\n create_guest_user(params)\n end\n end", "def guest_user(with_retry = true)\n\t # Cache the value the first time it's gotten.\n\t @cached_guest_user ||= User.find(session[:guest_user_id] ||= create_guest_user.id)\n\n\t rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n\t \tsession[:guest_user_id] = nil\n\t \tguest_user if with_retry\n\t end", "def guest_user(with_retry = true)\n begin\n # Cache the value the first time it's gotten.\n @cached_guest_user ||=User.find_by_guest_authentication_token(session[:guest_authentication_token]) ||User.build_guest(session)\n rescue ActiveRecord::RecordNotFound\n session[:guest_authentication_token] = nil\n guest_user if with_retry\n end\n end", "def set_guest\n @user = GuestUsers::User.find(params[:id])\n end", "def register_guest\n params[:guest] = params[:user] if params[:user]\n if current_guest\n @user = User.find(current_guest.id)\n @user.email = params[:guest][:email]\n @user.email_preference = params[:guest][:email_preference]\n return render :guest_registration unless @user.valid?\n\n @user.save!\n else\n # See if I can convert these next few lines to find_or_create_by, making sure to still\n # set account_status to 'G'. Pay attention to the block below looking to see if @user is valid\n @user = Guest.find_by_email(params[:guest][:email].downcase)\n @user ||= Guest.new(guest_params.merge(account_status: 'G'))\n # Doing the 'unless' condition so a user can't then make himself a guest and break his account\n @user.account_status = 'G' unless @user.account_status == 'A'\n\n unless @user.valid?\n flash[:alert] = 'You must enter a valid email and accept the terms of service before you can proceed.'\n return render :guest_registration\n end\n\n @user.save!\n session[:guest] = @user.id\n end\n redirect_to controller: :store, action: :checkout\n end", "def guest_user\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find_by!(email: (cookies.permanent.signed[:guest_user_email] ||= create_guest_user.email))\n\n # if cookies.signed[:guest_user_email] invalid\n rescue ActiveRecord::RecordNotFound\n cookies.delete :guest_user_email\n guest_user\n end", "def guest_user\n # Cache the value the first time it's gotten.\n @cached_guest_user ||=\n User.find_by!(email: (cookies.permanent.signed[:guest_user_email] ||= create_guest_user.email))\n\n # if cookies.signed[:guest_user_email] invalid\n rescue ActiveRecord::RecordNotFound #\n cookies.delete :guest_user_email\n guest_user\n end", "def user_or_guest\n user or Guest.new(guest_uid, guest_name)\n end", "def create_guest_user\n user = User.new { |user| user.role = 'guest' }\n user.email = \"guest_#{Time.now.to_i}#{rand(99)}@example.com\"\n user.save(validate: false)\n user\n end", "def guest_user(with_retry = true)\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find(session[:guest_user_id]) if session[:guest_user_id]\n\n # rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n # session[:guest_user_id] = nil\n # guest_user if with_retry\n end", "def current_user\n if session[:user_id] != nil\n user = User.find(session[:user_id])\n elsif session[:guest_id] != nil\n user = User.find(session[:guest_id])\n else\n user = User.new(name: \"Guest\", authenticated: false)\n user.save\n session[:guest_id] = user.id\n end\n return user\n end", "def guest_user\n @guest_user ||= User.where(guest: true).first || super\n end", "def guest_user(with_retry = true)\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find(guest_user_id)\n\n rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n session[:guest_user_id] = nil\n guest_user if with_retry\n end", "def create_guest_user\n uuid = rand(36**64).to_s(36)\n temp_email = \"guest_#{uuid}@guest_user.com\"\n u = User.create(name: \"GUEST\", username: \"Guest #{User.guests.size}\", email: temp_email, lazy_id: uuid)\n cookies[:uuid] = { value: uuid, path: '/', expires: 5.years.from_now }\n u.save(validate: false)\n u\n end", "def guest_user\n User.find_by_email('guest@guest.com')\n end", "def current_or_guest_user!\n if current_user\n if cookies[:uuid]\n\n # Called when a guest user is converted to current user\n promote_guest_to_user(current_user)\n\n # destroy the guest user and the session\n destroy_guest_user\n end\n current_user\n else\n find_or_create_guest_user\n end\n end", "def guest_user\n @_guest ||= Guest.from_cookies(cookies) unless user_signed_in?\n end", "def guest_user\n User.find_by_lazy_id(cookies[:uuid])\n end", "def guest_user(with_retry = true)\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find(cookies.signed.permanent[:guest_user_id] ||= create_guest_user.id)\n\n rescue ActiveRecord::RecordNotFound # if cookies.signed[:guest_user_id] invalid\n cookies.delete :guest_user_id\n guest_user if with_retry\n end", "def current_or_guest_user(create_guest = false)\n @current_or_guest_user ||=\n (\n logger.debug 'ApplicationController:current_or_guest_user'\n if current_user\n if session[:guest_user_id] && session[:guest_user_id] != current_user.id\n remove_guest\n logger.debug \"ApplicationController:current_or_guest_user >>> current_user and guest_user session found -- guest_user remove and return current_user\"\n end\n current_user\n else\n logger.debug \"ApplicationController:current_or_guest_user >>> current_user not found -- switching to guest_user with create = #{create_guest}\"\n guest_user(create_guest)\n end\n )\n end", "def maybe_login_guest\n # Assume that guest exists in DB\n # session[:usr_id] = (Usr.find_by_login(\"guest\").id)\n # Being a guest means that session[:usr_id] is nil\n # unless (session[:usr_id])\n # The idea that a guest has a usr_id causes problems with login_sugar.\n # So, a guest does not have a usr_id.\n end", "def guest\n new(email: GUEST_USER_EMAIL).freeze\n end", "def guest\n defaultuser = (\n case ActiveRecord::Base.connection.adapter_name\n when 'MySQL'\n 'defaultUser'\n else\n 'defaultuser'\n end\n )\n User.find(:first, :conditions => \"#{self.class.primary_key}=#{self.id} AND #{defaultuser} = true\" )\n end", "def current_user\n @current_user ||= User.find(session[:user_id])\n rescue ActiveRecord::RecordNotFound\n #login User.create_guest\n end", "def guest\n\t\tid = User.count + 1\n\t\t@user = User.new(username: \"Guest_#{id}\", password: \"guestpass#{id}\", password_confirmation: \"guestpass#{id}\")\n\t\tif @user.save!\n\t\t\tsign_in @user\n\t\t\tflash[:success] = \"Welcome to Lightcycles!\"\n\t\t\tredirect_to root_path\n\t\telse\n\t\t\tflash[:error] = \"Sorry, there was an error!\"\n\t\t\tredirect_to \"/login\"\n\t\tend\n\tend", "def get_or_create_user\n @user||=use_url_session? ? get_or_create_url_session_user : current_user_with_guest\n end", "def current_or_guest_user\n if current_user\n if session[:guest_user_id] && session[:guest_user_id] != current_user.id\n\n logging_in\n # reload guest_user to prevent caching problems before destruction\n guest_user(with_retry = false).try(:reload).try(:destroy)\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end", "def current_or_guest_user\n if current_user\n if session[:guest_user_id] && session[:guest_user_id] != current_user.id\n logging_in\n # reload guest_user to prevent caching problems before destruction\n guest_user(with_retry = false).try(:reload).try(:destroy)\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end", "def current_or_guest_user\n if current_user\n if session[:guest_user_id] && session[:guest_user_id] != current_user.id\n logging_in\n # reload guest_user to prevent caching problems before destruction\n guest_user(with_retry = false).try(:reload).try(:destroy)\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end", "def current_or_guest_user\n if current_user\n if session[:guest_user_id] && session[:guest_user_id] != current_user.id\n logging_in\n # reload guest_user to prevent caching problems before destruction\n #guest_user(with_retry = false).try(:reload).try(:destroy)\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end", "def current_or_guest_user\n if current_user\n if session[:guest_user_id] && session[:guest_user_id] != current_user.id\n logging_in\n # reload guest_user to prevent caching problems before destruction\n guest_user(with_retry = false).reload.try(:destroy)\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end", "def current_or_guest_user\n if current_user\n if session[:guest_user_id] && session[:guest_user_id] != current_user.id\n logging_in\n # reload guest_user to prevent caching problems before destruction\n guest_user(with_retry = false).reload.try(:destroy)\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end", "def current_or_guest_user\n if current_user\n if session[:guest_user_id] && session[:guest_user_id] != current_user.id\n logging_in\n # reload guest_user to prevent caching problems before destruction\n guest_user(with_retry = false).reload.try(:destroy)\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end", "def current_or_guest_user\n if current_user\n if session[:guest_user_id] && session[:guest_user_id] != current_user.id\n logging_in\n guest_user(with_retry = false).try(:reload).try(:destroy)\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end", "def create_guest_user\n u = User.create(name: 'guest', email: \"guest_#{Time.current.to_i}#{rand(99)}@example.com\")\n # u.skip_confirmation!\n u.save!(validate: false)\n u\n end", "def current_or_guest_user\n if current_user\n if session[:guest_authentication_token] &&\n !current_user.matches_guest_authentication_token?(session[:guest_authentication_token])\n # transfer_guest_to_current_user\n guest_user(with_retry = false).try(:destroy)\n session[:guest_authentication_token] = nil\n end\n current_user\n else\n guest_user\n end\n end", "def current_or_guest_user\n if current_user\n transfer_session_to_logged_in_user if session[:guest_user_id].present?\n current_user\n else\n guest_user\n end\n end", "def current_or_guest_user\n if current_user\n if session[:guest_user_id] && session[:guest_user_id] != current_user.id\n logging_in\n guest_user(with_retry = false).try(:destroy)\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end", "def current_or_guest_user\n if current_user\n if session[:guest_user_id] && session[:guest_user_id] != current_user.id\n logging_in\n guest_user(with_retry = false).try(:destroy)\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end", "def current_or_guest_user\n if current_user\n if session[:guest_user_id] && session[:guest_user_id] != current_user.id\n logging_in(guest_user_id)\n guest_user(with_retry = false).try(:destroy)\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end", "def current_or_guest_user\n if current_user\n if session[:guest_user_id] && session[:guest_user_id] != current_user.id\n logging_in\n puts \"test\"\n puts \"11111111\"\n # reload guest_user to prevent caching problems before destruction\n guest_user(with_retry = false).try(:reload).try(:destroy)\n session[:guest_user_id] = nil\n end\n current_user\n puts \"222222222222\"\n else\n guest_user\n puts \"3333333333\"\n end\n end", "def check_for_guest\n if(params[:user_id]) then \n @user=User.find(params[:user_id])\n else\n @user=nil\n end\n @user\n end", "def create_guest_user\n u = User.create(email: \"guest_#{Time.now.to_i}#{rand(99)}@example.com\")\n #u.skip_confirmation!\n u.save!(validate: false)\n u\n end", "def create\n if (params[:user][:email] == \"guest@example.com\")\n prep_guest\n end\n super\n end", "def current_or_guest_user\n if current_user\n if session[:guest_user_id] && session[:guest_user_id] != current_user.id\n logging_in\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end", "def promote_guest_to_user(user)\n # What should be done here is take all that belongs to user with lazy_id matching current_user's uuid cookie...\n # then associate them with current_user\n\n # Copy the subscription data from the guest user to the newly created user:\n # For example:\n # guest_comments = guest_user.comments.all\n # guest_comments.each do |comment|\n # comment.user_id = current_user.id\n # comment.save\n # end\n\n if !cookies[:uuid].nil?\n #user.subscriptions = guest_user.subscriptions.dup\n true\n else\n false\n end\n\n # When we promote a guest to a user, the guest should be destroyed (This includes deleting the cookie)\n destroy_guest_user\n\n end", "def current_or_guest_user\n if current_user\n if session[:guest_user_id]\n logging_in\n #guest_user.destroy\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end", "def current_or_guest_user\n if current_user\n if session[:guest_user_id]\n logging_in\n guest_user.destroy\n session[:guest_user_id] = nil\n end\n return current_user\n else\n return guest_user\n end\n end", "def current_or_guest_user\n\t\tif current_user\n\t\t\tif session[:guest_user_id] && session[:guest_user_id] != current_user.id\n\t\t\t\tlogging_in\n\t\t\t\tguest_user(with_retry = false).try(:destroy)\n\t\t\t\tsession[:guest_user_id] = nil\n\t\t\tend\n\t\t\tcurrent_user\n\t\telse\n\t\t\tguest_user\n\t\tend\n\tend", "def create_guest\n\t\tcustom_params = { \n\t\t\temail: Faker::Internet.email, \n\t\t\tpassword: \"demodemo\",\n\t\t\tguest: true\n\t\t}\t\t\n\t\t\n\t\tUser.transaction do\n\t\t\t@user = User.new(custom_params)\n\t\t\t@user.create_dashboard\n\t\tend\n\t\t\n\t\tif @user.save\n log_in!(@user)\n\t\t\t@user.create_guest_blog_with_posts!\n\t\t\t\n render json: @user\n else\n render json: @user.errors.full_messages, status: 422\n end\n\t\t\n\tend", "def set_guest\n @guest = Guest.find(params[:id])\n end", "def set_guest\n @guest = Guest.find(params[:id])\n end", "def set_guest\n @guest = Guest.find(params[:id])\n end", "def set_guest\n @guest = Guest.find(params[:id])\n end", "def set_guest\n @guest = Guest.find(params[:id])\n end", "def current_or_guest_user\n if current_user\n if session[:guest_user_id]\n logging_in\n guest_user.destroy\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end", "def current_or_guest_user\n if current_user\n if session[:guest_user_id]\n logging_in\n guest_user.destroy\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end", "def guest\n @patient=User.find_by_wedgetail(params[:wedgetail],:order =>\"created_at DESC\")\n authorize_only (:patient) {@patient.wedgetail == @user.wedgetail}\n authorize :admin\n @newuser = User.new\n \n @newuser.username= WedgePassword.username_make(\"G\")\n @newuser.password= WedgePassword.random_password(6)\n @newuser.family_name=\"Guest \"+@newuser.username\n @newuser.wedgetail=@newuser.username + @patient.wedgetail\n @newuser.role=7\n if @newuser.save \n render(:layout => \"layouts/guestcard\")\n flash.now[:notice] = \"Guest User Created\"\n else\n flash.now[:notice] = \"Guest User Not Created Due to Error\"\n redirect_to(patient_path(@patient.wedgetail))\n end\n end", "def set_guest_session_association\n @guest_session_association = GuestSessionAssociation.new(user_id:session[:user_id],jam_session_id:params[:id],player:params[:player])\n @guest_session_association.save!\n end", "def current_user_or_guest\n if current_user\n if session[:guest_user_id]\n logging_in\n guest_user.destroy\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end", "def set_guest\n @guest = Guest.find(params[:id])\n end", "def set_guest\n @guest = Guest.find(params[:id])\n end", "def set_guest\n @guest = Guest.find(params[:id])\n end", "def set_guest\n @guest = Guest.find(params[:id])\n end", "def set_guest\n @guest = Guests.find(params[:id])\n end", "def current_or_guest_user\n if current_user\n if session[:guest_user_id]\n logging_in\n guest_user_log_out\n end\n current_user\n else\n guest_user\n end\n end" ]
[ "0.8472314", "0.845497", "0.8437258", "0.83520234", "0.82588893", "0.8223962", "0.8223962", "0.82176185", "0.8186563", "0.816379", "0.8079325", "0.8057306", "0.80276537", "0.80152476", "0.79473615", "0.79373574", "0.78641075", "0.7785678", "0.7782463", "0.7755364", "0.77047455", "0.76955676", "0.7685013", "0.7685013", "0.7674658", "0.7640263", "0.7633682", "0.7613969", "0.76135457", "0.76135457", "0.76135457", "0.76135457", "0.76135457", "0.75784886", "0.7569463", "0.75607085", "0.75093627", "0.7466932", "0.7453588", "0.7425075", "0.7387092", "0.73842025", "0.7377385", "0.7375537", "0.7354126", "0.7353264", "0.7287227", "0.7271106", "0.72575307", "0.7231313", "0.7167256", "0.7111747", "0.7097944", "0.7084342", "0.7034694", "0.7033265", "0.7022798", "0.7009305", "0.6995327", "0.692292", "0.68691754", "0.68377614", "0.6837535", "0.6836467", "0.6816957", "0.6816957", "0.6816957", "0.6791994", "0.6781696", "0.67255753", "0.6715164", "0.6706419", "0.6706419", "0.66778535", "0.6671573", "0.6662879", "0.66507864", "0.6643683", "0.65930665", "0.6581285", "0.6550329", "0.65389884", "0.6537893", "0.6509421", "0.6488873", "0.6488873", "0.6488873", "0.6488873", "0.6488873", "0.6482002", "0.6482002", "0.6477077", "0.6474799", "0.64649165", "0.6448859", "0.6448859", "0.6448859", "0.6448859", "0.64340186", "0.643143" ]
0.76364464
26
creates guest user by adding a record to the DB with a guest name and email
def create_guest_user email = "guest_#{Time.now.to_i}#{rand(99)}@example.com" u = User.create(:email => email) u.save!(:validate => false) session[:guest_user_id] = u.id u end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_guest_user\n user = User.new { |user| user.role = 'guest' }\n user.email = \"guest_#{Time.now.to_i}#{rand(99)}@example.com\"\n user.save(validate: false)\n user\n end", "def create_guest_user\n u = User.new(:name => \"guest\", :email => \"guest_#{Time.now.to_i}#{rand(100)}@example.com\", :guest => true)\n u.save!(:validate => false)\n session[:guest_user_id] = u.id\n u\n end", "def create_guest_user\n u = User.create(name: 'guest', email: \"guest_#{Time.current.to_i}#{rand(99)}@example.com\")\n # u.skip_confirmation!\n u.save!(validate: false)\n u\n end", "def create_guest_user\n logger.debug \"ApplicationController:create_guest_user >>> creating new guest_user record\"\n guest = User.new_guest_user\n session[:guest_user_id] = guest.id\n guest\n end", "def create_guest_user\n u = User.create(email: \"guest_#{Time.now.to_i}#{rand(99)}@example.com\")\n #u.skip_confirmation!\n u.save!(validate: false)\n u\n end", "def create_guest_user\n uuid = rand(36**64).to_s(36)\n temp_email = \"guest_#{uuid}@guest_user.com\"\n u = User.create(name: \"GUEST\", username: \"Guest #{User.guests.size}\", email: temp_email, lazy_id: uuid)\n cookies[:uuid] = { value: uuid, path: '/', expires: 5.years.from_now }\n u.save(validate: false)\n u\n end", "def create_guest\n\t\tcustom_params = { \n\t\t\temail: Faker::Internet.email, \n\t\t\tpassword: \"demodemo\",\n\t\t\tguest: true\n\t\t}\t\t\n\t\t\n\t\tUser.transaction do\n\t\t\t@user = User.new(custom_params)\n\t\t\t@user.create_dashboard\n\t\tend\n\t\t\n\t\tif @user.save\n log_in!(@user)\n\t\t\t@user.create_guest_blog_with_posts!\n\t\t\t\n render json: @user\n else\n render json: @user.errors.full_messages, status: 422\n end\n\t\t\n\tend", "def create\n if params[:guest]\n @user = User.create(name_family: \"\", name_first: \"\", name_family_kana: \"\", name_first_kana: \"\", phone_number: \"\",\n handle_name: \"guest#{ SecureRandom.random_number(9999) }\",\n user_status: \"guest\",\n password: SecureRandom.alphanumeric(6), confirmed_at: DateTime.now)\n @user.update(email: \"#{ @user.handle_name }@guest.com\")\n sign_in @user\n flash[:notice] = 'ゲスト会員でログインしました。'\n redirect_to root_path\n return\n end\n @user = User.new(sign_up_params)\n render :new and return if params[:back]\n super\n end", "def guest_user\r\n guest = GuestUser.new\r\n guest.name = 'Guest User'\r\n guest.first_name = 'Guest'\r\n guest.last_name = 'User'\r\n guest.email = 'guest@test.com'\r\n guest\r\n end", "def guest\n\t\tid = User.count + 1\n\t\t@user = User.new(username: \"Guest_#{id}\", password: \"guestpass#{id}\", password_confirmation: \"guestpass#{id}\")\n\t\tif @user.save!\n\t\t\tsign_in @user\n\t\t\tflash[:success] = \"Welcome to Lightcycles!\"\n\t\t\tredirect_to root_path\n\t\telse\n\t\t\tflash[:error] = \"Sorry, there was an error!\"\n\t\t\tredirect_to \"/login\"\n\t\tend\n\tend", "def create_guest\n params.require(:guest).permit(:email, :name)\n end", "def create\n if (params[:user][:email] == \"guest@example.com\")\n prep_guest\n end\n super\n end", "def register_guest\n params[:guest] = params[:user] if params[:user]\n if current_guest\n @user = User.find(current_guest.id)\n @user.email = params[:guest][:email]\n @user.email_preference = params[:guest][:email_preference]\n return render :guest_registration unless @user.valid?\n\n @user.save!\n else\n # See if I can convert these next few lines to find_or_create_by, making sure to still\n # set account_status to 'G'. Pay attention to the block below looking to see if @user is valid\n @user = Guest.find_by_email(params[:guest][:email].downcase)\n @user ||= Guest.new(guest_params.merge(account_status: 'G'))\n # Doing the 'unless' condition so a user can't then make himself a guest and break his account\n @user.account_status = 'G' unless @user.account_status == 'A'\n\n unless @user.valid?\n flash[:alert] = 'You must enter a valid email and accept the terms of service before you can proceed.'\n return render :guest_registration\n end\n\n @user.save!\n session[:guest] = @user.id\n end\n redirect_to controller: :store, action: :checkout\n end", "def create_guest_user!\n # bah, this may not be entirely guaranteed to be unique\n # but it would be hard for it to collide, good enough. Actually\n # if the rails session id isn't unique, it's gonna cause problems\n # for more than just us, we should be good with just that even.\n unique_token = \"#{request.session_options[:id]}_#{(Time.now.to_f * 1000.0).to_i}_#{Process.pid}\"\n\n new_user = User.new.tap do |u|\n u.login = \"GUEST_USER_#{unique_token}\"\n u.guest = true\n u.save!\n end\n end", "def adduser(email, password, first_name, last_name, slug)\n @user = User.invite!(:email => email, :slug => slug) do |u|\n u.skip_invitation = true\n end\n token = @user.instance_variable_get(:@raw_invitation_token)\n User.accept_invitation!(:invitation_token => token,\n :password => password,\n :password_confirmation => password,\n :first_name => first_name,\n :last_name => last_name,\n :slug => slug)\n\n puts \"Created User #{email} with password #{password}\"\n @user\n end", "def create\n @guest = Guests.new(guest_params)\n\n if @guest.save\n redirect_to home_path, notice: 'Thank you for your response!'\n else\n redirect_to home_path, notice: \"Oops, looks like we're missing something.\"\n end\n end", "def guest_user\n guest = GuestUser.new\n guest.name = \"friend\"\n guest.first_name = \"Visitor\"\n guest.last_name = \"User\"\n guest.email = \"guest@ptorrsmith.com\"\n \n # return guest\n guest\n end", "def guest\n @patient=User.find_by_wedgetail(params[:wedgetail],:order =>\"created_at DESC\")\n authorize_only (:patient) {@patient.wedgetail == @user.wedgetail}\n authorize :admin\n @newuser = User.new\n \n @newuser.username= WedgePassword.username_make(\"G\")\n @newuser.password= WedgePassword.random_password(6)\n @newuser.family_name=\"Guest \"+@newuser.username\n @newuser.wedgetail=@newuser.username + @patient.wedgetail\n @newuser.role=7\n if @newuser.save \n render(:layout => \"layouts/guestcard\")\n flash.now[:notice] = \"Guest User Created\"\n else\n flash.now[:notice] = \"Guest User Not Created Due to Error\"\n redirect_to(patient_path(@patient.wedgetail))\n end\n end", "def create_user\n user = User.where(email: user_email)\n if user.blank? # new user\n @user = create_new_user\n church = nil\n if affiliation.blank?\n church = create_affiliation_from_church\n else\n church = Affiliation.find(self.affiliation)\n end\n @user.affiliation = church\n church.users << @user\n @user.save\n\n guest = Role.find_by_name(\"Guest\").id \n @user.role_ids=[guest]\n self.user_id = @user.id\n end\n end", "def create\n @user = params[:user] ? User.new(params[:user]) : User.new_guest\n if @user.save\n flash[:notice] = \"Your account was created successfully.\"\n current.user.move_to(@user) if current.user && current.user.guest?\n session[:user_id] = @user.id\n redirect_to root_path\n else\n render \"new\"\n flash[:notice] = \"There was a problem creating your account.\"\n end\n after_create :set_admin \n end", "def create\n @user = GuestUsers::User.new(guest_params)\n @user.host = current_user\n respond_to do |format|\n if @user.save\n @user.guest!\n if request.xml_http_request?\n format.html {render :show_for_modal, :layout => false}\n else\n format.html {redirect_to @user, notice: 'Guest was successfully created.'}\n end\n format.json {render :show, status: :created, location: @user}\n else\n if request.xml_http_request?\n format.html {render :new_for_modal, :layout => false}\n else\n format.html {render :new}\n end\n\n format.json {render json: @user.errors, status: :unprocessable_entity}\n end\n end\n end", "def create\n @guest = Guest.new(guest_params)\n\n respond_to do |format|\n if @guest.save\n format.html { redirect_to @guest, notice: 'Guest was successfully created.' }\n format.json { render :show, status: :created, location: @guest }\n else\n format.html { render :new }\n format.json { render json: @guest.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @guest = Guests.new(guest_params)\n\n respond_to do |format|\n if @guest.save\n format.html { redirect_to @guest, notice: 'Guests was successfully created.' }\n format.json { render :show, status: :created, location: @guest }\n else\n format.html { render :new }\n format.json { render json: @guest.errors, status: :unprocessable_entity }\n end\n end\n end", "def new_guest_user\n if object.user && object.user.guest? && object.user.trips.count == 1\n {email: object.user.email, authentication_token: object.user.authentication_token}\n else\n nil\n end\n end", "def user_creation_for_guest_user(user)\n response = HTTParty.post(\"#{Rails.application.secrets.mapp_integration[:api_endpoint]}\"+\"/user/create\", headers: headers, query: user_creation_api_query(user), body: user_creation_api_body(user))\n end", "def create_user\n User.create name: \"test\", email: \"test@example.com\", password: \"123456\"\n end", "def create_user\n User.create name: 'test', email: 'test@example.com', password: '123456'\n end", "def create\n @guest = Guest.new(params[:guest])\n\n respond_to do |format|\n if @guest.save\n format.html { redirect_to @guest, notice: 'Guest was successfully created.' }\n format.json { render json: @guest, status: :created, location: @guest }\n# Notifier.invited(@guest).deliver\n else\n format.html { render action: \"new\" }\n format.json { render json: @guest.errors, status: :unprocessable_entity }\n end\n end\n end", "def add_user(name, is_admin, building_id, notify_new_request= false, notify_new_listing=false)\n user_id = User.create(\n first_name: name,\n last_name: 'LNU',\n email: 'jack+' + name + '@jackmgill.com',\n password: 'foo',\n is_admin: is_admin,\n building_id: building_id,\n notify_new_request: notify_new_request,\n notify_new_listing: notify_new_listing\n ).id\n return user_id\nend", "def guest_user\n if session[:guest_user_id]\n guest = Guest.where(id: session[:guest_user_id]).first\n end\n guest ||= Guest.create\n session[:guest_user_id] = guest.id\n guest\n end", "def register()\n\tentry = {\"userid\" => @userid, \"username\" => @username, \"email\" => @email, \"password\" => @password}\n\tDATABASE.newEntry(\"users\", entry)\n\tend", "def create_user\n User.create name: 'test', email: 'test@example.com', password: '123456'\n end", "def create_user\n return @user.send_confirmation_instructions if @user\n\n @user = User.create!(new_agent_params.slice(:email, :name, :password, :password_confirmation))\n end", "def create\n @guest = Guest.new(guest_params)\n\n respond_to do |format|\n if @guest.save\n format.html { redirect_to @guest, notice: 'Guest was successfully created.' }\n format.json { render action: 'show', status: :created, location: @guest }\n else\n format.html { render action: 'new' }\n format.json { render json: @guest.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n user = User.find_by_email params[:user][:email]\n if user.blank?\n @user = User.create(user_params.merge(guest: true, invitation_token: generate_token))\n link_to_property @user, params[:user][:property_id] unless params[:user][:property_id].blank?\n UsersMailer.delay.invite_new_user current_user, @user\n end\n redirect_to properties_path\n end", "def create\n @guest = Guest.new(params[:guest])\n\n respond_to do |format|\n if @guest.save\n flash[:notice] = 'Guest was successfully created.'\n format.html { redirect_to(@guest) }\n format.xml { render :xml => @guest, :status => :created, :location => @guest }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @guest.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @guest = Guest.new(guest_params)\n\n respond_to do |format|\n if @guest.save\n format.html { redirect_to @guest, notice: 'Participante criado com sucesso!' }\n format.json { render :show, status: :created, location: @guest }\n else\n format.html { render :new }\n format.json { render json: @guest.errors, status: :unprocessable_entity }\n end\n end\n end", "def createuser(email, password, name, avatar)\n password_digest = BCrypt::Password.create(password)\n admin = \"0\"\n db.execute(\"INSERT INTO users(email, password, name, avatar, admin) VALUES (?,?,?,?,?)\", [email, password_digest, name, avatar, admin])\nend", "def guest\n new(email: GUEST_USER_EMAIL).freeze\n end", "def create\n #create the guest\n @guest = Guest.new(guest_params)\n\n #save the guest and create the invitation\n if @guest.save\n @inv = Invitation.new()\n @inv.guest_id = @guest.id\n @inv.event_id = Event.find_by(id:request.headers['EventId'].to_s).id\n @inv.user_id = User.find_by(auth_token:request.headers['AuthorizationToken'].to_s).id\n else\n render json: @guest.errors, status: :unprocessable_entity\n end\n\n #save the invitation and return the guest\n if @inv.save\n render json: @guest, status: :created, location: @guest\n else\n render json: @inv.errors, status: :unprocessable_entity\n end\n end", "def create_new_user\r\n touch(\"* id:'#{add}'\")\r\n end", "def create_guest(first_name: (\"A\"..\"z\").to_a.sample(5).join, last_name: (\"A\"..\"z\").to_a.sample(5).join)\n Guest.new(first_name: first_name, last_name: last_name)\n end", "def do_create\n begin\n raise 'Passwords do not match' unless request[:password] == request[:checkpass]\n user = Models::User.new\n user.username = request[:username]\n user.email = request[:email]\n user.name = request[:name]\n user.password = request[:password]\n user.save\n flash[:success] = 'New user has been added.'\n redirect('/admin')\n rescue Object => boom\n flash[:error] = \"Error encountered while saving: #{boom}\"\n redirect_referer\n end\n end", "def create\n fname = \"#{self.class.name}.#{__method__}\"\n super\n user=User.find_by_email(reg_params[:email])\n pars={}\n unless user.nil?\n pars[:name]=params[:user][:name]\n pars[:role]=params[:user][:role]\n user.update(pars) \n else\n user=User.new(params[:user])\n end\n LOG.debug(fname) {\"************************ current_user=#{user.inspect}\"}\n end", "def create\n\n if User.exists? email: params[:user][:email]\n user = User.find_by_email params[:user][:email]\n if user.invited_to_sign_up?\n Rails.logger.warn \"User #{user.email} was invited but instead of accepting the invitation is signing up normally. Destroying old user record before signup.\"\n user.destroy\n end\n end\n\n super\n end", "def guest_user\n User.find(session[:guest_user_id].nil? ? session[:guest_user_id] = create_guest_user.id : session[:guest_user_id])\n end", "def create_employee_user\n email = self.work_email\n user = User.new(email: self.work_email, password: 'appsimpact@#123', role: 'employee')\n user.save\n self.user_id = user.id\n end", "def create_guest_gamer(education, country, gender, dob)\n gamer = Gamer.new\n gamer.username = \"Guest_#{Time.now.to_i}#{rand(99)}\"\n gamer.country = country\n gamer.education_level = education\n gamer.gender = gender\n gamer.date_of_birth = dob\n gamer.email = \"guest_#{Time.now.to_i}#{rand(99)}@example.com\"\n gamer.password = \"1234567\"\n gamer.is_guest = true\n gamer.confirmed_at = Time.now\n if gamer.save\n session[:guest_gamer_id] = gamer.id\n return gamer, true\n else\n return gamer, false\n end\n end", "def guest_user\n User.find(session[:guest_user_id] ||= create_guest_user.id)\n\n rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n session[:guest_user_id] = nil\n guest_user\n end", "def create_user(name, email, password)\n\n # Password is hashed automatically\n user = User.new(name: name, email: email, password: password)\n user.save!\n end", "def create_admin\n unless User.find_by_email('admin@example.com')\n User.create! email: 'admin@example.com', password: 'password'\n end\nend", "def signup(params)\n if self.is_client?\n user = self.employees.create!(name: params[:name],last_name: params[:last_name],\n email: params[:email],password: params[:password],password_confirmation: params[:password_confirmation])\n GroupsUser.create!(user_id: user.id,group_id: params[:group_id])\n user\n else\n user = self.clients.create!(name: params[:name],email: params[:email],password: params[:password],\n password_confirmation: params[:password_confirmation])\n end\n end", "def create_user_account\n User.create!(email: self.email, password: self.customer)\n # user = User.new do |u|\n # u.email = email\n # u.password = customer\n # u.save\n # end\n end", "def create_user_if_none_exist\n return if User.exists?\n puts \"Creating Users...\"\n\n User.create :email => \"test@test.com\", :password => \"welcome1\", :password_confirmation => \"welcome1\"\n end", "def cria_user\n return if user.present?\n User.create(email: self.end_email, password: '123123', password_confirmation: '123123',\n tb_empregado_id: self.id, e_admin: self.e_admin || false).encrypted_password\n end", "def create_user(email, name, pw)\n user = User.find_or_create_by(username: name) do |u|\n u.email = email\n u.username = name\n u.password = pw\n u.password_confirmation = pw\n end\n user\nend", "def createUser(nickname) \n usr = User.new(nickname)\n backend_addUser(usr) \n end", "def create\n\t\t# method interacts with session > new.html.erb view\n\t\tuser = User.where(email: params[:user_email]).first\n\t\tif user && user.authenticate(params[:password])\n\t\t\tsession[:user_id] = user.id.to_s\n\t\t\tredirect_to '/'\n\t\telse\n\t\t\tredirect_to :back\n\t\tend\n\tend", "def create_user\n params = {\n client_id: @client_id,\n email: @email\n }\n @user = User.using_client_shard(client: @client).create!(params)\n end", "def create\n\t\t#get the user info\n\t\t\n\t\tauth = request.env[\"omniauth.auth\"]\n\t\tif auth == nil and \n\t\t\tif session[:temp] == true\n\t\t\t auth = {:info => {:email => \"jkoshakow@wesleyan.edu\"} }\n\t\t\telse\n\t\t\t auth = {:info => {:email => \"koshy44@gmail.com\"} }\t\n\t\t\tend\n\t\tend\n\t\t#whitelist \n\t\tif auth[:info][:email].to_s =~ /.+@wesleyan.edu/\n\t\t\tuser = User.find_by_uid(auth[\"uid\"]) || User.createUser(auth)\n\t\t\tsession[:user_id] = user.id \n\t\t\tsession[:admin] = user.admin\n\t\t\tsession[:authenticated] = true\n\t\t\tredirect_to links_path\n\t\telse\n\t\t\tsession[:authenticated] = false\n\t\t\tsession[:error] = \"Must have a wesleyan email address\"\n\t\t\tredirect_to root_path\n\t\tend\t\n\tend", "def create\n @user = User.new(user_params)\n if @user.save\n redirect_to '/enter'\n puts \"User created & saved to db\"\n else\n redirect_to '/enter'\n puts \"User not saved\"\n end\n end", "def create\n first_name, last_name, email, password = *params.values_at(:first_name, :last_name, :email, :password)\n\n if [first_name, last_name, email, password].any?(&:blank?)\n return render_success({status:\"error\", message: 'invalid create parameters'})\n end\n\n #User already exists\n if User.exists?(email: email.downcase)\n return render_success({status:\"error\", message:\"user already exists\"})\n end\n #create user\n User.transaction do\n @user = User.new(\n name: (first_name + \" \" + last_name).titleize,\n email: email.downcase,\n password: password,\n password_confirmation: password\n )\n if @user.save!\n render_success({status:\"success\", message:\"created\"})\n else\n render_success({status:\"error\", message:\"user creation failed\"})\n end\n end\n end", "def create_user\n # provide the interface asking for name, destination and duration\n # then, create and store the User object\n end", "def createNewUser(userName, initialGroup, userEmail, fname, lname, password)\n\n password = password.encrypt\n user = {\"login\" => userName,\n \"group0\" => initialGroup,\n \"email\" => userEmail,\n \"fname\" => fname,\n \"lname\" => lname,\n \"password\" => password,\n \"orga\" => \"0\"}\n saveUser(userName, user)\n end", "def new_user(name)\n User.create(name: name)\nend", "def guest_create\n authorize! :guest_create, Team.new\n raise InvalidParameter unless current_user.nil?\n \n tenant = LandLord.mitoo_tenant\n\n ActiveRecord::Base.transaction do\n @team = Team.new({\n name: params[:team][:name],\n created_by_type: \"User\"\n })\n\n @team.create_profile!({\n age_group: params[:team][:age_group],\n colour1: params[:team][:colour1] || DefaultColourEnum::DEFAULT_1,\n colour2: params[:team][:colour2] || DefaultColourEnum::DEFAULT_2,\n sport: params[:team][:sport]\n })\n @team.tenant = tenant\n @team.configurable_set_parent(tenant)\n\n @team.save!\n end\n\n # TODO: js must grab the uuid, set as cookie, and pass in params to\n # user_registrations#new_team_organiser as :team_uuid\n render 'show', formats: [:json], locals: { show_uuid: true }, location: api_v1_team_path(@team), status: :ok\n end", "def guest_user\n @cached_guest ||= create_guest_user\n end", "def create_user(db, user_name)\n\tdb.execute(\"INSERT INTO users (user_name) VALUES (?)\", [user_name])\n\tputs \"added new user\"\nend", "def guest_user\n User.find_by_email('guest@guest.com')\n end", "def new_user(user_name, email)\n @user_name = user_name\n @email = email\n\n mail to: \"Susie Ye <susie@baserails.com>\", subject: \"Free User: #{email}\"\n end", "def create\n name = params[:name]\n email = params[:email]\n password = params[:password]\n new_user = User.create!(\n name: name,\n email: email,\n password: password,\n )\n\n response = \"Hey #{name}, You are registered successfully!\"\n render plain: response\n end", "def create_gamer(email, password, username)\n gamer = Gamer.new\n gamer.username = username\n gamer.country = guest_gamer.country\n gamer.education_level = guest_gamer.education_level\n gamer.gender = guest_gamer.gender\n gamer.date_of_birth = guest_gamer.date_of_birth\n gamer.email = email\n gamer.password = password\n gamer.show_tutorial = guest_gamer.show_tutorial\n gamer.highest_score = guest_gamer.highest_score\n gamer.confirmed_at = nil\n if gamer.save\n logging_in(gamer.id)\n session[:guest_gamer_id] = nil\n return gamer, true\n else\n return gamer, false\n end\n end", "def create\n email = params[:user][:email]\n @user = User.find_by_email(email)\n if @user.nil?\n @user = User.create(email: email)\n @user.save!\n end\n session[:current_user_id] = @user.id\n redirect_to controller: 'games', action: 'new', game: {user: @user}\n end", "def create \n\t\tparams.inspect\n\t\tparams[:user][:email] = params[:user][:email].downcase\n\t\tparams.inspect\n\t\tuser = User.find_by(email: params[:user][:email])\n\n\t\tif user && user.authenticate(params[:user][:password])\n\t\t\tsession[:user_id] = user.id.to_s\n\t\t\tredirect_to recipes_path\n\t\telse\n\t\t\tflash[:danger]= \"Invalid login credentials.\"\t\n\t\t\tredirect_to login_path\n\n\n\t\tend\n\tend", "def create_user(obj, type)\n @logger.info(\"Creating user for #{type} #{obj.name}\")\n user = SugarCRM::User.new\n user.user_name = (type == 'agent') ? obj.emerchantpay_agent_id : obj.emerchantpay_iso_id\n user.user_name ||= \"EMP\"\n user.last_name = obj.name\n user.type_c = type\n #user.email1 = obj.email_address || \"mail@example.com\"\n user.email1 = 'stefan@emerchantpay.com'\n user.status = 'Inactive'\n user.system_generated_password = false\n user.save!\n obj.assigned_user_id = user.id\n obj.save!\n \n populate_user_pool(user, type)\n end", "def create\n\n @new_user = User.new\n\n new_user = @new_user.add(params['user_name'], params['pswd1'], params['email'], params['full_name'])\n\n if new_user.errors.any?\n redirect_to \"/\", :flash => { :error => 'User already exists'}\n else\n redirect_to \"/main\"\n end\n end", "def create\n @user = User.new(\n email: params[:user][:email],\n password: params[:user][:password],\n password_confirmation: params[:user][:password_confirmation],\n admin: params[:user][:admin],\n master: params[:user][:master]\n )\n\n e = -> (ex) {\n flash[:alert] = ex.message\n session[:form] = {\n email: params[:user][:email],\n admin: params[:user][:admin],\n master: params[:user][:master],\n }\n redirect_to(action: :new)\n }\n\n begin\n @user.save!\n rescue => ex\n e.(ex) and return\n end\n\n begin\n #TODO カレントユーザーでZabbixとコネクションを張れるようにする\n s = AppSetting.get\n z = Zabbix.new(s.zabbix_user, s.zabbix_pass)\n z.create_user(@user)\n rescue => ex\n @user.destroy\n e.(ex) and return\n end\n\n flash[:notice] = I18n.t('users.msg.created')\n redirect_to(action: :index) and return\n end", "def guest_user(params)\n if u = User.where(:lazy_id => true).where(:lazy_id => cookies[:uuid]).first\n u\n else\n create_guest_user(params)\n end\n end", "def sign_up(useremail, password)\n if new_user_available(useremail)\n query = \"INSERT INTO Users (useremail, password) VALUES('#{useremail}', '#{password}')\"\n @connection.exec(query)\n end\n end", "def create_user\n fake_password = Faker::Internet.password\n params = {\n user: {\n username: Faker::Internet.user_name,\n email: Faker::Internet.email,\n password: fake_password,\n password_confirmation: fake_password\n }\n }\n post signup_post_url, { params: params }\n params[:user]\n end", "def create_user\n # first insert into user_secrets and use it's id in users table\n @user_secret = UserSecret.using_client_shard(client: @client).create!(login_salt: @login_salt_hash[:ciphertext_blob])\n\n password_e = User.using_client_shard(client: @client).get_encrypted_password(@password, @login_salt_hash[:plaintext])\n\n @user = User.using_client_shard(client: @client).new(\n client_id: @client_id,\n email: @email,\n password: password_e,\n user_secret_id: @user_secret.id,\n status: GlobalConstant::User.active_status,\n last_logged_in_at: Time.now.to_i\n )\n\n @user.send(\"set_\" + GlobalConstant::User.doptin_mail_sent_property) if @client.is_verify_page_active_for_client?\n @user.save!\n end", "def create_trainer \n\t\ttrainer = Trainer.find_by_email(params[:email])\n\t\tif trainer && trainer.authenticate(params[:password])\n\t\t\tsession[:trainer_id] = trainer.id\n\t\t\tredirect_to root_path\n\t\telse \n\t\t\trender \"new_trainer\", alert: \"User Id And or Password Invalid\"\n\t\tend \n \tend", "def create(name, email)\n new(name, email).save\n end", "def create\n # Create a new user from the registrant\n # Keep the email the same\n @user = User.new(user_params)\n @user.email = @registrant.email\n \n # If the user is valid and saves, then destroy the\n # registrant, log the user in, and redirect to the home page\n if @user.save\n @registrant.destroy\n session[:user_id] = @user.id\n redirect_to root_url, notice: \"Welcome to Track Yo' Gas!\"\n else\n # Else, rerender the form\n render :new\n end\n end", "def perform(name, email, password)\n User.create(\n name: name,\n email: email,\n password: password,\n password_confirmation: password\n )\n end", "def create\n @user = User.new(user_params)\n if @user.save\n \n #immediately signs in newly registerd user\n sign_in :user, @user \n load_current_cart if session[:guest_user_id] != nil\n \n redirect_to @user, {notice: 'User was created'}\n else\n render 'new'\n end\n end", "def create_user(name, password_digest, rank, security, mail)\n\n db = connect_to_db(\"db/db.db\")\n\n db.execute(\"INSERT INTO users (name, password, rank, security_level, mail) VALUES (?,?,?,?,?)\", name, password_digest, rank, security, mail)\n\n end", "def register_user(mail, password_digest, date_joined, admin)\n return get_db_as_hash().execute(\"INSERT INTO user(mail, password_digest, date_joined, admin) VALUES (?, ?, ?, ?)\", mail, password_digest, date_joined, admin)\n end", "def create\n @guest = @wedding.guests.new(guest_params)\n\n respond_to do |format|\n if @guest.save\n\n @guest.evt.create! wedding: @wedding,\n state: 'new',\n headline: \"#{current_user.name} added #{@guest.name} to the guest list\"\n\n format.html { redirect_to wedding_guestlist_path(@wedding), notice: \"#{@guest.name} #{@guest.total_guests > 1 ? \"have\" : \"has\"} been added to the list.\" }\n format.json { render json: @guest, status: :created, location: @guest }\n else\n errors = @guest.errors.full_messages.map do |message|\n \"<li>#{message}</li>\"\n end.join\n\n format.html { redirect_to wedding_guestlist_path(@wedding), alert: \"Guest had problems: <ul>#{errors}</ul>\" }\n\n format.json { render json: @guest.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_user(body)\n post 'create_user', body\n end", "def create\n @guestaccount = Guestaccount.find_by_email(params[:session][:email])\n if @guestaccount && @guestaccount.authenticate(params[:session][:password])\n session[:guestaccount_id] = @guestaccount.id\n redirect_to '/guest?' \n else\n flash.now[:danger] = \"Invalid email/password combination\"# alert if wrong password/email combo entered\n render 'new'\n end \nend", "def create\n @user = User.new(email:session[:userinfo].info.email,\n name:session[:userinfo].info.name,\n uid:session[:userinfo].uid)\n if @user.save\n @user.save\n redirect_to @user, notice: \"Welcome #{@user.name}!\"\n else\n redirect_to root_path, status: \"Something went wrong. Let's try this again.\"\n end\n end", "def add_guest(guest, circle = guest.circle) \n # Adds authorization plugin role: 'guest' of user\n # guests can identify their hosts with:\n # guest.is_guest_of_what => Array of Members\n # and member can identify their guests with:\n # member.has_guests? => true/false\n # member.has_guests => Array of Guests\n #\n # Things to watch out for:\n # g.has_role? 'guest' => false\n # g.has_role? 'guest, member => ArgumentError\n guest.is_guest_of self\n \n # Adds relationship: guest + circle\n relationships.create!(:guest => guest, :circle => circle)\n end", "def create_user(email, pass, login = nil, id = nil, cui = nil)\n send_req({\n act: :user_create,\n cloudflare_email: email,\n cloudflare_pass: pass,\n cloudflare_username: login,\n unique_id: id,\n clobber_unique_id: cui\n })\n end", "def new_user\n User.new({\n email: 'hoge@hoge',\n password: 'hoge',\n password_confirmation: 'hoge'\n })\n end", "def create_new_account(database, email_address, first_name, last_name, password)\r\n database.execute(\"INSERT INTO users (email_address, first_name, last_name, password) VALUES (?, ?, ?, ?)\", [email_address, first_name, last_name, password])\r\nend", "def create\n \t@user = User.new(user_params)\n\n # save user data\n if @user.save\n redirect_to new_session_path\n else\n flash.keep[:error] = \"Email address already taken.\" # check if email is already taken\n redirect_to new_user_path\n end\n end", "def create_test_user!(attrs = {})\n default_email = 'john.doe@test.com'\n if attrs[:email].blank?\n attrs[:email] = if attrs[:name].present?\n default_email.gsub('john.doe', attrs[:name].parameterize)\n else\n default_email\n end\n end\n\n usrs = User.where(email: attrs[:email])\n if usrs.blank?\n user = User.new({ name: 'John Doe', email: default_email, password: 'my_Password10' }.merge(attrs))\n user.skip_confirmation!\n raise \"User not created! #{user.errors.full_messages.join(';')}\" unless user.save\n\n user\n else\n usrs.first\n end\n end", "def set_guest\n @user = GuestUsers::User.find(params[:id])\n end", "def create\n @user = User.new #create user\n @user.email = params[:email] #set value of email attribute\n @user.password = params[:password] #set value of password attribute\n\n if @user.save #save email and password to the database\n redirect_to \"/login\"\n else\n render :new\n end\n end" ]
[ "0.830063", "0.82268023", "0.8224379", "0.8064195", "0.80425715", "0.7921024", "0.77377284", "0.76262295", "0.7621246", "0.754229", "0.75343883", "0.7490319", "0.7354039", "0.73403853", "0.72703385", "0.72430253", "0.71995056", "0.7190832", "0.7177955", "0.7111888", "0.7084277", "0.6971099", "0.69624615", "0.6960205", "0.6921997", "0.6915978", "0.6896018", "0.6887237", "0.688293", "0.68604577", "0.68545413", "0.68244696", "0.68209386", "0.6815283", "0.6804538", "0.6801269", "0.6799116", "0.6785183", "0.6780509", "0.6759831", "0.67571354", "0.6720598", "0.6704184", "0.6697122", "0.6675542", "0.6665493", "0.6664807", "0.66535336", "0.6637448", "0.66263044", "0.6623957", "0.662275", "0.6613473", "0.6611862", "0.6605225", "0.65948725", "0.6592417", "0.6591117", "0.6577554", "0.6576927", "0.6568428", "0.6567104", "0.65547377", "0.6552396", "0.6551171", "0.6544257", "0.6533443", "0.65043485", "0.6497643", "0.6491172", "0.64860135", "0.6480177", "0.64797133", "0.6478349", "0.6477797", "0.64747703", "0.647051", "0.64703286", "0.6468847", "0.6468477", "0.64643836", "0.6461947", "0.64561987", "0.64556307", "0.6440761", "0.6435485", "0.6419136", "0.64168334", "0.64162374", "0.6413708", "0.64057875", "0.6405198", "0.64024955", "0.6396924", "0.6396518", "0.6395417", "0.6394796", "0.6391313", "0.6389604", "0.6384727" ]
0.8220254
3
GET /products/1 GET /products/1.json
def show @categories = Category.parent_categories @images = @product.product_images end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def product(name)\n get(\"/apiproducts/#{name}\")\n end", "def show\n product = Product.find_by_id(params[:id])\n\n render json: product\n end", "def show\n @product = Product.find(params[:id])\n\n render json: @product\n end", "def index\n @api_v1_products = Product.all\n json_response(@api_v1_products)\n end", "def show\n @product = Product.find(params[:id])\n json_response(params)\n end", "def get_products()\n\tputs \"Getting products\"\n\tresponse = request_get(\"/api/product\")\n\tputs response.body\nend", "def show\n @product = Product.find(params[:id])\n render json: @product, status: :ok\n end", "def show\n result = Product.find(params[:id])\n render json: {\n status: :ok,\n product: result\n } \n end", "def show\n @products = Product.find_by_id(params[:id])\n msg = { status: 200 , product: @products }\n respond_to do |format|\n format.html { render json: msg }\n format.json { render json: msg }\n end\n end", "def index\n @products = Product.all\n render json: @products\n end", "def show\n render json: @product, status: 200\n end", "def show\n @product = Product.find(params[:id])\n\n render json: @product\n end", "def show\n json_response(@api_v1_product)\n end", "def index\n @products = Product.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @products }\n end\n end", "def index\n @products = Product.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @products }\n end\n end", "def index\n @products = Product.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @products }\n end\n end", "def index\n @products = Product.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @products }\n end\n end", "def show\n render :json => Producto.find(params[:id])\n end", "def index\n begin\n @products = Product.all\n render json: @products, status: 200\n rescue => exception\n render json: { errors: exception }\n end\n end", "def show\n @product = ProductProduct.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @product }\n end\n end", "def show\n render json: @product\n end", "def index\n \tproducts = Product.all\n \trender json: products\n \tend", "def products\n request :public, :get, :products\n end", "def show\n @product = Product.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @product }\n end\n end", "def index\n @products = Product.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @products }\n end\n end", "def index\n @products = Product.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @products }\n end\n end", "def index\n @products = Product.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @products }\n end\n end", "def index\n @products = Product.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @products }\n end\n end", "def show\n render json: @product\n end", "def show\n @product = Product.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @product }\n end\n end", "def show\n @product = Product.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @product }\n end\n end", "def show\n @product = Product.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @product }\n end\n end", "def show\n @product = Product.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @product }\n end\n end", "def show\n @product = Product.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @product }\n end\n end", "def show\n @product = Product.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @product }\n end\n end", "def show\n @product = Product.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @product }\n end\n end", "def show\n @product = Product.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @product }\n end\n end", "def show\n @product = Product.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @product }\n end\n end", "def show\n @product = Product.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @product }\n end\n end", "def show\n @product = Product.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @product }\n end\n end", "def show\n @product = Product.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @product }\n end\n end", "def show\n @product = Product.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @product }\n end\n end", "def show\n @product = Product.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @product }\n end\n end", "def show\n @product = Product.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @product }\n end\n end", "def show\n @product = Product.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @product }\n end\n end", "def show\n @product = Product.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @product }\n end\n end", "def show\n @product = Product.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @product }\n end\n end", "def show\n @product = Product.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @product }\n end\n end", "def show\n @product = Product.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @product }\n end\n end", "def show\n @product = Product.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @product }\n end\n end", "def show\n @product = Product.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @product }\n end\n end", "def show\n @product = Product.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @product }\n end\n end", "def index\n @products = Product.all\n respond_to do |format|\n format.html\n format.json { render :json => @product }\n end\n end", "def show\n @product = @person.products.find(params[:id])\n\n respond_to do |format|\n format.json { render :json => @product }\n end\n end", "def show\n @product = Product.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @product }\n end\n end", "def show\n @product = Product.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @product }\n end\n end", "def show\n @product = Product.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @product }\n end\n end", "def show\n @product = Product.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json=> @product }\n end\n end", "def index\n @products = Product.all\n msg = { status: 200 , product: @products }\n respond_to do |format|\n format.html { render json: msg }\n format.json { render json: msg }\n end\n end", "def index\n @products = Product.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @inventories }\n end\n end", "def index\n @products = @user.products\n # was @products = Product.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @products }\n end\n end", "def index\n limit = params[:limit]&.to_i || 10\n page = params[:page]&.to_i || 0\n if params[:available] == \"1\"\n @products = Product.paginate(page, limit).available\n else\n @products = Product.paginate(page, limit)\n end\n render json: @products\n end", "def index\n render :json => Producto.all\n end", "def show\n respond_to do |format|\n format.html\n format.json { render :json => @product }\n end\n end", "def show\n puts \"the params are #{params}\" \n @product = Product.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @product }\n end\n end", "def getKind\n @products = Product.where(\"kind = ?\", params[:kind]).available.PriceOrder.paginate(page: params[:page], per_page: 5)\n render json: @products\n end", "def show\n @product_item = ProductItem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @product_item }\n end\n end", "def index\n @food_products = FoodProduct.all\n render json: @food_products\n end", "def index\n #@products = Product.all\n @products = Product.paginate( :page => params[:page],\n :per_page => 40\n )\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @products }\n end\n end", "def index\n @ordered_products = OrderedProduct.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ordered_products }\n end\n end", "def index\n products = Product.all\n render json: {message: \"ok\", data: products}\n puts \"hello\"\n\n end", "def user_products\n @products = current_user.products\n\n respond_to do |format|\n format.html\n format.json { render json: @products }\n end\n end", "def show\n @shopifyproduct = Shopifyproduct.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @shopifyproduct }\n end\n end", "def show\n @product = @user.products.find(params[:id])\n # was @product = Product.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @product }\n end\n end", "def show\n @ordered_product = OrderedProduct.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ordered_product }\n end\n end", "def show\n @products = Product.find(params[:id])\n end", "def index\n @products = Product.order('item_code ASC').page(params[:page]).per(25)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @products }\n end\n end", "def index\n if is_my_resource(params[:prossumer_id])\n @products = Product.where(prossumer_id: params[:prossumer_id]).as_json({\n cycle_id: params[:cycle_id],\n include: {\n prossumer: {\n except: [:encrypted_password, :salt, :confirm_hash]\n },\n product_category: {}\n }\n })\n render json: @products\n end\n end", "def get_product\n json_response({ message: 'NOT IMPLEMENTED' })\n end", "def show\n @onecompany_product = Onecompany::Product.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @onecompany_product }\n end\n end", "def index\n @tipo_products = TipoProduct.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tipo_products }\n end\n end", "def index\n begin\n \n products = Product.all\n render json: {\n success: true,\n totalRecords: products.length,\n data: (ActiveModel::ArraySerializer.new(products, each_serializer: ProductSerializer))\n }, status: 200\n rescue ActiveRecord::RecordNotFound => e\n render json: {\n success: false,\n errors: e.message\n }, status: 404\n rescue Exception => e\n render json: {\n success: false,\n errors: e.message\n }, status: 500\n end\n end", "def index\n @products = Product.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @products }\n format.json { render :json => @products }\n end\n end", "def index\n @products = Product.all\n render json: {is_success: true, error_code: 200, message: \"Products Found Successfully\", result: @products}, status: 200\n end", "def show\n render json: @product_management\n end", "def show\n @product2 = Product2.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @product2 }\n end\n end", "def index\n #@products = Product.all\n @products = Product.order('created_at ASC').page(params[:page]).per(12)\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @products }\n end\n end", "def index\n @product_images = ProductImage.where(product_uuid: params[:product_id])\n render json: @product_images, status: 200\n end", "def show\n @prod = Prod.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @prod }\n end\n end", "def set_api_v1_product\n begin\n @api_v1_product = Product.find(params[:id])\n rescue => ex\n json_response({error: ex.message}, :not_found)\n end\n end", "def getProduct( product_id)\n params = Hash.new\n params['product_id'] = product_id\n return doCurl(\"get\",\"/product\",params)\n end", "def show\n respond_to do |format|\n format.html {render \"products/show\"}\n format.json {\n product = Product.where(id: params[:id]).includes(:category).first\n render json: product.as_json(include: [:category, :photo])\n }\n end\n end", "def show\n @items = cart.items\n @products = @items.collect(&:product)\n \n respond_to do |format|\n format.html { render layout: false } \n format.json { render json: @items }\n end\n end", "def show\n @star_product = Star::Product.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @star_product }\n end\n end", "def show\n render json: @food_product\n end", "def show\n @producto = Producto.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @producto }\n end\n end", "def show\n # is_my_resource(params[:id])\n\n # prossumerProductsIds = Prossumer.find(params[:id]).products.ids\n render json: ProductAuth.where({product_id: params[:id], group_id: params[:group_id]}).first.as_json(:include => :product)\n end", "def show\n @home_searches_product = Home::Searches::Product.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @home_searches_product }\n end\n end", "def show\n @magento_product = MagentoProduct.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @magento_product }\n end\n end", "def show\n @product_price = ProductPrice.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @product_price }\n end\n end", "def show\n @prod = Prod.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @prod }\n end\n end" ]
[ "0.77224106", "0.76329553", "0.76313764", "0.7607208", "0.75760156", "0.7552171", "0.7506385", "0.7484625", "0.745622", "0.74501616", "0.74376804", "0.7421124", "0.7362056", "0.7318765", "0.73185545", "0.73185545", "0.73185545", "0.7316062", "0.7311976", "0.73088664", "0.72941", "0.729187", "0.7291441", "0.7276286", "0.7272662", "0.7272662", "0.7272662", "0.7272662", "0.72700304", "0.7255538", "0.7233478", "0.72326964", "0.72326964", "0.72326964", "0.72326964", "0.72326964", "0.72326964", "0.72326964", "0.72326964", "0.72326964", "0.72326964", "0.72326964", "0.72326964", "0.72326964", "0.72326964", "0.72326964", "0.72326964", "0.72326964", "0.72326964", "0.72326964", "0.72326964", "0.7232629", "0.7211553", "0.7191871", "0.71728355", "0.71728355", "0.71728355", "0.717033", "0.71582985", "0.7140302", "0.70848453", "0.7072449", "0.70673674", "0.706432", "0.7038531", "0.7004358", "0.69840044", "0.69693065", "0.6968406", "0.6964786", "0.6959802", "0.695388", "0.6943222", "0.69415545", "0.6939184", "0.6928706", "0.69022006", "0.6888529", "0.68479115", "0.6837828", "0.683746", "0.6822597", "0.6821544", "0.6817213", "0.68145454", "0.6811117", "0.67925274", "0.678835", "0.6788051", "0.67867345", "0.67776203", "0.6769408", "0.67637855", "0.6759666", "0.6751121", "0.67510307", "0.6748587", "0.6746096", "0.6745283", "0.67408913", "0.6733844" ]
0.0
-1
GET /categories/1 GET /categories/1.json
def show_cat @categories = Category.parent_categories if params[:sort] @products = Product.where(category_id: @category.id).order(params[:sort]).page(params[:page]).per(9) else @products = Product.where(category_id: @category.id).order(:title).page(params[:page]).per(9) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GetCategories params = {}\n\n params = params.merge(path: 'categories.json')\n APICall(params)\n\n end", "def get_categories\r\n categories = Taxonomy.get_categories\r\n render json: categories, root: 'categories', adapter: :json, status: :ok\r\n end", "def GetCategory id\n\n APICall(path: \"categories/#{id}.json\")\n\n end", "def categories\n\t\tbegin\n\t\t\t@categories = Category.select(:id, :name)\n\t\t\trender json: @categories\n\t\trescue Exception => e\n\t\t\terror_handling_bad_request(e)\n\t\tend\n\tend", "def categories\n\t\trender :json => {:status => 1, :categories => {\"1\" => \"Apparel & Accessories\", \"2\" => \"Arts and Crafts\", \"3\" => \"Electronics\", \n\t\t\t\"4\" => \"Home Appliances\", \"5\" => \"Kids & Baby\", \"6\" => \"Movies, Music, Books & Games\", \"7\" => \"Motor Vehicles\", \n\t\t\t\"8\" => \"Office & Education\", \"9\" => \"Parties & Events\", \"10\" => \"Spaces & Venues\", \"11\" => \"Sports & Outdoors\", \"12\" => \"Tools & Gardening\", \"13\" => \"Other\"}}, :status => 200\n\t\treturn\n\tend", "def index\n categories = Category.all\n render json:categories\n end", "def index\n @categories = Category.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @categories }\n end\n end", "def index\n @categories = Category.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @categories }\n end\n end", "def index\n @categories = Category.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @categories }\n end\n end", "def index\n\n\n @categories = Category.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @categories }\n end\n end", "def index\n @categories = Category.all \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @categories }\n end\n end", "def show\n render json: category\n end", "def show\n render json: @category\n end", "def index\n\t @categories = Category.all\n\n\t respond_to do |format|\n\t\tformat.html # index.html.erb\n\t\tformat.json { render json: @categories }\n\t end\n\tend", "def getCategoryAll()\n params = Hash.new\n return doCurl(\"get\",\"/category/all\",params)\n end", "def get_category id\n\t\t\t\t\tFreshdesk::Api::Client.convert_to_hash( @connection.get CATEGORIES, id )\n\t\t\t\tend", "def index\n categories = @vertical.catgories.order('created_at DESC');\n render json: {status: 'SUCCESS', message:'Loaded categories', data:categories},status: :ok\n end", "def getCategories(_, _, _)\n @db.categories\n end", "def category\n client.categories.find(data[\"categoryId\"])\n end", "def categories\n get('venues/categories').categories\n end", "def get_category\n json_response({ message: 'NOT IMPLEMENTED' })\n end", "def get_categories\n @categories = Category.all\n end", "def index\n respond_to do |format|\n format.html { @categories = Category.all }\n format.json { @categories = Category.order(:name) }\n end\n end", "def getCategory( category_id)\n params = Hash.new\n params['category_id'] = category_id\n return doCurl(\"get\",\"/category\",params)\n end", "def index\n @categories = Category.all\n @categories= @categories.sort_by(&:name)\n render json: @categories\n end", "def category\n # Whats the last category we are asking for? (the rest don't matter I don't think..)\n requested_category = params[:category].split(\"/\").last\n category = Taxonomy.find_by_seo_url requested_category\n\n if category.present?\n @category = category\n @posts = get_posts category.posts\n\n\n respond_to do |format|\n format.html { render :template => 'default/index' }\n format.json { render json: @posts }\n end\n else\n # No such category found, redirect to root index\n redirect_to root_path\n end\n end", "def index\n @categories = CategoryService.index\n end", "def index\n @categories = Category.all\n @categories.each do |category|\n authorize! :read, category\n end\n render json: @categories\n end", "def category(id = nil)\n res = Connection.get('categories', id)\n id.nil? ? Category.all(res) : Category.new(res)\n end", "def index\n @incidentcategories = Incidentcategory.all\n json_response(@incidentcategories)\n end", "def index\n @categories = Category.all\n render :json => @categories, :except => [:created_at, :updated_at]\n end", "def get_categories()\n\t\tzomoato_categories_url = @base_uri + \"categories\"\n\t\tresponse = HTTParty.get(zomoato_categories_url, headers: @headers)\n\t\tif response.success?\n\t\t\t@categories = response.parsed_response\n\t\telse\n\t\t\traise response.response\n\t\tend\n\t\treturn @categories\n\tend", "def index\n respond_with Category.all\n end", "def show\n render json: @categoria\n end", "def show\n @category = Category.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @category }\n end\n end", "def show\n @category = Category.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @category }\n end\n end", "def show\n @category = Category.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @category }\n end\n end", "def show\n @category = Category.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @category }\n end\n end", "def show\n @category = Category.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @category }\n end\n end", "def show\n @category = Category.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @category }\n end\n end", "def show\n @category = Category.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @category }\n end\n end", "def index\n @categories = Category.roots\n end", "def index\n @categories = Category.all\n end", "def index\n @categories = Category.all\n end", "def index\n @categories = Category.all\n end", "def index\n @categories = Category.all\n end", "def index\n @categories = Category.all\n end", "def index\n @categories = Category.all\n end", "def index\n @categories = Category.all\n end", "def index\n @categories = Category.all\n end", "def index\n @categories = Category.all\n end", "def index\n @categories = Category.all\n end", "def index\n @categories = Category.all\n end", "def index\n @categories = Category.all\n end", "def index\n @categories = Category.all\n end", "def index\n @categories = Category.all\n end", "def index\n @categories = Category.all\n end", "def index\n @categories = Category.all\n end", "def index\n @categories = Category.all\n end", "def index\n @categories = Category.all\n end", "def index\n @categories = Category.all\n end", "def index\n @categories = Category.all\n end", "def index\n @categories = Category.all\n end", "def index\n @categories = Category.all\n end", "def index\n @categories = Category.all\n end", "def index\n @categories = Category.all\n end", "def get_subcategories\r\n sub_categories = Taxonomy.get_subcategories\r\n render json: sub_categories, root: 'categories', adapter: :json, status: :ok\r\n end", "def index\n\t\t@categories = Category.all\n\tend", "def index\n\t@categories = Category.all\n\tend", "def index\n @categories = Category.all\n end", "def index\n @categories = Category.all\n end", "def index\n render json: Category.order('name ASC').all\n end", "def categories(params={})\n return @categories if (@categories && !params[:force])\n @categories = get_categories\n end", "def index\n @categories = Category.all\n respond_with(@categories)\n end", "def get_categories(add_params = nil)\n params = {\n }\n api_call('/global/categories(.:format)',:get,params,add_params)\n end", "def category\n Category.find(params[:id])\n end", "def index\n @categories=Category.root\n respond_with @categories\n end", "def show\n @category = current_mall.categories.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @category }\n end\n end", "def index\n @categories = Category.paginate(:page => params[:page])\n @title = \"Категории\"\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @categories }\n end\n end", "def get_categories_list\n args = receive_should_validate?\n get('redtube.Categories.getCategoriesList', {}, [], args[:should_validate])\n end", "def index\n categories = Category.all\n\n if params[:limit]\n categories = categories.limit(params[:limit])\n end\n\n render json: CategorySerializer.new(categories).serializable_hash\n end", "def show\n\t @category = Category.find(params[:id])\n\n\t respond_to do |format|\n\t\tformat.html # show.html.erb\n\t\tformat.json { render json: @category }\n\t end\n\tend", "def categories(query_object)\n\t\tdata = do_get_json(CATEGORIES_ENDPOINT, query_object)\n\tend", "def categories\n parsed_json['data']\n end", "def index\n #expires_in 24.hours\n #fresh_when last_modified: @max, public: true\n @roots = @categories.roots\n @keyword = String.new\n\n @roots.each do |r|\n @keyword << r.name << \" \"\n end\n\n if params[:id]\n if c = Category.find(params[:id])\n redirect_to c\n return\n else\n flash.now[:error] = \"Category not found.\"\n end\n end\n\n respond_to do |format|\n format.html\n format.json {render json:@categories}\n end\n\n end", "def index\n @categories = Category.order(\"name ASC\")\n @latest_reviews = Review.limit(3).order(\"created_at DESC\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @categories }\n end\n end", "def get_categories_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: CategoriesApi.get_categories ...\"\n end\n # resource path\n local_var_path = \"/categories\"\n\n # query parameters\n query_params = {}\n query_params[:'filter_search'] = opts[:'filter_search'] if !opts[:'filter_search'].nil?\n query_params[:'filter_active'] = opts[:'filter_active'] if !opts[:'filter_active'].nil?\n query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?\n query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?\n query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['oauth2_client_credentials_grant', 'oauth2_password_grant']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PageResourceCategoryResource')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CategoriesApi#get_categories\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_category_list\n ret_hash = Rails.cache.fetch(\"zaim_api/category\", expired_in: 1.day) do\n json_categories = self.zaim_api.category\n tmp_ret_hash = {}\n json_categories['categories'].each do |value|\n tmp_ret_hash[value['id']] = value['name']\n end\n tmp_ret_hash\n end\n ret_hash\n end", "def categories options = {}\n perform_get_with_object(\"/categories\", options, Vimeo::Entities::Category)\n end", "def getCategories\n @categories = []\n @categories << Category.new(name: \"All\", id: -1)\n @categories += Category.all\n end", "def show\n @post_category = Post::Category.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post_category }\n end\n end", "def index\n @categories = Category.paginate(:page => params[:page], per_page:30)\n @number = Category.count\n\n respond_to do |format|\n format.html\n format.json { render json: Category.all }\n end\n end", "def index\n @categorias = Categoria.where(ativo: true)\n \t\n render json: @categorias\n end", "def index\n @categories = Category.all\n \n respond_with do |format|\n format.html { render :index, :layout => false}\n end\n end", "def index\n @cover_cats = CoverCat.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @cover_cats }\n end\n end", "def index\n @section_categories = SectionCategory.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @section_categories }\n end\n end", "def show\n @cat = Cat.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cat }\n end\n end", "def show\n @recipe_category = RecipeCategory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @recipe_category }\n end\n end", "def index\n @categories = collections_config.values\n end", "def index\n @taxonomy_categories = TaxonomyCategory.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @taxonomy_categories }\n end\n end", "def fetch_categories(count = ENV['DEFAULT_CATEGORY_COUNT'].to_i)\n max_category = 18418\n uri = \"http://jservice.io/api/categories?count=#{count}&offset=#{1+rand(max_category/count.to_f)}\"\n request = HTTParty.get(uri)\n data = JSON.parse(request.body)\nend" ]
[ "0.7877691", "0.7865133", "0.78486437", "0.78422695", "0.7414923", "0.74083245", "0.73075056", "0.7306919", "0.7306919", "0.7282217", "0.7235693", "0.7186931", "0.7158298", "0.7133119", "0.7122198", "0.70659566", "0.70442134", "0.7036961", "0.70349413", "0.70324004", "0.7012643", "0.7009862", "0.6999405", "0.6993045", "0.6990838", "0.69787407", "0.6956943", "0.69493926", "0.693385", "0.68740106", "0.6857372", "0.6855677", "0.6852057", "0.68460214", "0.6835847", "0.6835847", "0.6835847", "0.6835847", "0.6835847", "0.6835847", "0.6835847", "0.68196505", "0.68190384", "0.68190384", "0.68190384", "0.68190384", "0.68190384", "0.68190384", "0.68190384", "0.68190384", "0.68190384", "0.68190384", "0.68190384", "0.68190384", "0.68190384", "0.68190384", "0.68190384", "0.68190384", "0.68190384", "0.68190384", "0.68190384", "0.68190384", "0.68190384", "0.68190384", "0.68190384", "0.68190384", "0.6811142", "0.6795076", "0.6769383", "0.6751968", "0.6730927", "0.67296433", "0.6723893", "0.6720277", "0.6718597", "0.6718178", "0.67129713", "0.6708545", "0.6707729", "0.67047274", "0.6698742", "0.6698137", "0.66946316", "0.66537845", "0.66530246", "0.6641249", "0.66375494", "0.6636564", "0.66132104", "0.66113704", "0.6608408", "0.6590371", "0.6587897", "0.65741247", "0.65741235", "0.65732604", "0.6570182", "0.6569654", "0.6567145", "0.6562422", "0.6556036" ]
0.0
-1
Use callbacks to share common setup or constraints between actions.
def set_prod @product = Product.find(params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "def action_hook; end", "def run_actions; end", "def define_action_hook; end", "def actions; end", "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end", "def add_actions; end", "def callbacks; end", "def callbacks; end", "def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end", "def define_action_helpers; end", "def post_setup\n end", "def action_methods; end", "def action_methods; end", "def action_methods; end", "def before_setup; end", "def action_run\n end", "def execute(setup)\n @action.call(setup)\n end", "def define_action_helpers?; end", "def set_actions\n actions :all\n end", "def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end", "def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end", "def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end", "def before_actions(*logic)\n self.before_actions = logic\n end", "def setup_handler\n end", "def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end", "def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end", "def action; end", "def action; end", "def action; end", "def action; end", "def action; end", "def workflow\n end", "def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end", "def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end", "def before(action)\n invoke_callbacks *self.class.send(action).before\n end", "def process_action(...)\n send_action(...)\n end", "def before_dispatch(env); end", "def after_actions(*logic)\n self.after_actions = logic\n end", "def setup\n # override and do something appropriate\n end", "def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end", "def setup(_context)\n end", "def setup(resources) ; end", "def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end", "def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end", "def determine_valid_action\n\n end", "def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end", "def startcompany(action)\n @done = true\n action.setup\n end", "def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end", "def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end", "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end", "def define_tasks\n define_weave_task\n connect_common_tasks\n end", "def setup(&block)\n define_method(:setup, &block)\n end", "def setup\n transition_to(:setup)\n end", "def setup\n transition_to(:setup)\n end", "def action\n end", "def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend", "def config(action, *args); end", "def setup\n @setup_proc.call(self) if @setup_proc\n end", "def before_action \n end", "def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end", "def action\n end", "def matt_custom_action_begin(label); end", "def setup\n # override this if needed\n end", "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end", "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end", "def after(action)\n invoke_callbacks *options_for(action).after\n end", "def pre_task\n end", "def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end", "def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end", "def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end", "def setup_signals; end", "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end", "def initialize(*args)\n super\n @action = :set\nend", "def after_set_callback; end", "def setup\n #implement in subclass;\n end", "def lookup_action; end", "def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end", "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "def release_actions; end", "def around_hooks; end", "def save_action; end", "def setup(easy)\n super\n easy.customrequest = @verb\n end", "def action_target()\n \n end", "def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end", "def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end", "def before_setup\n # do nothing by default\n end", "def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end", "def default_action; end", "def setup(&blk)\n @setup_block = blk\n end", "def callback_phase\n super\n end", "def advice\n end", "def _handle_action_missing(*args); end", "def duas1(action)\n action.call\n action.call\nend", "def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end", "def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end", "def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend" ]
[ "0.6163163", "0.6045976", "0.5946146", "0.591683", "0.5890051", "0.58349305", "0.5776858", "0.5703237", "0.5703237", "0.5652805", "0.5621621", "0.54210985", "0.5411113", "0.5411113", "0.5411113", "0.5391541", "0.53794575", "0.5357573", "0.53402257", "0.53394014", "0.53321576", "0.53124547", "0.529654", "0.5296262", "0.52952296", "0.52600986", "0.52442724", "0.52385926", "0.52385926", "0.52385926", "0.52385926", "0.52385926", "0.5232394", "0.523231", "0.5227454", "0.52226824", "0.52201617", "0.5212327", "0.52079266", "0.52050185", "0.51754695", "0.51726824", "0.51710224", "0.5166172", "0.5159343", "0.51578903", "0.51522785", "0.5152022", "0.51518047", "0.51456624", "0.51398855", "0.5133759", "0.5112076", "0.5111866", "0.5111866", "0.5110294", "0.5106169", "0.509231", "0.50873137", "0.5081088", "0.508059", "0.50677156", "0.50562143", "0.5050554", "0.50474834", "0.50474834", "0.5036181", "0.5026331", "0.5022976", "0.5015441", "0.50121695", "0.5000944", "0.5000019", "0.4996878", "0.4989888", "0.4989888", "0.49864885", "0.49797225", "0.49785787", "0.4976161", "0.49683493", "0.4965126", "0.4958034", "0.49559742", "0.4954353", "0.49535993", "0.4952725", "0.49467874", "0.49423352", "0.49325448", "0.49282882", "0.49269363", "0.49269104", "0.49252945", "0.4923091", "0.49194667", "0.49174926", "0.49173003", "0.49171105", "0.4915879", "0.49155936" ]
0.0
-1
Action for only changing user's password
def password end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def change_password\r\n \r\n end", "def edit_password; end", "def set_change_password(user)\n user.update_column(:must_change_passwd, true)\n session[:pwd] = 1\n end", "def change_password\n return if generate_filled_in\n if do_change_password_for(@user)\n # since sometimes we're changing the password from within another action/template...\n #redirect_to :action => params[:back_to] if params[:back_to]\n redirect_back_or_default :action => 'change_password'\n end\n end", "def change_password!(password)\n json = JSON.generate(:changePassword => { :adminPass => password })\n @compute.connection.req('POST', \"/servers/#{@id}/action\", :data => json)\n @adminPass = password\n end", "def change_password!(opts = {})\n password!(opts.merge(:verb => :put))\n end", "def change_password\n\t\t# if admin, allow editing user's password\n if current_user.is_admin?\n @user = User.find(params[:id])\n else\n @user = current_user\n end\n end", "def update\n @user.password = params[:password]\n @user.password_confirmation = params[:password_confirmation]\n return unless @user\n if @user.save\n flash[:notice] = t 'password_resets.updated'\n redirect_to @user\n else\n render :action => :edit\n end\n end", "def change_password\n #check if user is new or being updated\n if self.encrypted_password.present?\n #verifies password\n if self.password_check\n self.encrypt_password\n else\n raise \"error\"\n end\n else\n raise \"error\"\n end\n end", "def password_change_new\n\n end", "def edit_change_password\n @user = current_user\n end", "def change_password\n @user = current_user\n end", "def change_password\n @user = current_user\n end", "def change_temp_password\n\tend", "def change_password\n @user = User.shod(params[:id])\n authorize! :update, @user\n end", "def change_password\n @user=User.find(current_user)\n end", "def change_password_for_user\n if (@user = find_user(params[:id]))\n do_change_password_for(@user)\n flash[:notice] = \"Password for user '#{@user.login}' has been updated.\"\n end\n redirect_back_or_default :action => 'list'\n end", "def change_password(opts = {})\n password(opts.merge(:verb => :put))\n end", "def change_password\n @user = current_user\n @user.update_password(params)\n\n if @user.errors.empty?\n redirect_to profile_path, :notice => I18n.t('profile.password_changed')\n else\n flash.now[:alert] = I18n.t(\"errors.passwords.problem\")\n render 'show', :status => :forbidden\n end\n end", "def password\n if !logged_in?\n flash[:error] = \"Must log in to change password\"\n redirect_to(:action => :login)\n else\n @user = User.find(current_user_id)\n end\n end", "def password=(new_password); end", "def password\n if @user.update_with_password(password_params)\n render_update_success @user\n else\n render_failure @user\n end\n end", "def change_password\n if current_user.update_with_password(password_params)\n #\n # Sign in the user bypassing validation in case\n # their password changed.\n #\n sign_in current_user, bypass: true\n\n redirect_to current_user, notice: 'Password successfully changed.'\n else\n render 'edit'\n end\n end", "def update_password\n\t\t# if admin, allow editing user's password\n if current_user.is_admin?\n @user = User.find(params[:id])\n else\n\t\t\t# else just use current user\n @user = current_user\n end\n\n\t\t# update user password with regards to the parameters\n if @user.update_attributes(params[:user])\n gflash :success => \"Password Successfully Updated\"\n redirect_to :action => 'edit', :id => @user.id\n else\n render :action => 'change_password', :id => params[:id]\n end\n end", "def update_password\n @user = User.shod(params[:id])\n if @user.update(user_params)\n flash[:notice] = t('pass_change')\n redirect_to user_path(@user)\n else\n render 'change_password'\n end\n end", "def edit_password\n @user = User.find_by_id(current_user.id)\n authorize! :edit_password, User, :id => current_user.id\n end", "def set_password\n @user = User.find(session[:user_id])\n if @user.password == params[:old_password]\n if @user.update_attributes(params[:user])\n redirect_to user_new_path\n else\n flash[:notice] = \"Please enter correct passwords\"\n render user_change_password_path\n end\n else\n flash[:notice] = \"Please enter your correct passwords\"\n redirect_to user_change_password_path\n end\n end", "def edit_password(user, new_password)\n if @config.restrictions[:password_count_restriction]\n unless new_password >= @config.restrictions[:password_count_restriction].to_i\n return false\n end\n end\n user.password = user.hash_plaintext(new_password)\n user.save_data\n end", "def change_password\n set_breadcrumbs(\"change_password\") \n if request.post? || request.patch? \n admin = Admin.find(current_admin.id)\n @check = params[:admin][:password] == params[:admin][:password_confirmation] && params[:admin][:password].present? && params[:admin][:password_confirmation].present?\n if admin.present? && admin.valid_password?(params[:admin][:old_password])\n if @check \n if admin.update_attribute(:password, params[:admin][:password])\n sign_in admin, :bypass => true\n flash[:notice] = I18n.t('change_password.update.success')\n redirect_to admin_root_path\n else\n flash[:error] = I18n.t('common.error') \n end\n else\n flash[:error] = I18n.t('change_password.failure.password_is_not_match')\n end\n else\n flash[:error] = I18n.t('change_password.failure.invalid_old_password')\n end\n end\n end", "def change_password(username, password)\n perform_request({:action => \"client-updatepassword\", :username => username, :password => password})\n statusmsg.match /success/i\n end", "def newPassword(newPass)\n\t\tDATABASE.edit(\"users\", \"password\", newPass, \"username\", @username)\n\tend", "def change_password\r\n\r\n allowed = @current_user && (@current_user.is_admin? || @current_user.id.to_s == params[:id])\r\n if !allowed\r\n flash[:warning] = _(\"Not authorized!\")\r\n redirect_to(:action => :list) and return\r\n end\r\n params[:user] ||= {}\r\n params[:user][params[:id]] ||= {}\r\n conf = params[:user][params[:id]].delete(:password_confirmation)\r\n pass = params[:user][params[:id]][:password]\r\n @user_attributes = params[:user] ? params[:user][params[:id]].clone : {}\r\n @user_attributes.merge!(:id => params[:id]) if @user_attributes\r\n\r\n @user = User.load_from_params(@user_attributes)\r\n if @user.nil?\r\n flash[:warning] ||= []\r\n flash[:warning] << _(\"Warning: %{obj} with ID %{id} does not exist!\") % {:obj => 'user', :id => params[:id]}\r\n redirect_to(:action => :index)\r\n return\r\n end\r\n\r\n if request.post? && !pass.blank?\r\n if conf.blank? || pass.blank? || conf != pass\r\n @user.errors.add(:password, _(\"Password confirmation mismatch!\"))\r\n flash[:warning] ||= _(\"Password confirmation mismatch!\")\r\n @user.password = :random\r\n else\r\n flash[:notice] = _(\"Password changed\")\r\n @user.password = pass if @user.valid?\r\n end\r\n if @user.valid? && @user.password && @user.save\r\n flash[:notice] ||= _(\"Password not changed!\")\r\n redirect_to(:action => :show, :id => @user.id)\r\n else\r\n render(:action => :edit, :id => @user.id, :layout => !request.xhr?)\r\n end\r\n else\r\n render :layout => !request.xhr?\r\n end\r\n end", "def change_password\n #raise current_user.inspect\n end", "def change_password\n @user = User.find(session[:user_id])\n if params[:user]\n @user.password = params[:user][:password]\n @user.password_confirmation = params[:user][:password_confirmation]\n if @user.save\n flash[:notice] = \"Password change successful\"\n end\n end\n end", "def change_password\n @user = User.find(params[:id])\n end", "def change_password\n @user = User.find(params[:id])\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def password\n\n end", "def update_password\n @user = User.find_by_uuid(params[:id])\n if @user.update(user_params_with_password)\n if @user.send_password.present? && @user.send_password.to_i == 1\n @user.send_welcome_email\n end\n flash[:success] = t('messages.default_success')\n redirect_to users_path\n else\n flash[:error] = t('messages.default_error')\n render :edit_password\n end\n end", "def change_password\n @attributes[:change_password]\n end", "def alter(password)\n Statements::AlterUser.new(context: self).password(password)\n end", "def password_update\n redirect_to lato_core.root_path unless core_getRecoveryPasswordPermission\n user = LatoCore::Superuser.find(params[:id])\n if !user || user.session_code != params[:token]\n flash[:warning] = CORE_LANG['recover_password']['recover_error']\n redirect_to lato_core.login_path and return false\n end\n user.update(password: params[:password], password_confirmation: params[:password])\n if !user.save\n flash[:warning] = CORE_LANG['recover_password']['recover_error']\n redirect_to lato_core.login_path and return false\n end\n\n flash[:success] = CORE_LANG['recover_password']['recover_success']\n redirect_to lato_core.login_path\n end", "def edit_password\n\t\t# Do da def correct_user nen co the bo @user=User.find(paramas[:id])\n\t\t#could be same content as edit\n\t\t#@user = User.find(params[:id])\n\tend", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end", "def set_Password(value)\n set_input(\"Password\", value)\n end" ]
[ "0.84440583", "0.8195093", "0.800686", "0.7944755", "0.7904684", "0.7873718", "0.7840397", "0.7805231", "0.7786356", "0.7766612", "0.77570957", "0.77211535", "0.77211535", "0.77173865", "0.7709839", "0.77001524", "0.76962465", "0.7695477", "0.76768774", "0.7671499", "0.7656469", "0.7621898", "0.76210505", "0.7586101", "0.75854015", "0.7581286", "0.75786865", "0.7564082", "0.75584465", "0.75195533", "0.7512727", "0.75117844", "0.7494454", "0.74894094", "0.7483533", "0.7483533", "0.7465882", "0.7465882", "0.7465882", "0.7465882", "0.7465882", "0.7465882", "0.7465882", "0.7465882", "0.7465882", "0.7465882", "0.7465882", "0.7465882", "0.7465882", "0.7465882", "0.7465882", "0.7465882", "0.7465882", "0.7465882", "0.7465882", "0.7465882", "0.7465882", "0.7465882", "0.7465882", "0.7465882", "0.7465882", "0.7465882", "0.7465882", "0.7465882", "0.7465882", "0.7465882", "0.7465882", "0.7465882", "0.74652064", "0.74652064", "0.7439196", "0.74287695", "0.7383006", "0.7382571", "0.7381887", "0.7374848", "0.7366626", "0.7366626", "0.7366626", "0.7366626", "0.7366626", "0.7366626", "0.7366626", "0.7366626", "0.7366626", "0.7366626", "0.7366626", "0.7366626", "0.7366626", "0.7366626", "0.7366626", "0.7366626", "0.7366626", "0.7366626", "0.7366626", "0.7366626", "0.7366626", "0.7366626", "0.7366626", "0.7366626", "0.7366626" ]
0.0
-1
"A".to_binary() > "010000001" "AA".to_binary() > "010000001010000001"
def to_binary() return self.unpack('B*').join end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_binary(input)\n binary = []\n input.each_char do |char|\n result = char.hex.to_s(2).rjust(char.size*4, '0')\n binary << result\n end\n binary.join()\nend", "def fake_bin(s)\n s.tr('1-9', '00001')\nend", "def bin(x)\n x.to_s(16).chars.to_a.map{|d| d.to_i(16).to_s(2).rjust(4, '0')}.join(' ')\nend", "def int_to_binary_string(number)\n number.to_s(2)\nend", "def string_to_binary(str)\n if str.('a'..'m').include?\n return \"0\"\n else\n return \"1\"\n end\nend", "def replace_binary(str)\n str.gsub(/[01]+/) { |bin| bin.to_i(2).to_s(10) }\n end", "def replace_binary(str)\n str.gsub(/[01]+/) { |bin| bin.to_i(2).to_s(10) }\n end", "def stringy(num)\n binary = ''\n loop do\n binary << '1'\n break if binary.length == num\n binary << '0'\n break if binary.length == num\n end\n binary\nend", "def to_s\r\n @bitstring.reverse.scan(/.{1,8}/).map {|s| s.reverse}.reverse.map {|bin| \"\" << bin.to_i(2)}.join\r\n end", "def binary\n decimal.to_s(2).rjust(8, '0')\n end", "def bin2str(binary)\n str = [binary].pack(\"B*\")\n return str\nend", "def to_binary_string(min_length = 0)\n BitMapping.number_to_binary_string(number, min_length)\n end", "def stringy(num, bit = 1)\n bin_arr = []\n num.times { |n| n.even? ? bin_arr << (0 + bit) : bin_arr << (1 - bit) }\n bin_arr.join\nend", "def to_bin(num_string)\n digits = convert_to_base10(num_string)\n digits.map!{|char| to_bits(char)}\n digits.join\n end", "def binarize(string)\n string.codepoints.to_a.map { |byte| byte.to_s(2).insert(0, '0') }\n end", "def binary(digits)\n string(BINARY_DIGITS, digits)\n end", "def convert_to_binary\n @input.class == String ? @input : @input.to_s(2)\n end", "def string\n binary.map { |i| i.to_i.to_s(16) }.join('')\n end", "def test_003_to_s()\n TestVals.each do |sVal|\n iVal = sVal.to_i(2)\n sVal_e = sVal.sub(/^0+(.)/, '\\1')\n bs = BitString.new(sVal)\n assert_equal(sVal_e,\n bs.to_s,\n \"Test unbounded '#{sVal}'.to_s => '#{sVal_e}'\")\n bs = BitString.new(sVal, sVal.length)\n assert_equal(sVal,\n bs.to_s,\n \"Test bounded '#{sVal}'.to_s => '#{sVal}'\")\n end\n end", "def value_to_zero_one_string\n to_binary_s.unpack(\"C*\").map { |e| e.to_s(2).rjust(8, \"0\") }.join(\"\")\n end", "def BinaryConverter(str)\r\n return str.to_i(2)\r\nend", "def to_bin(number)\n number = Integer(number);\n if(number == 0)\n return 0;\n end\n ret_bin = \"\";\n ## Untill val is zero, convert it into binary format\n while(number != 0)\n ret_bin = String(number % 2) + ret_bin;\n number = number / 2;\n end\n return ret_bin;\n end", "def binary_string; end", "def hex_to_bin(hex)\nreturn hex.hex.to_s(2).rjust(hex.length * 4, '0')\nend", "def binary(digits: 4)\n bin = ''\n digits.times { bin += rand(2).to_s(2) }\n bin\n end", "def change(str)\n if str.class == String\n array = str.split(//)\n binary = Array.new(26, 0)\n array.uniq.sort!\n base = \"a\".ord\n base_upcase = \"A\".ord\n array.each do |x|\n if (65..90).include?(x.ord)\n binary[x.ord - base_upcase] = 1\n elsif (97..122).include?(x.ord)\n binary[x.ord - base] = 1\n end\n end\n end\n binary.join('')\nend", "def stringy number, count = 1\n binary_string = ''\n\n if count == 1\n (number / 2).times {binary_string << '10'}\n binary_string << '1' if number % 2 == 1\n elsif count == 0\n (number / 2).times {binary_string << '01'}\n binary_string << '0' if number % 2 == 1\n end\n\n binary_string\n end", "def number_to_binary_string(number, min_length = 0)\n assert_non_negative(number)\n binary_string = ''.force_encoding(Encoding::ASCII_8BIT)\n\n while number > 0\n byte_value = number & 0xFF\n binary_string << byte_value\n number >>= 8\n end\n\n binary_string.reverse.rjust(min_length, \"\\x00\")\n end", "def string_to_binary(value)\n self.class.string_to_binary(value)\n end", "def symbol_to_bin\n symbol.to_i.to_s(2).rjust(16, '0')\n end", "def setup\n @a = '0b100010011010101111001101'\n end", "def input_to_bitstring( value )\r\n value\r\n end", "def value_to_binary_string(value)\n #value.pack(\"V\")\n raise NotImplementedError\n end", "def getBinary(number)\n binary = \"\"\n while (number > 0 && binary.size < 16) do\n binary << (number % 2).to_s\n number = number / 2\n end\n # might add condition for case where binary.size < 16, to add extra zero-es\n return binary.reverse\nend", "def translate_to_binary(array_of_hex)\n array_of_binary = []\n array_of_hex.each do |num|\n array_of_binary << sprintf(\"%b\", num).rjust(32, '0')\n end\n array_of_binary\n end", "def show_binstring()\n @values.values.map do |v|\n v ? \"1\" : \"0\"\n end.join\n end", "def priorityEncode(binary)\n #puts(\"priority encoding:\" + binary.to_s)\n if binary.to_s.start_with?(\"1\")\n return 11\n end\n if binary.to_s.start_with?(\"01\")\n return 10\n end \n if binary.to_s.start_with?(\"001\")\n return 01\n end \n if binary.to_s.start_with?(\"0001\")\n return 00\n end \n\n # by default return nothing\n return nil\n\nend", "def toBinary (x)\n if (x>1)\n toBinary(x/2) + (x%2).to_s\n elsif x==1\n return x.to_s\n end\nend", "def old_boolean_to_binary(arr)\n binary = \"\"\n\n arr.each do |boolean|\n if boolean\n binary += \"1\"\n else\n binary += \"0\"\n end\n end\n\n binary\nend", "def string_to_binary(str)\n zero_array = [\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\"]\n one_array = [\"n\" , \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\"]\n\n def check_if_in_array(check, array)\n array.each do |i|\n if check.upcase == i.upcase\n return true\n end\n end\n\n return false\n end\n\n return_word = \"\"\n\n for char in str.chars\n if check_if_in_array(char, zero_array)\n return_word = return_word + \"0\"\n elsif check_if_in_array(char, one_array)\n return_word = return_word + \"1\"\n end\n end\n\n return return_word\nend", "def add_binary(a,b)\n (a+b).to_s(2)\n\n # \"%b\" % (a+b)\nend", "def dec_to_binary(num)\r\n bin = []\r\n quot = Math.floor(num / 2)\r\n bin.push(num % 2)\r\n while (quot > 1) \r\n bin.unshift(quot % 2)\r\n quot = Math.floor(quot / 2)\r\n end\r\n bin.unshift(quot)\r\n return bin.join('')\r\nend", "def evidence_to_binary(e)\n\tb = Hash.new(\"0\")\n\te.each_char do |i|\n\t\tb[i] = \"1\"\n\tend\n\n\tbinary = \"0000\"\n\tbinary[0] = b['N']\n\tbinary[1] = b['S']\n\tbinary[2] = b['W']\n\tbinary[3] = b['E']\n\tbinary\nend", "def string_to_binary(value)\n # Escape data prior to insert into a bytea column\n if value\n res = ''\n value.each_byte { |b| res << sprintf('\\\\\\\\%03o', b) }\n res\n end\n end", "def to_bi_a\n self.chars.map {|c| c.ord.to_s(2)}\n end", "def symbol_to_bin\n if symbol.to_i.is_a? Integer\n symbol.to_i.to_s(2).rjust(16, '0')\n else\n\n end\n end", "def fake_bin(s)\ns = s.split(\"\")\ns = s.map {|x| x.to_i }\ns.collect! {|e| (e<5) ? 0 : e || (e>5) ? 1 : e}\ns.join\nend", "def add_binary(a, b)\n (a + b).to_s(2)\nend", "def binary_to_text(b)\n [b].pack(\"B*\")\nend", "def stringy(number)\n number_range = (1..number)\n binary = []\n number_range.each do |num|\n if num % 2 == 1\n binary << 1\n elsif num % 2 == 0\n binary << 0\n end\n end\n binary.join(\"\")\nend", "def _to_bit_string(i, min_width=0)\n hexed = i.to_s(16)\n padded = true if hexed.length % 2 == 1 # prepend 0\n bitstring = [(padded ? \"0#{hexed}\" : hexed)].pack(\"H*\").unpack(\"B*\").first\n bitstring = bitstring[4,bitstring.length - 4] if padded\n (\"0\" * [min_width - bitstring.length, 0].max) + bitstring\n end", "def reverse_bits(n)\n bin = n.to_s(2)\n while bin.length < 32\n bin = \"0\" + bin\n end \n bin.reverse.to_i(2)\nend", "def make(byte, length)\n while byte.length < length\n byte = \"0\" + byte\n end\n return byte\nend", "def bin_to_hex(s)\r\n s.each_byte.map { |b| b.to_s(16) }.join\r\n #puts s.bin_to_hex\r\nend", "def bijective_encode\n \t# from http://refactormycode.com/codes/124-base-62-encoding\n \t# with only minor modification\n \t# return ALPHABET[0] if i == 0\n \t# s = ''\n \t# base = ALPHABET.length\n \t# while i > 0\n \t# \ts << ALPHABET[i.modulo(base)]\n \t# \ti /= base\n \t# end\n \t# s.reverse + SecureRandom.hex(5 - s.length)\n \tSecureRandom.hex(4)\n end", "def to_binary(num)\n num_bin = ''\n current_power_of_2 = 1\n \n loop do\n num_bin.prepend ((num % (current_power_of_2 * 2)) / current_power_of_2).to_s\n \n break if num < current_power_of_2 * 2\n current_power_of_2 *= 2\n end\n \n num_bin.to_i\n end", "def to_byte_val(s)\n val = 0\n s.each_char do |x|\n val *= 2\n val += x.to_i\n end\n return val\nend", "def convert_binary\n end", "def bijective_encode(id)\n code = ''\n\n while id > 0\n code << CHARS[id.modulo(BASE)]\n id /= BASE\n end\n\n code.reverse\n end", "def test_binarize\n output = \"111100111011111110101\" + \"\\n\" +\n \"110000111100101100101\" + \"\\n\" +\n \"1100100111010111011011100010\"\n assert_equal output, OneLiner.binarize(\"you are dumb\")\n end", "def test_binarize\n output = \"111100111011111110101\" + \"\\n\" +\n \"110000111100101100101\" + \"\\n\" +\n \"1100100111010111011011100010\"\n assert_equal output, OneLiner.binarize(\"you are dumb\")\n end", "def add_binary(a,b)\n string = (a + b).to_s(2)\nend", "def from_bin(num_string)\n bin_vals = num_string.scan(eval(\"/.{#{@bin_rep_length}}/\"))\n base10_vals = bin_vals.map{|bin_val| from_bits(bin_val)}\n convert_from_base10(base10_vals).join\n end", "def binary(num)\n result = []\n\n until num == 0\n result.unshift(num % 2)\n num /= 2\n end\n\n result.empty? ? \"0\" : result.join\nend", "def BinaryReversal(str)\n binary = str.to_i.to_s(2)\n pad_size = binary.size % 8 == 0 ? binary.size : (8 - binary.size % 8) + binary.size\n format(\"%0#{pad_size}d\", binary).reverse.to_i(2).to_s\nend", "def reverse_bits(num)\n num.to_s(2).rjust(32, '0').reverse.to_i(2)\nend", "def handle_bit (num)\n num2str=''\n num2str+=NUM_MAP[num]\n return num2str\nend", "def pattern_bits\n str = bits.to_s(2)\n str = str.rjust(self.step_count, '0')\n str.chars.collect{|x|x=='1'}\n end", "def to_i\n\t\tbits.map(&:to_s).join.to_i(2)\n\tend", "def stringy(size)\n i, string = 0, \"\"\n while i < size do\n string[-1] == \"1\" ? string << \"0\" : string << \"1\"\n i += 1\n end\n return string\nend", "def add_binary(a,b)\n #your code here\n binary = a + b\n binary.to_s(2) # Convert um inteiro para string na base 2(base binária)\nend", "def bit_to_hex(input)\n # string > binary -> hex -> justify right\n input.to_i(2).to_s(16).rjust(2, '0').upcase\n end", "def to_s22\n \tinteger=self.to_i\n \trval=''\n 22.times do\n c=(integer & 0x3F)\n rval+=@@chars64[c]\n integer =integer >> 6\n end\n return rval.reverse\n end", "def string_to_binary(val)\n saved_object_count = -1\n\n unless(@unique_table.has_key?(val)) then\n saved_object_count = @written_object_count\n @written_object_count += 1\n\n @unique_table[val] = saved_object_count\n utf16 = false\n\n val.each_byte do |b|\n if(b > 127) then\n utf16 = true\n break\n end\n end\n\n if(utf16) then\n bdata = Binary.type_bytes(\"6\",Binary.charset_strlen(val,\"UTF-8\")) # 6 is 0110, unicode string (utf16be)\n val = Binary.charset_convert(val,\"UTF-8\",\"UTF-16BE\")\n\n val.force_encoding(\"ASCII-8BIT\") if val.respond_to?(\"encode\")\n @object_table[saved_object_count] = bdata + val\n else\n bdata = Binary.type_bytes(\"5\",val.bytesize) # 5 is 0101 which is an ASCII string (seems to be ASCII encoded)\n @object_table[saved_object_count] = bdata + val\n end\n else\n saved_object_count = @unique_table[val]\n end\n\n return saved_object_count\n end", "def binary(digits: T.unsafe(nil)); end", "def to_b\n return self.to_s(2)\n end", "def change a\n a = a.downcase\n end_string = ''\n ('a'..'z').each { |let| a.include?(let) ? end_string << '1' : end_string << '0' }\n end_string\nend", "def str2binb(str)\n bin = []\n mask = (1 << $chrsz) - 1\n # for(var i = 0; i < str.length * $chrsz; i += $chrsz)\n i = 0\n while i < str.length * $chrsz\n bin[i >> 5] ||= 0\n bin[i >> 5] |= (str[i / $chrsz] & mask) << (32 - $chrsz - i % 32)\n i += $chrsz\n end\n bin\n end", "def str2bin(message)\n binary = message.unpack(\"B*\")[0]\n return binary\nend", "def bijective_encode(i)\n # from http://refactormycode.com/codes/125-base-62-encoding\n # with only minor modification\n return ALPHABET[0] if i == 0\n s = ''\n base = ALPHABET.length\n while i > 0\n s << ALPHABET[i.modulo(base)]\n i /= base\n end\n s.reverse\nend", "def convertBinaryToString(binary)\n # Use the pack function to encode the binary\n str = [binary].pack('b*')\n return str\n end", "def convert_to_base_8(n)\n n.to_s(8).to_i\nend", "def convert_to_base_8(n)\n n.to_s(8).to_i\nend", "def to_s\n @bits.to_s(2)\n end", "def add_binary(a,b)\n total = a+b\n total.to_s(2)\nend", "def str2binb(str)\n bin = []\n mask = (1 << $chrsz) - 1\n #for(var i = 0; i < str.length * $chrsz; i += $chrsz)\n i = 0\n while(i < str.length * $chrsz)\n bin[i>>5] ||= 0\n bin[i>>5] |= (str[i / $chrsz] & mask) << (32 - $chrsz - i%32)\n i += $chrsz\n end\n return bin\n end", "def string_to_bin(string)\n\tsize = pay_size_enc(string.length)\n\tdata = string.unpack(\"B*\")[0].split(\"\")\n\n\tans = size.concat(data)\nend", "def binary(string)\n string.force_encoding(Encoding::ASCII_8BIT)\n end", "def bin2hex(string)\n string.unpack(\"H*\").join\nend", "def my_convert_hex_to_b64\n Hex.new(INPUT_C1).to(B64) == EXPECTED_OUTPUT_C1\nend", "def add_binary(a,b)\n sum = (a+b).to_s(2)\nend", "def test_ber_integers\n assert_equal( \"\\002\\001\\005\", 5.to_ber )\n assert_equal( \"\\002\\002\\001\\364\", 500.to_ber )\n assert_equal( \"\\x02\\x02\\xC3P\", 50000.to_ber )\n assert_equal( \"\\002\\005\\001*\\005\\362\\000\", 5000000000.to_ber )\n end", "def binary_agent(binary_string)\n binary_array = binary_string.split(\" \")\n ascii_array = []\n\n binary_conversion = {\n A: \"01000001\",\n B: \"01000010\",\n C: \"01000011\",\n D: \"01000100\",\n E: \"01000101\",\n F: \"01000110\",\n G: \"01000111\",\n H: \"01001000\",\n I: \"01001001\",\n J: \"01001010\",\n K: \"01001011\",\n L: \"01001100\",\n M: \"01001101\",\n N: \"01001110\",\n O: \"01001111\",\n P: \"01010000\",\n Q: \"01010001\",\n R: \"01010010\",\n S: \"01010011\",\n T: \"01010100\",\n U: \"01010101\",\n V: \"01010110\",\n W: \"01010111\",\n X: \"01011000\",\n Y: \"01011001\",\n Z: \"01011010\",\n a: \"01100001\",\n b: \"01100010\",\n c: \"01100011\",\n d: \"01100100\",\n e: \"01100101\",\n f: \"01100110\",\n g: \"01100111\",\n h: \"01101000\",\n i: \"01101001\",\n j: \"01101010\",\n k: \"01101011\",\n l: \"01101100\",\n m: \"01101101\",\n n: \"01101110\",\n o: \"01101111\",\n p: \"01110000\",\n q: \"01110001\",\n r: \"01110010\",\n s: \"01110011\",\n t: \"01110100\",\n u: \"01110101\",\n v: \"01110110\",\n w: \"01110111\",\n x: \"01111000\",\n y: \"01111001\",\n z: \"01111010\",\n \" \": \"00100000\",\n \"'\": \"00100111\"\n }\n\n binary_array.each do |binary_value|\n ascii_array << binary_conversion.key(binary_value) if binary_conversion.has_value?(binary_value)\n end\n\n ascii_array.join(\"\")\nend", "def dec2bin(n)\n case n\n when 0 then '0000'\n when 1 then '0001'\n when 2 then '0010'\n when 3 then '0011'\n when 4 then '0100'\n when 5 then '0101'\n when 6 then '0110'\n when 7 then '0111'\n when 8 then '1000'\n when 9 then '1001'\n when 10 then '1010'\n when 11 then '1011'\n when 12 then '1100'\n when 13 then '1101'\n else nil\n end\n end", "def boolean_to_binary(arr)\n result = ''\n i = 0\n while i < arr.length\n result << '1' if arr[i]\n result << '0' if !arr[i]\n i += 1\n end\n return result\nend", "def convert_to_base_8(n)\n n.to_s(8).to_i # replace these two method calls\nend", "def binary(integer)\n\nend", "def binary(integer)\n\nend", "def flip_bit(integer)\n binary = integer.to_s(2)\n max = 0\n current = 0\n prev = 0\n gap = 0\n\n binary.each_char do |char|\n if char == '1'\n current += 1\n gap = 0\n elsif char == '0'\n prev = current unless gap > 1\n current = 0\n gap += 1\n end\n max = [prev + current + 1, max].max\n end\n\n max\nend", "def to_s\n value.unpack('B*').first[0...size]\n end" ]
[ "0.7192082", "0.7156558", "0.7130314", "0.7125877", "0.7091967", "0.70899665", "0.70899665", "0.708422", "0.7028592", "0.6983277", "0.6929828", "0.69008875", "0.68876886", "0.6862115", "0.68590826", "0.68250453", "0.67699736", "0.67368907", "0.6736262", "0.6699089", "0.6686939", "0.6672743", "0.66315275", "0.66315216", "0.66301775", "0.6591216", "0.6580642", "0.64930874", "0.64595723", "0.64510494", "0.63929814", "0.6383536", "0.63787544", "0.63569105", "0.63499665", "0.6346484", "0.63424194", "0.63399243", "0.6331668", "0.63244694", "0.6310855", "0.63074225", "0.63050425", "0.6280673", "0.62638944", "0.6254074", "0.6244884", "0.62427825", "0.62392545", "0.62365234", "0.62345755", "0.62335193", "0.62303954", "0.6227653", "0.62074286", "0.6204688", "0.6201424", "0.6198545", "0.6198195", "0.61905515", "0.6187336", "0.6183834", "0.61764175", "0.6154485", "0.6137923", "0.6137432", "0.6118527", "0.6115854", "0.6103433", "0.6102818", "0.60997325", "0.60994166", "0.6079381", "0.60715556", "0.60700125", "0.60638684", "0.6063685", "0.60553324", "0.60403323", "0.6031739", "0.6031043", "0.60242194", "0.60242194", "0.6022445", "0.60218984", "0.6020896", "0.5995254", "0.599418", "0.5986519", "0.5980916", "0.59790796", "0.59641135", "0.5957935", "0.5950523", "0.5947341", "0.5945738", "0.59426755", "0.59426755", "0.5917687", "0.5913218" ]
0.66680175
22
GET /categories GET /categories.json
def index @tasks = Task.all render json: @tasks end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def categories\n\t\tbegin\n\t\t\t@categories = Category.select(:id, :name)\n\t\t\trender json: @categories\n\t\trescue Exception => e\n\t\t\terror_handling_bad_request(e)\n\t\tend\n\tend", "def get_categories\r\n categories = Taxonomy.get_categories\r\n render json: categories, root: 'categories', adapter: :json, status: :ok\r\n end", "def GetCategories params = {}\n\n params = params.merge(path: 'categories.json')\n APICall(params)\n\n end", "def categories\n\t\trender :json => {:status => 1, :categories => {\"1\" => \"Apparel & Accessories\", \"2\" => \"Arts and Crafts\", \"3\" => \"Electronics\", \n\t\t\t\"4\" => \"Home Appliances\", \"5\" => \"Kids & Baby\", \"6\" => \"Movies, Music, Books & Games\", \"7\" => \"Motor Vehicles\", \n\t\t\t\"8\" => \"Office & Education\", \"9\" => \"Parties & Events\", \"10\" => \"Spaces & Venues\", \"11\" => \"Sports & Outdoors\", \"12\" => \"Tools & Gardening\", \"13\" => \"Other\"}}, :status => 200\n\t\treturn\n\tend", "def categories\n get('venues/categories').categories\n end", "def index\n categories = Category.all\n render json:categories\n end", "def get_categories()\n\t\tzomoato_categories_url = @base_uri + \"categories\"\n\t\tresponse = HTTParty.get(zomoato_categories_url, headers: @headers)\n\t\tif response.success?\n\t\t\t@categories = response.parsed_response\n\t\telse\n\t\t\traise response.response\n\t\tend\n\t\treturn @categories\n\tend", "def getCategoryAll()\n params = Hash.new\n return doCurl(\"get\",\"/category/all\",params)\n end", "def get_categories_list\n args = receive_should_validate?\n get('redtube.Categories.getCategoriesList', {}, [], args[:should_validate])\n end", "def index\n @categories = Category.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @categories }\n end\n end", "def GetCategory id\n\n APICall(path: \"categories/#{id}.json\")\n\n end", "def index\n @categories = Category.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @categories }\n end\n end", "def index\n @categories = Category.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @categories }\n end\n end", "def index\n\t @categories = Category.all\n\n\t respond_to do |format|\n\t\tformat.html # index.html.erb\n\t\tformat.json { render json: @categories }\n\t end\n\tend", "def index\n\n\n @categories = Category.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @categories }\n end\n end", "def get_categories\n @categories = Category.all\n end", "def index\n @categories = Category.all \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @categories }\n end\n end", "def categories options = {}\n perform_get_with_object(\"/categories\", options, Vimeo::Entities::Category)\n end", "def index\n @categories = Category.all\n @categories= @categories.sort_by(&:name)\n render json: @categories\n end", "def categories(query_object)\n\t\tdata = do_get_json(CATEGORIES_ENDPOINT, query_object)\n\tend", "def categories\n parsed_json['data']\n end", "def index\n @categories = Category.all\n @categories.each do |category|\n authorize! :read, category\n end\n render json: @categories\n end", "def categories(params={})\n return @categories if (@categories && !params[:force])\n @categories = get_categories\n end", "def index\n categories = @vertical.catgories.order('created_at DESC');\n render json: {status: 'SUCCESS', message:'Loaded categories', data:categories},status: :ok\n end", "def index\n respond_to do |format|\n format.html { @categories = Category.all }\n format.json { @categories = Category.order(:name) }\n end\n end", "def get_categories(query_obj=nil)\n uri = URI.parse(@uri + \"/Categories\")\n results = get(uri,query_obj)\n end", "def getCategories(_, _, _)\n @db.categories\n end", "def get_subcategories\r\n sub_categories = Taxonomy.get_subcategories\r\n render json: sub_categories, root: 'categories', adapter: :json, status: :ok\r\n end", "def all(params = {})\n handle_all_request(\"/categories\", :categories, params)\n end", "def get_categories_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: CategoriesApi.get_categories ...\"\n end\n # resource path\n local_var_path = \"/categories\"\n\n # query parameters\n query_params = {}\n query_params[:'filter_search'] = opts[:'filter_search'] if !opts[:'filter_search'].nil?\n query_params[:'filter_active'] = opts[:'filter_active'] if !opts[:'filter_active'].nil?\n query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?\n query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?\n query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['oauth2_client_credentials_grant', 'oauth2_password_grant']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PageResourceCategoryResource')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CategoriesApi#get_categories\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_categories(add_params = nil)\n params = {\n }\n api_call('/global/categories(.:format)',:get,params,add_params)\n end", "def categories(args={})\n res = api_request('private.request.getCategories', 'GET')\n res = JSON.parse(res)['category'] rescue []\n\n unless args[:include_deleted] and args[:include_deleted] == true\n res.reject!{|k, v| v['fDeleted'] == '1'} rescue []\n end\n \n return res\n end", "def show\n render json: category\n end", "def index\n @incidentcategories = Incidentcategory.all\n json_response(@incidentcategories)\n end", "def get_category\n json_response({ message: 'NOT IMPLEMENTED' })\n end", "def index\n respond_with Category.all\n end", "def index\n @categories = Category.all\n render :json => @categories, :except => [:created_at, :updated_at]\n end", "def index\n @categories = CategoryService.index\n end", "def show\n render json: @category\n end", "def get_categories_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CategoriesApi.get_categories ...'\n end\n # resource path\n local_var_path = '/categories'\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[:body] \n\n # return_type\n return_type = opts[:return_type] || 'Array<Category>' \n\n # auth_names\n auth_names = opts[:auth_names] || ['Bearer']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CategoriesApi#get_categories\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def categories(make, year)\n make_id = get_object_id make\n response = get_url \"Categories/#{make_id}/#{year}\"\n response_obj = JSON.parse response\n response_obj[\"GetCategoriesResult\"].map{|r| Models::Category.from_response_hash(r)}\n end", "def getCategories\n @categories = []\n @categories << Category.new(name: \"All\", id: -1)\n @categories += Category.all\n end", "def get_categories\n body = build_request(2935, 1501, \"ACTIVEHEADINGS\")\n response = send_to_localeze(body)\n xml_doc = respond_with_hash(Nokogiri::XML(response.to_xml).text)\n end", "def categories\n add_to_query restrict_kind: 'category'\n end", "def categories\n @categories = response[\"categories\"] || []\n @categories.map!{|category| Foursquared::Response::Category.new(client, category)}\n end", "def categories\n response[\"categories\"].map!{|category| Foursquared::Response::Category.new(client, category)} if response[\"categories\"]\n end", "def index\n @categories = Category.all\n respond_with(@categories)\n end", "def get_category_list\n ret_hash = Rails.cache.fetch(\"zaim_api/category\", expired_in: 1.day) do\n json_categories = self.zaim_api.category\n tmp_ret_hash = {}\n json_categories['categories'].each do |value|\n tmp_ret_hash[value['id']] = value['name']\n end\n tmp_ret_hash\n end\n ret_hash\n end", "def index\n @categories = Category.roots\n end", "def get_categories(opts = {})\n data, _status_code, _headers = get_categories_with_http_info(opts)\n data\n end", "def index\n @categories = Category.all\n end", "def index\n\t\t@categories = Category.all\n\tend", "def index\n @categories=Category.root\n respond_with @categories\n end", "def getcategories\n category_size = RequirementCategory.all.length\n current_offset = (params[:payload][:pagenumber] - 1)*10\n direction = params[:payload][:direction]\n\n respond_to do |format|\n format.json {\n\n \tif current_offset + direction < category_size && current_offset + direction >= 0\n offset = current_offset + direction\n \t@categories = RequirementCategory.all.offset(offset).take(10) \n \trender :json => @categories\n else\n \trender :nothing => true, :status => 200, :content_type => 'text/html'\n end\n }\n end\n\n\tend", "def category\n client.categories.find(data[\"categoryId\"])\n end", "def index\n @categories = Category.all\n end", "def index\n @categories = Category.all\n end", "def index\n @categories = Category.all\n end", "def index\n @categories = Category.all\n end", "def index\n @categories = Category.all\n end", "def index\n @categories = Category.all\n end", "def index\n @categories = Category.all\n end", "def index\n @categories = Category.all\n end", "def index\n @categories = Category.all\n end", "def index\n @categories = Category.all\n end", "def index\n @categories = Category.all\n end", "def index\n @categories = Category.all\n end", "def index\n @categories = Category.all\n end", "def index\n @categories = Category.all\n end", "def index\n @categories = Category.all\n end", "def index\n @categories = Category.all\n end", "def index\n @categories = Category.all\n end", "def index\n @categories = Category.all\n end", "def index\n @categories = Category.all\n end", "def index\n @categories = Category.all\n end", "def index\n @categories = Category.all\n end", "def index\n @categories = Category.all\n end", "def index\n @categories = Category.all\n end", "def index\n @categories = Category.all\n end", "def get_categories(opts = {})\n data, _status_code, _headers = get_categories_with_http_info(opts)\n return data\n end", "def categories\n category\n end", "def categories\n []\n end", "def index\n\t@categories = Category.all\n\tend", "def category\n # Whats the last category we are asking for? (the rest don't matter I don't think..)\n requested_category = params[:category].split(\"/\").last\n category = Taxonomy.find_by_seo_url requested_category\n\n if category.present?\n @category = category\n @posts = get_posts category.posts\n\n\n respond_to do |format|\n format.html { render :template => 'default/index' }\n format.json { render json: @posts }\n end\n else\n # No such category found, redirect to root index\n redirect_to root_path\n end\n end", "def index\n render json: Category.order('name ASC').all\n end", "def index\n @section_categories = SectionCategory.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @section_categories }\n end\n end", "def show\n render json: @categoria\n end", "def index\n categories = Category.all\n\n if params[:limit]\n categories = categories.limit(params[:limit])\n end\n\n render json: CategorySerializer.new(categories).serializable_hash\n end", "def get_categories\n cats = []\n params.each do |k,v|\n if k.starts_with? \"category\"\n name = v\n num = cat_number(k) \n cats << [name,num]\n end\n end\n return cats\n end", "def index\n @categories = Category.all\n end", "def get_categories(project_id_or_key)\n get(\"projects/#{project_id_or_key}/categories\")\n end", "def categories(options = {})\n fetch_categories.at('categories').children_of_type('category').inject([]){ |r, i| r << parse_single_category_xml(i) }\n\tend", "def index\n @categories = Category.paginate(:page => params[:page])\n @title = \"Категории\"\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @categories }\n end\n end", "def categories\n\t\t\t@cat_cache ||= @db.js('musicthoughts.all_categories()').map {|c| c.merge(category: c[@lang]) }\n\t\t\t@cat_cache\n\t\tend", "def categories\n raw_categories.to_hashugar\n end", "def event_categories(options = {})\n response = connection.get do |req|\n req.url \"events/categories\", options\n end\n return_error_or_body(response, response.body.response.categories)\n end", "def index\n @service_categories = ServiceCategory.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @service_categories }\n end\n end", "def categories_list_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: OtherApi.categories_list ...\"\n end\n # resource path\n local_var_path = \"/categories\"\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = []\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Array<Category>')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: OtherApi#categories_list\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def categories\n # @categories = Category.get_categories(@user.id)\n #@categories =Category.all.select(:id).select(:name).select(:description).select(:logo_url)\n @categories =Category.all\n user_cat= @user.categories.collect(&:id)\n categories = []\n @categories.each do |cat|\n cat_attr = cat.attributes\n user_cat.include?(cat.id) ? cat_attr.merge!('user_category' => true) : cat_attr.merge!('user_category' => false)\n categories << cat_attr\n end\n @categories = categories\n\n respond_to do |format|\n if @categories.blank?\n format.json {render json:{:success => false, :status_code => 404, :message => \"No category found\"}}\n format.xml {render xml:{:success => false, :status_code => 404, :message => \"No category found\"}}\n format.html {render json: {:success => false, :status_code => 404, :message => \"No category found\"}}\n else\n format.html {render json: {:success => true, :status_code => 200, :categories => @categories}}\n format.json {render json: {:success => true, :status_code => 200, :categories => @categories}}\n format.xml {render xml: {:success => true, :status_code => 200, :categories => @categories}}\n end\n end\n end", "def all\n render json: Cat.all\n end", "def index\n @categories = Category.all\n \n respond_with do |format|\n format.html { render :index, :layout => false}\n end\n end" ]
[ "0.83888507", "0.8327856", "0.83211476", "0.78072983", "0.7742051", "0.75669324", "0.75111455", "0.74151826", "0.7386452", "0.7369945", "0.7369187", "0.73691803", "0.73691803", "0.73457074", "0.73304063", "0.7316772", "0.72851175", "0.72663945", "0.72275496", "0.7220998", "0.721489", "0.7214744", "0.7191486", "0.7170767", "0.71196395", "0.7099406", "0.70744735", "0.7046364", "0.70421106", "0.7034058", "0.7032228", "0.7031601", "0.70285517", "0.701469", "0.6996653", "0.69954544", "0.6993141", "0.6981535", "0.6970529", "0.6965789", "0.69562495", "0.68973124", "0.6896462", "0.6888122", "0.6884991", "0.68843496", "0.68729085", "0.68694204", "0.684738", "0.68159676", "0.6808432", "0.68015593", "0.6799326", "0.6773361", "0.6770789", "0.67645466", "0.67645466", "0.67645466", "0.67645466", "0.67645466", "0.67645466", "0.67645466", "0.67645466", "0.67645466", "0.67645466", "0.67645466", "0.67645466", "0.67645466", "0.67645466", "0.67645466", "0.67645466", "0.67645466", "0.67645466", "0.67645466", "0.67645466", "0.67645466", "0.67645466", "0.67645466", "0.67645466", "0.67614204", "0.67590016", "0.67560863", "0.6751845", "0.6734348", "0.6726548", "0.67246544", "0.6723478", "0.67053044", "0.67034256", "0.66973054", "0.6697162", "0.6685197", "0.66803694", "0.66784716", "0.66742986", "0.6672338", "0.6635933", "0.6635794", "0.6623354", "0.6619753", "0.6616208" ]
0.0
-1
GET /categories/1 GET /categories/1.json
def show render json: @task end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GetCategories params = {}\n\n params = params.merge(path: 'categories.json')\n APICall(params)\n\n end", "def get_categories\r\n categories = Taxonomy.get_categories\r\n render json: categories, root: 'categories', adapter: :json, status: :ok\r\n end", "def GetCategory id\n\n APICall(path: \"categories/#{id}.json\")\n\n end", "def categories\n\t\tbegin\n\t\t\t@categories = Category.select(:id, :name)\n\t\t\trender json: @categories\n\t\trescue Exception => e\n\t\t\terror_handling_bad_request(e)\n\t\tend\n\tend", "def categories\n\t\trender :json => {:status => 1, :categories => {\"1\" => \"Apparel & Accessories\", \"2\" => \"Arts and Crafts\", \"3\" => \"Electronics\", \n\t\t\t\"4\" => \"Home Appliances\", \"5\" => \"Kids & Baby\", \"6\" => \"Movies, Music, Books & Games\", \"7\" => \"Motor Vehicles\", \n\t\t\t\"8\" => \"Office & Education\", \"9\" => \"Parties & Events\", \"10\" => \"Spaces & Venues\", \"11\" => \"Sports & Outdoors\", \"12\" => \"Tools & Gardening\", \"13\" => \"Other\"}}, :status => 200\n\t\treturn\n\tend", "def index\n categories = Category.all\n render json:categories\n end", "def index\n @categories = Category.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @categories }\n end\n end", "def index\n @categories = Category.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @categories }\n end\n end", "def index\n @categories = Category.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @categories }\n end\n end", "def index\n\n\n @categories = Category.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @categories }\n end\n end", "def index\n @categories = Category.all \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @categories }\n end\n end", "def show\n render json: category\n end", "def show\n render json: @category\n end", "def index\n\t @categories = Category.all\n\n\t respond_to do |format|\n\t\tformat.html # index.html.erb\n\t\tformat.json { render json: @categories }\n\t end\n\tend", "def getCategoryAll()\n params = Hash.new\n return doCurl(\"get\",\"/category/all\",params)\n end", "def get_category id\n\t\t\t\t\tFreshdesk::Api::Client.convert_to_hash( @connection.get CATEGORIES, id )\n\t\t\t\tend", "def index\n categories = @vertical.catgories.order('created_at DESC');\n render json: {status: 'SUCCESS', message:'Loaded categories', data:categories},status: :ok\n end", "def getCategories(_, _, _)\n @db.categories\n end", "def category\n client.categories.find(data[\"categoryId\"])\n end", "def categories\n get('venues/categories').categories\n end", "def get_category\n json_response({ message: 'NOT IMPLEMENTED' })\n end", "def get_categories\n @categories = Category.all\n end", "def index\n respond_to do |format|\n format.html { @categories = Category.all }\n format.json { @categories = Category.order(:name) }\n end\n end", "def getCategory( category_id)\n params = Hash.new\n params['category_id'] = category_id\n return doCurl(\"get\",\"/category\",params)\n end", "def index\n @categories = Category.all\n @categories= @categories.sort_by(&:name)\n render json: @categories\n end", "def category\n # Whats the last category we are asking for? (the rest don't matter I don't think..)\n requested_category = params[:category].split(\"/\").last\n category = Taxonomy.find_by_seo_url requested_category\n\n if category.present?\n @category = category\n @posts = get_posts category.posts\n\n\n respond_to do |format|\n format.html { render :template => 'default/index' }\n format.json { render json: @posts }\n end\n else\n # No such category found, redirect to root index\n redirect_to root_path\n end\n end", "def index\n @categories = CategoryService.index\n end", "def index\n @categories = Category.all\n @categories.each do |category|\n authorize! :read, category\n end\n render json: @categories\n end", "def category(id = nil)\n res = Connection.get('categories', id)\n id.nil? ? Category.all(res) : Category.new(res)\n end", "def index\n @incidentcategories = Incidentcategory.all\n json_response(@incidentcategories)\n end", "def index\n @categories = Category.all\n render :json => @categories, :except => [:created_at, :updated_at]\n end", "def get_categories()\n\t\tzomoato_categories_url = @base_uri + \"categories\"\n\t\tresponse = HTTParty.get(zomoato_categories_url, headers: @headers)\n\t\tif response.success?\n\t\t\t@categories = response.parsed_response\n\t\telse\n\t\t\traise response.response\n\t\tend\n\t\treturn @categories\n\tend", "def index\n respond_with Category.all\n end", "def show\n render json: @categoria\n end", "def show\n @category = Category.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @category }\n end\n end", "def show\n @category = Category.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @category }\n end\n end", "def show\n @category = Category.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @category }\n end\n end", "def show\n @category = Category.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @category }\n end\n end", "def show\n @category = Category.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @category }\n end\n end", "def show\n @category = Category.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @category }\n end\n end", "def show\n @category = Category.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @category }\n end\n end", "def index\n @categories = Category.roots\n end", "def index\n @categories = Category.all\n end", "def index\n @categories = Category.all\n end", "def index\n @categories = Category.all\n end", "def index\n @categories = Category.all\n end", "def index\n @categories = Category.all\n end", "def index\n @categories = Category.all\n end", "def index\n @categories = Category.all\n end", "def index\n @categories = Category.all\n end", "def index\n @categories = Category.all\n end", "def index\n @categories = Category.all\n end", "def index\n @categories = Category.all\n end", "def index\n @categories = Category.all\n end", "def index\n @categories = Category.all\n end", "def index\n @categories = Category.all\n end", "def index\n @categories = Category.all\n end", "def index\n @categories = Category.all\n end", "def index\n @categories = Category.all\n end", "def index\n @categories = Category.all\n end", "def index\n @categories = Category.all\n end", "def index\n @categories = Category.all\n end", "def index\n @categories = Category.all\n end", "def index\n @categories = Category.all\n end", "def index\n @categories = Category.all\n end", "def index\n @categories = Category.all\n end", "def get_subcategories\r\n sub_categories = Taxonomy.get_subcategories\r\n render json: sub_categories, root: 'categories', adapter: :json, status: :ok\r\n end", "def index\n\t\t@categories = Category.all\n\tend", "def index\n\t@categories = Category.all\n\tend", "def index\n @categories = Category.all\n end", "def index\n @categories = Category.all\n end", "def index\n render json: Category.order('name ASC').all\n end", "def categories(params={})\n return @categories if (@categories && !params[:force])\n @categories = get_categories\n end", "def index\n @categories = Category.all\n respond_with(@categories)\n end", "def get_categories(add_params = nil)\n params = {\n }\n api_call('/global/categories(.:format)',:get,params,add_params)\n end", "def category\n Category.find(params[:id])\n end", "def index\n @categories=Category.root\n respond_with @categories\n end", "def show\n @category = current_mall.categories.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @category }\n end\n end", "def index\n @categories = Category.paginate(:page => params[:page])\n @title = \"Категории\"\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @categories }\n end\n end", "def get_categories_list\n args = receive_should_validate?\n get('redtube.Categories.getCategoriesList', {}, [], args[:should_validate])\n end", "def index\n categories = Category.all\n\n if params[:limit]\n categories = categories.limit(params[:limit])\n end\n\n render json: CategorySerializer.new(categories).serializable_hash\n end", "def show\n\t @category = Category.find(params[:id])\n\n\t respond_to do |format|\n\t\tformat.html # show.html.erb\n\t\tformat.json { render json: @category }\n\t end\n\tend", "def categories(query_object)\n\t\tdata = do_get_json(CATEGORIES_ENDPOINT, query_object)\n\tend", "def categories\n parsed_json['data']\n end", "def index\n #expires_in 24.hours\n #fresh_when last_modified: @max, public: true\n @roots = @categories.roots\n @keyword = String.new\n\n @roots.each do |r|\n @keyword << r.name << \" \"\n end\n\n if params[:id]\n if c = Category.find(params[:id])\n redirect_to c\n return\n else\n flash.now[:error] = \"Category not found.\"\n end\n end\n\n respond_to do |format|\n format.html\n format.json {render json:@categories}\n end\n\n end", "def index\n @categories = Category.order(\"name ASC\")\n @latest_reviews = Review.limit(3).order(\"created_at DESC\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @categories }\n end\n end", "def get_categories_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: CategoriesApi.get_categories ...\"\n end\n # resource path\n local_var_path = \"/categories\"\n\n # query parameters\n query_params = {}\n query_params[:'filter_search'] = opts[:'filter_search'] if !opts[:'filter_search'].nil?\n query_params[:'filter_active'] = opts[:'filter_active'] if !opts[:'filter_active'].nil?\n query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?\n query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?\n query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['oauth2_client_credentials_grant', 'oauth2_password_grant']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PageResourceCategoryResource')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CategoriesApi#get_categories\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def get_category_list\n ret_hash = Rails.cache.fetch(\"zaim_api/category\", expired_in: 1.day) do\n json_categories = self.zaim_api.category\n tmp_ret_hash = {}\n json_categories['categories'].each do |value|\n tmp_ret_hash[value['id']] = value['name']\n end\n tmp_ret_hash\n end\n ret_hash\n end", "def categories options = {}\n perform_get_with_object(\"/categories\", options, Vimeo::Entities::Category)\n end", "def getCategories\n @categories = []\n @categories << Category.new(name: \"All\", id: -1)\n @categories += Category.all\n end", "def show\n @post_category = Post::Category.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post_category }\n end\n end", "def index\n @categories = Category.paginate(:page => params[:page], per_page:30)\n @number = Category.count\n\n respond_to do |format|\n format.html\n format.json { render json: Category.all }\n end\n end", "def index\n @categorias = Categoria.where(ativo: true)\n \t\n render json: @categorias\n end", "def index\n @categories = Category.all\n \n respond_with do |format|\n format.html { render :index, :layout => false}\n end\n end", "def index\n @cover_cats = CoverCat.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @cover_cats }\n end\n end", "def index\n @section_categories = SectionCategory.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @section_categories }\n end\n end", "def show\n @cat = Cat.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cat }\n end\n end", "def show\n @recipe_category = RecipeCategory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @recipe_category }\n end\n end", "def index\n @categories = collections_config.values\n end", "def index\n @taxonomy_categories = TaxonomyCategory.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @taxonomy_categories }\n end\n end", "def fetch_categories(count = ENV['DEFAULT_CATEGORY_COUNT'].to_i)\n max_category = 18418\n uri = \"http://jservice.io/api/categories?count=#{count}&offset=#{1+rand(max_category/count.to_f)}\"\n request = HTTParty.get(uri)\n data = JSON.parse(request.body)\nend" ]
[ "0.7877691", "0.7865133", "0.78486437", "0.78422695", "0.7414923", "0.74083245", "0.73075056", "0.7306919", "0.7306919", "0.7282217", "0.7235693", "0.7186931", "0.7158298", "0.7133119", "0.7122198", "0.70659566", "0.70442134", "0.7036961", "0.70349413", "0.70324004", "0.7012643", "0.7009862", "0.6999405", "0.6993045", "0.6990838", "0.69787407", "0.6956943", "0.69493926", "0.693385", "0.68740106", "0.6857372", "0.6855677", "0.6852057", "0.68460214", "0.6835847", "0.6835847", "0.6835847", "0.6835847", "0.6835847", "0.6835847", "0.6835847", "0.68196505", "0.68190384", "0.68190384", "0.68190384", "0.68190384", "0.68190384", "0.68190384", "0.68190384", "0.68190384", "0.68190384", "0.68190384", "0.68190384", "0.68190384", "0.68190384", "0.68190384", "0.68190384", "0.68190384", "0.68190384", "0.68190384", "0.68190384", "0.68190384", "0.68190384", "0.68190384", "0.68190384", "0.68190384", "0.6811142", "0.6795076", "0.6769383", "0.6751968", "0.6730927", "0.67296433", "0.6723893", "0.6720277", "0.6718597", "0.6718178", "0.67129713", "0.6708545", "0.6707729", "0.67047274", "0.6698742", "0.6698137", "0.66946316", "0.66537845", "0.66530246", "0.6641249", "0.66375494", "0.6636564", "0.66132104", "0.66113704", "0.6608408", "0.6590371", "0.6587897", "0.65741247", "0.65741235", "0.65732604", "0.6570182", "0.6569654", "0.6567145", "0.6562422", "0.6556036" ]
0.0
-1
POST /categories POST /categories.json
def create @task = Task.new(task_params) if @task.save render json: @task, status: :created else render json: @task.errors, status: :unprocessable_entity end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def CreateCategory params = {}\n \n APICall(path: 'categories.json',method: 'POST',payload: params.to_json)\n \n end", "def create\n json_create(category_params, Category)\n end", "def create_category payload\n\t\t\t\t\tFreshdesk::Api::Client.convert_to_hash( @connection.post CATEGORIES, payload )\n\t\t\t\tend", "def create\n category = @current_user.categories.create!(category_params)\n render json: { category: category }\n end", "def create\n if @category.save\n render json: @category, status: :created, location: @category\n else\n render json: @category.errors, status: :unprocessable_entity\n end\n end", "def create\n @category = Category.new(category_params)\n @category.save\n render json: { params: params, notice: 'Categoria registrada exitosamente' }\n end", "def get_categories\r\n categories = Taxonomy.get_categories\r\n render json: categories, root: 'categories', adapter: :json, status: :ok\r\n end", "def create\n @categoria = Categoria.new(categoria_params)\n if @categoria.save\n render json: @categoria\n else\n render json: @categoria.errors, status: :unprocessable_entity\n end\n end", "def create\n @category = current_user.categories.new(name: params[:name])\n if @category.save\n render \"create.json.jbuilder\", status: :created\n else\n render json: { errors: @category.errors.full_messages }, status: :unprocessable_entity\n end\n end", "def create\n @category = Category.new(params[:category])\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to api_v1_categories_path, notice: 'Category was successfully created.' }\n format.json { render json: @category, status: :created, location: @category }\n else\n format.html { render action: \"new\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def categories\n\t\tbegin\n\t\t\t@categories = Category.select(:id, :name)\n\t\t\trender json: @categories\n\t\trescue Exception => e\n\t\t\terror_handling_bad_request(e)\n\t\tend\n\tend", "def create\n @category = Category.new(category_params)\n authorize! :create, @category\n if @category.save\n render json: @category, status: :created\n else\n render json: @category.errors, status: :unprocessable_entity\n end\n end", "def create\n @category = current_mall.categories.new(params[:category])\n\n if @category.save\n render json: @category, status: :created\n else\n render json: @category.errors, status: :unprocessable_entity\n end\n end", "def post_category(category_name, options={ })\n self.post('/categories.json',\n options.merge(\n :body => { :category => {\n :name => category_name\n } }.to_json\n )\n )['category']\n end", "def create\n category = Category.create(category_params)\n\n \n if category\n render json:{\n status: :created,\n category: category}\n else\n render json: { status: 500 }\n end\n end", "def user_category\n # byebug\n @user = User.where(contact: params[:contact]).first\n params[:category_ids].each do |category|\n @user.user_categories.create!(category_id: category, user_id: @user.id)\n end\n render json: {status: \"SUCCESS\", message: \"user-data\", data: \"category saved\"}, status: :ok\n end", "def addCat()\n if(!authenticateAdmin(params[:admin_id], params[:admin_auth_key]))\n render json: {status: false, reason: \"Authentication Failed\", data: \"\"}\n return\n end\n c = Category.new(name: params[:name])\n status = c.save\n error = \"\"\n if(c.errors.full_messages.count > 0)\n error = c.errors.full_messages[0]\n end\n render json: {status: status, reason: error, data: \"\"}\n end", "def create\n @category = Category.create(params[:category])\n respond_with(@category, location: categories_url)\n end", "def categories\n\t\trender :json => {:status => 1, :categories => {\"1\" => \"Apparel & Accessories\", \"2\" => \"Arts and Crafts\", \"3\" => \"Electronics\", \n\t\t\t\"4\" => \"Home Appliances\", \"5\" => \"Kids & Baby\", \"6\" => \"Movies, Music, Books & Games\", \"7\" => \"Motor Vehicles\", \n\t\t\t\"8\" => \"Office & Education\", \"9\" => \"Parties & Events\", \"10\" => \"Spaces & Venues\", \"11\" => \"Sports & Outdoors\", \"12\" => \"Tools & Gardening\", \"13\" => \"Other\"}}, :status => 200\n\t\treturn\n\tend", "def create\n category = Category.create!(category_params)\n render json: {\n :html => render_to_string(\n :partial => \"setups/category\",\n :layout => false,\n :locals => {:category => category})\n }\n end", "def create\n @category = Category.new(params[:category])\n\n respond_to do |format|\n if @category.save\n format.html {\n redirect_to @category, notice: 'Category was successfully created.'\n }\n format.json {\n render json: @category, status: :created, location: @category\n }\n else\n format.html { render action: \"new\" }\n format.json {\n render json: @category.errors, status: :unprocessable_entity\n }\n end\n end\n end", "def create\n @category = Category.new(params[:category]) \n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: t(:created_category_success)}\n format.json { render json: @category, status: :created, location: @category }\n else\n format.html { render action: \"new\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @category = Category.new(category_params)\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to categories_path, notice: 'Category was successfully created.' }\n format.json { render :show, status: :created, location: @category }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @category = Category.new(params[:category])\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Category was successfully created.' }\n format.json { render json: @category, status: :created, location: @category }\n else\n format.html { render action: \"new\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @category = Category.new(params[:category])\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Category was successfully created.' }\n format.json { render json: @category, status: :created, location: @category }\n else\n format.html { render action: \"new\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @category = Category.new(params[:category])\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Category was successfully created.' }\n format.json { render json: @category, status: :created, location: @category }\n else\n format.html { render action: \"new\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @category = Category.new(params[:category])\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Category was successfully created.' }\n format.json { render json: @category, status: :created, location: @category }\n else\n format.html { render action: \"new\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @category = Category.new(params[:category])\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Category was successfully created.' }\n format.json { render json: @category, status: :created, location: @category }\n else\n format.html { render action: \"new\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @category = Category.new(category_params)\n respond_to do |format|\n if @category.save\n format.html { redirect_to management_categories_path }\n format.json { render json: @category, status: :created }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @categories_post = CategoriesPost.new(categories_post_params)\n\n respond_to do |format|\n if @categories_post.save\n format.html { redirect_to @categories_post, notice: 'Categories post was successfully created.' }\n format.json { render :show, status: :created, location: @categories_post }\n else\n format.html { render :new }\n format.json { render json: @categories_post.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @category = Category.new(category_params)\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Category was successfully created.' }\n format.json { render json: @category, status: :created }\n else\n format.html { render action: 'new' }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n \n category = params[:category]\n category_name = category['name']\n \n write_log(\"category.to_s: #{category.to_s}\",\n __FILE__.split(\"/\")[-1],\n __LINE__.to_s)\n \n cats = []\n if category_name != nil\n cats = category_name.split(\" \")\n end\n \n write_log(\"cats.size: #{cats.size}\",\n __FILE__.split(\"/\")[-1],\n __LINE__.to_s)\n\n if cats.size > 1\n \n flag = true\n counter = 0\n \n cats.each do |cat|\n # @category = Category.new(params[:category])\n # @category = Category.new(name=cat)\n @category = Category.new({\"name\"=> cat, \"genre_id\"=> category['genre_id']})\n \n if @category.save\n else\n counter += 1\n end\n end#cats.each do |cat|\n \n respond_to do |format|\n format.html { redirect_to @category, \n notice: \"New categories: Created => #{cats.size - counter}, Failed => #{counter}\" }\n format.json { render json: @category, status: :created, location: @category }\n end\n \n else#if cats.size > 1\n @category = Category.new(params[:category])\n \n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Category was successfully created.' }\n format.json { render json: @category, status: :created, location: @category }\n else\n format.html { render action: \"new\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end#if cats.size > 1\n \n \n # @category = Category.new(params[:category])\n# \n # respond_to do |format|\n # if @category.save\n # format.html { redirect_to @category, notice: 'Category was successfully created.' }\n # format.json { render json: @category, status: :created, location: @category }\n # else\n # format.html { render action: \"new\" }\n # format.json { render json: @category.errors, status: :unprocessable_entity }\n # end\n # end\n end", "def create\n @category = @collection.categories.new(category_params)\n\n if @category.save\n ActionCable.server.broadcast 'categories',\n title: @category.title,\n collection_id: @category.collection_id\n head :ok\n else\n\n end\n end", "def create\n @category = Category.new(category_params)\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to categories_path, notice: 'Category was successfully created.' }\n format.json { render action: 'show', status: :created, location: @category }\n else\n format.html { render action: 'new' }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @category = Category.new(category_params)\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to admin_dashboard_categories_path, notice: 'Category was successfully created.' }\n format.json { render :show, status: :created, location: @category }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @category = Category.new(category_params)\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Category was successfully created.' }\n format.json { render json: @category, status: :created, location: @category }\n else\n format.html { render action: \"new\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @category = Category.new(params[:category])\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Category was successfully created!!' }\n format.json { render json: @category, status: :created, location: @category }\n\n else\n format.html { render action: \"new\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @category = Category.new(category_params)\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Category was successfully created.' }\n format.json { render :show, status: :created, location: @category }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @category = Category.new(category_params)\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Category was successfully created.' }\n format.json { render :show, status: :created, location: @category }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @category = Category.new(category_params)\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Category was successfully created.' }\n format.json { render :show, status: :created, location: @category }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @category = Category.new(category_params)\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Category was successfully created.' }\n format.json { render :show, status: :created, location: @category }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @category = Category.new(category_params)\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Category was successfully created.' }\n format.json { render :show, status: :created, location: @category }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @category = Category.new(category_params)\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Category was successfully created.' }\n format.json { render :show, status: :created, location: @category }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @category = Category.new(category_params)\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Category was successfully created.' }\n format.json { render :show, status: :created, location: @category }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @category = Category.new(category_params)\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Category was successfully created.' }\n format.json { render :show, status: :created, location: @category }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @category = Category.new(category_params)\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Category was successfully created.' }\n format.json { render :show, status: :created, location: @category }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @category = Category.new(category_params)\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Category was successfully created.' }\n format.json { render :show, status: :created, location: @category }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @category = Category.new(category_params)\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Category was successfully created.' }\n format.json { render :show, status: :created, location: @category }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @categ = Categ.new(categ_params)\n\n respond_to do |format|\n if @categ.save\n format.html { redirect_to @categ, notice: 'Categ was successfully created.' }\n format.json { render :show, status: :created, location: @categ }\n else\n format.html { render :new }\n format.json { render json: @categ.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @post_category = Post::Category.new(params[:post_category])\n\n respond_to do |format|\n if @post_category.save\n format.html { redirect_to @post_category, notice: 'Category was successfully created.' }\n format.json { render json: @post_category, status: :created, location: @post_category }\n else\n format.html { render action: \"new\" }\n format.json { render json: @post_category.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @categoria = Categoria.new(params[:categoria])\n\n respond_to do |format|\n if @categoria.save\n format.html { redirect_to action: 'index', notice: 'Categoria was successfully created.' }\n format.json { render json: @categoria, status: :created, location: @categoria }\n else\n format.html { render action: \"new\" }\n format.json { render json: @categoria.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @category = Category.new(params[:category])\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to Category.find(@category.category_id), notice: 'Category was successfully created.' }\n format.json { render json: @category, status: :created, location: @category }\n else\n format.html { render action: \"new\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @category = CategoryService.create\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Category was successfully created.' }\n format.json { render :show, status: :created, location: @category }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @category = Category.new(params[:category])\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Категория добавлена.' }\n format.json { render json: @category, status: :created, location: @category }\n else\n format.html { render action: \"new\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @category = Category.new(category_params)\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Category was successfully created.' }\n format.json { render action: 'show', status: :created, location: @category }\n else\n format.html { render action: 'new' }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n\n # @category = Category.new(params[:category])\n @category = current_user.categories.build(params[:category])\n\n respond_to do |format|\n if @category.save\n # format.html { redirect_to @category, notice: 'Category was successfully created.' }\n format.html { redirect_to categories_path, notice: 'Pomyślnie utworzono kategorię.' }\n format.json { render json: @category, status: :created, location: @category }\n else\n # format.html { render action: \"new\" }\n format.html { redirect_to categories_path, :flash => { :error => 'Nie udało się utworzyć kategorii' } }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_category\n @category = TestCategory.new(params[:category])\n @category.save\n @categories = TestCategory.find(:all)\n redraw 'categories'\n end", "def index\n categories = Category.all\n render json:categories\n end", "def GetCategories params = {}\n\n params = params.merge(path: 'categories.json')\n APICall(params)\n\n end", "def create\n @categories = Category.all\n\n @category = Category.create(category_params)\n flash[:notice]=\"Catégorie créer avec succès!!!\"\n end", "def create\n @categories = Category.where(validity: true)\n @category = Category.new(params[:category])\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: t(:category_created) }\n format.json { render json: @category, status: :created, location: @category }\n else\n format.html { render action: \"new\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @categor = Categor.new(categor_params)\n\n respond_to do |format|\n if @categor.save\n format.html { redirect_to @categor, notice: 'Categor was successfully created.' }\n format.json { render :show, status: :created, location: @categor }\n else\n format.html { render :new }\n format.json { render json: @categor.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @incidentcategory = Incidentcategory.new(incidentcategory_params)\n\n if @incidentcategory.save\n json_response(@incidentcategory)\n else\n render json: @incidentcategory.errors, status: :unprocessable_entity\n end\n end", "def create\r\n @category = Category.new(categories_params)\r\n\r\n respond_to do |format|\r\n if @category.save\r\n format.html { redirect_to articles_path, notice: 'Profile was successfully updated.' }\r\n format.json { head :no_content }\r\n else\r\n format.html { render action: 'new' }\r\n format.json { render json: @category.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "def create\n\t\t@cat = Cat.new(cat_params)\n\n\t\tif @cat.save\n\t\t\t# cat_url(@cat) == /cat/{@cat.id}\n\t\t\tredirect_to cat_url(@cat)\n\t\telse\n\t\t\trender :new\n\t\t\t# render json: @cat.errors.full_messages, status: :unprocessable_entity\n\t\tend \n\tend", "def create\n @category = Category.new(category_params)\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Category was successfully created.' }\n format.json { render :show, status: :created, location: @category }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @categorization = Categorization.new(params[:categorization])\n @categories = category_list\n respond_to do |format|\n if @categorization.save\n format.html { redirect_to(admin_categorization_path(@categorization), :notice => 'Categorization was successfully created.') }\n format.xml { render :xml => @categorization, :status => :created, :location => @categorization }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @categorization.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @category = Category.new(category_params)\n respond_to do |format|\n if @category.save\n format.html { redirect_to categories_path, notice: 'Категория была успешно создана'}\n format.json { render :show, status: :created, location: @category }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @category = Category.new(category_params)\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to root_path, notice: 'Category was successfully created.' }\n format.json { render :show, status: :created, location: @category }\n else\n flash.alert = @category.errors.full_messages\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @category = Category.create(params[:category])\n \n if @category.save\n redirect_to categories_path\n else\n render 'new'\n end\n \n end", "def create\n @category = PostCategory.new(category_params)\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to cm_post_categories_url, notice: 'PostCategory was successfully created.' }\n format.json { render action: 'show', status: :created, location: @category }\n else\n format.html { render action: 'new' }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n categories = @vertical.catgories.order('created_at DESC');\n render json: {status: 'SUCCESS', message:'Loaded categories', data:categories},status: :ok\n end", "def create\n admins_only do\n @category = Category.new(category_params)\n @category.name = params[:category][:name].to_s.camelcase\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to category_index_path, notice: 'Category was successfully created.' }\n format.json { render action: 'index', status: :created, location: @category }\n else\n format.html { render action: 'new' }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end\n end", "def create\n if params[:categoria_producto]\n p = Producto.find(params[:producto_id])\n c = Categoria.find(params[:categoria_id])\n\n if p.categorias << c\n render json: c, status: :created\n else\n render json: {:errors => {categoria: [\"No se ha podido agregar categoria\"]}}, status: :unprocessable_entity\n end\n\n else\n @categoria = Categoria.new(parametros_categoria)\n\n if @categoria.save\n render json: @categoria, status: :created\n else\n render json: @categoria.errors, status: :unprocessable_entity\n end\n end\n end", "def modify_category(categories)\n begin\n puts Rainbow(\"Current categories: #{categories.join(', ')}\").whitesmoke\n yield\n\n write_json(categories, \"Categories/cat\", \"Available categories are: #{categories.join(', ')}\")\n rescue StandardError\n puts \"There are no categories to delete\"\n end\nend", "def create\n @cat = Cat.new(params[:cat])\n\n respond_to do |format|\n if @cat.save\n format.html { redirect_to @cat, notice: 'Cat was successfully created.' }\n format.json { render json: @cat, status: :created, location: @cat }\n else\n format.html { render action: \"new\" }\n format.json { render json: @cat.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @category = Category.new(category_params)\n respond_to do |format|\n if @category.save\n format.html { redirect_to adminpanel_categories_path, notice: \"Категория #{@category.name} успешно создана\" }\n format.json { render :show, status: :created, location: adminpanel_categories_path }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @category = Category.new(category_params)\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to edit_dashboard_category_path(@category), notice: 'Category was successfully created.' }\n format.json { render :show, status: :created, location: @category }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @category = Category.new(category_params)\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to admin_category_path(@category), notice: 'Category was successfully created.' }\n format.json { render action: 'show', status: :created, location: @category }\n else\n format.html { render action: 'new' }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def create \n\n user = User.find(@user_id)\n post = user.posts.build(params_post)\n \n category = Category.find_by_id(params[:category])\n return render json: { error: \"Category not found\"}, status: 404 if category.nil?\n \n post.category = category\n \n \n if post.save\n render json: post, status: :created\n else \n render json: post.errors, status: :unprocessable_entity\n end\n end", "def create\n @category = Category.new(category_params)\n @category.user_id = current_user.id\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: t('create.notice', name: t('activerecord.models.category')) }\n format.json { render :show, status: :created, location: @category }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @user = current_user\n @category = Category.new(params[:category])\n @user.categories << @category\n #TODO: error handling\n #TODO: AJAX this\n if @user.save\n redirect_to user_path(@user)\n else\n render \"new\"\n end\n end", "def create\n @post_category = current_user.post_categories.build(params[:post_category])\n\n respond_to do |format|\n if @post_category.save\n format.html { redirect_to [:client,:post_categories], notice: 'Post category was successfully created.' }\n format.json { render json: @post_category, status: :created, location: @post_category }\n else\n format.html { render action: \"index\" }\n format.json { render json: @post_category.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @recipe_category = RecipeCategory.new(params[:recipe_category])\n\n respond_to do |format|\n if @recipe_category.save\n format.html { redirect_to @recipe_category, notice: 'Recipe category was successfully created.' }\n format.json { render json: @recipe_category, status: :created, location: @recipe_category }\n else\n format.html { render action: \"new\" }\n format.json { render json: @recipe_category.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @category = Category.new(params[:category])\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to categories_url, notice: 'Category was successfully created.' }\n end\n end\n end", "def create\n @category_form_url = forum_categories_path\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Category was successfully created.' }\n format.json { render action: 'show', status: :created, location: @category }\n else\n format.html { render action: 'new' }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n \n @categorias_tipo = CatTipo.new(params[:cat_tipo])\n\n\t\trespond_to do |format|\n\t\t\tif @categorias_tipo.save\n \t\t\tcategories = @categorias_tipo.update_attributes(:tipo_acc_ids =>params[:tipo_accs])\n\t\t\t\t@categorias_tipo.update_attributes(:estado_ids =>params[:estados])\n\t\t\t\t\n\t\t\t\n\n format.html { redirect_to cat_tipos_path, notice: 'OK' }\n format.json { render json: @categorias_tipo, status: :created, location: @categorias_tipo }\n\t\t\telse\n format.html { render action: \"new\" }\n format.json { render json: @categorias_tipo.errors, status: :unprocessable_entity }\n \tend\t\n\t\tend\n\tend", "def create\n @category = Category.new(params[:category])\n @category.category_group_id ||= params[:category_group_id]\n\n respond_to do |format|\n if @category.save\n save_curated_items(@category)\n format.html { redirect_to(categories_path, notice: 'Category was successfully created.') }\n format.json { render json: @category, status: :created, location: @category }\n else\n set_flash_messages_from_errors(@category)\n format.html { render action: \"new\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @taxonomy_category = TaxonomyCategory.new(params[:taxonomy_category])\n\n respond_to do |format|\n if @taxonomy_category.save\n format.html { redirect_to @taxonomy_category, notice: 'Taxonomy category was successfully created.' }\n format.json { render json: @taxonomy_category, status: :created, location: @taxonomy_category }\n else\n format.html { render action: \"new\" }\n format.json { render json: @taxonomy_category.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @category = Category.new(params[:category])\n\n if @category.save\n flash[:notice] = 'Categoria criada com sucesso.'\n else\n flash[:notice] = 'Erro ao salvar a categoria.'\n end\n\n # respond_to do |format|\n # if @category.save\n # format.html { redirect_to categories_path}\n # format.json { render json: @category, status: :created, location: @category }\n # else\n # format.html { render action: \"new\" }\n # format.json { render json: @category.errors, status: :unprocessable_entity }\n # end\n # end\n end", "def create\n @category = Category.new(category_params)\n\n\n begin\n Category.transaction do # un ActiveRecord\n #@full_category.each do |f|\n #Category.create(f)\n #f.save!\n #end\n @category.save!\n end\n #Código de éxito\n rescue => e\n raise ActiveRecord::Rollback #Lanzamos el rollback de nuevo a saco\n #Seguimos con las acciones que queramos, como notificar, etc.\n end\n\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to api_v1_category_path(@category), notice: 'Category was successfully created.' }\n format.json { render :show, status: :created, location: @category }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n category = Documents::Category.create(category_params)\n if category.save\n redirect_to categories_path\n else\n redirect_to categories_path, alert: I18n.t('admin.categories.validation_error')\n end\n end", "def categories\n # @categories = Category.get_categories(@user.id)\n #@categories =Category.all.select(:id).select(:name).select(:description).select(:logo_url)\n @categories =Category.all\n user_cat= @user.categories.collect(&:id)\n categories = []\n @categories.each do |cat|\n cat_attr = cat.attributes\n user_cat.include?(cat.id) ? cat_attr.merge!('user_category' => true) : cat_attr.merge!('user_category' => false)\n categories << cat_attr\n end\n @categories = categories\n\n respond_to do |format|\n if @categories.blank?\n format.json {render json:{:success => false, :status_code => 404, :message => \"No category found\"}}\n format.xml {render xml:{:success => false, :status_code => 404, :message => \"No category found\"}}\n format.html {render json: {:success => false, :status_code => 404, :message => \"No category found\"}}\n else\n format.html {render json: {:success => true, :status_code => 200, :categories => @categories}}\n format.json {render json: {:success => true, :status_code => 200, :categories => @categories}}\n format.xml {render xml: {:success => true, :status_code => 200, :categories => @categories}}\n end\n end\n end", "def create_category_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: CategoriesApi.create_category ...\"\n end\n # resource path\n local_var_path = \"/categories\"\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(opts[:'category'])\n auth_names = ['oauth2_client_credentials_grant', 'oauth2_password_grant']\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 => 'CategoryResource')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CategoriesApi#create_category\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n @category = Category.new(params[:category])\n @title = \"Neue Kategorie erstellen\"\n respond_to do |format|\n if @category.save\n format.html { redirect_to categories_path, notice: 'Category was successfully created.' }\n format.json { render json: @category, status: :created, location: @category }\n else\n format.html { render action: \"new\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @category = CategoryService.create(category_params)\n\n respond_to do |format|\n unless @category.errors.any?\n format.html { redirect_to backoffice_categories_path,\n notice: notification_alert('success', 'Created!', \"Category [#{@category.description}] was successfully created.\") \n }\n format.json { render :show, status: :created, location: @category }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @mk_categoria = MkCategoria.new(mk_categoria_params)\n\n respond_to do |format|\n if @mk_categoria.save\n format.html { redirect_to @mk_categoria, notice: 'Mk categoria was successfully created.' }\n format.json { render :show, status: :created, location: @mk_categoria }\n else\n format.html { render :new }\n format.json { render json: @mk_categoria.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @category = Category.new(category_params)\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to [:admin, @category], notice: t('messages.created', model:Category.model_name.human) }\n format.json { render action: 'show', status: :created, location: @category }\n else\n format.html { render action: 'new' }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @admin_category = Admin::Category.new(admin_category_params)\n\n respond_to do |format|\n if @admin_category.save\n format.html { redirect_to admin_categories_url }\n format.json { render :show, status: :created, location: @admin_category }\n else\n format.html { render :new }\n format.json { render json: @admin_category.errors, status: :unprocessable_entity }\n end\n end\n end", "def categories=(value)\n @categories = value\n end", "def get_subcategories\r\n sub_categories = Taxonomy.get_subcategories\r\n render json: sub_categories, root: 'categories', adapter: :json, status: :ok\r\n end" ]
[ "0.7738549", "0.74339235", "0.72349083", "0.71634054", "0.7124031", "0.70645165", "0.705568", "0.695861", "0.6956783", "0.6903891", "0.6838659", "0.6821712", "0.68190134", "0.6807838", "0.678525", "0.66138625", "0.6566919", "0.65661913", "0.65567696", "0.6523676", "0.65186286", "0.65124106", "0.6507293", "0.64973867", "0.64973867", "0.64973867", "0.64973867", "0.64973867", "0.6491015", "0.64895564", "0.6476546", "0.64730144", "0.6470093", "0.6455681", "0.6438828", "0.6436862", "0.64220095", "0.6418686", "0.6418686", "0.6418686", "0.6418686", "0.6418686", "0.6418686", "0.6418686", "0.6418686", "0.6418686", "0.6418686", "0.6418686", "0.63991785", "0.63877624", "0.6384297", "0.6379078", "0.63786995", "0.6376995", "0.63656723", "0.63593614", "0.6358317", "0.6356693", "0.6355196", "0.6354375", "0.6352758", "0.6345056", "0.63400453", "0.63052505", "0.63035464", "0.62976784", "0.6287918", "0.6284682", "0.6269106", "0.62629235", "0.626244", "0.6258697", "0.6254516", "0.62478405", "0.62459856", "0.62374765", "0.62301993", "0.62244", "0.6220316", "0.6219008", "0.6210804", "0.6199586", "0.61989397", "0.6196965", "0.6195727", "0.61901325", "0.6185757", "0.61840874", "0.6181882", "0.61759615", "0.61596483", "0.6154083", "0.6150745", "0.6144707", "0.6140831", "0.6128935", "0.6128884", "0.61209923", "0.6117174", "0.6109629", "0.610358" ]
0.0
-1
PATCH/PUT /categories/1 PATCH/PUT /categories/1.json
def update if @task.update(category_params) head :no_content else render json: @task.errors, status: :unprocessable_entity end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def UpdateCategory params = {}\n \n APICall(path: 'categories.json',method: 'PUT',payload: params.to_json)\n \n end", "def update\n json_update(category,category_params, Category)\n end", "def update_categories(categories, options = {} )\n options.merge!(:docid => self.docid, :categories => categories)\n resp = @conn.put do |req|\n req.url \"categories\"\n req.body = options.to_json\n end\n\n resp.status \n end", "def update\n @category = Category.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n format.html { redirect_to api_v1_categories_path, notice: 'Category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n if @category.update(category_params)\n render json: @category, status: :ok\n else\n render json: @category.errors, status: :unprocessable_entity\n end\n end", "def update\n @headline = t(:update_category)\n @category = Category.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n format.html { redirect_to @category, notice: t(:updated_category_success) }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n if @category.update(params[:category])\n head :no_content\n else\n render json: @category.errors, status: :unprocessable_entity\n end\n end", "def update\n respond_to do |format|\n if @category.update(category_params)\n format.json { render :show, status: :ok, location: @category }\n else\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @category.update(category_params)\n format.html { redirect_to api_v1_category_path(@category), notice: 'Category was successfully updated.' }\n format.json { render :show, status: :ok, location: @category }\n else\n format.html { render :edit }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n update! {admin_categories_path}\n end", "def update\n unless @category.name == \"ROOT\"\n if @category.update(category_params)\n render 'show', :status => 200, :layout => false, notice: 'Category was successfully created.'\n else\n render :json => {:message => \"Error in updating category\"}, notice: @category.errors, :layout => false, :status => 400\n end\n else\n render :json => {:message => \"Root can't be edited.\"}, :layout => false, :status => 400\n end\n end", "def update\n if @categoria.update(categoria_params)\n render json: @categoria\n else\n render json: @categoria.errors, status: :unprocessable_entity \n end\n end", "def update\n @category = Category.find(params[:id])\n @category.update_attributes(params[:category])\n respond_with(@category, location: categories_url)\n end", "def update\n @recipe = Recipe.find(params[:id])\n\n\n respond_to do |format|\n if @recipe.update_attributes(params[:recipe])\n format.html { redirect_to @recipe, notice: 'Recipe was successfully updated.' }\n format.json { head :no_content }\n else\n @categories=RecipeCategory.all\n format.html { render action: \"edit\" }\n format.json { render json: @recipe.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @category.update_attributes(params[:category])\n respond_with(@category)\n end", "def editCat()\n if(!authenticateAdmin(params[:admin_id], params[:admin_auth_key]))\n render json: {status: false, reason: \"Authentication Failed\", data: \"\"}\n return\n end\n c = Category.find(params[:id])\n status = c.update(name: params[:name])\n error = \"\"\n if(c.errors.full_messages.count > 0)\n error = c.errors.full_messages[0]\n end\n render json: {status: status, reason: error, data: \"\"}\n end", "def update!(**args)\n @categories = args[:categories] if args.key?(:categories)\n end", "def update!(**args)\n @categories = args[:categories] if args.key?(:categories)\n end", "def update\n #locates the category to be updated\n @category = Category.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n format.html { redirect_to @category, notice: 'Category was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @category = Category.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n format.html { redirect_to @category, notice: t(:category_updated) }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @category.update(category_params)\n format.html { redirect_to @category, notice: t('update.notice', name: t('activerecord.models.category')) }\n format.json { render :show, status: :ok, location: @category }\n else\n format.html { render :edit }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @category = Category.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n format.html { redirect_to :back, notice: 'category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @category = Category.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n format.html {\n redirect_to @category, notice: 'Category was successfully updated.'\n }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json {\n render json: @category.errors, status: :unprocessable_entity\n }\n end\n end\n end", "def update\n # recipe_params[:ingredient_lists_attributes].each do |list|\n # list.each do |item|\n # item[:ingredient_attributes] = Ingredient.where(name: item[:ingredient_attributes].name).first_or_create\n # end\n # end\n \n # category_ids = params[:recipe][:categories_attributes].map { |k,v| v[:id] }\n # #pry.debugger\n \n # recipe_params.merge({ category_ids: category_ids })\n \n\n respond_to do |format|\n \n if @recipe.update(recipe_params)\n format.html { redirect_to recipes_url, notice: 'Recipe was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @recipe.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @category = Category.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n format.html { redirect_to @category, notice: 'Category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @category = Category.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n format.html { redirect_to @category, notice: 'Category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @category = Category.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n format.html { redirect_to @category, notice: 'Category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @category = Category.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n format.html { redirect_to @category, notice: 'Category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @category = Category.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n format.html { redirect_to @category, notice: 'Category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @category = Category.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n format.html { redirect_to @category, notice: 'Category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @category = Category.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n format.html { redirect_to @category, notice: 'Category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @category = Category.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n format.html { redirect_to @category, notice: 'Category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @category = current_mall.categories.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n format.html { redirect_to @category, notice: 'Category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @category = Category.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n format.html { redirect_to @category, notice: 'Category was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def user_category_edit\n @user = User.where(contact: params[:contact]).first\n @user.categories.destroy_all\n params[:category_ids].each do |category|\n @user.user_categories.create!(category_id: category, user_id: @user.id)\n end\n render json: {status: \"SUCCESS\", message: \"user-categories\", data: \"categories updated\"}, status: :ok\n end", "def update\n @cat = Cat.find(params[:id])\n\n respond_to do |format|\n if @cat.update_attributes(params[:cat])\n format.html { redirect_to @cat, notice: 'Cat was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @cat.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @cat = Cat.find(params[:id])\n\n respond_to do |format|\n if @cat.update_attributes(params[:cat])\n _update_topics \n format.html { redirect_to action: \"edit\", notice: 'Cat was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @cat.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @category = Category.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(category_params)\n format.html { redirect_to @category, notice: 'Category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @category.update(category_params)\n format.html { redirect_to categories_path, notice: 'Category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @post_category = Post::Category.find(params[:id])\n\n respond_to do |format|\n if @post_category.update_attributes(params[:post_category])\n format.html { redirect_to @post_category, notice: 'Category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @post_category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n category= Category.find(params[:id])\n category.update(category_params)\n \n end", "def update\n respond_to do |format|\n if @category.update(category_params)\n format.html { redirect_to @category, notice: 'Category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @category.update(category_params)\n format.html { redirect_to @category, notice: 'Category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @category.update(category_params)\n format.html { redirect_to management_categories_path }\n format.json { render json: @category, status: :ok }\n else\n format.html { render :edit }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @category.update category_params\n format.html { redirect_to admin_categories_url, notice: 'Category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @category.update(category_params)\n format.html { redirect_to cm_post_categories_url, notice: 'PostCategory was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @category.update_attributes(category_params)\n format.html { redirect_to @category, notice: 'Category was successfully updated.' }\n format.json { render :show, status: :ok, location: @category }\n else\n format.html { render :edit }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @recipe_category = RecipeCategory.find(params[:id])\n\n respond_to do |format|\n if @recipe_category.update_attributes(params[:recipe_category])\n format.html { redirect_to @recipe_category, notice: 'Recipe category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @recipe_category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @category = Category.find(params[:id])\n\n if @category.update_attributes(params[:category])\n flash[:notice] = 'Sucesso - update'\n else\n flash[:notice] = 'Falha ao atualizar a categoria'\n end\n\n # respond_to do |format|\n # if @category.update_attributes(params[:category])\n # format.html { redirect_to categories_path}\n # format.json { head :no_content }\n # else\n # format.html { render action: \"edit\" }\n # format.json { render json: @category.errors, status: :unprocessable_entity }\n \n # end\n # end\n end", "def update\n authorize! :update, @category\n \n @category.modifier = current_user\n \n respond_to do |format|\n if @category.update(category_params)\n format.html { redirect_to categories_url + '#' + @category.slug, notice: t('.success') }\n format.json { render :show, status: :ok, location: @category }\n else\n format.html { render :edit }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @category.update(category_params)\n format.html { redirect_to categories_path, notice: \"Category was successfully updated.\" }\n format.json { render :show, status: :ok, location: @category }\n else\n format.html { render :edit }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @category.update(category_params)\n end", "def update\n @category = Category.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n format.html { redirect_to @category, notice: 'Категория изменена.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @category.update(category_params)\n format.html { redirect_to admin_dashboard_categories_path, notice: 'Category was successfully updated.' }\n format.json { render :show, status: :ok, location: @category }\n else\n format.html { render :edit }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def putCategory( category_id, language, name)\n params = Hash.new\n params['category_id'] = category_id\n params['language'] = language\n params['name'] = name\n return doCurl(\"put\",\"/category\",params)\n end", "def update\n respond_to do |format|\n if @category.update(category_params)\n format.html { redirect_to @category, notice: 'Category was successfully updated.' }\n format.json { render :show, status: :ok, location: @category }\n else\n format.html { render :edit }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @category.update(category_params)\n format.html { redirect_to @category, notice: 'Category was successfully updated.' }\n format.json { render :show, status: :ok, location: @category }\n else\n format.html { render :edit }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @category.update(category_params)\n format.html { redirect_to @category, notice: 'Category was successfully updated.' }\n format.json { render :show, status: :ok, location: @category }\n else\n format.html { render :edit }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @category.update(category_params)\n format.html { redirect_to @category, notice: 'Category was successfully updated.' }\n format.json { render :show, status: :ok, location: @category }\n else\n format.html { render :edit }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @category.update(category_params)\n format.html { redirect_to @category, notice: 'Category was successfully updated.' }\n format.json { render :show, status: :ok, location: @category }\n else\n format.html { render :edit }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @category.update(category_params)\n format.html { redirect_to @category, notice: 'Category was successfully updated.' }\n format.json { render :show, status: :ok, location: @category }\n else\n format.html { render :edit }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @category.update(category_params)\n format.html { redirect_to @category, notice: 'Category was successfully updated.' }\n format.json { render :show, status: :ok, location: @category }\n else\n format.html { render :edit }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @category.update(category_params)\n format.html { redirect_to @category, notice: 'Category was successfully updated.' }\n format.json { render :show, status: :ok, location: @category }\n else\n format.html { render :edit }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @category.update(category_params)\n format.html { redirect_to @category, notice: 'Category was successfully updated.' }\n format.json { render :show, status: :ok, location: @category }\n else\n format.html { render :edit }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @category.update(category_params)\n format.html { redirect_to @category, notice: 'Category was successfully updated.' }\n format.json { render :show, status: :ok, location: @category }\n else\n format.html { render :edit }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @category.update(category_params)\n format.html { redirect_to @category, notice: 'Category was successfully updated.' }\n format.json { render :show, status: :ok, location: @category }\n else\n format.html { render :edit }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @category.update(category_params)\n format.html { redirect_to @category, notice: 'Category was successfully updated.' }\n format.json { render :show, status: :ok, location: @category }\n else\n format.html { render :edit }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @category.update(category_params)\n format.html { redirect_to @category, notice: 'Category was successfully updated.' }\n format.json { render :show, status: :ok, location: @category }\n else\n format.html { render :edit }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @category.update(category_params)\n format.html { redirect_to @category, notice: 'Category was successfully updated.' }\n format.json { render :show, status: :ok, location: @category }\n else\n format.html { render :edit }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @category.update(category_params)\n format.html { redirect_to @category, notice: 'Category was successfully updated.' }\n format.json { render :show, status: :ok, location: @category }\n else\n format.html { render :edit }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @category.update(category_params)\n format.html { redirect_to [:admin, @category], notice: t('messages.updated', model:Category.model_name.human) }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @category.update(category_params)\n format.html { redirect_to backend_shop_branch_category_path(@current_shop.slug, @current_branch, @category), notice: t('Category was successfully updated.') }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @category.update(category_params)\n format.html { redirect_to category_index_path, notice: 'Categorie was successfully updated.' }\n format.json { render :show, status: :ok, location: @category }\n else\n format.html { render :edit }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @incidentcategory.update(incidentcategory_params)\n json_response(@incidentcategory)\n else\n render json: @incidentcategory.errors, status: :unprocessable_entity\n end\n end\n end", "def update\n @category = Category.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n # format.html { redirect_to @category, notice: 'Category was successfully updated.' }\n format.html { redirect_to categories_path, notice: 'Pomyślnie zaktualizowano kategorię.' }\n format.json { head :no_content }\n else\n # format.html { render action: \"edit\" }\n format.html { redirect_to units_path, :flash => { :error => 'Nie udało się zaktualizować kategorii' } }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @catalog_category.update(catalog_category_params)\n format.html { redirect_to catalog_categories_url }\n format.json { render :show, status: :ok, location: @catalog_category }\n else\n format.html { render :edit }\n format.json { render json: @catalog_category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @categ.update(categ_params)\n format.html { redirect_to @categ, notice: 'Categ was successfully updated.' }\n format.json { render :show, status: :ok, location: @categ }\n else\n format.html { render :edit }\n format.json { render json: @categ.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n return unless admin?\n @category = Category.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n format.html { redirect_to @category, notice: 'Category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @post_category = current_user.post_categories.find(params[:id])\n\n respond_to do |format|\n if @post_category.update_attributes(params[:post_category])\n format.html { redirect_to [:client,@post_category], notice: 'Post category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @post_category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n # update attribute\n if @category.update_attributes(category_params)\n # flash message\n flash.now[:success] = \"更新完了しました。\"\n # get category data\n all_categories\n else\n render 'edit'\n end\n end", "def update\n params[:book][:category_ids] = nil if params[:book][:category_ids].nil?\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to books_url, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n @categories = Category.all.order('name asc')\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @category = Category.find(params[:id])\n @title = 'Kategorie ' + @category.title + ' bearbeiten'\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n format.html { redirect_to categories_path, notice: 'Category was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n\n intent_request = @api_ai_client.create_intents_request\n response = intent_request.update(@category.intent_id, param_options)\n\n if response.is_a?(Hash) && response[:status][:code].eql?(200)\n\n contexts_templates = { contexts: category_params[:contexts].split(\",\"), templates: category_params[:templates].split(\",\") }\n\n if @category.update(category_params.merge(contexts_templates))\n format.html { redirect_to @category, notice: 'Category was successfully updated.' }\n format.json { render :show, status: :ok, location: @category }\n else\n format.html { render :edit }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n else\n @notice = response.message\n\n format.html { render :new }\n format.json { render json: { error: response.message }, status: response.code}\n end\n end\n end", "def update\n @categorization = Categorization.find(params[:id])\n @categories = category_list\n respond_to do |format|\n if @categorization.update_attributes(params[:categorization])\n format.html { redirect_to(admin_categorization_path(@categorization), :notice => 'Categorization was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @categorization.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @category.update(category_params)\n format.html { redirect_to :back, notice: 'Kategori diperbarui.' }\n format.json { render :show, status: :ok, location: @category }\n else\n format.html { render :edit }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n \n #My product belongs_to category relationship won't work so I made this so when I update it reflects changes\n category_name = set_category.name\n Product.all.each do |product|\n product.category = category_params[:name] if product.category == category_name\n product.save\n end\n \n respond_to do |format|\n if @category.update(category_params)\n format.html { redirect_to @category, notice: 'Category was successfully updated.' }\n format.json { render :show, status: :ok, location: @category }\n else\n format.html { render :edit }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n category = Documents::Category.find(params[:id])\n category.update!(category_params)\n redirect_to categories_path\n end", "def update\n respond_to do |format|\n if @category.update(category_params)\n format.html { redirect_to backoffice_categories_path,\n notice: notification_alert('success', 'Updated!', \"Category [#{@category.description}] was successfully updated.\") \n }\n format.json { render :show, status: :ok, location: @category }\n else\n format.html { render :edit }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @api_v1_group_category.update(api_v1_group_category_params)\n format.html { redirect_to @api_v1_group_category, notice: 'Group category was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_v1_group_category }\n else\n format.html { render :edit }\n format.json { render json: @api_v1_group_category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @category.update(category_params)\n format.html { redirect_to edit_dashboard_category_path(@category), notice: 'Category was successfully updated.' }\n format.json { render :show, status: :ok, location: @category }\n else\n format.html { render :edit }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @category.update(category_params)\n format.html { redirect_to adminpanel_categories_path, notice: \"Категория #{@category.name} успешно обновлена\" }\n format.json { render :show, status: :ok, location: adminpanel_categories_path }\n else\n format.html { render :edit }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @categories = Category.all.map{|c| [ c.name, c.id ] }\n respond_to do |format|\n if @listing.update(listing_params)\n format.html { redirect_to @listing, notice: 'Listing was successfully updated.' }\n format.json { render :show, status: :ok, location: @listing }\n else\n format.html { render :edit }\n format.json { render json: @listing.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @category.update(category_params)\n format.html { redirect_to @category, notice: 'Категория была успешно изменена' }\n format.json { render :show, status: :ok, location: @category }\n else\n format.html { render :edit }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @category = Category.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n format.html { redirect_to categories_url, notice: 'Category was successfully updated.' }\n end\n end\n end", "def update\n @kategory = Kategory.find(params[:id])\n\n respond_to do |format|\n if @kategory.update_attributes(params[:kategory])\n format.html { redirect_to @kategory, notice: 'Kategory was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @kategory.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @schema_category.update(schema_category_params)\n format.html { redirect_to schema_categories_path, notice: 'Schema category was successfully updated.' }\n format.json { render :show, status: :ok, location: @schema_category }\n else\n format.html { render :edit }\n format.json { render json: @schema_category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @category.update(category_params)\n format.html { redirect_to @category , notice: 'Información actualizada correctamente.' }\n format.json { head :no_content }\n else\n format.html { render 'edit' }\n format.json { render json: @category.errors , status: :unprocessable_entity }\n end\n end\n end", "def update\n if current_category.category==\"noone\"\n respond_to do |format|\n if @category.update(category_params)\n format.html { redirect_to @category }\n format.json { render :show, status: :ok, location: @category }\n else\n format.html { render :edit }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n else\n render :file => \"/public/404.html\",:status => \"404\"\n end\n \n end", "def update_categories(cats=[])\n rescue_extra_data\n cats = cats.to_i\n old_categories = categories.pluck(\"#{CamaleonCms::TermTaxonomy.table_name}.id\")\n delete_categories = old_categories - cats\n news_categories = cats - old_categories\n term_relationships.where(\"term_taxonomy_id in (?)\", delete_categories ).destroy_all if delete_categories.present?\n news_categories.each do |key|\n term_relationships.create(:term_taxonomy_id => key)\n end\n update_counters(\"categories\")\n end", "def update\n respond_to do |format|\n if @category.update(category_params)\n flash[:success] = 'Category was successfully updated.'\n format.html { redirect_to admin_category_url(@category) }\n format.json { render :show, status: :ok, location: @category }\n else\n format.html { render :edit }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end", "def modify_category(categories)\n begin\n puts Rainbow(\"Current categories: #{categories.join(', ')}\").whitesmoke\n yield\n\n write_json(categories, \"Categories/cat\", \"Available categories are: #{categories.join(', ')}\")\n rescue StandardError\n puts \"There are no categories to delete\"\n end\nend" ]
[ "0.76931995", "0.7600433", "0.721346", "0.6943123", "0.6914936", "0.6817601", "0.67816055", "0.6713112", "0.66984165", "0.6693479", "0.66566056", "0.66523254", "0.6651486", "0.6645902", "0.66068524", "0.65989816", "0.6571709", "0.6571709", "0.65543723", "0.65349466", "0.6500273", "0.6476041", "0.6465057", "0.64642215", "0.6447606", "0.6447606", "0.6447606", "0.6447606", "0.6447606", "0.6447606", "0.6447606", "0.6446929", "0.6445167", "0.64354783", "0.64269394", "0.6404794", "0.63986206", "0.6397466", "0.63869214", "0.63710886", "0.6369283", "0.6361617", "0.6361617", "0.63606787", "0.63583905", "0.6350508", "0.6350283", "0.6349869", "0.6345752", "0.6333139", "0.6325586", "0.63239694", "0.63143516", "0.6313136", "0.63053083", "0.62989515", "0.62989515", "0.62989515", "0.62989515", "0.62989515", "0.62989515", "0.62989515", "0.62989515", "0.62989515", "0.62989515", "0.62989515", "0.62989515", "0.62989515", "0.62989515", "0.62989515", "0.6258468", "0.62565297", "0.6253094", "0.62488115", "0.62480146", "0.6242642", "0.62424415", "0.6231377", "0.62297356", "0.6213893", "0.62138283", "0.62133265", "0.6212125", "0.62068313", "0.6203744", "0.62033004", "0.6203232", "0.6199041", "0.61897093", "0.6188133", "0.6184581", "0.61833024", "0.6171633", "0.616978", "0.61682814", "0.61661804", "0.61531246", "0.614805", "0.61377615", "0.61349887", "0.61325574" ]
0.0
-1
DELETE /categories/1 DELETE /categories/1.json
def destroy @task.destroy head :no_content end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def DeleteCategory id\n \n APICall(path: \"categories/#{id}.json\",method: 'DELETE')\n \n end", "def destroy\n @category.destroy\n render json: @category, status: :ok\n end", "def destroy\n @category = Category.find(params[:id])\n @category.destroy\n\n respond_to do |format|\n format.html { redirect_to api_v1_categories_path }\n format.json { head :no_content }\n end\n end", "def deleteCat()\n if(!authenticateAdmin(params[:admin_id], params[:admin_auth_key]))\n render json: {status: false, reason: \"Authentication Failed\", data: \"\"}\n return\n end\n c = Category.find(params[:id])\n status = c.destroy\n error = \"\"\n if(c.errors.full_messages.count > 0)\n error = c.errors.full_messages[0]\n end\n render json: {status: true, reason: error, data: \"\"}\n end", "def destroy\n @category.destroy\n render json: { notice: 'Categoria eliminada exitosamente' }\n end", "def destroy\n category = set_category\n if category.destroy\n head :no_content\n else\n render json: { status: 500 }\n end\n \n end", "def destroy\n @category = Category.find(params[:id])\n @category.destroy\n\n respond_to do |format|\n format.html { redirect_to categories_url }\n format.json { head :ok }\n end\n end", "def destroy\n @category = Category.find(params[:id])\n @category.destroy\n\n respond_to do |format|\n format.html { redirect_to categories_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @category = Category.find(params[:id])\n @category.destroy\n\n respond_to do |format|\n format.html { redirect_to categories_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @category = Category.find(params[:id])\n @category.destroy\n\n respond_to do |format|\n format.html { redirect_to categories_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @category = Category.find(params[:id])\n @category.destroy\n\n respond_to do |format|\n format.html { redirect_to categories_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @category = Category.find(params[:id])\n @category.destroy\n\n respond_to do |format|\n format.html { redirect_to categories_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @category = Category.find(params[:id])\n @category.destroy\n\n respond_to do |format|\n format.html { redirect_to categories_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @category = Category.find(params[:id])\n @category.destroy\n\n respond_to do |format|\n format.html { redirect_to categories_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @category = Category.find(params[:id])\n @category.destroy\n\n respond_to do |format|\n format.html { redirect_to categories_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @category = Category.find(params[:id])\n @category.destroy\n\n respond_to do |format|\n format.html { redirect_to categories_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @category = Category.find(params[:id])\n @category.destroy\n\n respond_to do |format|\n format.html { redirect_to categories_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @category = Category.find(params[:id])\n @category.destroy\n\n respond_to do |format|\n format.html { redirect_to categories_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @category = Category.find(params[:id])\n @category.destroy\n\n respond_to do |format|\n format.html { redirect_to categories_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @category.destroy\n respond_to do |format|\n format.html { redirect_to categories_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @category.destroy\n respond_to do |format|\n format.html { redirect_to categories_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @category.destroy\n respond_to do |format|\n format.html { redirect_to categories_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @category.destroy\n respond_to do |format|\n format.html { redirect_to api_v1_categories_path, notice: 'Category was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @category = @collection.category.find(params[:id])\n @category.destroy\n respond_to do |format|\n format.html { redirect_to categories_url, notice: 'Category was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @alien_category.destroy\n respond_to do |format|\n format.html { redirect_to alien_categories_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @cat = Cat.find(params[:id])\n @cat.destroy\n\n respond_to do |format|\n format.html { redirect_to cats_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @cat = Cat.find(params[:id])\n @cat.destroy\n\n respond_to do |format|\n format.html { redirect_to cats_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @category.destroy\n respond_to do |format|\n format.html { redirect_to categories_url, notice: t('destroy.notice', name: t('activerecord.models.category')) }\n format.json { head :no_content }\n end\n end", "def destroy\n @category.destroy\n respond_to do |format|\n format.html { redirect_to admin_categories_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @category.destroy\n respond_to do |format|\n format.html { redirect_to cm_post_categories_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @categoria = Categoria.find(params[:id])\n @categoria.destroy\n\n respond_to do |format|\n format.html { redirect_to categoria_index_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @category = current_mall.categories.find(params[:id])\n @category.destroy\n\n respond_to do |format|\n format.html { redirect_to api_wmall_categories_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @category.destroy\n head :no_content\n end", "def destroy\n #@incidentcategory.destroy\n render json: {}, status: 200\n end", "def destroy\n @category.destroy\n respond_to do |format|\n format.html { redirect_to admin_good_categories_url }\n format.json { head :no_content }\n end\n end", "def delete_category id\n\t\t\t\t\tFreshdesk::Api::Client.delete_status_wrapper do\n\t\t\t\t\t\t( @connection.delete CATEGORIES, id ).code\n\t\t\t\t\tend\n\t\t\t\tend", "def destroy\n IndicatorCategory.delete_hack(params[:id])\n\n respond_to do |format|\n format.html { redirect_to indicator_categories_url }\n format.json { head :ok }\n end\n end", "def destroy\n @post_category = Post::Category.find(params[:id])\n @post_category.destroy\n\n respond_to do |format|\n format.html { redirect_to post_categories_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @categ.destroy\n respond_to do |format|\n format.html { redirect_to categs_url, notice: 'Categ was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @category_db.destroy\n respond_to do |format|\n format.html { redirect_to category_dbs_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @categoria.destroy\n respond_to do |format|\n format.html { redirect_to categorias_path, notice: @@titulo + t('msg.remove') }\n format.json { head :no_content }\n end\n end", "def destroy\n @categorie = Categorie.find(params[:id])\n @categorie.destroy\n\n respond_to do |format|\n format.html { redirect_to(categories_url) }\n format.xml { head :ok }\n format.json {render :json => {\"success\"=>true,\"data\"=>[]}}\n end\n end", "def destroy\n @category.delete\n end", "def destroy\n @admin_category.destroy\n respond_to do |format|\n format.html { redirect_to admin_categories_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @recipe_category = RecipeCategory.find(params[:id])\n @recipe_category.destroy\n\n respond_to do |format|\n format.html { redirect_to recipe_categories_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @taxonomy_category = TaxonomyCategory.find(params[:id])\n @taxonomy_category.destroy\n\n respond_to do |format|\n format.html { redirect_to taxonomy_categories_url }\n format.json { head :ok }\n end\n end", "def destroy\n @category = Category.find(params[:id])\n @category.destroy\n respond_to do |format|\n format.html { redirect_to categories_url, notice: \"Journal was successfully deleted.\" }\n format.json { head :no_content }\n end\n end", "def destroy\n @category = Category.find(params[:id])\n @category.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_scenic_spots_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @desserts_category.destroy\n respond_to do |format|\n format.html { redirect_to desserts_categories_url}\n format.json { head :no_content }\n end\n end", "def destroy\n @level_category = LevelCategory.find(params[:id])\n @level_category.destroy\n\n respond_to do |format|\n format.html { redirect_to level_categories_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @cat.destroy\n respond_to do |format|\n format.html { redirect_to cats_url, notice: 'Cat was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @category = Category.find(params[:id])\n begin\n @category.destroy\n rescue ActiveRecord::DeleteRestrictionError\n error = 'Эта категория не может быть удалена, пока с ней связан хоть один файл.'\n ensure\n respond_to do |format|\n format.html { redirect_to categories_url, notice: error }\n format.json { head :ok }\n end\n end\n end", "def destroy\n @kategory = Kategory.find(params[:id])\n @kategory.destroy\n\n respond_to do |format|\n format.html { redirect_to kategories_url }\n format.json { head :ok }\n end\n end", "def destroy\n return unless admin?\n\n @category = Category.find(params[:id])\n @category.destroy\n\n respond_to do |format|\n format.html { redirect_to categories_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @category.destroy\n respond_to do |format|\n format.html { redirect_to categories_path, notice: \"Category was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def destroy\n @categor.destroy\n respond_to do |format|\n format.html { redirect_to categors_url, notice: 'Categor was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @category.destroy\n respond_to do |format|\n format.html { redirect_to \"index\", notice: 'Category was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @category = current_user.user_categories.find(params[:id])\n @category.destroy\n\n respond_to do |format|\n format.html { redirect_to categories_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @categorias_tipo = CatTipo.find(params[:id])\n @categorias_tipo.destroy\n\n respond_to do |format|\n format.html { redirect_to cat_tipos_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @category.destroy\n respond_to do |format|\n format.html { redirect_to categories_url, notice: 'Category was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @category.destroy\n respond_to do |format|\n format.html { redirect_to categories_url, notice: 'Category was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @category.destroy\n respond_to do |format|\n format.html { redirect_to categories_url, notice: 'Category was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @category.destroy\n respond_to do |format|\n format.html { redirect_to categories_url, notice: 'Category was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @category.destroy\n respond_to do |format|\n format.html { redirect_to categories_url, notice: 'Category was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @category.destroy\n respond_to do |format|\n format.html { redirect_to categories_url, notice: 'Category was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @category.destroy\n respond_to do |format|\n format.html { redirect_to categories_url, notice: 'Category was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @category.destroy\n respond_to do |format|\n format.html { redirect_to categories_url, notice: 'Category was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @category.destroy\n respond_to do |format|\n format.html { redirect_to categories_url, notice: 'Category was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @category.destroy\n respond_to do |format|\n format.html { redirect_to categories_url, notice: 'Category was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @category.destroy\n respond_to do |format|\n format.html { redirect_to categories_url, notice: 'Category was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @category.destroy\n respond_to do |format|\n format.html { redirect_to categories_url, notice: 'Category was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @category.destroy\n respond_to do |format|\n format.html { redirect_to categories_url, notice: 'Category was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @category.destroy\n respond_to do |format|\n format.html { redirect_to categories_url, notice: 'Category was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @cathegory.destroy\n respond_to do |format|\n format.html { redirect_to cathegories_url, notice: 'Cathegory was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n #locates the category to be destroyed\n @category = Category.find(params[:id])\n #Creates an array of all categories\n @all_categories = Category.all\n #creates an empty hash\n @all_categories_hash = {}\n #calls function to populate & sort @all_categories_hash\n sort_categories()\n #calls function to destroy the category\n destroy_category(@category)\n\n respond_to do |format|\n format.html { redirect_to '/admin' }\n format.json { head :ok }\n end\n end", "def destroy\n authorize! :destroy, @category\n @category.destroy\n respond_to do |format|\n format.html { redirect_to categories_url, notice: t('.success') }\n format.json { head :no_content }\n end\n end", "def destroy\n @category.destroy\n respond_to do |format|\n format.html { redirect_to backend_shop_branch_categories_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @cat = Cat.find(params[:id])\n @cat.destroy\n\n respond_to do |format|\n format.html { redirect_to(cats_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @mk_categoria.destroy\n respond_to do |format|\n format.html { redirect_to mk_categories_url, notice: 'Mk categoria was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @category_type = CategoryType.find(params[:id])\n @category_type.destroy\n\n respond_to do |format|\n format.html { redirect_to category_types_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @categorie_droit.destroy\n respond_to do |format|\n format.html { redirect_to categorie_droits_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @category = Category.find(params[:id])\n @category.delete_context #there you go, this little fatty kills em all!\n #fred and post have equal methods, makes it slim and easy\n\n respond_to do |format|\n format.html { redirect_to categories_url, :method => :get, :notice => t(:deleted_category_success) }\n format.json { head :ok }\n end\n end", "def destroy\n @activity_category.destroy\n respond_to do |format|\n format.html { redirect_to activity_categories_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @dish_category.destroy\n respond_to do |format|\n format.html { redirect_to dish_categories_url, notice: 'Категория блюда удалена.' }\n format.json { head :no_content }\n end\n end", "def destroy\n CategoryService.destroy\n respond_to do |format|\n format.html { redirect_to categories_url, notice: 'Category was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @category.destroy\n respond_to do |format|\n #######\n format.html { redirect_to category_url }\n format.json { head :no_content }\n end\n end", "def destroy\n \tauthorize! :destroy, @category\n @category.destroy\n respond_to do |format|\n format.html { redirect_to categories_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @status_category.destroy\n respond_to do |format|\n format.html { redirect_to status_categories_url, notice: 'Status category was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @post_category = current_user.post_categories.find(params[:id])\n @post_category.destroy\n\n respond_to do |format|\n format.html { redirect_to [:client, :post_categories] }\n format.json { head :no_content }\n end\n end", "def destroy\n @course_category = CourseCategory.find(params[:id])\n @course_category.destroy\n\n respond_to do |format|\n format.html { redirect_to course_categories_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @category.destroy\n respond_to do |format|\n format.html { redirect_to categories_url, notice: '分类删除成功~' }\n format.json { head :no_content }\n end\n end", "def destroy\n @gt_category.destroy\n respond_to do |format|\n format.html { redirect_to gt_categories_url, notice: 'Gt category was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @cover_cat = CoverCat.find(params[:id])\n @cover_cat.destroy\n\n respond_to do |format|\n format.html { redirect_to cover_cats_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @category = Category.find(params[:id])\n @category.destroy\n\n respond_to do |format|\n format.html { redirect_to(categories_path) }\n format.xml { head :ok }\n end\n end", "def destroy\n @category = Category.find(params[:id])\n @category.destroy\n end", "def destroy\n @category = DishCategory.find(params[:id])\n @category.destroy\n\n respond_to do |format|\n format.html { redirect_to :back, notice: 'Категория удалена.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @category = Category.find(params[:id])\n @category.destroy\n\n respond_to do |format|\n format.html { redirect_to(categories_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @category = Category.find(params[:id])\n @category.destroy\n\n respond_to do |format|\n format.html { redirect_to(categories_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @category = Category.find(params[:id])\n @category.destroy\n\n respond_to do |format|\n format.html { redirect_to(categories_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @category.destroy\n respond_to do |format|\n format.html { redirect_to categories_url, notice: 'Category was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @category.destroy\n respond_to do |format|\n format.html { redirect_to management_categories_url, notice: 'Category was successfully removed.' }\n format.json { head :no_content }\n end\n end" ]
[ "0.78272814", "0.77353686", "0.76392984", "0.7488916", "0.74731207", "0.74233276", "0.7399541", "0.7385346", "0.7385346", "0.7385346", "0.7385346", "0.7385346", "0.7385346", "0.7385346", "0.7385346", "0.7385346", "0.7385346", "0.7385346", "0.7385346", "0.7378597", "0.7378597", "0.7378597", "0.7372517", "0.7366761", "0.7362291", "0.7334964", "0.7334964", "0.7333799", "0.73254865", "0.7318471", "0.7294363", "0.728636", "0.7283016", "0.72823733", "0.7245488", "0.7242075", "0.72370917", "0.71940225", "0.7186593", "0.7184272", "0.71675783", "0.7166838", "0.7147197", "0.71468467", "0.7146009", "0.71421075", "0.712865", "0.71269435", "0.7125966", "0.7122311", "0.71151847", "0.7114038", "0.711263", "0.71069294", "0.7101981", "0.71015203", "0.7098744", "0.70979154", "0.70844114", "0.708277", "0.708277", "0.708277", "0.708277", "0.708277", "0.708277", "0.708277", "0.708277", "0.708277", "0.708277", "0.708277", "0.708277", "0.708277", "0.708277", "0.7077371", "0.70768744", "0.7076328", "0.7075828", "0.70738447", "0.7071764", "0.7064413", "0.70556885", "0.70518345", "0.7051709", "0.7048051", "0.7047651", "0.70454115", "0.7042982", "0.70411265", "0.7030913", "0.7013192", "0.70061165", "0.69993097", "0.6998523", "0.6996587", "0.69943523", "0.6993104", "0.69879425", "0.69879425", "0.69879425", "0.6978936", "0.69772786" ]
0.0
-1
Use callbacks to share common setup or constraints between actions.
def set_task @task = Task.find(params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "def action_hook; end", "def run_actions; end", "def define_action_hook; end", "def actions; end", "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end", "def add_actions; end", "def callbacks; end", "def callbacks; end", "def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end", "def define_action_helpers; end", "def post_setup\n end", "def action_methods; end", "def action_methods; end", "def action_methods; end", "def before_setup; end", "def action_run\n end", "def execute(setup)\n @action.call(setup)\n end", "def define_action_helpers?; end", "def set_actions\n actions :all\n end", "def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end", "def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end", "def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end", "def before_actions(*logic)\n self.before_actions = logic\n end", "def setup_handler\n end", "def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end", "def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end", "def action; end", "def action; end", "def action; end", "def action; end", "def action; end", "def workflow\n end", "def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end", "def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end", "def before(action)\n invoke_callbacks *self.class.send(action).before\n end", "def process_action(...)\n send_action(...)\n end", "def before_dispatch(env); end", "def after_actions(*logic)\n self.after_actions = logic\n end", "def setup\n # override and do something appropriate\n end", "def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end", "def setup(_context)\n end", "def setup(resources) ; end", "def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end", "def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end", "def determine_valid_action\n\n end", "def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end", "def startcompany(action)\n @done = true\n action.setup\n end", "def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end", "def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end", "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end", "def define_tasks\n define_weave_task\n connect_common_tasks\n end", "def setup(&block)\n define_method(:setup, &block)\n end", "def setup\n transition_to(:setup)\n end", "def setup\n transition_to(:setup)\n end", "def action\n end", "def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend", "def config(action, *args); end", "def setup\n @setup_proc.call(self) if @setup_proc\n end", "def before_action \n end", "def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end", "def action\n end", "def matt_custom_action_begin(label); end", "def setup\n # override this if needed\n end", "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end", "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end", "def after(action)\n invoke_callbacks *options_for(action).after\n end", "def pre_task\n end", "def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end", "def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end", "def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end", "def setup_signals; end", "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end", "def initialize(*args)\n super\n @action = :set\nend", "def after_set_callback; end", "def setup\n #implement in subclass;\n end", "def lookup_action; end", "def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end", "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "def release_actions; end", "def around_hooks; end", "def save_action; end", "def setup(easy)\n super\n easy.customrequest = @verb\n end", "def action_target()\n \n end", "def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end", "def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end", "def before_setup\n # do nothing by default\n end", "def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end", "def default_action; end", "def setup(&blk)\n @setup_block = blk\n end", "def callback_phase\n super\n end", "def advice\n end", "def _handle_action_missing(*args); end", "def duas1(action)\n action.call\n action.call\nend", "def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end", "def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end", "def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend" ]
[ "0.6163163", "0.6045976", "0.5946146", "0.591683", "0.5890051", "0.58349305", "0.5776858", "0.5703237", "0.5703237", "0.5652805", "0.5621621", "0.54210985", "0.5411113", "0.5411113", "0.5411113", "0.5391541", "0.53794575", "0.5357573", "0.53402257", "0.53394014", "0.53321576", "0.53124547", "0.529654", "0.5296262", "0.52952296", "0.52600986", "0.52442724", "0.52385926", "0.52385926", "0.52385926", "0.52385926", "0.52385926", "0.5232394", "0.523231", "0.5227454", "0.52226824", "0.52201617", "0.5212327", "0.52079266", "0.52050185", "0.51754695", "0.51726824", "0.51710224", "0.5166172", "0.5159343", "0.51578903", "0.51522785", "0.5152022", "0.51518047", "0.51456624", "0.51398855", "0.5133759", "0.5112076", "0.5111866", "0.5111866", "0.5110294", "0.5106169", "0.509231", "0.50873137", "0.5081088", "0.508059", "0.50677156", "0.50562143", "0.5050554", "0.50474834", "0.50474834", "0.5036181", "0.5026331", "0.5022976", "0.5015441", "0.50121695", "0.5000944", "0.5000019", "0.4996878", "0.4989888", "0.4989888", "0.49864885", "0.49797225", "0.49785787", "0.4976161", "0.49683493", "0.4965126", "0.4958034", "0.49559742", "0.4954353", "0.49535993", "0.4952725", "0.49467874", "0.49423352", "0.49325448", "0.49282882", "0.49269363", "0.49269104", "0.49252945", "0.4923091", "0.49194667", "0.49174926", "0.49173003", "0.49171105", "0.4915879", "0.49155936" ]
0.0
-1
Never trust parameters from the scary internet, only allow the white list through.
def task_params params.require(:task).permit(:title, :description, :duration, :priority, :category_id) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "def allow_params_authentication!; end", "def allowed_params\n ALLOWED_PARAMS\n end", "def default_param_whitelist\n [\"mode\"]\n end", "def param_whitelist\n [:role, :title]\n end", "def expected_permitted_parameter_names; end", "def safe_params\n params.except(:host, :port, :protocol).permit!\n end", "def strong_params\n params.require(:team_member).permit(param_whitelist)\n end", "def permitir_parametros\n \t\tparams.permit!\n \tend", "def strong_params\n params.require(:community).permit(param_whitelist)\n end", "def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end", "def strong_params\n params.require(:education).permit(param_whitelist)\n end", "def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end", "def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end", "def param_whitelist\n [:rating, :review]\n end", "def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end", "def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end", "def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end", "def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end", "def valid_params_request?; end", "def strong_params\n params.require(:experience).permit(param_whitelist)\n end", "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end", "def allowed_params\n params.require(:allowed).permit(:email)\n end", "def permitted_params\n []\n end", "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end", "def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend", "def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end", "def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end", "def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end", "def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end", "def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end", "def safe_params\n params.require(:user).permit(:name)\n end", "def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend", "def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end", "def check_params; true; end", "def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end", "def quote_params\n params.permit!\n end", "def valid_params?; end", "def paramunold_params\n params.require(:paramunold).permit!\n end", "def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend", "def filtered_parameters; end", "def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end", "def filtering_params\n params.permit(:email, :name)\n end", "def check_params\n true\n end", "def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend", "def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend", "def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end", "def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end", "def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end", "def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend", "def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end", "def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end", "def active_code_params\n params[:active_code].permit\n end", "def filtering_params\n params.permit(:email)\n end", "def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end", "def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end", "def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end", "def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end", "def post_params\n if current_user.admin? \n params.permit(:title, :body, :city, :country, :gps_location, :privacy, :visible, :latitude, :longitude, images: [], files: [])\n else \n params.permit(:title, :body, :city, :country, :gps_location, :privacy,:latitude, :longitude, images: [], files: [])\n end \n end", "def list_params\n params.permit(:name)\n end", "def filter_parameters; end", "def filter_parameters; end", "def vineyard_params\n params.permit(:vineyard_name, :email, :website_url, :phone, :address, :city, :region, :postcode, :country, :specialty, :description, :pet_friendly, :holiday, :tours, :events, :family_friendly, :cover_image, :image_one, :image_two, :image_three, :image_four, :user_id, :base64)\n end", "def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end", "def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end", "def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end", "def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end", "def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end", "def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end", "def url_whitelist; end", "def admin_social_network_params\n params.require(:social_network).permit!\n end", "def filter_params\n params.require(:filters).permit(:letters)\n end", "def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end", "def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end", "def sensitive_params=(params)\n @sensitive_params = params\n end", "def permit_request_params\n params.permit(:address)\n end", "def user_params\n # Ensure a user can't give themselves admin priveleges\n params.delete(:admin) if current_user.admin?\n params.require(:user).permit(:name, :email, :admin, :image)\n end", "def secure_params\n params.require(:location).permit(:name)\n end", "def strong_params\n params.require( :setting ).\n permit( :global_scan_limit, :per_user_scan_limit,\n :target_whitelist_patterns, :target_blacklist_patterns )\n end", "def question_params\n params.require(:survey_question).permit(question_whitelist)\n end", "def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end", "def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end", "def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end", "def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end", "def url_params\n params[:url].permit(:full)\n end", "def backend_user_params\n params.permit!\n end", "def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend", "def speed_measurement_params\n\n #fuckit, to lazy to deal with permit crap right now\n ActionController::Parameters.permit_all_parameters = true\n\n params[:speed_measurement]\n end", "def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end", "def get_params\r\n #params.require(:article).permit(:title, :permalink, :content, :source_site, :introtext, :type_id, :order_by, :searchable, :created_by, :edited_by, :published_by, :published_on, :user_id)\r\n params.require(:article).permit!\r\n\r\n end", "def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end", "def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end", "def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end", "def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end", "def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end" ]
[ "0.69792545", "0.6781151", "0.67419964", "0.674013", "0.6734356", "0.6591046", "0.6502396", "0.6496313", "0.6480641", "0.6477825", "0.64565", "0.6438387", "0.63791263", "0.63740575", "0.6364131", "0.63192815", "0.62991166", "0.62978333", "0.6292148", "0.6290449", "0.6290076", "0.62894756", "0.6283177", "0.6242471", "0.62382483", "0.6217549", "0.6214457", "0.6209053", "0.6193042", "0.6177802", "0.6174604", "0.61714715", "0.6161512", "0.6151757", "0.6150663", "0.61461", "0.61213595", "0.611406", "0.6106206", "0.6105114", "0.6089039", "0.6081015", "0.6071004", "0.60620916", "0.6019971", "0.601788", "0.6011056", "0.6010898", "0.6005122", "0.6005122", "0.6001556", "0.6001049", "0.59943926", "0.5992201", "0.59909594", "0.5990628", "0.5980841", "0.59669393", "0.59589154", "0.5958826", "0.5957911", "0.5957385", "0.5953072", "0.59526145", "0.5943361", "0.59386164", "0.59375334", "0.59375334", "0.5933856", "0.59292704", "0.59254247", "0.5924164", "0.59167904", "0.59088355", "0.5907542", "0.59064597", "0.5906243", "0.5898226", "0.589687", "0.5896091", "0.5894501", "0.5894289", "0.5891739", "0.58860534", "0.5882406", "0.587974", "0.58738774", "0.5869024", "0.58679986", "0.5867561", "0.5865932", "0.5864461", "0.58639693", "0.58617616", "0.5861436", "0.5860451", "0.58602303", "0.5854586", "0.58537364", "0.5850427", "0.5850199" ]
0.0
-1
GET /controlpltkts GET /controlpltkts.json
def index @controlpltkts = Controlpltkt.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_controlpltkt\n @controlpltkt = Controlpltkt.find(params[:id])\n end", "def index\n @controltltkts = Controltltkt.all\n end", "def index\n @controltnytts = Controltnytt.all\n end", "def create\n @controlpltkt = Controlpltkt.new(controlpltkt_params)\n\n respond_to do |format|\n if @controlpltkt.save\n format.html { redirect_to @controlpltkt, notice: 'Controlpltkt was successfully created.' }\n format.json { render :show, status: :created, location: @controlpltkt }\n else\n format.html { render :new }\n format.json { render json: @controlpltkt.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @tnpscs = Tnpsc.all\n end", "def update\n respond_to do |format|\n if @controlpltkt.update(controlpltkt_params)\n format.html { redirect_to @controlpltkt, notice: 'Controlpltkt was successfully updated.' }\n format.json { render :show, status: :ok, location: @controlpltkt }\n else\n format.html { render :edit }\n format.json { render json: @controlpltkt.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @tps = Tps.all\n end", "def index\n @controltgmts = Controltgmt.all\n end", "def index\n @time_controls = TimeControl.all\n end", "def index\n @tp_parameters = TpParameter.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tp_parameters }\n end\n end", "def controlpltkt_params\n params.require(:controlpltkt).permit(:n1, :n2, :siglas, :limite, :vendida)\n end", "def fetchControlPoints(url, mapID)\n url = URI(url.to_s+'maps/'+mapID.to_s+'/control_points.json')\n response = Net::HTTP.get_response(url)\n data = response.body\n JSON.parse(data)\n end", "def set_controltltkt\n @controltltkt = Controltltkt.find(params[:id])\n end", "def index\n # Retrieve kpis templates from impac api.\n # TODO: improve request params to work for strong parameters\n attrs = params.slice('metadata', 'opts')\n auth = { username: MnoEnterprise.tenant_id, password: MnoEnterprise.tenant_key }\n\n response = begin\n MnoEnterprise::ImpacClient.send_get('/api/v2/kpis', attrs, basic_auth: auth)\n rescue => e\n return render json: { message: \"Unable to retrieve kpis from Impac API | Error #{e}\" }\n end\n\n # customise available kpis\n kpis = (response['kpis'] || []).map do |kpi|\n kpi = kpi.with_indifferent_access\n kpi[:watchables].map do |watchable|\n kpi.merge(\n name: \"#{kpi[:name]} #{watchable.capitalize unless kpi[:name].downcase.index(watchable)}\".strip,\n watchables: [watchable],\n target_placeholders: {watchable => kpi[:target_placeholders][watchable]},\n )\n end\n end\n .flatten\n\n render json: { kpis: kpis }\n end", "def set_tnpsc\n @tnpsc = Tnpsc.find(params[:id])\n end", "def index\n @controlpreats = Controlpreat.all\n end", "def index\n @tccapis = Tccapi.all\n end", "def index\n \n unless @parent.nil?\n @control_points = @parent.control_points.order(:updated_at).page(params[:page]).per(10)\n @all_control_points = @parent.control_points\n else\n @control_points = ControlPoint.order(:updated_at).page(params[:page]).per(10)\n @all_control_points = ControlPoint.all\n end\n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @all_control_points }\n format.json { render :json => @all_control_points }\n format.rdf\n end\n end", "def index\n @otps = Otp.all\n end", "def index\n @tssks = Tssk.all\n end", "def index\n @needed_control = NeededControl.all\n end", "def set_controltnytt\n @controltnytt = Controltnytt.find(params[:id])\n end", "def index\n @tsps = Tsp.page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json:@tsps }\n end\n end", "def getControls\n controls = {}\n response = self.class.get(\"/rest/items\",:basic_auth => @auth)\n JSON.parse(response.body).each do |r|\n if r[\"category\"] == \"Controls\" || r[\"category\"] == \"Lamps\"\n controls[r[\"id\"]] = r[\"name\"]\n end\n end\n return controls\n end", "def get_spending_control_all_using_get_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: SpendingControlApi.get_spending_control_all_using_get ...'\n end\n # resource path\n local_var_path = '/nucleus/v1/spending_control'\n\n # query parameters\n query_params = {}\n query_params[:'ascending'] = opts[:'ascending'] if !opts[:'ascending'].nil?\n query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?\n query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].nil?\n query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?\n query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['oauth2']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PageSpendingControl')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: SpendingControlApi#get_spending_control_all_using_get\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def index\n @controls = Control.all\n\n respond_with @controls\n end", "def destroy\n @controlpltkt.destroy\n respond_to do |format|\n format.html { redirect_to controlpltkts_url, notice: 'Controlpltkt was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def index\n @gtp_planners = GtpPlanner.all\n end", "def index\n # @tickets = policy_scope(Ticket)\n render json: @tickets\n end", "def get_spending_control_all_using_get(opts = {})\n data, _status_code, _headers = get_spending_control_all_using_get_with_http_info(opts)\n data\n end", "def index\n @mpg_controls = MpgControl.all\n end", "def controltltkt_params\n params.require(:controltltkt).permit(:n1, :n2, :n3, :siglas, :limite, :vendida)\n end", "def index\n @ts = T.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ts }\n end\n end", "def hours\n render json: Pings::Selector.new.hours(params)\n end", "def index\n @pricings = Pricing.all\n\n render json: @pricings\n end", "def show\n @tsp = Tsp.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json:@tsp }\n end\n end", "def set_controltgmt\n @controltgmt = Controltgmt.find(params[:id])\n end", "def index\n @control_loops = ControlLoop.all\n end", "def index\n @punch_clocks = current_user.account.punch_clocks\n end", "def index\n # @project_controls = ProjectControl.all\n end", "def index\n @srg = Srg.find(params[:srg_id])\n @srg_controls = SrgControl.all\n end", "def update\n respond_to do |format|\n if @tnpsc.update(tnpsc_params)\n format.html { redirect_to @tnpsc, notice: 'Tnpsc was successfully updated.' }\n format.json { render :show, status: :ok, location: @tnpsc }\n else\n format.html { render :edit }\n format.json { render json: @tnpsc.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @admin_kpi_templates = Admin::KpiTemplate.paginate(:page=>params[:page],:per_page=>20)\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @admin_kpi_templates }\n end\n end", "def index\n @ptpktps = Ptpktp.order(date: :desc, msg_time: :desc)\n end", "def index\n @otg_crypsts = OtgCrypst.all\n end", "def create\n @controltltkt = Controltltkt.new(controltltkt_params)\n\n respond_to do |format|\n if @controltltkt.save\n format.html { redirect_to @controltltkt, notice: 'Controltltkt was successfully created.' }\n format.json { render :show, status: :created, location: @controltltkt }\n else\n format.html { render :new }\n format.json { render json: @controltltkt.errors, status: :unprocessable_entity }\n end\n end\n end", "def trips\n get '/gtfs/trips'\n end", "def update\n respond_to do |format|\n if @controltltkt.update(controltltkt_params)\n format.html { redirect_to @controltltkt, notice: 'Controltltkt was successfully updated.' }\n format.json { render :show, status: :ok, location: @controltltkt }\n else\n format.html { render :edit }\n format.json { render json: @controltltkt.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @controltleits = Controltleit.all\n end", "def index\n @pkhds = Pkhd.all\n end", "def index\n @funcion_controls = FuncionControl.all\n end", "def create\n @tnpsc = Tnpsc.new(tnpsc_params)\n\n respond_to do |format|\n if @tnpsc.save\n format.html { redirect_to @tnpsc, notice: 'Tnpsc was successfully created.' }\n format.json { render :show, status: :created, location: @tnpsc }\n else\n format.html { render :new }\n format.json { render json: @tnpsc.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @controltnytt.update(controltnytt_params)\n format.html { redirect_to @controltnytt, notice: 'Controltnytt was successfully updated.' }\n format.json { render :show, status: :ok, location: @controltnytt }\n else\n format.html { render :edit }\n format.json { render json: @controltnytt.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @pclevels = Pclevel.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @pclevels }\n end\n end", "def index\n @timers = Timer.all\n\n render json: @timers\n end", "def index\n @pdks = Pdk.all\n end", "def index\n @p_times = PTime.all\n end", "def index\n @gppts = Gppt.all\n end", "def index\n @taskks = Taskk.all\n end", "def index\n @service_times = ServiceTime.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @service_times }\n end\n end", "def controltnytt_params\n params.require(:controltnytt).permit(:n1, :n2, :n3, :siglas, :limite, :vendida)\n end", "def index\n @version_controls = VersionControl.all\n end", "def tccapi_params\n params[:tccapi]\n end", "def index\n @pcs = Pc.all\n end", "def show\n @kpt = Kpt.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @kpt }\n end\n end", "def index\n @takipcis = Takipci.all\n end", "def index\n @controlpleits = Controlpleit.all\n end", "def index\n @socio_spcs = SocioSpc.all\n end", "def create\n @controltnytt = Controltnytt.new(controltnytt_params)\n\n respond_to do |format|\n if @controltnytt.save\n format.html { redirect_to @controltnytt, notice: 'Controltnytt was successfully created.' }\n format.json { render :show, status: :created, location: @controltnytt }\n else\n format.html { render :new }\n format.json { render json: @controltnytt.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @putniks = Putnik.all\n end", "def index\n @trips = Trip.all\n\n render json: @trips\n end", "def index\n @trips = Trip.all\n\n render json: @trips\n end", "def index\n @tvs = Tv.all\n end", "def owt_list\n @client.make_request :get, templates_path('owt')\n end", "def index\n @controls = @device.controls\n end", "def index\n @trips = Trip.all\n render :json => @trips\n end", "def show\n @control_point = ControlPoint.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @control_point }\n format.json { render :json => @control_point }\n format.rdf { render :rdf => @control_point, \n :httpURI => @base_uri,\n :host => @host}\n format.ttl { render :ttl => @control_point, \n :httpURI => @base_uri,\n :host => @host}\n format.nt { render :nt => @control_point, \n :httpURI => @base_uri,\n :host => @host}\n end\n end", "def klines(options)\n request :public, :get, :klines, options\n end", "def create\n @time_control = TimeControl.new(time_control_params)\n\n respond_to do |format|\n if @time_control.save\n format.html { redirect_to @time_control, notice: 'Time control was successfully created.' }\n format.json { render action: 'show', status: :created, location: @time_control }\n else\n format.html { render action: 'new' }\n format.json { render json: @time_control.errors, status: :unprocessable_entity }\n end\n end\n end", "def ps(app_name)\n deprecate # 07/31/2012\n json_decode get(\"/apps/#{app_name}/ps\", :accept => 'application/json').to_s\n end", "def index\n trips = Trip.all\n render json: trips\n end", "def index\n @pacientes = Pacientes.all\n render json: @pacientes\n end", "def index\n @timecharts = Timechart.find(:all, order: \"stop_time DESC\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @timecharts }\n end\n end", "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", "def index\n @timetables = Timetable.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @timetables }\n end\n end", "def index\n @twallets_cs = TwalletsC.all\n end", "def controltgmt_params\n params.require(:controltgmt).permit(:n1, :n2, :n3, :siglas, :limite, :vendida)\n end", "def index\n @cp_changes = CpChange.all\n\n render json: @cp_changes\n end", "def index\n @sub_gtps = SubGtp.all\n end", "def show\n @tp_parameter = TpParameter.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tp_parameter }\n end\n end", "def show\n @control_tower = ControlTower.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @control_tower }\n end\n end", "def index\n @terminate_points = TerminatePoint.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @terminate_points }\n end\n end", "def index\n @microfinance_service_provider_typologies = MicrofinanceServiceProviderTypology.all\n end", "def index\n @policy_templates = PolicyTemplate.all\n end", "def index\n @taxis = Taxi.where(:open_for_bidding => true).all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @taxis }\n end\n end", "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", "def index\n @kvs = Kv.all\n end", "def index\n @controldepagogts = Controldepagogt.all\n end", "def index\n @gpsds = Gpsd.all\n #respond_to do |format|\n # format.json { render }\n #end\n end", "def index\n @nvs_subsystems = NvsSubsystem.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @nvs_subsystems }\n end\n end" ]
[ "0.67161757", "0.65112853", "0.62452555", "0.61688733", "0.61178905", "0.603198", "0.6029375", "0.5960648", "0.58432084", "0.58032733", "0.58014846", "0.56973445", "0.5612154", "0.55961776", "0.5566658", "0.5547444", "0.5513052", "0.5481493", "0.5434418", "0.53877026", "0.5342665", "0.5324693", "0.52992386", "0.52918154", "0.5286596", "0.5269541", "0.52565366", "0.5241238", "0.5239882", "0.52201504", "0.5210201", "0.519025", "0.5184111", "0.51302814", "0.512557", "0.512195", "0.51169133", "0.5113346", "0.5096444", "0.5094888", "0.50912416", "0.50904053", "0.5086978", "0.50651574", "0.5063325", "0.50548536", "0.50488955", "0.50487494", "0.5047543", "0.5035431", "0.50310713", "0.50277835", "0.50273955", "0.50177544", "0.49961492", "0.49923027", "0.4989945", "0.49861008", "0.49860072", "0.4985568", "0.49827078", "0.49779725", "0.49754757", "0.49714854", "0.49699134", "0.49680364", "0.49415654", "0.49305895", "0.49296468", "0.49238497", "0.49163112", "0.49163112", "0.4913153", "0.49108863", "0.49094042", "0.49017707", "0.4901477", "0.48978117", "0.4885148", "0.48834217", "0.4883152", "0.48825252", "0.48763672", "0.4862064", "0.48571783", "0.485458", "0.48518148", "0.4828382", "0.4823694", "0.48193765", "0.4803238", "0.48013908", "0.4801011", "0.47861484", "0.47798237", "0.47765675", "0.47737616", "0.4773749", "0.47732148", "0.4770025" ]
0.7468065
0
GET /controlpltkts/1 GET /controlpltkts/1.json
def show end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @controlpltkts = Controlpltkt.all\n end", "def set_controlpltkt\n @controlpltkt = Controlpltkt.find(params[:id])\n end", "def index\n @controltltkts = Controltltkt.all\n end", "def index\n @tps = Tps.all\n end", "def index\n @tp_parameters = TpParameter.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tp_parameters }\n end\n end", "def index\n @tnpscs = Tnpsc.all\n end", "def index\n @controltnytts = Controltnytt.all\n end", "def create\n @controlpltkt = Controlpltkt.new(controlpltkt_params)\n\n respond_to do |format|\n if @controlpltkt.save\n format.html { redirect_to @controlpltkt, notice: 'Controlpltkt was successfully created.' }\n format.json { render :show, status: :created, location: @controlpltkt }\n else\n format.html { render :new }\n format.json { render json: @controlpltkt.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @controlpltkt.update(controlpltkt_params)\n format.html { redirect_to @controlpltkt, notice: 'Controlpltkt was successfully updated.' }\n format.json { render :show, status: :ok, location: @controlpltkt }\n else\n format.html { render :edit }\n format.json { render json: @controlpltkt.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n # Retrieve kpis templates from impac api.\n # TODO: improve request params to work for strong parameters\n attrs = params.slice('metadata', 'opts')\n auth = { username: MnoEnterprise.tenant_id, password: MnoEnterprise.tenant_key }\n\n response = begin\n MnoEnterprise::ImpacClient.send_get('/api/v2/kpis', attrs, basic_auth: auth)\n rescue => e\n return render json: { message: \"Unable to retrieve kpis from Impac API | Error #{e}\" }\n end\n\n # customise available kpis\n kpis = (response['kpis'] || []).map do |kpi|\n kpi = kpi.with_indifferent_access\n kpi[:watchables].map do |watchable|\n kpi.merge(\n name: \"#{kpi[:name]} #{watchable.capitalize unless kpi[:name].downcase.index(watchable)}\".strip,\n watchables: [watchable],\n target_placeholders: {watchable => kpi[:target_placeholders][watchable]},\n )\n end\n end\n .flatten\n\n render json: { kpis: kpis }\n end", "def show\n @tsp = Tsp.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json:@tsp }\n end\n end", "def index\n @controltgmts = Controltgmt.all\n end", "def index\n @tsps = Tsp.page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json:@tsps }\n end\n end", "def index\n @time_controls = TimeControl.all\n end", "def set_tnpsc\n @tnpsc = Tnpsc.find(params[:id])\n end", "def index\n \n unless @parent.nil?\n @control_points = @parent.control_points.order(:updated_at).page(params[:page]).per(10)\n @all_control_points = @parent.control_points\n else\n @control_points = ControlPoint.order(:updated_at).page(params[:page]).per(10)\n @all_control_points = ControlPoint.all\n end\n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @all_control_points }\n format.json { render :json => @all_control_points }\n format.rdf\n end\n end", "def index\n @ts = T.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ts }\n end\n end", "def index\n @otps = Otp.all\n end", "def show\n @kpt = Kpt.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @kpt }\n end\n end", "def index\n @tccapis = Tccapi.all\n end", "def fetchControlPoints(url, mapID)\n url = URI(url.to_s+'maps/'+mapID.to_s+'/control_points.json')\n response = Net::HTTP.get_response(url)\n data = response.body\n JSON.parse(data)\n end", "def controlpltkt_params\n params.require(:controlpltkt).permit(:n1, :n2, :siglas, :limite, :vendida)\n end", "def show\n @control_point = ControlPoint.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @control_point }\n format.json { render :json => @control_point }\n format.rdf { render :rdf => @control_point, \n :httpURI => @base_uri,\n :host => @host}\n format.ttl { render :ttl => @control_point, \n :httpURI => @base_uri,\n :host => @host}\n format.nt { render :nt => @control_point, \n :httpURI => @base_uri,\n :host => @host}\n end\n end", "def show\n @tp_parameter = TpParameter.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tp_parameter }\n end\n end", "def set_controltltkt\n @controltltkt = Controltltkt.find(params[:id])\n end", "def hours\n render json: Pings::Selector.new.hours(params)\n end", "def index\n @service_times = ServiceTime.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @service_times }\n end\n end", "def index\n @controlpreats = Controlpreat.all\n end", "def index\n @pricings = Pricing.all\n\n render json: @pricings\n end", "def index\n @admin_kpi_templates = Admin::KpiTemplate.paginate(:page=>params[:page],:per_page=>20)\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @admin_kpi_templates }\n end\n end", "def show\n @tipp = Tipp.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tipp }\n end\n end", "def show\n @clinic_timing = ClinicTiming.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @clinic_timing }\n end\n end", "def get_spending_control_all_using_get_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: SpendingControlApi.get_spending_control_all_using_get ...'\n end\n # resource path\n local_var_path = '/nucleus/v1/spending_control'\n\n # query parameters\n query_params = {}\n query_params[:'ascending'] = opts[:'ascending'] if !opts[:'ascending'].nil?\n query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?\n query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].nil?\n query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?\n query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['oauth2']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PageSpendingControl')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: SpendingControlApi#get_spending_control_all_using_get\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def index\n @gtp_planners = GtpPlanner.all\n end", "def index\n @timers = Timer.all\n\n render json: @timers\n end", "def index\n @tssks = Tssk.all\n end", "def show\n @pinit = Pinit.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pinit }\n end\n end", "def index\n # @tickets = policy_scope(Ticket)\n render json: @tickets\n end", "def show\n @admin_kpi_template = Admin::KpiTemplate.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @admin_kpi_template }\n end\n end", "def index\n @timetables = Timetable.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @timetables }\n end\n end", "def set_controltnytt\n @controltnytt = Controltnytt.find(params[:id])\n end", "def index\n @timecharts = Timechart.find(:all, order: \"stop_time DESC\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @timecharts }\n end\n end", "def show\n @control_tower = ControlTower.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @control_tower }\n end\n end", "def index\n @trips = Trip.all\n\n render json: @trips\n end", "def index\n @trips = Trip.all\n\n render json: @trips\n end", "def show\n @trips_connect = TripsConnect.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @trips_connect }\n end\n end", "def index\n @trips = Trip.all\n render :json => @trips\n end", "def index\n @ptpktps = Ptpktp.order(date: :desc, msg_time: :desc)\n end", "def index\n @snps = Snp.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @snps }\n end\n end", "def index\n trips = Trip.all\n render json: trips\n end", "def index\n @p_times = PTime.all\n end", "def update\n respond_to do |format|\n if @tnpsc.update(tnpsc_params)\n format.html { redirect_to @tnpsc, notice: 'Tnpsc was successfully updated.' }\n format.json { render :show, status: :ok, location: @tnpsc }\n else\n format.html { render :edit }\n format.json { render json: @tnpsc.errors, status: :unprocessable_entity }\n end\n end\n end", "def show\n respond_to do |format|\n format.html\n format.json { render json: ProjectControl.find(params[:id]) }\n end\n end", "def index\n @needed_control = NeededControl.all\n end", "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", "def index\n @vhours = Vhour.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @vhours }\n end\n end", "def ps(app_name)\n deprecate # 07/31/2012\n json_decode get(\"/apps/#{app_name}/ps\", :accept => 'application/json').to_s\n end", "def index\n @terminate_points = TerminatePoint.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @terminate_points }\n end\n end", "def index\n @controls = Control.all\n\n respond_with @controls\n end", "def index\n @pkhds = Pkhd.all\n end", "def index\n @pacientes = Pacientes.all\n render json: @pacientes\n end", "def destroy\n @controlpltkt.destroy\n respond_to do |format|\n format.html { redirect_to controlpltkts_url, notice: 'Controlpltkt was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def create\n @tnpsc = Tnpsc.new(tnpsc_params)\n\n respond_to do |format|\n if @tnpsc.save\n format.html { redirect_to @tnpsc, notice: 'Tnpsc was successfully created.' }\n format.json { render :show, status: :created, location: @tnpsc }\n else\n format.html { render :new }\n format.json { render json: @tnpsc.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @punch_clocks = current_user.account.punch_clocks\n end", "def index\n @peticion_servicio_tis = Peticion::ServicioTi.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @peticion_servicio_tis }\n end\n end", "def index\n # @checkpoints = Checkpoint.all\n @route = Route.find(params[:route_id])\n @checkpoints = @route.checkpoints\n # render json: {\n # checkpoints: @checkpoints.to_a\n # }\n end", "def trips\n get '/gtfs/trips'\n end", "def show\n @timechart = Timechart.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @timechart }\n end\n end", "def index\n @gpsds = Gpsd.all\n #respond_to do |format|\n # format.json { render }\n #end\n end", "def index\n @pricings = Pricing.all.order(\"updated_at DESC\").order(\"created_at DESC\")\n\n render json: @pricings\n end", "def show\n @service_time = ServiceTime.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @service_time }\n end\n end", "def show\n @dtpic = Dtpic.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @dtpic }\n end\n end", "def show\n @tktest = Tktest.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tktest }\n end\n end", "def show\n render json: @timer\n end", "def index\n @taxis = Taxi.where(:open_for_bidding => true).all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @taxis }\n end\n end", "def index\n @gppts = Gppt.all\n end", "def index\n @service_schedules = ServiceSchedule.all\n\n render json: @service_schedules\n end", "def index\n @cp_changes = CpChange.all\n\n render json: @cp_changes\n end", "def index\n @nvs_subsystems = NvsSubsystem.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @nvs_subsystems }\n end\n end", "def index\n @taskks = Taskk.all\n end", "def index\n @pcs = Pc.all\n end", "def show\n @time_point = TimePoint.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @time_point }\n end\n end", "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", "def get(path, params={})\n params = merge_set_up_params(params)\n JSON.parse(Typhoeus::Request.get(API_URL + path, :params => params).body)[\"response\"]\n end", "def show\n @pst = Pst.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @pst }\n end\n end", "def index\n @pdks = Pdk.all\n end", "def index\n @timesheets = Timesheet.all\n render json: @timesheets\n end", "def index\n @labtech_timeslips = LabtechTimeslip.all\n @dtl_timeslips = LabtechTimeslip.all.where('lab_client_id = 12 ')\n end", "def index\n @takipcis = Takipci.all\n end", "def show\n @planned_time = PlannedTime.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @planned_time }\n end\n end", "def index \n render json: Tuning.all\n end", "def index\n @tips_tricks = @tips_tricks.published.recent.page(params[:page]).per(10)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tips_tricks }\n end\n end", "def index\n @tunes = Tune.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tunes }\n end\n end", "def set_controltgmt\n @controltgmt = Controltgmt.find(params[:id])\n end", "def index\n @picks = PickName.order(:id).all\n\n respond_to do |format|\n format.html # index.html.haml\n format.json { render json: @picks }\n end\n end", "def new\n @tp_parameter = TpParameter.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tp_parameter }\n end\n end", "def update\n respond_to do |format|\n if @controltnytt.update(controltnytt_params)\n format.html { redirect_to @controltnytt, notice: 'Controltnytt was successfully updated.' }\n format.json { render :show, status: :ok, location: @controltnytt }\n else\n format.html { render :edit }\n format.json { render json: @controltnytt.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @patrocinios = Patrocinio.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @patrocinios }\n end\n end", "def new\n @kpt = Kpt.new\n @iterations = Iteration.all\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @kpt }\n end\n end", "def new\n @pinit = Pinit.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pinit }\n end\n end", "def index\n @otg_crypsts = OtgCrypst.all\n end" ]
[ "0.723292", "0.65737957", "0.62344295", "0.6181718", "0.61692655", "0.61501455", "0.6101707", "0.60642964", "0.59439987", "0.58539784", "0.58221895", "0.580051", "0.57625717", "0.5710458", "0.57098657", "0.56659013", "0.5644223", "0.560472", "0.55934644", "0.5578684", "0.556565", "0.5530534", "0.55304277", "0.55246735", "0.5492141", "0.5484221", "0.5463418", "0.54550797", "0.5451585", "0.5420181", "0.53988516", "0.5384132", "0.53799427", "0.5374696", "0.53573775", "0.5348724", "0.5340209", "0.5330324", "0.532992", "0.53231496", "0.53067416", "0.5286999", "0.5273103", "0.5267555", "0.5267555", "0.5262645", "0.52616656", "0.5259444", "0.5258464", "0.52426344", "0.5242244", "0.52411294", "0.5239138", "0.52296495", "0.5226885", "0.5217118", "0.52170914", "0.5213318", "0.52065164", "0.52038515", "0.51997805", "0.51965857", "0.51908743", "0.5187167", "0.51646304", "0.5146055", "0.51446253", "0.5141796", "0.5139441", "0.51387703", "0.5136124", "0.5132911", "0.51300526", "0.5119899", "0.51134497", "0.510084", "0.5090865", "0.5089047", "0.5086569", "0.5086372", "0.5083864", "0.50834167", "0.50831395", "0.5081118", "0.50753707", "0.5074549", "0.5073677", "0.5070939", "0.5059725", "0.50569075", "0.50527287", "0.5047824", "0.50467145", "0.5046091", "0.50397885", "0.50371844", "0.50314933", "0.50286347", "0.50257194", "0.50222284", "0.5021996" ]
0.0
-1
POST /controlpltkts POST /controlpltkts.json
def create @controlpltkt = Controlpltkt.new(controlpltkt_params) respond_to do |format| if @controlpltkt.save format.html { redirect_to @controlpltkt, notice: 'Controlpltkt was successfully created.' } format.json { render :show, status: :created, location: @controlpltkt } else format.html { render :new } format.json { render json: @controlpltkt.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def controlpltkt_params\n params.require(:controlpltkt).permit(:n1, :n2, :siglas, :limite, :vendida)\n end", "def set_controlpltkt\n @controlpltkt = Controlpltkt.find(params[:id])\n end", "def create\n @tnpsc = Tnpsc.new(tnpsc_params)\n\n respond_to do |format|\n if @tnpsc.save\n format.html { redirect_to @tnpsc, notice: 'Tnpsc was successfully created.' }\n format.json { render :show, status: :created, location: @tnpsc }\n else\n format.html { render :new }\n format.json { render json: @tnpsc.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @controltltkt = Controltltkt.new(controltltkt_params)\n\n respond_to do |format|\n if @controltltkt.save\n format.html { redirect_to @controltltkt, notice: 'Controltltkt was successfully created.' }\n format.json { render :show, status: :created, location: @controltltkt }\n else\n format.html { render :new }\n format.json { render json: @controltltkt.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @controltnytt = Controltnytt.new(controltnytt_params)\n\n respond_to do |format|\n if @controltnytt.save\n format.html { redirect_to @controltnytt, notice: 'Controltnytt was successfully created.' }\n format.json { render :show, status: :created, location: @controltnytt }\n else\n format.html { render :new }\n format.json { render json: @controltnytt.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @controlpltkts = Controlpltkt.all\n end", "def update\n respond_to do |format|\n if @controlpltkt.update(controlpltkt_params)\n format.html { redirect_to @controlpltkt, notice: 'Controlpltkt was successfully updated.' }\n format.json { render :show, status: :ok, location: @controlpltkt }\n else\n format.html { render :edit }\n format.json { render json: @controlpltkt.errors, status: :unprocessable_entity }\n end\n end\n end", "def controltltkt_params\n params.require(:controltltkt).permit(:n1, :n2, :n3, :siglas, :limite, :vendida)\n end", "def controltnytt_params\n params.require(:controltnytt).permit(:n1, :n2, :n3, :siglas, :limite, :vendida)\n end", "def create\n @time_control = TimeControl.new(time_control_params)\n\n respond_to do |format|\n if @time_control.save\n format.html { redirect_to @time_control, notice: 'Time control was successfully created.' }\n format.json { render action: 'show', status: :created, location: @time_control }\n else\n format.html { render action: 'new' }\n format.json { render json: @time_control.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @ptpktp = Ptpktp.new(ptpktp_params)\n\n respond_to do |format|\n if @ptpktp.save\n format.html { redirect_to ptpktps_path, notice: 'Запись успешно добавлена.' }\n format.json { render :show, status: :created, location: ptpktps_path }\n else\n format.html { render :new }\n format.json { render json: @ptpktp.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @controltgmt = Controltgmt.new(controltgmt_params)\n\n respond_to do |format|\n if @controltgmt.save\n format.html { redirect_to @controltgmt, notice: 'Controltgmt was successfully created.' }\n format.json { render :show, status: :created, location: @controltgmt }\n else\n format.html { render :new }\n format.json { render json: @controltgmt.errors, status: :unprocessable_entity }\n end\n end\n end", "def controltgmt_params\n params.require(:controltgmt).permit(:n1, :n2, :n3, :siglas, :limite, :vendida)\n end", "def set_tnpsc\n @tnpsc = Tnpsc.find(params[:id])\n end", "def create\n @tssk = Tssk.new(tssk_params)\n\n respond_to do |format|\n if @tssk.save\n format.html { redirect_to @tssk, notice: 'Tssk was successfully created.' }\n format.json { render action: 'show', status: :created, location: @tssk }\n else\n format.html { render action: 'new' }\n format.json { render json: @tssk.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @tnpsc.update(tnpsc_params)\n format.html { redirect_to @tnpsc, notice: 'Tnpsc was successfully updated.' }\n format.json { render :show, status: :ok, location: @tnpsc }\n else\n format.html { render :edit }\n format.json { render json: @tnpsc.errors, status: :unprocessable_entity }\n end\n end\n end", "def destroy\n @controlpltkt.destroy\n respond_to do |format|\n format.html { redirect_to controlpltkts_url, notice: 'Controlpltkt was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def create_spending_control_using_post_with_http_info(spending_control, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: SpendingControlApi.create_spending_control_using_post ...'\n end\n # verify the required parameter 'spending_control' is set\n if @api_client.config.client_side_validation && spending_control.nil?\n fail ArgumentError, \"Missing the required parameter 'spending_control' when calling SpendingControlApi.create_spending_control_using_post\"\n end\n # resource path\n local_var_path = '/nucleus/v1/spending_control'\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(['*/*'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(spending_control)\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 => 'SpendingControl')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: SpendingControlApi#create_spending_control_using_post\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def control_params\n params.require(:control).permit(:cid, :name, :type, :status, :installation_type, :usage_time, :activity_count)\n end", "def set_controltltkt\n @controltltkt = Controltltkt.find(params[:id])\n end", "def create_spending_control_using_post(spending_control, opts = {})\n data, _status_code, _headers = create_spending_control_using_post_with_http_info(spending_control, opts)\n data\n end", "def create\n @tktest = Tktest.new(params[:tktest])\n\n respond_to do |format|\n if @tktest.save\n format.html { redirect_to @tktest, notice: 'Tktest was successfully created.' }\n format.json { render json: @tktest, status: :created, location: @tktest }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tktest.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @controlpreat = Controlpreat.new(controlpreat_params)\n\n respond_to do |format|\n if @controlpreat.save\n format.html { redirect_to @controlpreat, notice: 'Controlpreat was successfully created.' }\n format.json { render :show, status: :created, location: @controlpreat }\n else\n format.html { render :new }\n format.json { render json: @controlpreat.errors, status: :unprocessable_entity }\n end\n end\n end", "def ptpktp_params\n params[:ptpktp].permit(\n :date,:msg_time,:address,:pch,:plan_cart,:numberptpktp,:hod,:karaul\n )\n end", "def tnpsc_params\n params.require(:tnpsc).permit(:Post, :Qualification)\n end", "def set_controltnytt\n @controltnytt = Controltnytt.find(params[:id])\n end", "def update\n respond_to do |format|\n if @controltnytt.update(controltnytt_params)\n format.html { redirect_to @controltnytt, notice: 'Controltnytt was successfully updated.' }\n format.json { render :show, status: :ok, location: @controltnytt }\n else\n format.html { render :edit }\n format.json { render json: @controltnytt.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @tp_parameter = TpParameter.new(params[:tp_parameter])\n\n respond_to do |format|\n if @tp_parameter.save\n format.html { redirect_to @tp_parameter, notice: 'Tp parameter was successfully created.' }\n format.json { render json: @tp_parameter, status: :created, location: @tp_parameter }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tp_parameter.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @controltltkts = Controltltkt.all\n end", "def create\n @labtech_timeslip = LabtechTimeslip.new(labtech_timeslip_params)\n\n respond_to do |format|\n if @labtech_timeslip.save\n format.html { redirect_to @labtech_timeslip, notice: 'Labtech timeslip was successfully created.' }\n format.json { render :show, status: :created, location: @labtech_timeslip }\n else\n format.html { render :new }\n format.json { render json: @labtech_timeslip.errors, status: :unprocessable_entity }\n end\n end\n end", "def control_params\n params.require(:control).permit(\n :id, :title, :desc, :impact, :refs, :refs_list,\n :code, :control_id, :profile_id,\n :tag_severity, :tag_gtitle, :tag_gid, :tag_rid, :tag_stig_id,\n :tag_cci, :tag_nist, :tag_nist_list,\n :tag_subsystems, :tag_subsystems_list, :tag_check, :tag_fix,\n :sl_ref, :sl_line\n )\n end", "def create\n @sub_gtp = SubGtp.new(sub_gtp_params)\n\n respond_to do |format|\n if @sub_gtp.save\n format.html { redirect_to @sub_gtp, notice: 'Sub gtp was successfully created.' }\n format.json { render :show, status: :created, location: @sub_gtp }\n else\n format.html { render :new }\n format.json { render json: @sub_gtp.errors, status: :unprocessable_entity }\n end\n end\n end", "def add_kyc_form\n service_response = SimpleTokenApi::Request::User.new(\n host_url_with_protocol,\n request.cookies,\n {\"User-Agent\" => http_user_agent}).basic_detail(GlobalConstant::TemplateType.kyc_template_type, params[:t])\n\n # Check if error present or not?\n unless service_response.success?\n render_error_response(service_response)\n return\n end\n\n @presenter_obj = ::Web::Client::Setup.new(service_response, params)\n redirect_to '/token-sale-blocked-region', status: GlobalConstant::ErrorCode.temporary_redirect and return if @presenter_obj.is_blacklisted_ip?(get_ip_to_aml_countries)\n redirect_to \"/login\", status: GlobalConstant::ErrorCode.temporary_redirect and return if @presenter_obj.has_sale_ended?\n\n @user = service_response.data[\"user\"]\n\n extra_param = params[:t].present? ? \"?e_t=1\" : \"\"\n redirect_if_step_not_reachable(@user[\"user_token_sale_state\"], GlobalConstant::TokenSaleUserState.kyc_page_allowed_states, extra_param)\n return if has_performed?\n get_ip_to_preferred_aml_country\n set_page_meta_info(@presenter_obj.custom_meta_tags)\n end", "def update\n respond_to do |format|\n if @controltltkt.update(controltltkt_params)\n format.html { redirect_to @controltltkt, notice: 'Controltltkt was successfully updated.' }\n format.json { render :show, status: :ok, location: @controltltkt }\n else\n format.html { render :edit }\n format.json { render json: @controltltkt.errors, status: :unprocessable_entity }\n end\n end\n end", "def controltleit_params\n params.require(:controltleit).permit(:n1, :n2, :n3, :siglas, :limite, :vendida)\n end", "def tssk_params\n params.require(:tssk).permit(:title, :detail)\n end", "def create\n @otg_crypst = OtgCrypst.new(otg_crypst_params)\n\n respond_to do |format|\n if @otg_crypst.save\n format.html { redirect_to @otg_crypst, notice: 'Otg crypst was successfully created.' }\n format.json { render :show, status: :created, location: @otg_crypst }\n else\n format.html { render :new }\n format.json { render json: @otg_crypst.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @timing = Timing.new(params[:timing].slice(:start, :stop, :days, :parent_class, :parent_id, :active))\n if @timing.save\n render json: @timing\n else\n render json: { error: 'error: could not save timing' }\n end\n end", "def create\n @controltleit = Controltleit.new(controltleit_params)\n\n respond_to do |format|\n if @controltleit.save\n format.html { redirect_to @controltleit, notice: 'Controltleit was successfully created.' }\n format.json { render :show, status: :created, location: @controltleit }\n else\n format.html { render :new }\n format.json { render json: @controltleit.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @control = @device.controls.new(control_params)\n\n respond_to do |format|\n if @control.save\n format.html { redirect_to [@device,@control], notice: 'Control was successfully created.' }\n format.json { render action: 'show', status: :created, location: @control }\n else\n format.html { render action: 'new' }\n format.json { render json: @control.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @timeslot = Timeslot.new(timeslot_params)\n @timeslot.save!\n render :json => @timeslot.as_json\n end", "def controlpreat_params\n params.require(:controlpreat).permit(:n1, :n2, :siglas, :limite, :vendida)\n end", "def create\n @takipci = Takipci.new(takipci_params)\n\n respond_to do |format|\n if @takipci.save\n format.html { redirect_to @takipci, notice: 'Takipci was successfully created.' }\n format.json { render :show, status: :created, location: @takipci }\n else\n format.html { render :new }\n format.json { render json: @takipci.errors, status: :unprocessable_entity }\n end\n end\n end", "def needed_control_params\n params.require(:needed_control).permit(:content, :completed)\n end", "def create\n @tsp = Tsp.new(params[:tsp])\n respond_to do |format|\n if@tsp.save\n #if@tsp.rb.status == 1\n Content.send_message_to_est(false,current_user,@tsp)\n #end\n format.html { redirect_to @tsp, notice: 'Tsp was successfully created.' }\n format.json { render json: @tsp, status: :created, location: @tsp }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tsp.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_controltgmt\n @controltgmt = Controltgmt.find(params[:id])\n end", "def create\n @controlqreat = Controlqreat.new(controlqreat_params)\n\n respond_to do |format|\n if @controlqreat.save\n format.html { redirect_to @controlqreat, notice: 'Controlqreat was successfully created.' }\n format.json { render :show, status: :created, location: @controlqreat }\n else\n format.html { render :new }\n format.json { render json: @controlqreat.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @controltnytts = Controltnytt.all\n end", "def labtech_timeslip_params\n params.require(:labtech_timeslip).permit(:name, :labtime, :started_date, :mins, :hours, :subject, :lab_client_id, :lab_ticketid, :labtech_client_id, :user_id )\n end", "def create\n @clinic_timing = ClinicTiming.new(params[:clinic_timing])\n\n respond_to do |format|\n if @clinic_timing.save\n format.html { redirect_to @clinic_timing, notice: 'Clinic timing was successfully created.' }\n format.json { render json: @clinic_timing, status: :created, location: @clinic_timing }\n else\n format.html { render action: \"new\" }\n format.json { render json: @clinic_timing.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @admin_kpi_template = Admin::KpiTemplate.new(params[:admin_kpi_template])\n\n respond_to do |format|\n if @admin_kpi_template.save\n format.html { redirect_to @admin_kpi_template, notice: 'Kpi template was successfully created.' }\n format.json { render json: @admin_kpi_template, status: :created, location: @admin_kpi_template }\n else\n format.html { render action: \"new\" }\n format.json { render json: @admin_kpi_template.errors, status: :unprocessable_entity }\n end\n end\n end", "def parameter_control_params\n params.require(:parameter_control).permit(:result_no, :generate_no, :e_no, :cond, :day, :mod, :cvp, :pvp)\n end", "def create\n @control_tower = ControlTower.new(params[:control_tower])\n\n respond_to do |format|\n if @control_tower.save\n format.html { redirect_to @control_tower, notice: 'Control tower was successfully created.' }\n format.json { render json: @control_tower, status: :created, location: @control_tower }\n else\n format.html { render action: \"new\" }\n format.json { render json: @control_tower.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @tnpscs = Tnpsc.all\n end", "def create\n @control_loop = ControlLoop.new(control_loop_params)\n\n respond_to do |format|\n if @control_loop.save\n format.html { redirect_to @control_loop, notice: 'Control loop was successfully created.' }\n format.json { render :show, status: :created, location: @control_loop }\n else\n format.html { render :new }\n format.json { render json: @control_loop.errors, status: :unprocessable_entity }\n end\n end\n end", "def poset_params\n params.require(:poset).permit(:name, :pass_threshold, :fail_threshold)\n end", "def create\n @test_ride = TestRide.new(test_ride_params)\n @control = BookingTimeControl.book_time_control_method(params)\n \n if @control == true\n if @test_ride.save\n render json: @test_ride, status: :created\n # Create Notifications\n @test_ride.delay.test_ride_booking_notification(I18n.t('Notification.test_ride_booking'), I18n.t('Email.test_ride_booking_dealer'), I18n.t('Email.test_ride_booking_user'), params)\n else\n render json: @test_ride.errors, status: :unprocessable_entity\n end\n else\n render json: @control\n end\n end", "def create\n @gtp_planner = GtpPlanner.new(gtp_planner_params)\n\n respond_to do |format|\n if @gtp_planner.save\n format.html { redirect_to @gtp_planner, notice: 'Gtp planner was successfully created.' }\n format.json { render :show, status: :created, location: @gtp_planner }\n else\n format.html { render :new }\n format.json { render json: @gtp_planner.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @planned_time = PlannedTime.new(params[:planned_time])\n\n respond_to do |format|\n if @planned_time.save\n format.html { redirect_to @planned_time, notice: 'Planned time was successfully created.' }\n format.json { render json: @planned_time, status: :created, location: @planned_time }\n else\n format.html { render action: \"new\" }\n format.json { render json: @planned_time.errors, status: :unprocessable_entity }\n end\n end\n end", "def teetime_params\n params.require(:teetime).permit plist\n end", "def create\n @timechart = Timechart.new(params[:timechart])\n\n respond_to do |format|\n if @timechart.save\n format.html { redirect_to @timechart, notice: 'Timechart was successfully created.' }\n format.json { render json: @timechart, status: :created, location: @timechart }\n else\n format.html { render action: \"new\" }\n format.json { render json: @timechart.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @recordspltknnt = Recordspltknnt.new(recordspltknnt_params)\n\n respond_to do |format|\n if @recordspltknnt.save\n format.html { redirect_to @recordspltknnt, notice: 'Recordspltknnt was successfully created.' }\n format.json { render :show, status: :created, location: @recordspltknnt }\n else\n format.html { render :new }\n format.json { render json: @recordspltknnt.errors, status: :unprocessable_entity }\n end\n end\n end", "def recordspltknnt_params\n params.require(:recordspltknnt).permit(:ticket_id, :n1, :n2, :siglas, :monto)\n end", "def create\n @p_time = PTime.new(p_time_params)\n\n respond_to do |format|\n if @p_time.save\n format.html { redirect_to @p_time, notice: 'P time was successfully created.' }\n format.json { render :show, status: :created, location: @p_time }\n else\n format.html { render :new }\n format.json { render json: @p_time.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @service_booking = ServiceBooking.new(service_booking_params)\n @control = BookingTimeControl.book_time_control_method(params)\n \n if @control == true\n if @service_booking.save\n render json: @service_booking, status: :created, serializer: Website::V1::ServiceBookingSerializer\n # Notification\n @service_booking.sevice_booking_notification(I18n.t('Notification.service_booking'), I18n.t('Email.service_booking_dealer'), I18n.t('Email.service_booking_user'), params)\n else\n render json: @service_booking.errors, status: :unprocessable_entity\n end\n else\n render json: @control\n end \n end", "def create\n @tccapi = Tccapi.new(tccapi_params)\n\n respond_to do |format|\n if @tccapi.save\n format.html { redirect_to @tccapi, notice: 'Tccapi was successfully created.' }\n format.json { render :show, status: :created, location: @tccapi }\n else\n format.html { render :new }\n format.json { render json: @tccapi.errors, status: :unprocessable_entity }\n end\n end\n end", "def sub_gtp_params\n params.require(:sub_gtp).permit(:name, :start_date, :end_date, :gtp_planner_id, :description)\n end", "def create\n @pinit = Pinit.new(params[:pinit])\n\n respond_to do |format|\n if @pinit.save\n format.html { redirect_to @pinit, notice: 'Pinit was successfully created.' }\n format.json { render json: @pinit, status: :created, location: @pinit }\n else\n format.html { render action: \"new\" }\n format.json { render json: @pinit.errors, status: :unprocessable_entity }\n end\n end\n end", "def pds_button_params\n params.require(model.to_s.underscore).permit! # permit(:IC, :sys, :Project, :range, :Fixed, :t)\n end", "def t403_params\n params.require(:t403).permit(:awon_station_id, :date, :time, :HToPcpn, :HAvSol, :HAvTAir, :HAvRHum, :HAvTS05, :HAvTS10, :HAvTS50, :HPkWind, :HAvWind, :HRsWind, :HRsDir, :HDvDir, :HAvPAR, :HMxWnd1, :HAvTDew)\n end", "def recordpnytt_params\n params.require(:recordpnytt).permit(:ticket_id, :n1, :n2, :siglas, :monto)\n end", "def tick_params\n params.require(:tick).permit([:common_name, :scientific_name, :host_species, :common_parasites, :pathogenic_effect, :morphology, :description, :control_measures, :latitude, :longtitude, {tick_image: []}])\n end", "def create\n @data_ukt = DataUkt.new(data_ukt_params)\n\n respond_to do |format|\n if @data_ukt.save\n format.html { redirect_to @data_ukt, notice: 'Data ukt was successfully created.' }\n format.json { render :show, status: :created, location: @data_ukt }\n else\n format.html { render :new }\n format.json { render json: @data_ukt.errors, status: :unprocessable_entity }\n end\n end\n end", "def post\n Typhoeus.post(@url,\n body: @results_hash.to_json,\n headers: { 'Content-Type' => 'application/json' })\n end", "def create\n @punch_clock = PunchClock.new(punch_clock_params)\n\n respond_to do |format|\n if @punch_clock.save\n format.html { redirect_to @punch_clock, notice: t('punch_clocks.created_ok')}\n format.json { render :show, status: :created, location: @punch_clock }\n else\n format.html { render :new }\n format.json { render json: @punch_clock.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_ptpktp\n @ptpktp = Ptpktp.find(params[:id])\n end", "def srg_control_params\n params.require(:srg_control).permit(:id, :srg_id, :profile_id, :controlId, :severity, :title, :description, :ruleID, :fixid, :fixtext, :checkid, :checktext)\n end", "def create\n @time_point = TimePoint.new(params[:time_point])\n\n respond_to do |format|\n if @time_point.save\n format.html { redirect_to @time_point, notice: 'Time point was successfully created.' }\n format.json { render json: @time_point, status: :created, location: @time_point }\n else\n format.html { render action: \"new\" }\n format.json { render json: @time_point.errors, status: :unprocessable_entity }\n end\n end\n end", "def recordtltkt_params\n params.require(:recordtltkt).permit(:ticket_id, :n1, :n2, :n3, :siglas, :monto, :seleccionada)\n end", "def create\n @pt_record = PtRecord.new(pt_record_params)\n\n respond_to do |format|\n if @pt_record.save\n format.html { redirect_to @pt_record, notice: 'Pt record was successfully created.' }\n format.json { render :show, status: :created, location: @pt_record }\n else\n format.html { render :new }\n format.json { render json: @pt_record.errors, status: :unprocessable_entity }\n end\n end\n end", "def train_tracker_params\n params.permit(:mapid, :stpid, :max, :rt)\n end", "def create\n @taskk = Taskk.new(taskk_params)\n\n respond_to do |format|\n if @taskk.save\n format.html { redirect_to @taskk, notice: 'Taskk was successfully created.' }\n format.json { render :show, status: :created, location: @taskk }\n else\n format.html { render :new }\n format.json { render json: @taskk.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @gppt = Gppt.new(gppt_params)\n\n respond_to do |format|\n if @gppt.save\n format.html { redirect_to @gppt, notice: 'Gppt was successfully created.' }\n format.json { render :show, status: :created, location: @gppt }\n else\n format.html { render :new }\n format.json { render json: @gppt.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_ntp_service_action_start_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: NsxComponentAdministrationApi.create_ntp_service_action_start ...\"\n end\n # resource path\n local_var_path = \"/node/services/ntp?action=start\"\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(: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 => 'NodeServiceStatusProperties')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: NsxComponentAdministrationApi#create_ntp_service_action_start\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n @txdotlight = Txdotlight.new(txdotlight_params)\n\n respond_to do |format|\n if @txdotlight.save\n format.html { redirect_to @txdotlight, notice: 'TX-DOT Light Call-Out was successfully created.' }\n format.json { render :show, status: :created, location: @txdotlight }\n else\n format.html { render :new }\n format.json { render json: @txdotlight.errors, status: :unprocessable_entity }\n end\n end\n end", "def post operation, data={}\n body = case data\n when String\n body = data\n else\n Yajl::Encoder.encode(data)\n end\n\n request = new_request operation, body\n request.sign sts\n hydra.queue request\n hydra.run\n response = request.response\n puts response.inspect if @debug\n\n if response.code == 200\n Yajl::Parser.parse response.body\n else\n raise_error response\n end\n end", "def create\n @tick = Tick.new(tick_params)\n\n respond_to do |format|\n if @tick.save\n format.html { redirect_to @tick, notice: 'Tick was successfully created.' }\n format.json { render :show, status: :created, location: @tick }\n else\n format.html { render :new }\n format.json { render json: @tick.errors, status: :unprocessable_entity }\n end\n end\n end", "def touch\n @service.context.post(@control_path, :action => 'touch')\n self\n end", "def update\n respond_to do |format|\n if @ptpktp.update(ptpktp_params)\n format.html { redirect_to ptpktps_path, notice: 'Запись успешно обновлена.' }\n format.json { render :show, status: :ok, location: ptpktps_path }\n else\n format.html { render :edit }\n format.json { render json: @ptpktp.errors, status: :unprocessable_entity }\n end\n end\n end", "def submit_form_2122\n validate_json_schema\n\n power_of_attorney = ClaimsApi::PowerOfAttorney.find_using_identifier_and_source(header_md5: header_md5,\n source_name: source_name)\n unless power_of_attorney&.status&.in?(%w[submitted pending])\n power_of_attorney = ClaimsApi::PowerOfAttorney.create(\n status: ClaimsApi::PowerOfAttorney::PENDING,\n auth_headers: auth_headers,\n form_data: form_attributes,\n source_data: source_data,\n header_md5: header_md5\n )\n\n unless power_of_attorney.persisted?\n power_of_attorney = ClaimsApi::PowerOfAttorney.find_by(md5: power_of_attorney.md5)\n end\n\n power_of_attorney.save!\n end\n\n ClaimsApi::PoaUpdater.perform_async(power_of_attorney.id)\n\n render json: power_of_attorney, serializer: ClaimsApi::PowerOfAttorneySerializer\n end", "def iot_datum_params\n params.require(:iot_datum).permit(:workbench_number, :part_number, :target, :lot_size, :employee_name, :employee_id, :shift, :device_id, :count, :status)\n end", "def index\n @tp_parameters = TpParameter.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tp_parameters }\n end\n end", "def create\n @tipos_encuestum = TiposEncuestum.new(tipos_encuestum_params)\n\n respond_to do |format|\n if @tipos_encuestum.save\n format.html { redirect_to @tipos_encuestum, notice: 'Tipos encuestum was successfully created.' }\n format.json { render :show, status: :created, location: @tipos_encuestum }\n else\n format.html { render :new }\n format.json { render json: @tipos_encuestum.errors, status: :unprocessable_entity }\n end\n end\n end", "def control_loop_params\n params.require(:control_loop).permit(:name, :mode, :reference,\n :parameters, :next_run,\n :sampling_rate, :sensor_id,\n :actuator_id)\n end", "def create\n @pit_form = PitForm.new(pit_form_params)\n\n respond_to do |format|\n if @pit_form.save\n format.html { redirect_to @pit_form, notice: 'Pit form was successfully created.' }\n format.json { render :show, status: :created, location: @pit_form }\n else\n format.html { render :new }\n format.json { render json: @pit_form.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @tb_period = TbPeriod.new(params[:tb_period])\n\n respond_to do |format|\n if @tb_period.save\n format.html { redirect_to @tb_period, notice: 'Tb period was successfully created.' }\n format.json { render json: @tb_period, status: :created, location: @tb_period }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tb_period.errors, status: :unprocessable_entity }\n end\n end\n end", "def project_controls_params\n params.require('project_control').permit(:title, :justification, :applicability, :description, :impact, :code, :control_id, :sl_ref, :sl_line, :srg_title_id, :nist_families, :checktext, :fixtext, :parent_id)\n end", "def create\n @tipp = Tipp.new(params[:tipp])\n @tipp.user_id||= current_user.id\n @tipp.errors.add(:base, 'Bei einem KO Spiel kann nicht auf unentschieden getippt werden!') if @tipp.spiel.ko && @tipp.team_a_result == @tipp.team_b_result\n\n respond_to do |format|\n if ! @tipp.too_late? && @tipp.errors.empty? && @tipp.save\n format.html { redirect_to @tipp.spiel, notice: 'Tipp was successfully created.' }\n format.json { render json: @tipp, status: :created, location: @tipp }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tipp.errors, status: :unprocessable_entity }\n end\n end\n end", "def contiene_plato_params\n params.require(:contiene_plato).permit(:order_id, :plt_id)\n end", "def create\n @rescue_time_chart = RescueTimeChart.new(rescue_time_chart_params)\n\n respond_to do |format|\n if @rescue_time_chart.save\n format.html { redirect_to @rescue_time_chart, notice: 'Rescue time chart was successfully created.' }\n format.json { render action: 'show', status: :created, location: @rescue_time_chart }\n else\n format.html { render action: 'new' }\n format.json { render json: @rescue_time_chart.errors, status: :unprocessable_entity }\n end\n end\n end" ]
[ "0.6564666", "0.64664435", "0.62317586", "0.6172066", "0.6170496", "0.6067384", "0.605376", "0.59029263", "0.5852787", "0.5839412", "0.5767802", "0.5723936", "0.5675327", "0.55736446", "0.54343426", "0.5364062", "0.5357854", "0.53383005", "0.53369534", "0.52882266", "0.52844703", "0.52663475", "0.52469474", "0.5231255", "0.5221417", "0.5133482", "0.5126372", "0.51033425", "0.50918347", "0.5068457", "0.5062645", "0.50606906", "0.5048856", "0.5014843", "0.50034904", "0.50034434", "0.5002291", "0.49831644", "0.4974594", "0.4963864", "0.4961242", "0.49539942", "0.49521065", "0.49304706", "0.4918931", "0.4909874", "0.4901974", "0.48850396", "0.4863612", "0.48629177", "0.48611325", "0.4859465", "0.4859132", "0.48563474", "0.48419192", "0.4841516", "0.48324856", "0.48314574", "0.483002", "0.4829204", "0.4826844", "0.48250434", "0.48181888", "0.48149344", "0.4803447", "0.4800803", "0.478675", "0.4786", "0.4775912", "0.47750753", "0.4773684", "0.47725797", "0.4769349", "0.4764464", "0.47466236", "0.47463134", "0.4744457", "0.47420225", "0.47391865", "0.47364545", "0.47312224", "0.4729676", "0.4723076", "0.4722752", "0.47204152", "0.47197184", "0.47118324", "0.47056296", "0.46943608", "0.46936896", "0.469145", "0.4689899", "0.4688103", "0.46876252", "0.46856233", "0.46835795", "0.4681133", "0.4680189", "0.4677522", "0.46775013" ]
0.72422993
0
PATCH/PUT /controlpltkts/1 PATCH/PUT /controlpltkts/1.json
def update respond_to do |format| if @controlpltkt.update(controlpltkt_params) format.html { redirect_to @controlpltkt, notice: 'Controlpltkt was successfully updated.' } format.json { render :show, status: :ok, location: @controlpltkt } else format.html { render :edit } format.json { render json: @controlpltkt.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n respond_to do |format|\n if @controltltkt.update(controltltkt_params)\n format.html { redirect_to @controltltkt, notice: 'Controltltkt was successfully updated.' }\n format.json { render :show, status: :ok, location: @controltltkt }\n else\n format.html { render :edit }\n format.json { render json: @controltltkt.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @controltnytt.update(controltnytt_params)\n format.html { redirect_to @controltnytt, notice: 'Controltnytt was successfully updated.' }\n format.json { render :show, status: :ok, location: @controltnytt }\n else\n format.html { render :edit }\n format.json { render json: @controltnytt.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @tnpsc.update(tnpsc_params)\n format.html { redirect_to @tnpsc, notice: 'Tnpsc was successfully updated.' }\n format.json { render :show, status: :ok, location: @tnpsc }\n else\n format.html { render :edit }\n format.json { render json: @tnpsc.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @time_control.update(time_control_params)\n format.html { redirect_to @time_control, notice: 'Time control was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @time_control.errors, status: :unprocessable_entity }\n end\n end\n end", "def patch\n headers = {\"If-Match\" => @version}\n response = @context.request :patch, \"#{@path}/#{@id}\", @data.to_json, headers\n @version += 1\n response\n # 'X-HTTP-Method-Override' => 'PATCH'\n end", "def patch!\n request! :patch\n end", "def update\n respond_to do |format|\n if @ptpktp.update(ptpktp_params)\n format.html { redirect_to ptpktps_path, notice: 'Запись успешно обновлена.' }\n format.json { render :show, status: :ok, location: ptpktps_path }\n else\n format.html { render :edit }\n format.json { render json: @ptpktp.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @controltgmt.update(controltgmt_params)\n format.html { redirect_to @controltgmt, notice: 'Controltgmt was successfully updated.' }\n format.json { render :show, status: :ok, location: @controltgmt }\n else\n format.html { render :edit }\n format.json { render json: @controltgmt.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_controlpltkt\n @controlpltkt = Controlpltkt.find(params[:id])\n end", "def api_patch(path, data = {})\n api_request(:patch, path, :data => data)\n end", "def update_tenant_circle(args = {}) \n put(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend", "def update\n respond_to do |format|\n if @tssk.update(tssk_params)\n format.html { redirect_to @tssk, notice: 'Tssk was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @tssk.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @controlpreat.update(controlpreat_params)\n format.html { redirect_to @controlpreat, notice: 'Controlpreat was successfully updated.' }\n format.json { render :show, status: :ok, location: @controlpreat }\n else\n format.html { render :edit }\n format.json { render json: @controlpreat.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @admin_kpi_template = Admin::KpiTemplate.find(params[:id])\n\n respond_to do |format|\n if @admin_kpi_template.update_attributes(params[:admin_kpi_template])\n format.html { redirect_to @admin_kpi_template, notice: 'Kpi template was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @admin_kpi_template.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @labtech_timeslip.update(labtech_timeslip_params)\n format.html { redirect_to @labtech_timeslip, notice: 'Labtech timeslip was successfully updated.' }\n format.json { render :show, status: :ok, location: @labtech_timeslip }\n else\n format.html { render :edit }\n format.json { render json: @labtech_timeslip.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @controltleit.update(controltleit_params)\n format.html { redirect_to @controltleit, notice: 'Controltleit was successfully updated.' }\n format.json { render :show, status: :ok, location: @controltleit }\n else\n format.html { render :edit }\n format.json { render json: @controltleit.errors, status: :unprocessable_entity }\n end\n end\n end", "def patch(path, data)\n request 'PATCH', path, body: data.to_json\n end", "def update\n respond_to do |format|\n if @tick.update(tick_params)\n format.html { redirect_to @tick, notice: 'Tick was successfully updated.' }\n format.json { render :show, status: :ok, location: @tick }\n else\n format.html { render :edit }\n format.json { render json: @tick.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @pec_form = PecForm.find(params[:id])\n\n respond_to do |format|\n if @pec_form.update_attributes(params[:pec_form])\n format.html { redirect_to @pec_form, notice: I18n.t('pec_form.notice.update') }\n format.json { head :ok }\n else\n\t\t\t\tgon.edit_pec_form = true\n\t\t\t\tgon.registration_time = @pec_form.registration_time.strftime('%m/%d/%Y %H:%M') if @pec_form.registration_time\n format.html { render action: \"edit\" }\n format.json { render json: @pec_form.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @tccapi.update(tccapi_params)\n format.html { redirect_to @tccapi, notice: 'Tccapi was successfully updated.' }\n format.json { render :show, status: :ok, location: @tccapi }\n else\n format.html { render :edit }\n format.json { render json: @tccapi.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @control.update(control_params)\n format.html { redirect_to [@device,@control], notice: 'Control was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @control.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @task.update(task_params)\n @task.whenever_reset unless task_params[:every].blank? && task_params[:at].blank?\n format.html { redirect_to @task, notice: 'Task was successfully updated.' }\n format.json { render :show, status: :ok, location: @task }\n else\n format.html { render :edit }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @srg_control.update(srg_control_params)\n format.html { redirect_to @srg_control, notice: 'Srg control was successfully updated.' }\n format.json { render :show, status: :ok, location: @srg_control }\n else\n format.html { render :edit }\n format.json { render json: @srg_control.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @control_point = ControlPoint.find(params[:id])\n respond_to do |format|\n if @control_point.update_attributes(params[:control_point])\n format.html { redirect_to(@control_point, :notice => 'Control Point was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @control_point.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @sub_gtp.update(sub_gtp_params)\n format.html { redirect_to @sub_gtp, notice: 'Sub gtp was successfully updated.' }\n format.json { render :show, status: :ok, location: @sub_gtp }\n else\n format.html { render :edit }\n format.json { render json: @sub_gtp.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @otg_crypst.update(otg_crypst_params)\n format.html { redirect_to @otg_crypst, notice: 'Otg crypst was successfully updated.' }\n format.json { render :show, status: :ok, location: @otg_crypst }\n else\n format.html { render :edit }\n format.json { render json: @otg_crypst.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @chest_triceps1.update(chest_triceps1_params)\n format.html { redirect_to \"/chest_triceps1s\" } \n format.json { render :show, status: :ok, location: @chest_triceps1 }\n else\n format.html { render :edit }\n format.json { render json: @chest_triceps1.errors, status: :unprocessable_entity }\n end\n end\n end", "def put!\n request! :put\n end", "def update\n add_breadcrumb 'Update Trouble Ticket'\n\n respond_to do |format|\n if @troubleticket.update(troubleticket_params)\n format.html do\n redirect_to @troubleticket,\n notice: 'Trouble ticket was successfully updated.'\n end\n format.json { render :show, status: :ok, location: @troubleticket }\n else\n format.html { render :edit , status: :unprocessable_entity }\n format.json do\n render json: @troubleticket.errors, status: :unprocessable_entity\n end\n end\n end\n end", "def update\n respond_to do |format|\n if @topping.update(topping_params)\n format.html { redirect_to [:admin, @topping], notice: 'Topping was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @topping.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @zt020.update(zt020_params)\n format.html { redirect_to @zt020, notice: 'Zt020 was successfully updated.' }\n format.json { render :show, status: :ok, location: @zt020 }\n else\n format.html { render :edit }\n format.json { render json: @zt020.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @tktest = Tktest.find(params[:id])\n\n respond_to do |format|\n if @tktest.update_attributes(params[:tktest])\n format.html { redirect_to @tktest, notice: 'Tktest was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tktest.errors, status: :unprocessable_entity }\n end\n end\n end", "def patch options\n rest_request({ method: :patch }.merge(options))\n end", "def patch options\n rest_request({ method: :patch }.merge(options))\n end", "def update\n @control_tower = ControlTower.find(params[:id])\n\n respond_to do |format|\n if @control_tower.update_attributes(params[:control_tower])\n format.html { redirect_to @control_tower, notice: 'Control tower was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @control_tower.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @tip_so = TipSo.find(params[:id])\n\n respond_to do |format|\n if @tip_so.update_attributes(params[:tip_so])\n format.html { redirect_to @tip_so, notice: 'Tip so was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tip_so.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @tapioca.update(tapioca_params)\n format.html { redirect_to @tapioca, notice: 'Tapioca was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @tapioca.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @takipci.update(takipci_params)\n format.html { redirect_to @takipci, notice: 'Takipci was successfully updated.' }\n format.json { render :show, status: :ok, location: @takipci }\n else\n format.html { render :edit }\n format.json { render json: @takipci.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @clinic_timing = ClinicTiming.find(params[:id])\n\n respond_to do |format|\n if @clinic_timing.update_attributes(params[:clinic_timing])\n format.html { redirect_to @clinic_timing, notice: 'Clinic timing was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @clinic_timing.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @tp_parameter = TpParameter.find(params[:id])\n\n respond_to do |format|\n if @tp_parameter.update_attributes(params[:tp_parameter])\n format.html { redirect_to @tp_parameter, notice: 'Tp parameter was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tp_parameter.errors, status: :unprocessable_entity }\n end\n end\n end", "def UpdateTicket params = {}\n \n APICall(path: 'tickets.json',method: 'PUT',payload: params.to_json)\n \n end", "def update\n respond_to do |format|\n if @tips_trick.update_attributes(params[:tips_trick])\n format.html { redirect_to @tips_trick, notice: 'Tips trick was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tips_trick.errors, status: :unprocessable_entity }\n end\n end\n end", "def patch(path, params)\n time(\"PATCH #{path}\") { Cloudflarer.new.patch(path, params) }\n end", "def patch\n end", "def update\n respond_to do |format|\n if @otp.update(otp_params)\n format.html { redirect_to @otp, notice: 'Otp was successfully updated.' }\n format.json { render :show, status: :ok, location: @otp }\n else\n format.html { render :edit }\n format.json { render json: @otp.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n self.unuse_pto_hours\n if @time_off_instance.update(time_off_instance_params)\n self.use_pto_hours\n format.html { redirect_to @time_off_instance, notice: 'Time off instance was successfully updated.' }\n format.json { render :show, status: :ok, location: @time_off_instance }\n else\n format.html { render :edit }\n format.json { render json: @time_off_instance.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @control_loop.update(control_loop_params)\n format.html { redirect_to @control_loop, notice: 'Control loop was successfully updated.' }\n format.json { render :show, status: :ok, location: @control_loop }\n else\n format.html { render :edit }\n format.json { render json: @control_loop.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @taskk.update(taskk_params)\n format.html { redirect_to @taskk, notice: 'Taskk was successfully updated.' }\n format.json { render :show, status: :ok, location: @taskk }\n else\n format.html { render :edit }\n format.json { render json: @taskk.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @time_off_request = TimeOffRequest.find(params[:id])\n respond_to do |format|\n if @time_off_request.update_attributes(params[:time_off_request])\n format.html { redirect_to admin_time_off_requests_url, notice: 'Time off request was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @time_off_request.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @peticion_servicio_ti = Peticion::ServicioTi.find(params[:id])\n\n respond_to do |format|\n if @peticion_servicio_ti.update_attributes(params[:peticion_servicio_ti])\n format.html { redirect_to edit_peticion_servicio_ti_path(@peticion_servicio_ti), notice: 'Actualizado Correctamente.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @peticion_servicio_ti.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @hack_tip.update(hack_tip_params)\n format.html { redirect_to @hack_tip, notice: 'Hack tip was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @hack_tip.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @trip.update(trip_params)\n last_clip(@trip, trip_params[:clips_attributes].present?)\n format.html { redirect_to @trip.parent || @trip, notice: 'Trip was successfully updated.', change: \"list\" }\n format.json { head :no_content }\n else\n format.html { redirect_to @trip.parent || @trip }\n format.json { render json: @trip.errors, status: :unprocessable_entity }\n end\n end\n end", "def update # PATCH\n raise NotImplementedError\n end", "def update\n respond_to do |format|\n if @patch.update(patch_params)\n format.html { redirect_to @patch, notice: 'Patch was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @patch.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @tsp = Tsp.find(params[:id])\n if current_user.role.id == 7\n params[:tsp][:status] = 6\n end\n respond_to do |format|\n if @tsp.update_attributes(params[:tsp])\n format.html { redirect_to@tsp, notice: 'Tsp was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json:@tsp.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @kv = Kv.find(params[:id])\n\n respond_to do |format|\n if @kv.update_attributes(params[:kv])\n format.html { redirect_to @kv, notice: 'Kv was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @kv.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @tso = Tso.find(params[:id])\n\n respond_to do |format|\n if @tso.update_attributes(params[:tso])\n flash[:notice] = 'Tso was successfully updated.'\n format.html { redirect_to(@tso) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @tso.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @punch_clock.update(punch_clock_params)\n format.html { redirect_to @punch_clock, notice: t('punch_clocks.updated_ok') }\n format.js { head :no_content }\n format.json { render :show, status: :ok, location: @punch_clock }\n else\n format.html { render :edit }\n format.json { render json: @punch_clock.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n add_breadcrumb 'Edit Ticketnotes'\n\n respond_to do |format|\n if @ticketnote.update(ticketnote_params)\n format.html do\n redirect_to @ticketnote,\n notice: 'Ticket note was successfully updated.'\n end\n format.json { render :show, status: :ok, location: @ticketnote }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json do\n render json: @ticketnote.errors, status: :unprocessable_entity\n end\n end\n end\n end", "def update\n respond_to do |format|\n if @opt10080.update(opt10080_params)\n format.html { redirect_to @opt10080, notice: 'Opt10080 was successfully updated.' }\n format.json { render :show, status: :ok, location: @opt10080 }\n else\n format.html { render :edit }\n format.json { render json: @opt10080.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @timeslot.update(timeslot_params)\n format.html { redirect_to @timeslot, notice: 'Timeslot was successfully updated.' }\n format.json { render :show, status: :ok, location: @timeslot }\n else\n format.html { render :edit }\n format.json { render json: @timeslot.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @trac.update(trac_params)\n format.html { redirect_to @trac, notice: 'Trac was successfully updated.' }\n format.json { render :show, status: :ok, location: @trac }\n else\n format.html { render :edit }\n format.json { render json: @trac.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @controlqreat.update(controlqreat_params)\n format.html { redirect_to @controlqreat, notice: 'Controlqreat was successfully updated.' }\n format.json { render :show, status: :ok, location: @controlqreat }\n else\n format.html { render :edit }\n format.json { render json: @controlqreat.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @pit_form.update(pit_form_params)\n format.html { redirect_to @pit_form, notice: 'Pit form was successfully updated.' }\n format.json { render :show, status: :ok, location: @pit_form }\n else\n format.html { render :edit }\n format.json { render json: @pit_form.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_tenant_maintenance_window(args = {}) \n id = args['id']\n temp_path = \"/tenants.json/maintenance/{tenantId}\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"tenantId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend", "def update\n respond_to do |format|\n if @genericcallout.update(genericcallout_params)\n format.html { redirect_to @genericcallout, notice: 'Generic Call-Out was successfully updated.' }\n format.json { render :show, status: :ok, location: @genericcallout }\n else\n format.html { render :edit }\n format.json { render json: @genericcallout.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @cpt.update(cpt_params)\n format.html { redirect_to @cpt, notice: 'Cpt was successfully updated.' }\n format.json { render :show, status: :ok, location: @cpt }\n else\n format.html { render :edit }\n format.json { render json: @cpt.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @voprosy = Voprosy.find(params[:id])\n\n respond_to do |format|\n if @voprosy.update_attributes(params[:voprosy])\n format.html { redirect_to @voprosy, notice: 'Voprosy was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @voprosy.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @controlpleit.update(controlpleit_params)\n format.html { redirect_to @controlpleit, notice: 'Controlpleit was successfully updated.' }\n format.json { render :show, status: :ok, location: @controlpleit }\n else\n format.html { render :edit }\n format.json { render json: @controlpleit.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n render_json_auto @survey.update_logic_control_rule(params[:id].to_i, params[:logic]) and return\n end", "def update\n @koti = Koti.find(params[:id])\n\n respond_to do |format|\n if @koti.update_attributes(params[:koti])\n format.html { redirect_to @koti, notice: 'Koti was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @koti.errors, status: :unprocessable_entity }\n end\n end\n end", "def patch_kubernetes_version_with_http_info(moid, kubernetes_version, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: KubernetesApi.patch_kubernetes_version ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling KubernetesApi.patch_kubernetes_version\"\n end\n # verify the required parameter 'kubernetes_version' is set\n if @api_client.config.client_side_validation && kubernetes_version.nil?\n fail ArgumentError, \"Missing the required parameter 'kubernetes_version' when calling KubernetesApi.patch_kubernetes_version\"\n end\n # resource path\n local_var_path = '/api/v1/kubernetes/Versions/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(kubernetes_version)\n\n # return_type\n return_type = opts[:debug_return_type] || 'KubernetesVersion'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"KubernetesApi.patch_kubernetes_version\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: KubernetesApi#patch_kubernetes_version\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def update\n @plato = Plato.find(params[:id])\n\n if @plato.update(plato_params)\n head :no_content\n else\n render json: @plato.errors, status: :unprocessable_entity\n end\n end", "def update\n @service_time = ServiceTime.find(params[:id])\n\n respond_to do |format|\n if @service_time.update_attributes(params[:service_time])\n format.html { redirect_to @service_time, notice: 'Service time was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @service_time.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @tap.update(tap_params)\n format.html { redirect_to taps_path, notice: 'Tap was successfully updated.' }\n format.json { head :no_content }\n else\n format.json { render json: @tap.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @zt010.update(zt010_params)\n format.html { redirect_to @zt010, notice: 'Zt010 was successfully updated.' }\n format.json { render :show, status: :ok, location: @zt010 }\n else\n format.html { render :edit }\n format.json { render json: @zt010.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @cto.update(cto_params)\n format.html { redirect_to @cto, notice: 'Cto was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @cto.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @microfinance_service_provider_typology.update(microfinance_service_provider_typology_params)\n format.html { redirect_to @microfinance_service_provider_typology, notice: 'Microfinance service provider typology was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @microfinance_service_provider_typology.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n authorize! :update, @profile\n respond_to do |format|\n begin\n @control.parse_update(control_params)\n @control.save\n format.html { redirect_to profile_control_url(@profile, @control), notice: 'Control was successfully updated.' }\n format.json { render :show, status: :ok, location: @control }\n rescue Mongoid::Errors::InvalidValue\n format.html { render :edit }\n format.json { render json: @control.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @traceroute.update(traceroute_params)\n format.html { redirect_to @traceroute, notice: 'Traceroute was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @traceroute.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @traceroute.update(traceroute_params)\n format.html { redirect_to @traceroute, notice: 'Traceroute was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @traceroute.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @troop = Troop.find(params[:id])\n\n respond_to do |format|\n if @troop.update_attributes(params[:troop])\n format.html { redirect_to @troop, notice: 'Troop was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @troop.errors, status: :unprocessable_entity }\n end\n end\n end", "def patch(path, data, params = {}, request_options = {})\n request(:patch, path, data, params)\n end", "def update\n\n if @teetime.update(teetime_params)\n\n render json: @teetime,status: :ok\n\n else\n\n render json: {error: true,errors: @teetime.errors},status: :unprocessable_entity\n\n end\n\n \t\tend", "def update\n respond_to do |format|\n if @socio_spc.update(socio_spc_params)\n format.html { redirect_to @socio_spc, notice: 'Socio spc was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @socio_spc.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n authorize! :manage, @vspec\n\n respond_to do |format|\n if @vspec.update(vspec_params)\n format.html { redirect_to [@vspec.metric, @vspec], notice: 'Vspec was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @vspec.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @opt10059.update(opt10059_params)\n format.html { redirect_to @opt10059, notice: 'Opt10059 was successfully updated.' }\n format.json { render :show, status: :ok, location: @opt10059 }\n else\n format.html { render :edit }\n format.json { render json: @opt10059.errors, status: :unprocessable_entity }\n end\n end\n end", "def patch(path, params = {})\n request(:patch, path, params)\n end", "def patch(path, params = {})\n request(:patch, path, params)\n end", "def update\n respond_to do |format|\n if @version_control.update(version_control_params)\n format.html { redirect_to @version_control, notice: 'Version control was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @version_control.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @tipp = Tipp.find(params[:id])\n deny_access!('Zugriff verweigert! Es ist verboten die Tipps anderer Spieler zu manipulieren!') if ! current_user.id == @tipp.user_id and ! current_user.is_superuser?\n @tipp.errors.add(:base, 'Bei einem KO Spiel kann nicht auf unentschieden getippt werden!') if @tipp.spiel.ko && @tipp.team_a_result == @tipp.team_b_result\n # deny_access! unless current_user.id == @tipp.user_id and ! current_user.is_superuser?\n \n respond_to do |format|\n if ! @tipp.too_late? && @tipp.errors.empty? && @tipp.update_attributes(params[:tipp])\n format.html { redirect_to @tipp.spiel, notice: 'Tipp was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tipp.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @microplst = Microplst.find(params[:id])\n\n respond_to do |format|\n if @microplst.update_attributes(params[:microplst])\n format.html { redirect_to @microplst, notice: 'Microplst was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @microplst.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @microtask = Microtask.find(params[:id])\n\n respond_to do |format|\n if @microtask.update_attributes(params[:microtask])\n format.html { redirect_to @microtask, notice: 'Microtask was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @microtask.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @platoon.update(platoon_params)\n format.html { redirect_to @platoon, notice: 'Platoon was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @platoon.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @admin_kpi_category_template = Admin::KpiCategoryTemplate.find(params[:id])\n\n respond_to do |format|\n if @admin_kpi_category_template.update_attributes(params[:admin_kpi_category_template])\n format.html { redirect_to @admin_kpi_category_template, notice: 'Kpi category template was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @admin_kpi_category_template.errors, status: :unprocessable_entity }\n end\n end\n end", "def patch(path, **args); end", "def update_current_tenant_maintenance_window(args = {}) \n id = args['id']\n temp_path = \"/tenants.json/maintenance\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"tenantId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend", "def update\n respond_to do |format|\n if @spi.update(spi_params)\n format.html { redirect_to @spi, notice: 'Spi was successfully updated.' }\n format.json { render :show, status: :ok, location: @spi }\n else\n format.html { render :edit }\n format.json { render json: @spi.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @troll.update(troll_params)\n format.html { redirect_to dev_troll_path(@dev, @troll), notice: 'Troll was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @troll.errors, status: :unprocessable_entity }\n end\n end\n end", "def patch_kubernetes_sys_config_policy_with_http_info(moid, kubernetes_sys_config_policy, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: KubernetesApi.patch_kubernetes_sys_config_policy ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling KubernetesApi.patch_kubernetes_sys_config_policy\"\n end\n # verify the required parameter 'kubernetes_sys_config_policy' is set\n if @api_client.config.client_side_validation && kubernetes_sys_config_policy.nil?\n fail ArgumentError, \"Missing the required parameter 'kubernetes_sys_config_policy' when calling KubernetesApi.patch_kubernetes_sys_config_policy\"\n end\n # resource path\n local_var_path = '/api/v1/kubernetes/SysConfigPolicies/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(kubernetes_sys_config_policy)\n\n # return_type\n return_type = opts[:debug_return_type] || 'KubernetesSysConfigPolicy'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"KubernetesApi.patch_kubernetes_sys_config_policy\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: KubernetesApi#patch_kubernetes_sys_config_policy\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end" ]
[ "0.6532852", "0.6509571", "0.6395982", "0.6198386", "0.61478835", "0.613765", "0.6071614", "0.60679764", "0.6034653", "0.59630775", "0.59617704", "0.5924026", "0.58550006", "0.58530194", "0.5848847", "0.5816572", "0.58021027", "0.579757", "0.57883656", "0.5745402", "0.5745032", "0.57354504", "0.5703905", "0.5700275", "0.5686479", "0.56838286", "0.5683073", "0.567935", "0.5674415", "0.5667611", "0.5663545", "0.5644975", "0.5630126", "0.5630126", "0.56278825", "0.5613599", "0.56126463", "0.5606687", "0.56044763", "0.55967593", "0.5587585", "0.55813366", "0.55767715", "0.5572675", "0.55670744", "0.5565193", "0.5558779", "0.55581105", "0.55496347", "0.5547784", "0.55464077", "0.5543502", "0.5537213", "0.552922", "0.55290765", "0.5528695", "0.55068856", "0.5506117", "0.55048275", "0.5501198", "0.5500743", "0.5494974", "0.54936355", "0.5492379", "0.5492187", "0.54913473", "0.5491142", "0.5490889", "0.54905856", "0.5490014", "0.5488417", "0.5485263", "0.5482531", "0.54817903", "0.5481291", "0.54805124", "0.54758424", "0.54753494", "0.54733175", "0.54717696", "0.54714483", "0.54704803", "0.5469967", "0.54685396", "0.54682004", "0.54659814", "0.5464176", "0.54613763", "0.54613763", "0.5460445", "0.54573023", "0.54557407", "0.54555655", "0.5453943", "0.5453911", "0.545263", "0.54512393", "0.5449207", "0.54425156", "0.5439658" ]
0.7192734
0
DELETE /controlpltkts/1 DELETE /controlpltkts/1.json
def destroy @controlpltkt.destroy respond_to do |format| format.html { redirect_to controlpltkts_url, notice: 'Controlpltkt was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @controltltkt.destroy\n respond_to do |format|\n format.html { redirect_to controltltkts_url, notice: 'Controltltkt was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend", "def destroy\n @controltnytt.destroy\n respond_to do |format|\n format.html { redirect_to controltnytts_url, notice: 'Controltnytt was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def test_del\n header 'Content-Type', 'application/json'\n\n data = File.read 'sample-traces/0.json'\n post('/traces', data, 'CONTENT_TYPE': 'application/json')\n\n id = last_response.body\n\n delete \"/traces/#{id}\"\n assert last_response.ok?\n\n get \"/traces/#{id}\"\n\n contents = JSON.parse last_response.body\n assert_kind_of(Hash, contents, 'Response contents is not a hash')\n assert contents.key? 'description'\n assert(!last_response.ok?)\n end", "def destroy\n @tssk.destroy\n respond_to do |format|\n format.html { redirect_to tssks_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @treq = Treq.find(params[:id])\n @treq.destroy\n\n respond_to do |format|\n format.html { redirect_to treqs_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @tnpsc.destroy\n respond_to do |format|\n format.html { redirect_to tnpscs_url, notice: 'Tnpsc was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete_course_template(org_unit_id)\n path = \"/d2l/api/lp/#{$lp_ver}/coursetemplates/#{org_unit_id}\"\n _delete(path)\n puts '[+] Course template data deleted successfully'.green\nend", "def destroy\n @controltgmt.destroy\n respond_to do |format|\n format.html { redirect_to controltgmts_url, notice: 'Controltgmt was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @tsp = Tsp.find(params[:id])\n @tsp.destroy\n\n respond_to do |format|\n format.html { redirect_to tsps_url }\n format.json { head :ok }\n end\n end", "def delete\n client.delete(\"/#{id}\")\n end", "def destroy\n @time_control.destroy\n respond_to do |format|\n format.html { redirect_to time_controls_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @htscdt.destroy\n respond_to do |format|\n format.html { redirect_to htscdts_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @tktest = Tktest.find(params[:id])\n @tktest.destroy\n\n respond_to do |format|\n format.html { redirect_to tktests_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @tccapi.destroy\n respond_to do |format|\n format.html { redirect_to tccapis_url, notice: 'Tccapi was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @kv = Kv.find(params[:id])\n @kv.destroy\n\n respond_to do |format|\n format.html { redirect_to kvs_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @otg_crypst.destroy\n respond_to do |format|\n format.html { redirect_to otg_crypsts_url, notice: 'Otg crypst was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @kv.destroy\n respond_to do |format|\n format.html { redirect_to kvs_url, notice: 'Kv was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @sub_gtp.destroy\n respond_to do |format|\n format.html { redirect_to sub_gtps_url, notice: 'Sub gtp was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @vpn = Vpn.find(params[:id])\n checkaccountobject(\"vpns\",@vpn)\n @vpn.send_delete\n\n respond_to do |format|\n format.html { redirect_to vpns_url }\n format.json { head :ok }\n end\n end", "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "def destroy\n @needed_control.destroy\n respond_to do |format|\n format.html { redirect_to needed_controls_url, notice: 'Needed control was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete\n res = HTTParty.get URL, headers: HEADERS\n message = JSON.parse res.body, symbolize_names: true\n if res.code == 200\n numSubs = message[:data].count\n if numSubs > 0\n message[:data].each do |sub|\n id = sub[:id]\n delRes = HTTParty.delete \"#{URL}/#{id}\", headers: HEADERS\n #TODO handle status codes\n end\n end\n end\n end", "def destroy\n @cto.destroy\n respond_to do |format|\n format.html { redirect_to ctos_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @zt020.destroy\n respond_to do |format|\n format.html { redirect_to zt020s_url, notice: 'Zt020 was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @admin_kpi_template = Admin::KpiTemplate.find(params[:id])\n @admin_kpi_template.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_kpi_templates_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @control.destroy\n respond_to do |format|\n format.html { redirect_to device_controls_url(@device) }\n format.json { head :no_content }\n end\n end", "def destroy\n @xsbg_tt_datum = XsbgTtDatum.find(params[:id])\n @xsbg_tt_datum.destroy\n\n respond_to do |format|\n format.html { redirect_to xsbg_tt_data_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @pdk.destroy\n respond_to do |format|\n format.html { redirect_to pdks_url }\n format.json { head :no_content }\n end\n end", "def delete\n super \"/templates/#{template_id}.json\", {}\n end", "def delete\n svc = Service.find_by_label(params[:label])\n raise CloudError.new(CloudError::SERVICE_NOT_FOUND) unless svc\n raise CloudError.new(CloudError::FORBIDDEN) unless svc.verify_auth_token(@service_auth_token)\n\n svc.destroy\n\n render :json => {}\n end", "def destroy\n @backfire_control = BackfireControl.find(params[:id])\n @backfire_control.destroy\n \n respond_to do |format|\n format.html { redirect_to backfire_controls_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @controltleit.destroy\n respond_to do |format|\n format.html { redirect_to controltleits_url, notice: 'Controltleit was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @controlpreat.destroy\n respond_to do |format|\n format.html { redirect_to controlpreats_url, notice: 'Controlpreat was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n debug(\"#{self.class}::destroy\")\n\n #Retrieval of key\n if ((defined? $key) && !(($key.nil?) || ($key.empty?)))\n Puppet.debug('INFO: key already provided as a command parameter ' + $key)\n\n elsif (!($name.to_s.empty?) )\n\n #Retrieve key\n uriAttributeMap1 = {}\n uriAttributeMap1[:name] = $name\n resourceType = \"storage-service-levels\"\n $key = self.retrieveKeyOfObjectType('/api/1.0/slo/storage-service-levels', resourceType, uriAttributeMap1)\n\n end\n\n\n apiUri = '/api/1.0/slo/storage-service-levels/'+$key\n resourceType = \"storageservicelevel\"\n\n if(transport.http_delete_request(apiUri ,resourceType))\n if(resource[:name] != null)\n puts \"#{resourceType} : #{resource[:name]} successfully deleted\"\n\t\t\telse\n\t\t\t puts \" #{resourceType} successfully deleted\"\n\t\t\tend\n else\n if(resource[:name] != null)\n puts \" #{resourceType} : #{resource[:name]} deletion failed\"\n\t\t else\n\t\t\t puts \" #{resourceType} deletion failed\"\n\t\t end\n end\n\nend", "def delete!( opts = {} )\n http_action :delete, nil, opts\n end", "def destroy\n @chest_triceps1.destroy\n respond_to do |format|\n format.html { redirect_to chest_triceps1s_url, notice: 'Chest/Triceps 1 was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete_aos_version(args = {}) \n delete(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend", "def destroy\n @ptpktp.destroy\n respond_to do |format|\n format.html { redirect_to ptpktps_url, notice: 'Запись успешно удалена.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @controlpleit.destroy\n respond_to do |format|\n format.html { redirect_to controlpleits_url, notice: 'Controlpleit was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete\n request(:delete)\n end", "def destroy\n @srg_control.destroy\n respond_to do |format|\n format.html { redirect_to srg_controls_url, notice: 'Srg control was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete\n client.delete(url)\n @deleted = true\nend", "def delete_suggested_course_pathway\n suggested_pathway = SuggestedPathway.find_by_id(params[:pathway_id])\n suggested_pathway.destroy\n render json: suggested_pathway\n end", "def delete\n start { |connection| connection.request http :Delete }\n end", "def destroy\n @pkhd.destroy\n respond_to do |format|\n format.html { redirect_to pkhds_url, notice: 'Pkhd was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n authorize! :manage, @vspec\n metric = @vspec.metric\n @vspec.destroy\n respond_to do |format|\n format.html { redirect_to [metric.service, metric] }\n format.json { head :no_content }\n end\n end", "def destroy\n puts @iot_datum.count\n if @iot_datum.count > 0\n @deleted_rec = IotDatum.new\n @deleted_rec.workbench_number = @iot_datum.workbench_number\n @deleted_rec.part_number = @iot_datum.part_number\n @deleted_rec.target = @iot_datum.target\n @deleted_rec.lot_size = @iot_datum.lot_size\n @deleted_rec.employee_name = @iot_datum.employee_name\n @deleted_rec.shift = @iot_datum.shift\n @deleted_rec.device_id = @iot_datum.device_id\n @deleted_rec.count = @iot_datum.count\n @deleted_rec.status = 'Deleted'\n @deleted_rec.save!\n @iot_datum.destroy\n else\n @iot_datum.destroy\n end\n respond_to do |format|\n format.html { redirect_to iot_data_url, notice: 'Planner was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n render_json_auto @survey.delete_logic_control_rule(params[:id].to_i) and return\n end", "def destroy\n @controlqreat.destroy\n respond_to do |format|\n format.html { redirect_to controlqreats_url, notice: 'Controlqreat was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @cephalopod.destroy\n respond_to do |format|\n format.html { redirect_to cephalopods_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @clinic_timing = ClinicTiming.find(params[:id])\n @clinic_timing.destroy\n\n respond_to do |format|\n format.html { redirect_to clinic_timings_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @testpat.destroy\n respond_to do |format|\n format.html { redirect_to testpats_url }\n format.json { head :no_content }\n end\n end", "def delete(name)\n raise('wrong type: String required') unless name.is_a?(String)\n raise('wrong value: name must be valid') unless !name.nil? && !name.empty?\n\n @client.post({\n 'action' => 'del',\n 'object' => 'htpl',\n 'values' => name,\n }.to_json)\n end", "def destroy\n @server = Server.find(params[:id])\n checkaccountobject(\"servers\",@server)\n @server.send_delete\n respond_to do |format|\n format.html { redirect_to servers_url }\n format.json { head :ok }\n end\n end", "def delete_json(path)\n url = [base_url, path].join\n resp = HTTParty.delete(url, headers: standard_headers)\n parse_json(url, resp)\n end", "def destroy\n @ct.destroy\n respond_to do |format|\n format.html { redirect_to cts_url, notice: 'Ct was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @controldepagogt.destroy\n respond_to do |format|\n format.html { redirect_to controldepagogts_url, notice: 'Controldepagogt was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @recreation_service_typology.destroy\n respond_to do |format|\n format.html { redirect_to recreation_service_typologies_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @t = T.find(params[:id])\n @t.destroy\n\n respond_to do |format|\n format.html { redirect_to ts_url }\n format.json { head :no_content }\n end\n end", "def delete path\n make_request(path, \"delete\", {})\n end", "def destroy\n dns_entry_response = RestClient.delete('https://api.cloudflare.com/client/v4/zones/:zone_identifier/dns_records/:identifier',:content_type => :json, :accept => :json, :'x-auth-key' => session[:key] :'x-auth-email' => session[:email])\n @dns_entry.destroy\n respond_to do |format|\n format.html { redirect_to dns_entries_url, notice: \"Dns entry was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def destroy\n @patchcord.destroy\n respond_to do |format|\n format.html { redirect_to patchcords_url, notice: 'Patchcord was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n return if new_record?\n \n @api.delete \"/items/#{shortcode_url}.json\"\n end", "def destroy\n onesecgroup('delete', resource[:name])\n @property_hash.clear\n end", "def cmd_delete argv\n setup argv\n uuid = @hash['uuid']\n response = @api.delete(uuid)\n msg response\n return response\n end", "def destroy\n @htc.destroy\n respond_to do |format|\n format.html { redirect_to htcs_url }\n format.json { head :no_content }\n end\n end", "def delete(path)\n RestClient.delete request_base+path\n end", "def destroy\n @version_control.destroy\n respond_to do |format|\n format.html { redirect_to version_controls_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @subway.destroy\n respond_to do |format|\n format.html { redirect_to subways_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @dtpic = Dtpic.find(params[:id])\n @dtpic.destroy\n\n respond_to do |format|\n format.html { redirect_to dtpics_url }\n format.json { head :no_content }\n end\n end", "def delete\n api(\"Delete\")\n end", "def destroy\n @tick.destroy\n respond_to do |format|\n format.html { redirect_to ticks_url, notice: 'Tick was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @tc_detail_step = TcDetailStep.find(params[:id])\n @tc_detail_step.destroy\n\n respond_to do |format|\n format.html { redirect_to tc_detail_steps_url }\n format.json { head :no_content }\n end\n end", "def delete(options={})\n DNSimple::Client.delete \"templates/#{id}\", options\n end", "def destroy\n @secubat_client = SecubatClient.find(params[:id])\n @secubat_client.destroy\n\n respond_to do |format|\n format.html { redirect_to secubat_clients_url }\n format.json { head :ok }\n end\n end", "def destroy\n @tapioca.destroy\n respond_to do |format|\n format.html { redirect_to tapiocas_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @nagios_service_escalation_template = NagiosServiceEscalationTemplate.find(params[:id])\n @nagios_service_escalation_template.destroy\n\n respond_to do |format|\n format.html { redirect_to(nagios_service_escalation_templates_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @lk.destroy\n respond_to do |format|\n format.html { redirect_to lks_url, notice: 'Lk was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete endpoint\n do_request :delete, endpoint\n end", "def api_delete(path, data = {})\n api_request(:delete, path, :data => data)\n end", "def destroy\n @takipci.destroy\n respond_to do |format|\n format.html { redirect_to takipcis_url, notice: 'Takipci was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @recordtltkt.destroy\n respond_to do |format|\n format.html { redirect_to recordtltkts_url, notice: 'Recordtltkt was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete_data\n response = WebPay.client.delete([path, 'data'].join('/'))\n response['deleted']\n end", "def incident_delete(statuspage_id, incident_id)\n data = {}\n data['statuspage_id'] = statuspage_id\n data['incident_id'] = incident_id\n\n request :method => :post,\n :url => @url + 'incident/delete',\n :payload => data\n end", "def destroy\n return if new_record?\n \n @api.delete \"/meetings/#{shortcode_url}.json\"\n end", "def destroy\n @data_ukt.destroy\n respond_to do |format|\n format.html { redirect_to data_ukts_url, notice: 'Data ukt was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n onevnet('delete', resource[:name])\n @property_hash.clear\n end", "def destroy\n @taskk.destroy\n respond_to do |format|\n format.html { redirect_to taskks_url, notice: 'Taskk was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @traceroute.destroy\n respond_to do |format|\n format.html { redirect_to traceroutes_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @traceroute.destroy\n respond_to do |format|\n format.html { redirect_to traceroutes_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @zt010.destroy\n respond_to do |format|\n format.html { redirect_to zt010s_url, notice: 'Zt010 was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @opt10075.destroy\n respond_to do |format|\n format.html { redirect_to opt10075s_url, notice: 'Opt10075 was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @otp.destroy\n respond_to do |format|\n format.html { redirect_to otps_url, notice: 'Otp was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @controlpersona = Controlpersona.find(params[:id])\n @controlpersona.destroy\n\n respond_to do |format|\n format.html { redirect_to controlpersonas_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @go_slim = GoSlim.find(params[:id])\n @go_slim.destroy\n\n respond_to do |format|\n format.html { redirect_to go_slims_url }\n format.json { head :no_content }\n end\n end", "def delete!\n request! :delete\n end" ]
[ "0.6941498", "0.68738836", "0.6850847", "0.672702", "0.6712603", "0.67033225", "0.6682263", "0.667959", "0.666711", "0.6617167", "0.6615948", "0.6608726", "0.6579389", "0.6556748", "0.65337735", "0.6502583", "0.64983404", "0.64923036", "0.64913964", "0.64684", "0.6462727", "0.6462727", "0.6462727", "0.6462727", "0.64598864", "0.6452917", "0.6441155", "0.6436683", "0.6436534", "0.6435058", "0.6421727", "0.64196724", "0.64106536", "0.6388532", "0.6382188", "0.63801676", "0.6380028", "0.637387", "0.63685334", "0.6364109", "0.6351159", "0.6351082", "0.6340814", "0.63380283", "0.63307977", "0.63246113", "0.6314566", "0.6313588", "0.631299", "0.6311853", "0.6306336", "0.6305566", "0.6304987", "0.630088", "0.6298367", "0.62930053", "0.62920177", "0.62905043", "0.6288352", "0.6287242", "0.62819016", "0.6279533", "0.6270884", "0.6269061", "0.62541586", "0.6251052", "0.625021", "0.6246356", "0.624347", "0.62411255", "0.62405056", "0.62349623", "0.62344086", "0.6231269", "0.622961", "0.62250525", "0.62241167", "0.6221505", "0.6221302", "0.6218156", "0.6217474", "0.62173027", "0.6216", "0.62119013", "0.6211814", "0.620984", "0.6209368", "0.6203778", "0.62037015", "0.6203627", "0.619753", "0.6194204", "0.6193822", "0.6193822", "0.6192118", "0.6191988", "0.6188084", "0.6187796", "0.6187343", "0.61863476" ]
0.72975755
0
Use callbacks to share common setup or constraints between actions.
def set_controlpltkt @controlpltkt = Controlpltkt.find(params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "def action_hook; end", "def run_actions; end", "def define_action_hook; end", "def actions; end", "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end", "def add_actions; end", "def callbacks; end", "def callbacks; end", "def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end", "def define_action_helpers; end", "def post_setup\n end", "def action_methods; end", "def action_methods; end", "def action_methods; end", "def before_setup; end", "def action_run\n end", "def execute(setup)\n @action.call(setup)\n end", "def define_action_helpers?; end", "def set_actions\n actions :all\n end", "def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end", "def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end", "def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end", "def before_actions(*logic)\n self.before_actions = logic\n end", "def setup_handler\n end", "def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end", "def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end", "def action; end", "def action; end", "def action; end", "def action; end", "def action; end", "def workflow\n end", "def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end", "def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end", "def before(action)\n invoke_callbacks *self.class.send(action).before\n end", "def process_action(...)\n send_action(...)\n end", "def before_dispatch(env); end", "def after_actions(*logic)\n self.after_actions = logic\n end", "def setup\n # override and do something appropriate\n end", "def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end", "def setup(_context)\n end", "def setup(resources) ; end", "def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end", "def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end", "def determine_valid_action\n\n end", "def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end", "def startcompany(action)\n @done = true\n action.setup\n end", "def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end", "def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end", "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end", "def define_tasks\n define_weave_task\n connect_common_tasks\n end", "def setup(&block)\n define_method(:setup, &block)\n end", "def setup\n transition_to(:setup)\n end", "def setup\n transition_to(:setup)\n end", "def action\n end", "def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend", "def config(action, *args); end", "def setup\n @setup_proc.call(self) if @setup_proc\n end", "def before_action \n end", "def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end", "def action\n end", "def matt_custom_action_begin(label); end", "def setup\n # override this if needed\n end", "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end", "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end", "def after(action)\n invoke_callbacks *options_for(action).after\n end", "def pre_task\n end", "def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end", "def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end", "def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end", "def setup_signals; end", "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend", "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end", "def initialize(*args)\n super\n @action = :set\nend", "def after_set_callback; end", "def setup\n #implement in subclass;\n end", "def lookup_action; end", "def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end", "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "def release_actions; end", "def around_hooks; end", "def save_action; end", "def setup(easy)\n super\n easy.customrequest = @verb\n end", "def action_target()\n \n end", "def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end", "def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end", "def before_setup\n # do nothing by default\n end", "def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end", "def default_action; end", "def setup(&blk)\n @setup_block = blk\n end", "def callback_phase\n super\n end", "def advice\n end", "def _handle_action_missing(*args); end", "def duas1(action)\n action.call\n action.call\nend", "def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end", "def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end", "def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend" ]
[ "0.6163163", "0.6045976", "0.5946146", "0.591683", "0.5890051", "0.58349305", "0.5776858", "0.5703237", "0.5703237", "0.5652805", "0.5621621", "0.54210985", "0.5411113", "0.5411113", "0.5411113", "0.5391541", "0.53794575", "0.5357573", "0.53402257", "0.53394014", "0.53321576", "0.53124547", "0.529654", "0.5296262", "0.52952296", "0.52600986", "0.52442724", "0.52385926", "0.52385926", "0.52385926", "0.52385926", "0.52385926", "0.5232394", "0.523231", "0.5227454", "0.52226824", "0.52201617", "0.5212327", "0.52079266", "0.52050185", "0.51754695", "0.51726824", "0.51710224", "0.5166172", "0.5159343", "0.51578903", "0.51522785", "0.5152022", "0.51518047", "0.51456624", "0.51398855", "0.5133759", "0.5112076", "0.5111866", "0.5111866", "0.5110294", "0.5106169", "0.509231", "0.50873137", "0.5081088", "0.508059", "0.50677156", "0.50562143", "0.5050554", "0.50474834", "0.50474834", "0.5036181", "0.5026331", "0.5022976", "0.5015441", "0.50121695", "0.5000944", "0.5000019", "0.4996878", "0.4989888", "0.4989888", "0.49864885", "0.49797225", "0.49785787", "0.4976161", "0.49683493", "0.4965126", "0.4958034", "0.49559742", "0.4954353", "0.49535993", "0.4952725", "0.49467874", "0.49423352", "0.49325448", "0.49282882", "0.49269363", "0.49269104", "0.49252945", "0.4923091", "0.49194667", "0.49174926", "0.49173003", "0.49171105", "0.4915879", "0.49155936" ]
0.0
-1
Never trust parameters from the scary internet, only allow the white list through.
def controlpltkt_params params.require(:controlpltkt).permit(:n1, :n2, :siglas, :limite, :vendida) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "def allow_params_authentication!; end", "def allowed_params\n ALLOWED_PARAMS\n end", "def default_param_whitelist\n [\"mode\"]\n end", "def param_whitelist\n [:role, :title]\n end", "def expected_permitted_parameter_names; end", "def safe_params\n params.except(:host, :port, :protocol).permit!\n end", "def strong_params\n params.require(:team_member).permit(param_whitelist)\n end", "def permitir_parametros\n \t\tparams.permit!\n \tend", "def strong_params\n params.require(:community).permit(param_whitelist)\n end", "def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end", "def strong_params\n params.require(:education).permit(param_whitelist)\n end", "def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end", "def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end", "def param_whitelist\n [:rating, :review]\n end", "def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end", "def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end", "def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end", "def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end", "def valid_params_request?; end", "def strong_params\n params.require(:experience).permit(param_whitelist)\n end", "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end", "def allowed_params\n params.require(:allowed).permit(:email)\n end", "def permitted_params\n []\n end", "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end", "def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend", "def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end", "def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end", "def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end", "def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end", "def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end", "def safe_params\n params.require(:user).permit(:name)\n end", "def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend", "def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end", "def check_params; true; end", "def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end", "def quote_params\n params.permit!\n end", "def valid_params?; end", "def paramunold_params\n params.require(:paramunold).permit!\n end", "def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend", "def filtered_parameters; end", "def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end", "def filtering_params\n params.permit(:email, :name)\n end", "def check_params\n true\n end", "def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend", "def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend", "def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end", "def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end", "def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end", "def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend", "def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end", "def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end", "def active_code_params\n params[:active_code].permit\n end", "def filtering_params\n params.permit(:email)\n end", "def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end", "def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end", "def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end", "def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end", "def post_params\n if current_user.admin? \n params.permit(:title, :body, :city, :country, :gps_location, :privacy, :visible, :latitude, :longitude, images: [], files: [])\n else \n params.permit(:title, :body, :city, :country, :gps_location, :privacy,:latitude, :longitude, images: [], files: [])\n end \n end", "def list_params\n params.permit(:name)\n end", "def filter_parameters; end", "def filter_parameters; end", "def vineyard_params\n params.permit(:vineyard_name, :email, :website_url, :phone, :address, :city, :region, :postcode, :country, :specialty, :description, :pet_friendly, :holiday, :tours, :events, :family_friendly, :cover_image, :image_one, :image_two, :image_three, :image_four, :user_id, :base64)\n end", "def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end", "def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end", "def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end", "def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end", "def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end", "def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end", "def url_whitelist; end", "def admin_social_network_params\n params.require(:social_network).permit!\n end", "def filter_params\n params.require(:filters).permit(:letters)\n end", "def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end", "def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end", "def sensitive_params=(params)\n @sensitive_params = params\n end", "def permit_request_params\n params.permit(:address)\n end", "def user_params\n # Ensure a user can't give themselves admin priveleges\n params.delete(:admin) if current_user.admin?\n params.require(:user).permit(:name, :email, :admin, :image)\n end", "def secure_params\n params.require(:location).permit(:name)\n end", "def strong_params\n params.require( :setting ).\n permit( :global_scan_limit, :per_user_scan_limit,\n :target_whitelist_patterns, :target_blacklist_patterns )\n end", "def question_params\n params.require(:survey_question).permit(question_whitelist)\n end", "def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end", "def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end", "def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end", "def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end", "def url_params\n params[:url].permit(:full)\n end", "def backend_user_params\n params.permit!\n end", "def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend", "def speed_measurement_params\n\n #fuckit, to lazy to deal with permit crap right now\n ActionController::Parameters.permit_all_parameters = true\n\n params[:speed_measurement]\n end", "def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end", "def get_params\r\n #params.require(:article).permit(:title, :permalink, :content, :source_site, :introtext, :type_id, :order_by, :searchable, :created_by, :edited_by, :published_by, :published_on, :user_id)\r\n params.require(:article).permit!\r\n\r\n end", "def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end", "def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end", "def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end", "def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end", "def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end" ]
[ "0.69792545", "0.6781151", "0.67419964", "0.674013", "0.6734356", "0.6591046", "0.6502396", "0.6496313", "0.6480641", "0.6477825", "0.64565", "0.6438387", "0.63791263", "0.63740575", "0.6364131", "0.63192815", "0.62991166", "0.62978333", "0.6292148", "0.6290449", "0.6290076", "0.62894756", "0.6283177", "0.6242471", "0.62382483", "0.6217549", "0.6214457", "0.6209053", "0.6193042", "0.6177802", "0.6174604", "0.61714715", "0.6161512", "0.6151757", "0.6150663", "0.61461", "0.61213595", "0.611406", "0.6106206", "0.6105114", "0.6089039", "0.6081015", "0.6071004", "0.60620916", "0.6019971", "0.601788", "0.6011056", "0.6010898", "0.6005122", "0.6005122", "0.6001556", "0.6001049", "0.59943926", "0.5992201", "0.59909594", "0.5990628", "0.5980841", "0.59669393", "0.59589154", "0.5958826", "0.5957911", "0.5957385", "0.5953072", "0.59526145", "0.5943361", "0.59386164", "0.59375334", "0.59375334", "0.5933856", "0.59292704", "0.59254247", "0.5924164", "0.59167904", "0.59088355", "0.5907542", "0.59064597", "0.5906243", "0.5898226", "0.589687", "0.5896091", "0.5894501", "0.5894289", "0.5891739", "0.58860534", "0.5882406", "0.587974", "0.58738774", "0.5869024", "0.58679986", "0.5867561", "0.5865932", "0.5864461", "0.58639693", "0.58617616", "0.5861436", "0.5860451", "0.58602303", "0.5854586", "0.58537364", "0.5850427", "0.5850199" ]
0.0
-1
Create 'n' number of new Harness (class) with parameters
def new_harnesses puts "++ NEW HARNESSES++ ++++++++++++++++++" number = "" until number.class == Fixnum puts "How many Harnesses would you like to create?" number = gets.chomp.to_i end counter = 1 while number > 0 puts "-------- Harness #{counter} input --------" puts "Input a harness NUMBER: (standard format of one letter and 2 number eg. A99)" harness_number = gets.chomp if $all_harnesses[0..$all_harnesses.length].include?(harness_number.upcase) puts "Sorry, that Harness already exists. Please input a unique ID" else puts "Input a harness TYPE: (single, 2-point, 3-point, jerk, ballet, garden...etc.)" harness_type = gets.chomp puts "Input YEAR #{harness_number} was built:(yyyy)" harness_year = gets.chomp.to_i harness = Harness.new(harness_number, harness_type, harness_year) $all_harnesses << harness harness.print number = number - 1 counter += 1 end end return $all_harnesses end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def populate klass, n = klass::COUNT\n n.times.map {\n o = klass.new self\n yield o if block_given?\n o }\n end", "def initialize(n)\n @n = n\n end", "def initialize(n, h, w, a)\n # defines instance variables upon creation of new object\n # ties specific and individual data to created object (state)\n @name = n\n @height = h\n @weight = w\n\n # increment number of dogs each time new GoodDog object is initialized\n @@number_of_dogs += 1\n # class variables accessible throughout class definition\n\n # use constant to calculate age in dog years when object is initialized\n self.age = a * DOG_YEARS\n end", "def initialize(number_of_players)\n @players = []\n number_of_players.times {|n| @players << Player.new}\n end", "def initialize(n)\n\t\t@nums=(1..n).to_a.sort{ rand() - 0.5 }\n\t\tindex_pairs_sum\n\tend", "def initialize(n)\n self.length = n\n self.list = (1..n).to_a\n end", "def spawn_fish(n=20)\n for i in 0..n-1\n type = Aqua::Salmon\n srand\n sex = rand(2) == 0 ? Aqua::Male : Aqua::Female\n fish_desc = {\n 'type' => type,\n 'sex' => sex,\n 'speed' => Aqua::DefaultSpeed, # the following 3 can be lumped into one constant\n 'world_perception' => Aqua::DefaultWorldVision,\n 'food_perception' => Aqua::DefaultFoodPerception,\n 'mate_perception' => Aqua::DefaultMatePerception,\n 'position' => Aqua::Position.new([randomFloatSigned, 0, randomFloatSigned]),\n 'direction_change_factor' => Aqua::DefaultChangeFactor\n };\n self << Aqua::SalmonObject.new(fish_desc)\n end\n end", "def factory(klass, how_many = reps)\n how_many.times.collect { klass.generate }\n end", "def initialize(n, c)\n @weights = Array.new(n) { rand(-1.0..1) }\n @c = c # learning constant\n end", "def generate_random_hypothesis( size )\n hypothesis = Hypothesis.new\n size.times do\n hypothesis << generate_random_rule\n end\n hypothesis\nend", "def generate_random_hypothesis( size )\n hypothesis = Hypothesis.new\n size.times do\n hypothesis << generate_random_rule\n end\n hypothesis\nend", "def santa_creator(number_of_santas)\n example_genders = [\"agender\", \"female\", \"bigender\", \"male\", \"female\", \"gender fluid\", \"N/A\"]\n example_ethnicities = [\"black\", \"Latino\", \"white\", \"Japanese-African\", \"prefer not to say\", \"Mystical Creature (unicorn)\", \"N/A\"]\n number_of_santas.times do\n santa_instance = Santa.new(example_genders.sample, example_ethnicities. sample)\n p santa_instance.gender\n p santa_instance.age\n p santa_instance.ethnicity\n p santa_instance.reindeer_ranking\n end\nend", "def initialize(n, h, w, a)\n # Instance variables\n self.name = n\n self.height = h\n self.weight = w\n self.age = a * DOG_YEARS\n\n @@number_of_dogs += 1\n\n puts \"#{self.name} was initialized!\"\n end", "def disc_factory(number)\n disc_array = []\n number.times do\n disc_array << Disc.new\n end\n disc_array\n end", "def create_players(team, classes, num_players)\n num_players.times do\n player = Player.new\n player.first_name = Faker::Name.first_name \n player.last_name = Faker::Name.last_name \n player.team = team\n player.class_of = classes.sample\n player.save\n end\nend", "def initialize(number_of_fish_players) \t\n\t\t@player = []\n\t\t@turn = 0\n\t\t@winner = false\n\t\ti = 0\t##Revise so i can be 0?\n\t\tnumber_of_fish_players.times do #like 5.times do\n\t\t#puts \"iteration i is: #{i}\"\t\n\t\t\t@player[i] = FishPlayer.new\t#Revise to PLAYER CLASS\n\t\t\ti += 1\n\t\tend\n\t\t@max_turns = (@player.size - 1)\n\t\t#puts \"PLAYER ARRAY: #{@player}\"\n\t\t#puts \"players 0: #{@player[0].player_hand.player_cards}, players 1: #{@player[1]}\"\n\tend", "def initialize(player_count)\n\t\t@total_players = player_count\n\t\tplayers = []\n\t\tplayer_count.times do |i|\n\t\t\tplayers << Player.new(i+1)\n\t\tend\n\t\t@players = players\n\tend", "def rand_population(n)\r\n\t\treturn Array.new(n) { Snek.new(@start_x,@start_y, Array.new(@nb_heuristic) { @random.rand(-5.0..5.0) }) }\r\n\tend", "def initialize(name)\n super(name: name)\n self.hit_points = 10\n self.charm_points = 10\n self.house_id = House.all.sample.id\n self.wand = Character.all.select{|c| !c.wand.start_with?(\" \") }.sample.wand\n self.pet = [\"cat\", \"owl\", \"toad\", \"rat\"].sample\n self.patronus = MY_ANIMAL_FAKER.sample\n @classmates_faced = []\n self.friends = 0\n self.victories = 0\n end", "def initialize(n)\n\t\t@name = n\n\t\t@people = [] #here we are telling ruby that people and animals are empty arrays\n\t\t@animals = []\n\t\t\n\tend", "def initialize(n)\n raise ArgumentError if n < 3\n @grid = Array.new(n){ Array.new(n) }\n if n % 2 != 0\n initialize_odd(n)\n else\n if n % 4 == 0\n initialize_double_even(n)\n else\n initialize_single_even(n)\n end\n end\n end", "def create_samples(n)\n n.times do |i|\n Post.create(title: \"New Post #{i}\", body: \"Body of post #{i}\", created_at: Time.now)\n end\nend", "def initialize(n)\n @name = n \n @@count += 1 # WHENEVER A NEW DOG INSTANCE IS CREATED THIS COUNTER GOES UP.\n end", "def initialize(number_of_players)\n @deck = BlackjackRb::Deck.new\n @dealer = BlackjackRb::Dealer.new\n @players = Array.new(number_of_players) { BlackjackRb::Player.new }\n end", "def create_pieces(color)\n 8.times { @pieces << Pawn.new(color) }\n 2.times do\n @pieces << Rook.new(color)\n @pieces << Bishop.new(color)\n @pieces << Knight.new(color)\n end\n @pieces << Queen.new(color)\n @pieces << King.new(color)\n end", "def loop_into_data_structure(number_of_instances)\n\tarray_moves = []\n\tn = 0\n\twhile n < number_of_instances\n\t\tarray_moves[n] = Dancer.new\n\t\tn += 1\n\tend\n\tp array_moves\nend", "def initialize(num_decks)\n @num_decks = num_decks\n @cards = []\n\n # Validate num_decks; raise exceptions\n if not num_decks.is_a?(Integer) \\\n or num_decks < MIN_DECKS or \\\n num_decks > MAX_DECKS\n raise ArgumentError, \"num_decks must be [#{MIN_DECKS}..#{MAX_DECKS}]\"\n end\n\n # Create the shoe\n i = 0\n 1.upto(num_decks) do |x|\n @cards += super().cards # () in super is important due to arg diffs\n end\n end", "def initialize size=6, mines=20\n @size = size\n @mines = mines\n end", "def initialize(n = 3)\n @n = n\n @player_names = ['', '']\n @board = Array.new(n) { Array.new(n) { 0 } }\n end", "def initialize(n, h, w)\n @name = n\n @height = h\n @weight = w\n puts \"This object was initialized with the name #{@name}\"\n end", "def initialize(num_decks)\n #Init cards array\n @cards = []\n\n #Create a card for each suit/value combo\n SUITS.each do |suit|\n VALUES.each do |val|\n @cards << Card.new(suit, val)\n end\n end\n\n #Duplicate to make num_decks decks\n @cards = @cards * num_decks\n\n #shuffle the deck\n @cards.shuffle!\n end", "def spawn_prospectors(num_prospectors)\r\n prospectors = []\r\n count = 0\r\n while count <= num_prospectors - 1\r\n prospectors[count] = Prospector.new\r\n \t prospectors[count].intialize\r\n\t count += 1\r\n end\r\n prospectors\r\n end", "def create_hitsets_and_post(n)\n (n/5).times{self.create_a_hit_and_post!}\n end", "def initialize num_decks = 1\n @shoe = []\n @used_cards = []\n @dealt_cards = []\n num_decks.times do\n @shoe.concat(Deck.new.deck)\n end\n shuffle!\n end", "def create_cohort(n)\n $cohort = Array.new\n i = 1\n (n).times do\n\t\t$cohort.push(\"Person \"+ i.to_s)\n\t\ti += 1\n\tend\n return $cohort\nend", "def create_bed_new\n count = no_of_beds.to_i\n count.times do\n beds.create()\n end\n end", "def initialize(n, h, w)\n @name = n # The @ symbol beforehand defines an instance variable\n @height = h\n @weight = w\n end", "def initialize(n) # The state of a season is just its \n @n = n # index in the NAMES and INSTANCES arrays\n end", "def initialize(n) # The state of a season is just its \n @n = n # index in the NAMES and INSTANCES arrays\n end", "def initialize(name)\n @name = name\n @balance = 25\n @hygiene_index = 8\n @happiness_index = 8\nend", "def create_deck\n deck = Array.new\n for number in 0..2\n for color in 0..2\n for shape in 0..2\n for shade in 0..2\n deck.push(Card.new(number,color,shape,shade))\n end\n end\n end\n end\n return deck\nend", "def initialize(n_splits: 5)\n @n_splits = n_splits\n end", "def initialize(n=3)\n raise(ArgumentError.new \"Board must be larger than 1 square!\") if n <=1\n @board_length = n\n @squares = Array.new\n for i in 0...n*n\n @squares[i] = Square.new(i)\n addNeighbours(i)\n end\n end", "def initialize(n)\r\n @name = n\r\n @cards = [] # Initialize cards array to empty []. During course of game we get gards! Player needs to keep track of it's cards (primary state to track) Most Important\r\n end", "def initialize(n, h, w) #changed name to n; added h & w\n @name = n\n @height = h\n @weight = w\n end", "def initialize(n) # The state of a season is just its\n@n = n # index in the NAMES and INSTANCES arrays\nend", "def initialize(n) # The state of a season is just its\n @n = n # index in the NAMES and INSTANCE arrays\n end", "def initialize\n self.cards = []\n (0..51).each { |i| cards << Card.new(i) }\n self.cards.shuffle! \n end", "def initialize(n, h, w)\r\n @name = n #@ symbol is called an instance variable\r\n @height = h\r\n @weight = w\r\n end", "def initialize\n @cards = []\n\n RANKS.product(SUITS).each do |rank, suit|\n @cards << Card.new(rank, suit)\n end\n end", "def initialize(n,h,w)\n @name = n #@name -- > Instance variable - scoped at the object level.\n #It is a variable that exists as long as the object instance exists\n @height = h\n @weight = w\n end", "def initialize(number_of_decks)\n @deck = (SINGLE_DECK * number_of_decks).shuffle\n end", "def initialize(number_of_fish_players) \t\n\t\t@player = []\n\t\t@turn = 0\n\t\t@winner_message = \"Initialization message.\"\n\t\t@player_to_player_result = \"DEFAULT MESSAGE\"\n\n\t\ti = 0\t##Revise so i can be 0?\n\t\tnumber_of_fish_players.times do #like 5.times do\n\t\t#puts \"iteration i is: #{i}\"\t\n\t\t\t@player[i] = FishPlayer.new\t#Revise to PLAYER CLASS\n\t\t\ti += 1\n\t\tend\n\t\t@max_turns = (@player.size - 1)\n\t\t#puts \"PLAYER ARRAY: #{@player}\"\n\t\t#puts \"players 0: #{@player[0].player_hand.player_cards}, players 1: #{@player[1]}\"\n\tend", "def initialize(cfg)\n @scoring = Scoring::Methods[cfg['scoring']]\n @tapecount = cfg['tapecount'].to_i\n @tiebreak = cfg['tiebreak'] # TODO: use\n\n # construct a hill of dummy programs\n\n nprogs = cfg['size'].to_i\n\n @progs = {}\n @hill = Array.new(nprogs)\n\n (0 .. nprogs-1).each do |id|\n prog = \"dummy-#{id}\"\n @progs[prog] = id\n @hill[id] = prog\n end\n\n # construct initial dummy results\n\n @results = ResultMatrix.new(nprogs, @tapecount)\n (0 .. nprogs-2).each do |idA|\n (idA+1 .. nprogs-1).each { |idB| @results[idA, idB] = Array.new(2*@tapecount, 0) }\n end\n end", "def initialize(n)\n @n = n\n init_positions\n end", "def *(n)\n Dice.new(count, sides, increment, multiplier * n)\n end", "def enemy_fleet()\n enemy_fleet = Array.new\n for count in 1..6 do \n enemy_fleet.push(Ship.new(generateHull, generateFirepower, generateAccuracy))\n end\n return enemy_fleet\nend", "def initialize(gender, ethnicity)\n @gender = gender\n @ethnicity = ethnicity\n @age = rand(0..140)\n @reindeer_ranking = ['Rudolph', 'Dasher', 'Dancer', 'Prancer', 'Vixen', 'Comet', 'Cupid', 'Donner', 'Blitzen']\n #puts \"Initializing Santa instance...\"\nend", "def build_pieces\n (1..8).each do |i|\n Pawn.new(2, i, \"white\") \n end\n Rook.new(1, 1, \"white\")\n Knight.new(1, 2, \"white\")\n Bishop.new(1, 3, \"white\")\n Queen.new(1, 4, \"white\")\n King.new(1, 5, \"white\")\n Bishop.new(1, 6, \"white\")\n Knight.new(1, 7, \"white\")\n Rook.new(1, 8, \"white\")\n (1..8).each do |i|\n Pawn.new(7, i, \"black\") \n end\n Rook.new(8, 1, \"black\")\n Knight.new(8, 2, \"black\")\n Bishop.new(8, 3, \"black\")\n Queen.new(8, 4, \"black\")\n King.new(8, 5, \"black\")\n Bishop.new(8, 6, \"black\")\n Knight.new(8, 7, \"black\")\n Rook.new(8, 8, \"black\")\n end", "def spawn(random, length, values)\n Individual.new(Array.new(length) { random.rand(values) })\nend", "def create_rand_spot\n spot_list = []\n 100.times {\n spot_list << @spot = Spot.new\n }\n spot_list\nend", "def initialize \r\n @cards = []\r\n\r\n\r\n\r\n # Idiomatic ruby loop\r\n SUITS.each do |suit|\r\n RANKS.each do |rank|\r\n @cards.push(Card.new(rank,suit))\r\n end\r\n end\r\n end", "def initialize(grid_size)\n\t\t@stats = {}\n\t\t@grid = grid_size #reads user input into a variable\n\t\t@skippy = Kangaroo.new(@grid) #initializes an instance of the Kangaroo class\n\t\t@hops = 0 #to record total number of hops taken in a trip\n\t\t@throws = 0 #initialize total number of dice throws - used in stats calcs\n\tend", "def initialize(name, species=['cat', 'dog', 'bunny wearing backpack'].sample, options = {})\n @name = name\n @species = species\n @num_teeth = options[:num_teeth]\n @num_claws = options[:num_claws]\n @num_backpacks = options[:num_backpacks]\n end", "def initialize(randomness, ngram_size)\n @chains = []\n @input_set = []\n @randomness, @ngram_size = randomness, ngram_size\n end", "def initialize(length=0,breadth=0)\n puts \"object created\"\n @length=length\n @breadth=breadth\n end", "def initialize (trials, prob)\n if trials <= 0\n raise ArgumentError.new(\"Error: trials must be greater than 0\")\n end\n @n = trials\n if prob < 0.0 || prob > 1.0\n raise ArgumentError.new(\"prob must be between 0 and 1\")\n end\n @p = prob\n end", "def initialize(tablao)\n #TO DO :\n #Quand la classe s'initialize, elle doit créer 9 instances BoardCases\n #Ces instances sont rangées dans une array qui est l'attr_accessor de la classe\n for i in 1..9\n @tablao << BoardCase.new(i, \"_\")\n end\n \n end", "def initialize(n, h, w)\n @name = n\n @height = h\n @weight = w\n end", "def initialize(n, h, w)\n @name = n\n @height = h\n @weight = w\n end", "def initialize pieces=nil\n @squares = []\n for i in 0...64 do\n @squares[i] = Square.new \n end\n\n @pieces = pieces\n @pieces ||= createPieceHash\n @rules = ChessRules.new\n end", "def construct(count, length)\n \n @count = count\n @length = length\n \n @board = Array.new(@count * @length) {LudoField.new}\n @homes = Array.new(@count * 4) {LudoField.new}\n @targets = Array.new(@count * 4) {LudoField.new} \n \n return true\n end", "def initialize (num=200)\n @num = num\n end", "def santa_automater(i)\n example_genders = [\"agender\", \"female\", \"bigender\", \"male\", \"female\", \"gender fluid\", \"N/A\"]\n example_ethnicities = [\"black\", \"Latino\", \"white\", \"Japanese-African\", \"prefer not to say\", \"Mystical Creature (unicorn)\", \"N/A\"]\n i.times do\n Santa.new(example_genders.sample, example_ethnicities.sample)\n end\nend", "def initialize(name) #constructor\n self.name = name\n self.hp = 50 #default values line7-14 every object has these by default\n self.mp = 10\n self.atk = 10\n self.speed = 5\n self.ct = 0\n self.maxhp = 50\n self.maxmp = 10\n self.status = 'alive'\n ALL_UNITS << self\n end", "def initialize(args)\n @handstand_starting_exercise = BaseExercise.find_by(short_name: @@handstand_hash[args[\"handstand_hold\"]])\n @prep_starting_exercise = BaseExercise.find_by(short_name: @@wrist_hash[args[\"fingertip_pushup\"]][:prep])\n @knuckle_starting_exercise = BaseExercise.find_by(short_name: @@wrist_hash[args[\"fingertip_pushup\"]][:knuckle])\n @rock_starting_exercise = BaseExercise.find_by(short_name: @@wrist_hash[args[\"fingertip_pushup\"]][:rock])\n @fingertip_starting_exercise = BaseExercise.find_by(short_name: @@wrist_hash[args[\"fingertip_pushup\"]][:fingertip])\n @days = args[\"days\"].to_i\n @number = (args[\"number\"].to_i) * 2\n self.set_other_variables\n end", "def santa_machine(number)\r\n\t\r\n\texample_genders = [\"male\", \"female\", \"agender\", \"bigender\", \"gender fluid\", \"other\" ]\r\n\texample_ethnicities = [\"black\", \"white\", \"Japanese\", \"lizzard\", \"merpeople\" , \"plant\"]\r\n\tnumber.times do\r\n \t\tsanta = Santa.new(example_genders.sample, example_ethnicities.sample, rand(0..140))\r\n \t\tsanta.reindeer_shuffle\r\n \t\tsanta.about\r\n \t\tend\r\n\r\nend", "def build_shoe(num_of_decks)\n shoe = []\n num_of_decks.times do |_|\n DECK_OF_CARDS.map do |card|\n shoe << card\n end\n end\n shoe\nend", "def createChallenges\n for tab in Lecode_BattleChallenge::Challenges\n chall = Battle_Challenge.new\n chall.name = tab[0]\n chall.icon = tab[1]\n chall.description = tab[2]\n chall.gain = tab[3]\n chall.freq = tab[4]\n chall.success_onEnd = tab[5]\n chall.id = @challenges.size\n @challenges.push(chall)\n init_evaluation(chall.name)\n end\n \n end", "def initialize(size)\n @size = size\n @cards = Array.new\n for i in 1..@size\n deck = Deck.new\n @cards.concat(deck.get_cards)\n end\n \n # Shuffle all the cards in the deck\n @cards = @cards.shuffle\n end", "def new()\n trace(\"Instance #{index} created\")\n index += 1\n end", "def create_track(talks)\n self.number_of_tracks(talks)\n tracks_num = Array.new(@number_of_tracks) { |x| x+1 } # e.g. [1, 2]\n tracks_num.each do |track_num|\n @tracks_hash['Track ' + track_num.to_s] = Track.new\n end\n end", "def initialize(size = 2)\n raise ArgumentError if size < 1\n @pool = size\n end", "def random_objects_with_max(max, model_type)\n number_of_objects = Random.rand(1..max)\n objects = []\n number_of_objects.times do |index|\n objects[index] = create(model_type)\n end\n objects\nend", "def initialize (parameters={})\n @seed_stock_id = parameters.fetch(:seed_stock_id, \"XXXXXX\")\n @gene = self.check_gene=(parameters.fetch(:gene, \"XXXXXX\"))\n @last_planted = self.check_last_planted=(parameters.fetch(:last_planted, \"XXXXXX\"))\n @storage = parameters.fetch(:storage, \"XXXXXX\")\n @grams_remaining = self.check_grams_remaining=(parameters.fetch(:grams_remaining, \"XXXXXX\"))\n @@count += 1\n @@objects << self\n end", "def initialize(num_sides)\n @num_sides = num_sides\n end", "def initialize(name:, rating:, city:, total_rooms:, features:)\n @name = name\n @rating = rating\n @city = city\n @total_rooms = total_rooms\n @features = features\n @@hotels << self\n # self.class.count += 1\n\n end", "def build_jobs(count)\n (1..count).each.collect {|i| Tester::Job.new((i - 1) * ($range / count), i * ($range / count) - 1) }\n end", "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", "def initialize (params = {})\n @p1 = params.fetch(:p1,'Unknown P2')\n @p2 = params.fetch(:p2,'Unknown P1')\n @f2_wild = params.fetch(:f2_wild, \"0\").to_f\n @f2_p1 = params.fetch(:f2_p1,\"0\").to_f\n @f2_p2 = params.fetch(:f2_p2,\"0\").to_f\n @f2_p1p2 = params.fetch(:f2_p1p2,\"0\").to_f\n \n #Assign the SeedStocks object with the same name as parent to the variable @seed.\n #If there is no SeedStocks object with that name the code stops\n @seed1 = SeedStocks.all_stocks.find { |seed| seed.seed_stock == @p1 }\n if @seed1 == nil\n abort (\"The seed stock #{@p1} is not registered\")\n end\n \n @seed2 = SeedStocks.all_stocks.find { |seed| seed.seed_stock == @p2 }\n if @seed2 == nil\n abort (\"The seed stock #{@p2} is not registered\")\n end\n \n @chi = nil\n \n @@my_crosses << self #Add the new object to the array\n \n end", "def replicate(n)\n Array.new(n) {\n self\n }\n end", "def search_by(step_count, total_presents, start=0)\n p \"Search by: #{pn(step_count)} for #{pn(total_presents)} starting at #{pn(start)}\"\n presents = 0\n house_num = start\n house = House.new(0) # remove obj creation \"cost\"\n while presents < total_presents\n house_num += step_count\n house.number = house_num\n presents = house.determine_present_count\n end\n p \"House (#{pn(house_num)}) => #{pn(presents)}\"\n house_num\nend", "def initialize(stap=5,aantal=34)\n @stap = stap\n @monte_carlos = []\n aantal.times do |x|\n van = x*stap\n tot = (x+1)*stap-1\n @monte_carlos[tot] = MonteCarlo.from_db(van,tot)\n end\n end", "def initialize(num_buckets = 8)\n @store = Array.new(num_buckets) { Array.new }\n @count = 0\n @num_buckets = num_buckets\n end", "def initialize(n,h,w)\n\t\t@name=n\n\t\t@height=h\n\t\t@weight=w\n\tend", "def newGame(tiers = 5, expLowerBound = 0.25, expUpperBound = 0.93, durability = 10, baseChance = 0.065, nextTierChance = 0.7)\r\n #All intermediate next tier percentages are interpolated from the two bounds.\r\n @expUpperBound = expLowerBound #Upper bound percentage for percentage of available experience required to reach the final tier.\r\n @expLowerBound = expUpperBound #Lower bound percentage for percentage of available experience required to reach the next tier from the first tier.\r\n @tiers = tiers #Number of different ore tiers that appear in the grid.\r\n @durabilityInt = durability #Starting durability.\r\n @baseChance = baseChance #Level 1 type ore chance of appearing\r\n @nextTierChance = nextTierChance #E.G Level N chance = BASE CHANCE * NEXTTIERCHANCE^N-1\r\n\r\n newGameSetup #Sets up the grid and game variables.\r\nend", "def initialize(*args_p)\n super(0..6, *args_p)\n end", "def initialize(n, params = {})\n @row = Array.new(n) { Square.new }\n @row.each do |i|\n @output_stream = params[:output] || $stdout\n end\n @size = n\n vals = params[:vals]\n if vals && vals.length > 0 # empty array is accepted\n raise InvalidBoardContents unless vals.length == n # uncaught\n vals.each_with_index do |symbol, index|\n set_square(index, symbol)\n end\n end\n end", "def santa_generator(num)\n\t@santas = []\n\texample_names = [\"Sarah\", \"Sting\", \"Sigmond\", \"Stella\", \"Stephen\", \"Sidney\", \"Singin\"]\n\texample_genders = [\"agender\", \"female\", \"bigender\", \"male\", \"female\", \"gender fluid\", \"N/A\"]\n\texample_ethnicities = [\"black\", \"Latino\", \"white\", \"Japanese-African\", \"prefer not to say\", \"Mystical Creature (unicorn)\", \"N/A\"]\n\t\n\tnum.times do |num|\n\n\tnew_santa = Santa.new(example_names.sample(example_names.length), example_genders.sample(example_genders.length), example_ethnicities.sample(example_ethnicities.length)) \n\t\t\t\t# name = example_names.rand(example_name.length)\n\t\t\t\t# gender = example_genders.rand(example_genders.length)\n\t\t\t\t# ethnicity = example_ethnicities.rand(example_ethnicities.length)\n\t\t\t\t\n\t\t\t\t\t new_santa.age = (1..140).to_a.sample\n\n\n# Emmanual said these sage words otherwise there is no variable to accept the random number\n\n# [11:21] \n# if you had another method that created age and called it before this that would work too\n\n# [11:21] \n# basically, initialize sets all of the basic information for the class. What needs to exist for this class to exist\n\t@santas << new_santa\n\t\t# index = 0 do |num|\n\t\t# \tuntil num == index \n\t\t# \t\tname = example_names.rand(example_name.length)\n\t\t# \t\tgender = example_genders.rand(example_genders.length)\n\t\t# \t\tethnicity = example_ethnicities.rand(example_ethnicities.length)\n\t\t# \t\tage = Random.rand(141)\n\t\t# \tsantas << Santa.new (name, gender,ethnicity)\n\t\t# \t# name = example_names(rand(example_name.length)\n\t\t# \t# gender = example_genders(rand(example_genders.length)\n\t\t# \t# ethnicity = example_ethnicities(rand(example_ethnicities.length)\n\t\t# \t# age = Random.rand(141)\n\n\t\t# index += 1\n\t\n\tend\nend", "def make_ivory_tower\n 5.times do |n| \n user = make_user\n journal = make_journal\n journal.save!\n publication = make_publication\n article = make_article\n section_array = []\n 3.times { |n| section_array << make_section }\n author = make_author\n journal.publications << publication\n publication.articles << article\n article.authors << author\n section_array.each { |section| article.sections << section }\n end\nend", "def generate_instances(supervisor, quantity = self.quantity)\n quantity.times.map { |i| create_instance(supervisor) }\n end" ]
[ "0.6583012", "0.6545054", "0.644339", "0.6393393", "0.63457257", "0.62996715", "0.62719965", "0.6266888", "0.62598974", "0.62580454", "0.62580454", "0.6203432", "0.6166434", "0.6128871", "0.6119985", "0.60836107", "0.6072784", "0.6022334", "0.6011186", "0.6005819", "0.60057896", "0.5960037", "0.595126", "0.5946455", "0.594196", "0.59194475", "0.59175533", "0.59171236", "0.5888557", "0.58718", "0.58425134", "0.58328426", "0.58320946", "0.5830519", "0.5819368", "0.5816833", "0.57940656", "0.57926846", "0.57926846", "0.57818896", "0.57703", "0.576909", "0.5768526", "0.5767315", "0.57667077", "0.5737512", "0.57370734", "0.57364273", "0.5731201", "0.5729905", "0.5725059", "0.5706506", "0.5706198", "0.57033813", "0.57027435", "0.5698409", "0.56982195", "0.5690719", "0.5678583", "0.5678094", "0.5676155", "0.566072", "0.56591576", "0.56479585", "0.5647827", "0.5637412", "0.56336635", "0.56324387", "0.5630222", "0.5630222", "0.5628311", "0.56280994", "0.56267154", "0.56241316", "0.5620421", "0.5614849", "0.56143963", "0.55942124", "0.55893403", "0.5589258", "0.558607", "0.5585029", "0.557959", "0.55769044", "0.55756116", "0.55743396", "0.55729073", "0.5572428", "0.55591124", "0.5554658", "0.5546723", "0.55420345", "0.5534791", "0.5531526", "0.5526054", "0.55232394", "0.5521829", "0.5518551", "0.5517915", "0.5513482", "0.55056244" ]
0.0
-1
saves selected harness in 'current_harness'
def select_harness all_harness_str = "" $all_harnesses.each_with_index do |harness, index| new_harness = " " + index.to_s + "- " + harness.serial_number all_harness_str += new_harness end puts all_harness_str harness_input = -1 until harness_input >= 0 && harness_input < $all_harnesses.length puts "Which HARNESS to edit?(select number)" harness_input = gets.chomp.to_i current_harness = $all_harnesses[harness_input] end return current_harness end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_test_suite(test_suite)\n @test_suites << test_suite\nend", "def capture_current_tune_settings\n puts \"Checking current tune settings...\"\n settings_json = run_script_on(master, \"./util/tune/current_settings.rb\").output\n output_path = \"#{@archive_root}/#{CURRENT_TUNE_SETTINGS}\"\n\n puts \"Writing file: #{output_path}\"\n File.write(output_path, settings_json)\n end", "def set_current\n File.open(File.join(SCORE_FOLDER,'_CURRENT_.js'),'wb') do |f|\n f.write(\"let CURRENT_ANALYSE = '#{name}';\\n\")\n end\nend", "def save_lesson\n puts \"saving the lesson, tut_lesson_#@name -> #{@lesson}, tut_page_#@name -> #{@page}\"\n HH::PREFS[\"tut_lesson_#@name\"] = @lesson\n HH::PREFS[\"tut_page_#@name\"] = @page\n HH.save_prefs\n end", "def scenario_outline scenario_outline_obj\n current_feature.scenarios << scenario_outline_obj\n @current_scenario = scenario_outline_obj\n end", "def save\n return unless @playground.collecting?\n\n connection.set_experiment_created_at @id, Time.now\n end", "def save\n @saved = @state\n end", "def store_selected locator, option_locator, variable_name\r\n raise 'Not supported in Selenium Core at the moment'\r\n end", "def save\n @opts\n end", "def save\n if defined?(@saved)\n Vanity.logger.warn(\"Experiment #{name} has already been saved\")\n return\n end\n @saved = true\n true_false unless defined?(@alternatives)\n raise \"Experiment #{name} needs at least two alternatives\" unless @alternatives.size >= 2\n\n if !@is_default_set\n default(@alternatives.first)\n Vanity.logger.warn(\"No default alternative specified; choosing #{@default} as default.\")\n elsif alternative(@default).nil?\n # Specified a default that wasn't listed as an alternative; warn and override.\n Vanity.logger.warn(\"Attempted to set unknown alternative #{@default} as default! Using #{@alternatives.first} instead.\")\n # Set the instance variable directly since default(value) is no longer defined\n @default = @alternatives.first\n end\n super\n if !defined?(@metrics) || @metrics.nil? || @metrics.empty?\n Vanity.logger.warn(\"Please use metrics method to explicitly state which metric you are measuring against.\")\n default_metric = @playground.metrics[id] ||= Vanity::Metric.new(@playground, name)\n @metrics = [default_metric]\n end\n @metrics.each do |metric|\n metric.hook(&method(:track!)) # rubocop:todo Performance/MethodObjectAsBlock\n end\n end", "def pickUp(simulator)\n end", "def assign_current_step\n resource.current_step = step.to_sym\n end", "def asset_selected( main_model )\n workTabPane_state_changed( main_model )\n end", "def asset_selected( main_model )\n workTabPane_state_changed( main_model )\n end", "def save\n filename = Time.now.strftime(\"measures-%Y-%m-%d-%H%M%S.json\")\n dirname = \"goals/measures\"\n hash = { \"objective\" => @name}\n @outcomes.each {|o|\n hash.store(\"outcome\", o.name)\n hash.store(\"scale\", \"#{o.scale.class.name}.rb\")\n hash.store(\"baseline\", o.baseline)\n hash.store(\"baseline date\", o.baseline_date)\n hash.store(\"target\", o.target)\n hash.store(\"target date\", o.target_date)\n hash.store(\"measure\", o.last_measure.value)\n hash.store(\"measure date\", Time.now.strftime(\"%b %-d, %Y\"))\n }\n\n if !File.exists? dirname\n FileUtils.mkdir_p dirname\n end\n\n File.open(\"#{dirname}/#{filename}\",\"a\") do |f|\n f.write(JSON.pretty_generate(hash))\n f.write(\"\\n\")\n end\n end", "def save\n frm.button(:value=>\"Save\").click\n AssignmentsList.new(@browser)\n end", "def save\n frm.button(:value=>\"Save\").click\n AssignmentsList.new(@browser)\n end", "def save_env\n [@src, @tree, @block_ial, @stack, @text_type]\n end", "def save\n File.open(SaveLocation, 'w') do |file|\n file.puts @value.join(\"\")\n file.puts @progress.join(\"\")\n file.puts @bad_guesses.join(\"\")\n end\n end", "def save\n frm.button(:name=>\"modifyPartForm:_id89\").click\n EditAssessment.new(@browser)\n end", "def save_env; end", "def work_tool(tool)### set and get\r\n @tool = tool\r\n puts \"#{@name} works using a #{@tool} #{return_phtest_writer}\"\r\n end", "def save\n if file\n # Ensure the current store has been loaded before we try to re-write it, this\n # is necessary if the program generator has crashed before creating a test\n store\n p = Pathname.new(file)\n FileUtils.mkdir_p(p.dirname)\n File.open(p, 'w') { |f| f.puts JSON.pretty_generate(store) }\n end\n end", "def test_set_selected_page_edgecases\n status = Sketchup.active_model.pages.add \"Page 1\"\n status = Sketchup.active_model.pages.add \"Page 2\"\n Sketchup.active_model.pages.selected_page = Sketchup.active_model.pages[0]\n expected = \"Page 1\"\n result = Sketchup.active_model.pages.selected_page.name\n assert_equal(expected, result,\n 'Failed in test_set_selected_page_api_example.')\n end", "def save()\n @env.sync(true)\n self\n end", "def save\n\t\t\tsuper\n\t\t\t@@env = self\n\t\tend", "def save_new_selection\n save_element.when_visible { save }\n wait_for_ajax\n end", "def objexporter()\r\n Sketchup.active_model.select_tool(OBJexporter.new())\r\nend", "def save!\n ScriptoriaCore::Ruote.engine.storage_participant.do_update(_workitem)\n end", "def done\n frm.button(:name=>\"takeAssessmentForm:_id5\").click\n EditAssessment.new(@browser)\n end", "def save_state file=nil\n App.out.write_text_files file\nend", "def backup\n @current_teacher = current_teacher\n @school = School.find(current_teacher.school_id)\n @school_name = School.find(current_teacher.school_id).full_name\n end", "def save\n @history << {@entry_station => @exit_station}\n end", "def save_game\n\t\t# If current game was previously saved, delete the old version of current game...\n\t\tif @running_saved_game != nil\n\t\t\tover_write_data\n\t\tend\n\t\t# And add new version of current game to saved data\n\t\tFile.open(@path, 'a+') do |f|\n\t\t\t\tf.puts \"#{@word.join},#{@guess},#{@wrong_letters},#{@turn}\"\n\t\tend\n\tend", "def save\n completed_achievements = []\n @data_achievements.each do |index, achievement|\n completed_achievements << index if achievement.completed?\n end\r\n \r\n File.open(SAVE_FILE, \"wb+\") do |f|\r\n f.flock File::LOCK_EX\r\n completed_achievements |= load_save(f)\n Marshal.dump(completed_achievements, f)\r\n end\n end", "def set_escenario_ideal\n @escenario_ideal = EscenarioIdeal.find(params[:id])\n end", "def save\n\n quiz = frm.div(:class=>\"portletBody\").div(:index=>0).text\n pool = frm.div(:class=>\"portletBody\").div(:index=>1).text\n\n frm.button(:value=>\"Save\").click\n\n if quiz =~ /^Assessments/\n EditAssessment.new(@browser)\n elsif pool =~ /^Question Pools/\n EditQuestionPool.new(@browser)\n else\n puts \"Unexpected text: \"\n p pool\n p quiz\n end\n\n end", "def save(data)\n\t\t# NOTE: in a low-level implementation of this, you want to have two \"save slots\", and juggle pointers to figure out what data is \"this\" and what is \"prev\", rather moving the data down one slot. (ie, you alternate saving data into the left slot, and the right slot, rather than always saving in the right slot)\n\t\t@prev = @this\n\t\t@this = data\n\tend", "def save_draft\n frm.button(:name=>\"save\").click\n AssignmentsList.new(@browser)\n end", "def set_current analyse\n analyse = analyse.name if analyse.instance_of?(Analyse)\n File.open(CUR_ANALYSE_FILE,'wb'){|f|f.write(\"const ANALYSE=\\\"#{analyse}\\\";\")}\n puts t('analysis-folder-chosen', {name: analyse.inspect})\n end", "def puppet_infrastructure_tune_current\n puts \"Checking current PE tune...\"\n puts\n\n output = on(master, \"puppet infrastructure tune --current\").output\n\n puts output\n puts\n\n output\n end", "def save\n perform_save\n end", "def save_employment\n self.current_stage = :references_stage\n self.save\n true\n end", "def store_selected_options locator, variable_name\r\n command 'storeSelectedOptions', locator, variable_name\r\n end", "def save_state_if_changed\n data = ''\n @state_mutex.synchronize do\n return if @current_version == @saved_version\n data = serialize\n @saved_version = @current_version\n @last_save_time = Time.now.to_f\n end\n\n @logger.info(\"Writing state at version #@saved_version to #@state_file\")\n tmpfile = @state_file + '.tmp'\n File.open(tmpfile, File::CREAT|File::EXCL|File::RDWR, 0600) do |f|\n f.write(data)\n end\n File.rename(tmpfile, @state_file)\n end", "def save\n # Nothing in base class. This should be used to persist settings in\n # subclasses that use files.\n end", "def save\n\t\t# Ask the user for a file.\n\t\t# Defaults to current file.\n\t\tans = $screen.ask(\"save to: \",[@filename],true,true)\n\t\tif ans == nil\n\t\t\t$screen.write_message(\"Cancelled\")\n\t\t\treturn\n\t\tend\n\t\tif ans == \"\" then ans = @filename end\n\t\tif ans == \"\"\n\t\t\t$screen.write_message(\"Cancelled\")\n\t\t\treturn\n\t\tend\n\t\t# If name is different from current file name,\n\t\t# ask for verification.\n\t\tif ans != @filename\n\t\t\tyn = $screen.ask_yesno(\"save to different file: \"+ans+\" ? [y/n]\")\n\t\t\tif yn == \"yes\"\n\t\t\t\t@filename = ans\n\t\t\t\tset_filetype(@filename)\n\t\t\telse\n\t\t\t\t$screen.write_message(\"aborted\")\n\t\t\t\treturn\n\t\t\tend\n\t\tend\n\t\t# Dump the text to the file.\n\t\tFile.open(@filename,\"w\"){|file|\n\t\t\ttext = @text.join(@eol)\n\t\t\tfile.write(text)\n\t\t}\n\t\t# Let the undo/redo history know that we have saved,\n\t\t# for revert-to-saved purposes.\n\t\t@buffer_history.save\n\t\t# Save the command/search histories.\n\t\tif $hist_file != nil\n\t\t\t$buffers.save_hists\n\t\tend\n\t\t$screen.write_message(\"saved to: \"+@filename)\n\tend", "def save_state\n @saved_state = clone.to_hash\n @changed = {}\n end", "def save_state\n @saved_state = clone.to_hash\n @changed = {}\n end", "def save\n @@all << self\n @@current << self\n end", "def save_states(fname)\n raise \"assertion failed: @optimizer.nil?\" if @optimizer.nil?\n if @update_on_kvstore\n @kvstore.save_optimizer_states(fname, dump_optimizer: true)\n else\n IO.binwrite(fname, @updaters[0].get_states(dump_optimizer: true))\n end\n end", "def write()\n open(CurrentFilename, 'w'){|fp|\n Marshal.dump(@current_setting, fp)\n }\n end", "def save_current_module(state_module)\n @@current_module = state_module['.module']\nend", "def set_current_test_name(name)\n metadata[:case] ||= {}\n metadata[:case][:name] = name\n end", "def save_unknown!\n\t\t @saved = []\n\t end", "def master_done!\n @done = true\n specification! true\n summarize_performance!\n \t\tsummarize_results! @results\n \t\tcleanup!\n \t\t#Notify.completed @experiment\n\n \t\t#sleep 1\n #DRb.stop_service\n end", "def save\n File.open(@test_name, \"w+\") do |file|\n file.write(render)\n end\n end", "def enter\n Apartment::Tenant.switch!(leaser_name)\n Leases.current = self\n end", "def save_state\n return unless @state_writer\n\n @state_writer.call(@state)\n end", "def save_graphics_state\n @stack.push clone_state\n end", "def restore; end", "def after_update_success\n new_intake = @form.intake\n session[:intake_id] = new_intake.id\n new_intake.set_navigator(session[:navigator])\n end", "def save_and_close( filename = clean_name )\n result.parent.export filename\n end", "def save(path)\n @driver.save_screenshot(path)\n end", "def save_branch\n @@save_branch << @@obj.current_branch\n end", "def save_inventory(ems, _target, persister)\n InventoryRefresh::SaveInventory.save_inventory(ems, persister.inventory_collections)\n end", "def state_out(path:)\n add option: \"-state-out=#{path}\"\n end", "def save_grip; end", "def save!\n raise Informative, 'This XCScheme object was not initialized ' \\\n 'using a file path. Use save_as instead.' unless @file_path\n File.open(@file_path, 'w') do |f|\n f.write(to_s)\n end\n end", "def save\n SAVE\n end", "def save_output\n\n end", "def save_settings\n dir = 'Wave_Trace'\n model = Sketchup.active_model\n model.start_operation('Wave_Trace: Save All Settings', true) # Start an undo-able operation\n model.attribute_dictionaries.delete(dir) # First delete any pre-existing Wave_Trace dictionary\n \n model.set_attribute(dir, 'draw_realtime', @draw_realtime_check.checked?)\n model.set_attribute(dir, 'bounce_hidden', @bounce_hidden_check.checked?)\n model.set_attribute(dir, 'max_length', @max_length_drop.value)\n # model.set_attribute(dir, 'use_barrier', @use_barrier_check.checked?)\n model.set_attribute(dir, 'max_bounces', @max_bounces_drop.value)\n model.set_attribute(dir, 'bounce_filter', @bounce_filter_drop.value)\n # model.set_attribute(dir, 'draw_sweetspot', @draw_sweetspot_check.checked?)\n \n @speaker_list.each do |speaker|\n # Name each speaker after its index location in speaker_list... \"s_1\" \"s_2\" etc\n speaker_key = \"s_#{speaker_list.index(speaker).to_s}\" \n speaker_value = {\n name: speaker.button.caption,\n realtime_check: speaker.realtime_check.checked?,\n commit_check: speaker.commit_check.checked?,\n group_num: speaker.group_num\n }\n # Store the speaker settings as a string\n model.set_attribute(dir, speaker_key, speaker_value.inspect) \n \n speaker.driver_list.each do |driver|\n # Name driver index s_1_d_1, s_1_d_2 etc \n driver_key = \"#{speaker_key}_d_#{speaker.driver_list.index(driver).to_s}\"\n driver_value = {\n name: driver.name_field.value,\n origin: driver.origin.to_a,\n vector: driver.vector.to_a,\n x_angle_low: driver.x_angle_low_drop.value,\n x_angle_high: driver.x_angle_high_drop.value,\n y_angle_low: driver.y_angle_low_drop.value,\n y_angle_high: driver.y_angle_high_drop.value,\n x_angle_link: driver.x_angle_link_check.checked?,\n y_angle_link: driver.y_angle_link_check.checked?,\n density: driver.density_drop.value,\n ray_list: driver.ray_list,\n realtime_check: driver.realtime_check.checked?,\n commit_check: driver.commit_check.checked?\n }\n # Store the driver settings as a string\n model.set_attribute(dir, driver_key, driver_value.inspect)\n end\n end\n \n # FIX - Save global options too\n \n model.commit_operation # End undo-able operation\n UI.messagebox(\" Important!\\n\\nAll speakers, drivers and global settings have been stored in your model. You must SAVE YOUR MODEL for these settings to persist.\", MB_OK)\n end", "def save\n # Alternative ways can be implemented here. (text file etc.)\n # TODO: Handle Unicode and special characters.\n # (If further escaping than inspect is necessary.)\n Sketchup.write_default(\"Plugins_ae\", @identifier, @options.inspect.gsub(/\"/, \"'\"))\n # Sketchup.write_default(\"Plugins_ae\", @identifier, @options.inspect.inspect[1..-2]) # TODO!!!\nend", "def take_screenshot\n $browser.screenshot.save \"#{$image_folder}#{$testcase}_#{@var2}.png\"\n @var2+=1\n end", "def save file='GOL.sav'\n File.open(file,'w') do |f|\n Marshal.dump(state,f)\n end\n end", "def save_curr_game(fname)\n @log.debug \"Don't save the network game\"\n end", "def current!\n @current = true\n end", "def drive_using(sut_driver)\r\n \r\n raise \"String - Not be a SUT Driver: Error\" if (sut_driver.class==String.new.class) \r\n raise \"Array - Not be a SUT Driver: Error\" if (sut_driver.class==Array.new.class) \r\n \r\n # Test/verify start state is valid\r\n sut_driver.send(\"test_\" + self.start_state.to_s)\r\n \r\n # Loop through transitions\r\n self.transitions.each do |a_transition|\r\n \r\n # Run each action\r\n sut_driver.send(a_transition.action.to_s)\r\n # Test/verify arrival at resulting state\r\n sut_driver.send(\"test_\" + a_transition.end_state.to_s)\r\n \r\n end # end Loop block\r\n \r\n end", "def save!\n end", "def store_something_selected select_locator, variable_name\r\n command 'storeSomethingSelected', select_locator, variable_name\r\n end", "def save_game\n save_data = YAML::dump(self)\n puts \"Please enter a name for your save game:\"\n prompt\n @filename = gets.chomp\n File.open(\"./saved/#{@filename}\", \"w\") { |file| file.write(save_data)}\n puts \"Saved\"\n get_input\n end", "def enshelf(picked_shelf)\n\t\t@shelf_num = picked_shelf\n\tend", "def save_plan_units\n save_plan_btn.click\n end", "def store\n Thread.current\n end", "def __set_current(current)\n @current = current\n end", "def save_current_page(options = {})\n default_options = {:replacement => true}\n options = default_options.merge(options)\n if options[:dir]\n # already defined the dir\n to_dir = options[:dir]\n elsif $ITEST2_RUNNING_SPEC_ID && $ITEST2_WORKING_DIR\n\n $ITEST2_DUMP_DIR = File.join($ITEST2_WORKING_DIR, \"dump\")\n FileUtils.mkdir($ITEST2_DUMP_DIR) unless File.exists?($ITEST2_DUMP_DIR)\n\n spec_run_id = $ITEST2_RUNNING_SPEC_ID\n spec_run_dir_name = spec_run_id.to_s.rjust(4, \"0\") unless spec_run_id == \"unknown\"\n to_dir = File.join($ITEST2_DUMP_DIR, spec_run_dir_name)\n else\n to_dir = ENV['TEMP_DIR'] || \"C:\\\\temp\"\n end\n\n if options[:filename]\n file_name = options[:filename]\n else\n file_name = Time.now.strftime(\"%m%d%H%M%S\") + \".html\"\n end\n\n Dir.mkdir(to_dir) unless File.exists?(to_dir)\n file = File.join(to_dir, file_name)\n\n content = page_source\n base_url = @web_browser.context.base_url\n current_url = @web_browser.url\n current_url =~ /(.*\\/).*$/\n current_url_parent = $1\n if options[:replacement] && base_url =~ /^http:/\n File.new(file, \"w\").puts absolutize_page_hpricot(content, base_url, current_url_parent)\n else\n File.new(file, \"w\").puts content\n end\n\n end", "def teardown\n\n puts2(\"\\nTestcase finished in \" + calc_elapsed_time(@@tTestCase_StartTime) + \" seconds.\")\n\n # Restore the Global variable's original settings\n $VERBOSE = @@VERBOSE_ORIG\n $DEBUG = @@DEBUG_ORIG\n $FAST_SPEED = @@FAST_SPEED_ORIG\n $HIDE_IE = @@HIDE_IE_ORIG\n\n # Flag indicating if a browser was started\n $bBrowserStarted = false\n\n end", "def subject_save\n self.save_button.click\n end", "def scenarios\n @runner.done_scenarios\n end", "def restore\n end", "def update_intest\n @context = 1\n update_submission\n end", "def working\n current_user.chef.toggle(:currently_working).save\n end", "def approved\n @trader = current_trader\n end", "def finish!\n send_results()\n self.current_question_index = nil\n save()\n end", "def save_editor_settings\n Sketchup.write_default('MSPhysics', 'Editor Theme', @editor_theme.to_s)\n Sketchup.write_default('MSPhysics', 'Editor Font', @editor_font.to_i)\n Sketchup.write_default('MSPhysics', 'Editor Wrap', @editor_wrap.to_s)\n Sketchup.write_default('MSPhysics', 'Editor Print Margin', @editor_print_margin)\n Sketchup.write_default('MSPhysics', 'Editor Size', @editor_size.inspect)\n Sketchup.write_default('MSPhysics', 'Dialog Help Box', @dialog_help_box)\n Sketchup.write_default('MSPhysics', 'Dialog Scale', @dialog_scale)\n end", "def save(ruleset=nil)\n if ruleset\n ruleset = getruleset(ruleset)\n refresh(ruleset)\n saved[ruleset.name.to_s] = current[ruleset.name.to_s]\n else\n refresh\n saved = current\n end\n\n dir = File.dirname(filename)\n FileUtils.mkdir_p(dir) unless File.directory?(dir)\n File.open(filename, 'w') do |f|\n f << to_s\n end\n end", "def running_test_step; end", "def save_state\n json_object = { :secret_word => @secret_word, :display_content => @display_content,\n \t :failed_attemps => @failed_attemps }.to_json\n File.open(\"saved_state.json\", \"w\") { |file| file.write(json_object) }\n end", "def suite\n @suite ||= $TEST_SUITE\n end", "def after_update_success\n new_intake = @form.intake\n session[:intake_id] = new_intake.id\n assign_triage_source(new_intake)\n end" ]
[ "0.56488454", "0.5514428", "0.53165376", "0.52906543", "0.5230893", "0.52292037", "0.5226883", "0.51932436", "0.5168493", "0.5162603", "0.5051158", "0.50435627", "0.50306785", "0.50306785", "0.4960219", "0.4954789", "0.4954789", "0.49421448", "0.49306655", "0.49264398", "0.49202937", "0.48654363", "0.48616746", "0.4860444", "0.48425144", "0.483999", "0.48368895", "0.48333463", "0.48098013", "0.47970098", "0.4795858", "0.47889024", "0.47846714", "0.47755703", "0.47711575", "0.4755098", "0.4754525", "0.47377026", "0.47347003", "0.47274134", "0.47152942", "0.47033754", "0.47004193", "0.46962044", "0.46933404", "0.46870437", "0.46832654", "0.46812457", "0.46812457", "0.46786904", "0.4676165", "0.46747684", "0.46670875", "0.46651146", "0.46603128", "0.4659198", "0.46515325", "0.4648982", "0.46402115", "0.46390772", "0.46360624", "0.46351734", "0.46230692", "0.46230373", "0.46003395", "0.45944187", "0.45911247", "0.45895627", "0.45847496", "0.45791265", "0.4579072", "0.4571986", "0.4567893", "0.45494938", "0.45470747", "0.4541143", "0.453872", "0.4536043", "0.4530448", "0.45282888", "0.4518361", "0.45183384", "0.45125726", "0.45120466", "0.45102024", "0.45066804", "0.45020312", "0.44986415", "0.44962555", "0.44930196", "0.44884366", "0.44871867", "0.44871226", "0.44858098", "0.44829527", "0.44782498", "0.4476927", "0.4472839", "0.44696036", "0.4465502" ]
0.5011029
14
These methods change a harnesses attributes
def add_location(current_harness) current_harness.print puts "Location of #{current_harness.serial_number}? (City, State)" location = gets.chomp puts "Date sent?(mm/dd/yyyy)" date = gets.chomp current_harness.new_location(location, date) current_harness.print end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set(hsh = {})\n hsh.each { |name, val| self.set_attr(name,val) }\n self\n end", "def attributes= hsh\n conv_hsh = {}\n hsh.each do |k,v|\n k = k.to_s.gsub(/:/,'_') if k =~ /:/\n conv_hsh[k] = v\n end\n super hsh\n end", "def change_info(n, h, w)\n #using self. tells ruby we are calling the set method we created earlier, not a local variable\n self.name = n\n self.height = h\n self.weight = w\n end", "def attributes=(_arg0); end", "def set_attribute(name, value); end", "def change_info(n, h, w)\n self.name = n\n self.height = h\n self.weight = w\nend", "def change_info(n, h, w)\n self.name = n\n self.height = h\n self.weight = w\n end", "def change_info(n, h, w)\n self.name = n\n self.height = h\n self.weight = w\n end", "def change_info(n, h, w)\n self.name = n\n self.height = h\n self.weight = w\n end", "def attribute=(_arg0); end", "def attribute=(_arg0); end", "def setAttributes _obj, _args\n \"_obj setAttributes _args;\" \n end", "def update(attrs)\n super(attrs)\n end", "def update(attrs)\n super(attrs)\n end", "def update(attrs)\n super(attrs)\n end", "def update(attrs)\n super(attrs)\n end", "def change_info(n,h,w)\n @name = n\n @height = h\n @weight = w\nend", "def change_info(n, h, w) #these three arguments correspond to the new name height and weight respectively\n @name = n\n @height = h\n @weight = w\nend", "def update_attrs(hashit)\n hashit.instance_variables.each do |name|\n singleton_class.class_eval {attr_accessor \"#{name[1..-1]}\"} #remove leading @ from varname\n send(\"#{name[1..-1]}=\", hashit.instance_variable_get(name))\n end\n end", "def update!(**args)\n @crowding_attribute = args[:crowding_attribute] if args.key?(:crowding_attribute)\n end", "def update!(**args)\n @crowding_attribute = args[:crowding_attribute] if args.key?(:crowding_attribute)\n end", "def update!(**args)\n @age_indeterminate = args[:age_indeterminate] if args.key?(:age_indeterminate)\n @csam = args[:csam] if args.key?(:csam)\n @porn = args[:porn] if args.key?(:porn)\n @racy = args[:racy] if args.key?(:racy)\n @violence = args[:violence] if args.key?(:violence)\n end", "def update!(**args)\n @attribute_columns = args[:attribute_columns] if args.key?(:attribute_columns)\n @attribute_weights = args[:attribute_weights] if args.key?(:attribute_weights)\n @context_columns = args[:context_columns] if args.key?(:context_columns)\n @context_weights = args[:context_weights] if args.key?(:context_weights)\n @horizon_columns = args[:horizon_columns] if args.key?(:horizon_columns)\n @horizon_weights = args[:horizon_weights] if args.key?(:horizon_weights)\n end", "def initialize(this_name =\"default name\", height, )\n @name = this_name OR self.name = this name\n #can do this for all other attibutes\n self.height = new_height\n self.hair_color = hair_color\n\n end", "def set_attribute(ents, handle, name, value)\n ents.each { |e|\n e.set_attribute(handle, name, value)\n }\n end", "def update!(**args)\n @attribute_name = args[:attribute_name] if args.key?(:attribute_name)\n @attribute_value = args[:attribute_value] if args.key?(:attribute_value)\n @section_name = args[:section_name] if args.key?(:section_name)\n end", "def update!(**args)\n @horizontal_alignment = args[:horizontal_alignment] if args.key?(:horizontal_alignment)\n @horizontal_size_style = args[:horizontal_size_style] if args.key?(:horizontal_size_style)\n @vertical_alignment = args[:vertical_alignment] if args.key?(:vertical_alignment)\n @widgets = args[:widgets] if args.key?(:widgets)\n end", "def update!(**args)\n @horizontal_alignment = args[:horizontal_alignment] if args.key?(:horizontal_alignment)\n @horizontal_size_style = args[:horizontal_size_style] if args.key?(:horizontal_size_style)\n @vertical_alignment = args[:vertical_alignment] if args.key?(:vertical_alignment)\n @widgets = args[:widgets] if args.key?(:widgets)\n end", "def attributes=(params)\n end", "def update!(**args)\n @bold = args[:bold] if args.key?(:bold)\n @highlight = args[:highlight] if args.key?(:highlight)\n @italics = args[:italics] if args.key?(:italics)\n @strikethrough = args[:strikethrough] if args.key?(:strikethrough)\n @style = args[:style] if args.key?(:style)\n @underline = args[:underline] if args.key?(:underline)\n end", "def update!(**args)\n @bold = args[:bold] if args.key?(:bold)\n @highlight = args[:highlight] if args.key?(:highlight)\n @italics = args[:italics] if args.key?(:italics)\n @strikethrough = args[:strikethrough] if args.key?(:strikethrough)\n @style = args[:style] if args.key?(:style)\n @underline = args[:underline] if args.key?(:underline)\n end", "def update_from!(enc_hs)\n unless self.class.exist?(enc_hs)\n fail UnacceptableEncryptedAttributeFormat,\n 'Trying to construct invalid encrypted attribute. Maybe it is '\\\n 'not encrypted?'\n end\n enc_hs = enc_hs.dup\n enc_hs.delete(JSON_CLASS)\n enc_hs.delete(CHEF_TYPE)\n update(enc_hs)\n end", "def attribute_to_set; end", "def update_info(update_attr_hash)\n update_attr_hash.each do |k,v| \n\t\t\tself.send(\"#{k}=\",v)\n\t\tend\n end", "def set_attrs(rowHash)\n self.english = rowHash[\"english\"] \n self.russian = rowHash[\"russian\"]\n self.sound = rowHash[\"sound\"]\n self.picture = rowHash[\"picture\"]\n self.example = rowHash[\"example\"]\n self.regex1 = rowHash[\"regex1\"]\n self.added_at = rowHash[\"date\"] \n true\n end", "def change_something(lineup)\n\n puts \"Who do you want to change? Enter Spice name: \"\n lineup.list_names\n member = gets.strip\n lineup.name_check=(member)\n puts \"What would you like to change? enter a --> e \"\n list_changeables\n attribute = gets.strip\n lineup.name_check=(attribute)\n att_name = describe_attribute(attribute)\n current_att = lineup.get_attribute(member, attribute)\n puts \"#{member}'s #{att_name} is #{current_att}...what do you want to change it to?:\"\n new_value = gets.strip\n lineup.name_check=(new_value)\n byebug\n lineup.change_attribute(member, attribute, new_value)\n puts \"#{member}'s #{att_name} has been changed.\"\nend", "def hp=(hp)\n @hp = hp\n end", "def update_attributes(attrs)\n super({})\n end", "def set_attributes(*args)\n if args && args[0]\n if args[0].is_a?(Hash)\n args[0].each{|m,value|\n self.send(\"#{m}=\".to_sym,value)\n }\n else\n raise ArgumentError.new(\"Lolita::Configuration::List::Editable arguments must be Hash instead of #{args[0].class}\")\n end\n end\n end", "def update_attributes(hash)\n hash.keys.each do |key|\n m = \"#{key}=\"\n Child.send(m, hash[key]) if Child.respond_to?(m)\n end\n end", "def set_attribute(a,b)\n write_attribute(a,b)\n end", "def update_attribute\n end", "def set_attrs(rowHash)\n self.english = rowHash[\"english\"]\n self.russian = rowHash[\"russian\"]\n self.sound = rowHash[\"sound\"]\n self.picture = rowHash[\"picture\"]\n self.example = rowHash[\"example\"]\n self.regex1 = rowHash[\"regex1\"]\n self.added_at = rowHash[\"date\"] \n true\n end", "def method_missing(method, *args, &block)\n attribute = method.to_s\n\n if attribute =~ /=$/ # Define property -- does not have to exist\n attribute = attribute.chop\n self.changed_attributes[attribute] = args[0]\n self.attributes[attribute] = args[0]\n else\n return super unless self.attributes.include?(attribute)\n self.attributes[attribute]\n end \n \n end", "def hset(key, *attrs); end", "def attributes= new_attributes\n ingest_attributes(new_attributes)\n end", "def health=(v) self['Health'] = v end", "def change_info(n, h, w)\n name = n\n height = h\n weight = w\nend", "def change_info(n, h, w)\n name = n\n height = h\n weight = w\nend", "def update_attributes(attribute_hash)\n attribute_hash.each do |key, value|\n self.send(:\"#{key}=\", value) if self.respond_to?(:\"#{key}=\")\n end\n self\n end", "def update_attr_with_ial(attr, ial); end", "def adjust!(attributes,reload=false)\n all.adjust!(attributes,reload)\n end", "def new_attributes(name, library)\n (library.commands_hash[name] || {}).merge(name: name).\n update(library_attributes(library))\n end", "def h=(val); self[3] = val; end", "def allowed_attributes=(_arg0); end", "def allowed_attributes=(_arg0); end", "def set_attributes(hash={})\n hash.keys.each do |field|\n if self.respond_to? field\n self.instance_variable_set(\"@#{field}\", hash[field])\n end\n end\n end", "def set_attributes(attrs)\n @attributes = attrs.to_smash\n true\n end", "def update!(**args)\n @border = args[:border] if args.key?(:border)\n @dash = args[:dash] if args.key?(:dash)\n @label = args[:label] if args.key?(:label)\n @stroke = args[:stroke] if args.key?(:stroke)\n end", "def setstatus(hash)\n prophash = {}\n hash.each do |param, value|\n next if param == :name\n case self.class.attrtype(param)\n when :property\n # Only try to provide values for the properties we're managing\n if prop = self.property(param)\n prophash[prop] = value\n end\n else\n self[param] = value\n end\n end\n prophash\n end", "def height=(height)\n end", "def attrs=(hash)\n super(hash.is_a?(Hash) ? hash.to_json.to_s : '{}')\n end", "def update(attrs)\n attrs.each_pair do |key, value|\n send(\"#{key}=\", value) if respond_to?(\"#{key}=\")\n # attributes[key] = value <- lets make use of virtual attributes too\n end\n end", "def update!(**args)\n @base_height_meters_agl = args[:base_height_meters_agl] if args.key?(:base_height_meters_agl)\n @default_display_level = args[:default_display_level] if args.key?(:default_display_level)\n @floors = args[:floors] if args.key?(:floors)\n @floors_metadata = args[:floors_metadata] if args.key?(:floors_metadata)\n @height_meters = args[:height_meters] if args.key?(:height_meters)\n @height_meters_metadata = args[:height_meters_metadata] if args.key?(:height_meters_metadata)\n @level = args[:level] if args.key?(:level)\n @structure = args[:structure] if args.key?(:structure)\n end", "def update!(**args)\n @agent_style = args[:agent_style] if args.key?(:agent_style)\n @directory_url = args[:directory_url] if args.key?(:directory_url)\n @logo_url = args[:logo_url] if args.key?(:logo_url)\n @name = args[:name] if args.key?(:name)\n end", "def set_attrs_soft(new_attrs)\n updatable = new_attrs.select {|k,v| self.class.column_names.include? k.to_s}\n updatable.each {|k,v| puts \"self.send '#{k}=', #{v}\"; self.send \"#{k}=\", v}\n return self\n end", "def attributes=(*args)\n define_dynamic_answer_setters!\n super(*args)\n end", "def update!(**args)\n @html_attribute_type = args[:html_attribute_type] if args.key?(:html_attribute_type)\n @name = args[:name] if args.key?(:name)\n @value = args[:value] if args.key?(:value)\n end", "def update_block(hash, attrs)\n raise \"Not implemented\"\n end", "def attributes=(params)\n params.each_pair do |k, v|\n setter = \"#{k}=\".to_sym\n public_send(setter, v)\n end\n end", "def update!(**args)\n @mean_attributions = args[:mean_attributions] if args.key?(:mean_attributions)\n end", "def update!(**args)\n @attr_value = args[:attr_value] if args.key?(:attr_value)\n end", "def update!(**args)\n @mid_line_curve = args[:mid_line_curve] if args.key?(:mid_line_curve)\n @thickness = args[:thickness] if args.key?(:thickness)\n @top_to_bottom = args[:top_to_bottom] if args.key?(:top_to_bottom)\n end", "def attr_writer(sym, *more) end", "def attributes=(hash)\n hash.each do |key, value|\n send(\"#{key}=\", value)\n end\n end", "def health=(new_health)\n @health = new_health\n end", "def update!(**args)\n @birthday_decoration_visibility = args[:birthday_decoration_visibility] if args.key?(:birthday_decoration_visibility)\n end", "def age=(v) self['Age'] = v end", "def override\n attributes.override\n end", "def update!(**args)\n @enable_feature_attributes = args[:enable_feature_attributes] if args.key?(:enable_feature_attributes)\n @explanation_baseline = args[:explanation_baseline] if args.key?(:explanation_baseline)\n end", "def update!(**args)\n @metalines = args[:metalines] if args.key?(:metalines)\n @object_display_label = args[:object_display_label] if args.key?(:object_display_label)\n end", "def update!(**args)\n @metalines = args[:metalines] if args.key?(:metalines)\n @object_display_label = args[:object_display_label] if args.key?(:object_display_label)\n end", "def update(hash)\n super(hash.to_hash)\n end", "def set_attributes_from_stanzas(lsvg_stanzas)\n \n lsvg_stanzas.each do |stanza|\n attribute, value = stanza.split ':'\n attribute.downcase!.tr!(' ', '_')\n if VG_ATTRIBUTES.include? attribute\n attribute.sub!(/vg_/, '')\n value = value.slice(/[\\w\\d]+/)\n value = value.to_i if value.is_i?\n method_name = attribute + '='\n if self.respond_to? method_name\n self.send(method_name, value)\n else\n p \"No accessor for #{attribute}\"\n end\n end\n end\n end", "def method_missing(method_name, *args, &block)\n if method_name.to_s.end_with?('=')\n set_attribute(method_name, *args)\n elsif has_attribute?(method_name)\n get_attribute(method_name)\n else\n super\n end\n end", "def rewrite_attributes(h={})\n row, original_primary_key, record_class \\\n = CkuruTools.validate_hash_arguments(h,\n [:row,{:instance_that_inherits_from => ActiveRecord::Base,:required => true}],\n [:original_primary_key,{:instance_that_inherits_from => String,:required => true}],\n [:record_class,{:klass_that_inherits_from => ActiveRecord::Base,:required => true}]\n )\n\n\n new = Hash.new\n row.attributes.keys.each do |k|\n new_key = k.downcase\n if new_key == record_class.primary_key\n if new_key == original_primary_key\n ckebug 0, \"mapping #{new_key} from #{record_class.primary_key}\"\n new_key = \"original_#{new_key}\"\n else\n ckebug 1, \"skipping attribute #{new_key}; assuming this is the system generated key\"\n next\n end\n end\n new[new_key] = row.attributes[k]\n end\n return new\n end", "def update_locally!(attributes_hash)\n attributes_hash.each_pair do |attr_name, value|\n attributes[attr_name.to_sym] = value\n end\n end", "def update!(**args)\n @attribute_id = args[:attribute_id] if args.key?(:attribute_id)\n @entity_relationship = args[:entity_relationship] if args.key?(:entity_relationship)\n @freebase_mid = args[:freebase_mid] if args.key?(:freebase_mid)\n @personal_entity_child = args[:personal_entity_child] if args.key?(:personal_entity_child)\n end", "def update!(**args)\n @attribute = args[:attribute] if args.key?(:attribute)\n end", "def attributes=(new_attributes)\n @attributes = if new_attributes.is_a?(Hash)\n cloned_attributes = new_attributes.clone\n cloned_attributes.delete(:ID)\n cloned_attributes.delete(:Name)\n cloned_attributes.delete(:Alias)\n cloned_attributes.delete(:Parent)\n cloned_attributes\n else\n Feature.parse_attributes(new_attributes, except: [:ID, :Name, :Alias, :Parent])\n end\n end", "def update!(**args)\n @debug_title = args[:debug_title] if args.key?(:debug_title)\n @is_boosted_primary_weight_link = args[:is_boosted_primary_weight_link] if args.key?(:is_boosted_primary_weight_link)\n @target_mid = args[:target_mid] if args.key?(:target_mid)\n @variant_info = args[:variant_info] if args.key?(:variant_info)\n end", "def update!(**args)\n @attribute_key = args[:attribute_key] if args.key?(:attribute_key)\n @attribute_value = args[:attribute_value] if args.key?(:attribute_value)\n end", "def setVehicleArmor _obj, _args\n \"_obj setVehicleArmor _args;\" \n end", "def attributes=(new_attributes)\n acceptable_attributes = [:ID, :Name, :Note, :Alias, :Parent]\n @attributes = if new_attributes.is_a?(Hash)\n # Symbolify the keys in the hash\n symbolized_attributes = Hash[new_attributes.map { |(attribute, value)| [attribute.to_sym, value] }]\n \n # Pull out the acceptable attributes\n detected_attributes = {}\n acceptable_attributes.each do |attribute|\n detected_attributes[attribute] = symbolized_attributes[attribute] if symbolized_attributes[attribute]\n end\n \n detected_attributes\n else\n Feature.parse_attributes(new_attributes, only: acceptable_attributes)\n end\n end", "def scaffold_set_attributes(object, attributes)\n attributes.each do |k,v|\n v = nil if v.empty? and (scaffold_table_column_type(k) == :boolean or scaffold_table_column_type(k) == :integer)\n object.send(\"#{k}=\", v)\n end \n end", "def setAttrib(name,value)\n\t\t@attributes[name] = value\n\tend", "def update!(**args)\n @name = args[:name] if args.key?(:name)\n @sigma = args[:sigma] if args.key?(:sigma)\n end", "def do_bean_set_attributes(params)\n return if !params || params.empty?\n new_attributes = @remote_strategy.set_attributes(@ancestry, params, @client_info)\n super(new_attributes)\n #rescue Exception => e\n # puts \"Error setting attributes: #{e.message}\"\n # return e\n end", "def update_attributes(attrs)\n difference = attrs.keys - ASSIGNABLE\n if difference.empty?\n attributes.merge!(attrs)\n else\n raise \"unexpected attributes #{difference} for #{@node.path}\"\n end\n end", "def set(params = {})\n params.each do |k,v|\n self.class.attributes k.to_s\n send(k.to_s+\"=\",v)\n end\n end", "def setup_object_attributes; end" ]
[ "0.648372", "0.6469076", "0.6367974", "0.6240641", "0.62323076", "0.61405843", "0.61291534", "0.61275584", "0.61275584", "0.603827", "0.603827", "0.6023425", "0.5988246", "0.5988246", "0.5988246", "0.5988246", "0.594472", "0.59079933", "0.59029317", "0.58717495", "0.58717495", "0.5830552", "0.58286756", "0.58159775", "0.5807751", "0.5769078", "0.5727919", "0.5727919", "0.5713554", "0.56946623", "0.56946623", "0.5690865", "0.56821376", "0.5677015", "0.5674452", "0.56730443", "0.5669746", "0.5667429", "0.56664354", "0.5665551", "0.56610924", "0.5660582", "0.56547326", "0.56421167", "0.56416935", "0.56411684", "0.56371903", "0.5621607", "0.5621607", "0.56180674", "0.56168807", "0.5602361", "0.5596656", "0.5593193", "0.5588275", "0.5588275", "0.5579318", "0.5564471", "0.5560415", "0.5560065", "0.555746", "0.5555121", "0.55511326", "0.5540763", "0.5539607", "0.5528204", "0.55230534", "0.5508616", "0.5508301", "0.5499614", "0.54980224", "0.5494979", "0.54941803", "0.5493121", "0.5489347", "0.54858375", "0.5482199", "0.5477605", "0.54761463", "0.54709864", "0.546912", "0.546912", "0.5468504", "0.5463607", "0.54601616", "0.54475087", "0.5439778", "0.54386675", "0.5437878", "0.5437872", "0.5437388", "0.5435221", "0.5433659", "0.5433639", "0.5432699", "0.5430062", "0.5428137", "0.542391", "0.54227877", "0.542145", "0.5418303" ]
0.0
-1
Init with exception message and response object if one is available
def initialize(httpMsg, responseObj = nil) @response = responseObj super("An error occurred executing the HTTP request: #{httpMsg}") end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize(*args, **opt)\n @http_response = @http_status = @cause = nil\n args.map! do |arg|\n case arg\n when Integer then (@http_status = arg) and next\n when Exception then @cause = arg\n when Faraday::Response then faraday_response(arg)\n else arg\n end\n end\n args.flatten!\n args.compact!\n # noinspection RailsParamDefResolve\n case @cause\n when nil\n # Ignore\n when Api::Error\n @http_response ||= @cause.http_response\n @http_status ||= @cause.http_status\n when Faraday::Error\n @http_status ||= @cause.response&.dig(:status)\n args = faraday_error(*@cause.message) + args\n @cause = @cause.wrapped_exception || @cause\n when Exception\n @http_status ||= @cause.try(:code)\n else\n Log.warn { \"Api::Error#initialize: @cause #{@cause.class} unexpected\" }\n end\n @http_status ||= @http_response&.status\n super(*args, **opt)\n rescue => error\n Log.error { \"Api::Error#initialize: #{error.class}: #{error.message}\" }\n re_raise_if_internal_exception(error)\n super('ERROR')\n end", "def initialize(response)\n response.error = self\n @response = response\n\n message = []\n\n if response.parsed.is_a?(Hash)\n @code = response.parsed['error']\n @description = response.parsed['error_description']\n message << \"#{@code}: #{@description}\"\n end\n\n message << response.body.force_encoding(\"UTF-8\")\n\n super(message.join(\"\\n\"))\n end", "def initialize(msg, args={})\n super\n @response = args.to_smash[:response]\n @message = msg\n extract_error_message(@response)\n end", "def intitiate_response_object \n response_object = Hash.new\n response_object[:status] = \"failure\"\n response_object[:statusCode] = 500\n response_object[:response] = \"\"\n response_object[:message] = \"The server encountered an unexpected condition which prevented it from fulfilling the request\"\n return response_object\n end", "def from_response(response)\n\n payload = response.body\n @error = payload['error']\n @error_code = payload['error_code']\n @details = payload['details']\n @response = response\n\n logger.error(\"Request failed with status #{response.code.to_s}: '#{@error_code} #{@error}': #{response.body}\")\n\n self\n end", "def initialize(response)\n @response = response\n\n if outcome\n @code = outcome[:reason_code]\n message = outcome[:reason_message]\n else\n message = \"the server responded with status #{response[:status]}\"\n end\n\n super(message)\n end", "def initialize(exception, **options)\n @exception = exception\n\n @status = options[:status]\n\n @title = options[:title]\n\n @detail = options[:detail]\n if options[:message] && @detail.nil?\n # Deprecated, from GraphitiErrors\n @detail = (options[:message] == true) ? :exception : options[:message]\n end\n\n @meta = options[:meta]\n @code = options[:code]\n\n # TODO: Warn about unrecognized options\n end", "def initialize(response)\n raise ArgumentError, \"Response doesnot exist\" if ((response.nil? || response.empty?) && response.code.nil? && response.code.empty?)\n @_response = response\n @_statusCode = response.code\n @_responseBody = response.body\n end", "def exc_msg_and_response(exc, response = T.unsafe(nil)); end", "def make_error(type, response, url: 'http://example.com', request_body: '{\"msg\": \"The request body\"}')\n error = nil\n\n begin\n begin\n raise Faraday::ClientError, \"The original error\"\n rescue Faraday::ClientError => e\n request = RestfulResource::Request.new(:get, url, body: request_body)\n raise type.new(request, response)\n end\n rescue Exception => e\n error = e\n end\n\n error\n end", "def initialize(opts = {})\n error_message = opts[:error_message] || Default::ERROR_MESSAGE\n add_backtrace!(error_message, opts[:backtrace]) if opts[:backtrace]\n error_code = opts[:error_code] || Default::ERROR_CODE\n @hash_form = ResponseOrErrorHashContent.new(:notok, Key.error_message => error_message, Key.error_code => error_code)\n end", "def initialize(base_url, exc_class = nil)\n @base_url = base_url.chomp('/')\n @exc_class = exc_class || RestException\n @headers = {}\n end", "def initialize(msg, api_response = nil)\n super(msg)\n\n # Automatically use included response object if possible\n @api_response = api_response.respond_to?(:response) ? api_response.response : api_response\n\n # Parse response and set instance vars\n parse_response unless @api_response.nil?\n end", "def initialize(reason, response_code, response_body)\r\n super(reason)\r\n @response_code = response_code\r\n @response_body = response_body\r\n end", "def exception_response\n { ok: false, message: 'Error processing request' }\n end", "def initialize(msg, response = nil)\n @response = response\n msg += \" => #{response.body}\" if response&.body\n super(msg)\n end", "def initialize(response, url, query_params = {})\n @response_status = response.status\n @response_body = response.body\n @response_headers = response.headers\n message = \"Status code #{response.status} on resource #{url}\"\n message += \" with params: #{query_params.inspect}\" if query_params.present?\n super(message)\n end", "def initialize(options={})\n options = {} if options.nil?\n options = { :message => options.message } if options.is_a? Exception\n \n options = { :message => options } if options.is_a? String\n @headers = Hash.new\n @headers.merge! options.delete(:headers) || {}\n @status = options[:status] || default_status\n @title = options[:title] || default_title\n @message = options[:message] || default_message\n @help = options[:help] || default_help\n end", "def handle_exceptions &block\n begin\n yield\n rescue RestClient::Exception => e\n Response.new(e.response, :error => e.message)\n end\n end", "def response!\n return response if !response.errors?\n\n raise response.to_exception\n end", "def populate_error resp\n code = resp.http_response.status\n if EMPTY_BODY_ERRORS.include?(code) and empty_response_body?(resp.http_response.body)\n error_class = EMPTY_BODY_ERRORS[code]\n resp.error = error_class.new(resp.http_request, resp.http_response)\n else\n super\n end\n end", "def initialize(response)\n @response = response\n @headers = response.headers\n @status = response.status\n @body = response.body || ''\n end", "def initialize(headers, errors, status_code)\n @headers = headers\n\n if errors.is_a?(Array) || !errors\n @errors = (errors || []).map do |error|\n OpenStruct.new(error['error'])\n end\n else\n @errors = [OpenStruct.new(message: 'The API returned an unexpected '\\\n 'response. This is likely due to an incorrectly defined base URL.')]\n end\n\n @status_code = status_code\n end", "def initialize(method, path, response)\n @method = method\n @path = path\n @code = response.code\n @body = response.body.to_s\n @body = @body.empty? ? \"<none>\" : \"#{response.body}\"\n message = \"Unexpected server response:\\n Method: #{@method}\\n Path: \"\\\n \"#{@path}\\n Code: #{@code}\\n Body: #{@body}\"\n super message\n end", "def initialize(http_response, http_response_code, http_raw_response)\n @http_status_code = http_response_code\n @http_raw_response = http_raw_response\n\n # only set these variables if a message-body is expected.\n if not @http_raw_response.kind_of? Net::HTTPNoContent\n @body = MultiJson.load(http_response) unless http_response.nil?\n @request = MultiJson.load(@body[\"request\"].to_s) if @body[\"request\"]\n @api_status = @body[\"status\"].to_i if @body[\"status\"]\n @api_error_message = @body[\"error_message\"].to_s if @body[\"error_message\"]\n end\n end", "def initialize(response)\n @data = response[:data]\n @status = response[:status]\n super ApduError.message_for_apdu_response(response)\n end", "def not_found(response)\n NotFound.new.tap { |exception| exception.response = response }\n end", "def initialize(error_reply)\n\t\t\tsuper(error_reply.value)\n\t\t\t@status_code = error_reply.status_code\n\t\tend", "def __raise_transport_error(response)\n error = ERRORS[response.status] || ServerError\n raise error.new \"[#{response.status}] #{response.body}\"\n end", "def initialize(response)\n @response = response\n end", "def initialize(response)\n @response = response\n end", "def initialize(response)\n @response = response\n end", "def initialize(response)\n @response = response\n end", "def with_general_exception_check(exception_code, exception_regexp, exception)\n if @response.code == exception_code && exception_regexp.match(JSON.parse(@response.body)['error'])\n raise(exception)\n else\n self\n end\n rescue JSON::ParserError\n self\n end", "def initialize(response, request)\n @response = response\n @request = request\n end", "def initialize(params = {})\n set_error(params)\n set_message(params[:message])\n set_http_code(params[:http_code])\n @data = params[:data] || {}\n end", "def initialize_retry_exceptions\n [\n RestClient::ExceptionWithResponse,\n RestClient::ServerBrokeConnection,\n RestClient::Exceptions::Timeout\n ].push(*Retry::Exceptions::SOCKET_EXCEPTIONS)\n end", "def initialize(response)\n @response = response\n end", "def serve_exception(_exception); end", "def with_error_handling\n\t\t\tyield\n\t\t rescue RestClient::Exceptions::Timeout\n \t\t\tbody = {\n \t\t\t\terror: {\n \t\t\t\t\ten: \"Request Timeout\"\n \t\t\t\t},\n \t\t\t\thttp_code: 504\n \t\t\t}\n\t\t\t raise Error.from_response(body)\n\t\t rescue RestClient::Exception => e\n if e.response.headers[:content_type] == 'application/json'\n body = JSON.parse(e.response.body)\n else\n \t\t\t\tbody = {\n \t\t\t\t\terror: {\n \t\t\t\t\t\ten: e.response.body\n \t\t\t\t\t},\n \t\t\t\t\thttp_code: e.response.code\n \t\t\t\t}\n\t\t\t end\n\t\t\t raise Error.from_response(body)\n\t\tend", "def handle(response)\n exception = AuthorizeNet::Exception.new\n\n if !response.errors.nil?\n first_error = response.errors.first\n exception.message = first_error[:text]\n\n # Add errors to exception\n response.errors.each do |error|\n exception.errors << buildError(error)\n end\n\n raise exception\n\n # If there are no errors, then the \"messages\" are probably errors... *sigh*\n elsif !response.messages.nil? and response.result == AuthorizeNet::RESULT_ERROR\n first_msg = response.messages.first\n exception.message = first_msg[:text]\n\n # Add messages (that are sometimes actually errors) to exception\n response.messages.each do |msg|\n exception.errors << buildError(msg)\n end\n\n raise exception\n end\n\n end", "def invalid_request(response)\n errors = body(response).fetch('errors', []).map { |e| e['message'] }\n InvalidRequest.new(errors).tap do |exception|\n exception.response = response\n end\n end", "def set_error(ex, backtrace=false)\n\n # set repsonse headers\n @status = 404;\n @header['content-type'] = \"text/html; charset=UTF-8\"\n\n # set response content\n @body = ''\n @body << <<-_end_of_html_\n \n <HTML>\n <HEAD>\n <TITLE>No page for you!</TITLE>\n\n <STYLE type=\"text/css\">\n BODY { font: 8pt/12pt verdana }\n H1 { font: 13pt/15pt verdana }\n H2 { font: 8pt/12pt verdana }\n A:link { color: black; text-decoration: none }\n A:visited { color: black; text-decoration: none }\n </STYLE>\n\n </HEAD><BODY>\n <TABLE width=500 border=0 cellspacing=10>\n <TR>\n <TD>\n\n <h1><a href=\"http://www.bindshell.net/tools/beef/\">These aren't the pages you're looking for</a></h1>\n \n </TD>\n </TR>\n </TABLE>\n </BODY>\n </HTML>\n \n _end_of_html_\n \n end", "def initialize(e)\n @fault = e\n e.to_hash.tap do |fault|\n fault_code = fault[:fault][:faultcode]\n fault_string = parse_fault(fault[:fault][:faultstring])\n super(compose_message('soap_error',\n message: fault_string,\n code: fault_code))\n end\n end", "def test_handles_failure_to_create_request_object\n if defined?(ActionDispatch::Request)\n ActionDispatch::Request.stubs(:new).raises('bad news')\n\n assert_raises RuntimeError do\n get '/foo/bar?q=12'\n end\n\n assert_equal('unhandled error', last_error.message)\n assert_equal('/foo/bar', last_error.params[:request_uri])\n end\n end", "def handle_request_exception(exception)\n # puts \"ERROR: #{exception}\\n\" + exception.backtrace.join(\"\\n\")\n handle_error_response(exception.kind_of?(CAHTTPError) ? JSON.parse(exception.response) : {})\n end", "def error_manager(uri, response)\n case response\n when Net::HTTPSuccess then\n # This covers cases where the response may not validate as JSON.\n begin\n return JSON.parse(response.body)\n rescue\n return {}\n end\n when Net::HTTPBadRequest\n raise Ropenstack::MalformedRequestError, response.body\n when Net::HTTPNotFound\n raise Ropenstack::NotFoundError, \"URI: #{uri} \\n\" + response.body\t\n when Net::HTTPUnauthorized\n raise Ropenstack::UnauthorisedError, response.body\n else\n raise Ropenstack::RopenstackError, response.body\n end\n end", "def from_error(error)\n child = error.get_elements('Errors')[0].get_elements('error')[0]\n code = child.attributes['code']\n exception = exceptions.find{|exc| exc.http_code == code }\n exception ||= self\n message = child.children.empty? ? '' : child.children[0].attributes['message']\n exception.new code, message\n end", "def initialize(hash={})\n @hash = hash\n @api_key = hash[:api_key] if hash.has_key? :api_key\n\n super(hash[:api_url] || 'https://api.ramcoams.com/api/v2/') do |builder|\n yield builder if block_given?\n builder.use FaradayMiddleware::RaiseHttpException\n end\n end", "def initialize(response, status)\n @response = response\n @status = status\n end", "def initialize(http_response, request)\n @http_response = http_response\n @request = request\n end", "def get_exception_with_string\r\n # Prepare query url.\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << '/error/stringInException'\r\n _query_url = APIHelper.clean_url _query_builder\r\n\r\n # Prepare headers.\r\n _headers = {\r\n 'accept' => 'application/json'\r\n }\r\n\r\n # Prepare and execute HttpRequest.\r\n _request = @http_client.get(\r\n _query_url,\r\n headers: _headers\r\n )\r\n 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 == 444\r\n raise ExceptionWithStringException.new(\r\n 'exception with string',\r\n _context\r\n )\r\n end\r\n validate_response(_context)\r\n\r\n # Return appropriate response type.\r\n decoded = APIHelper.json_deserialize(_context.response.raw_body) unless\r\n _context.response.raw_body.nil? ||\r\n _context.response.raw_body.to_s.strip.empty?\r\n decoded\r\n end", "def auth_exception_response(auth_exception_response=nil)\n return @auth_exception_response unless auth_exception_response\n @auth_exception_response = auth_exception_response\n end", "def initialize(response)\n self.savon = response\n self.body = response.body\n self.http_code = response.http.code\n # TODO: handle errors here\n end", "def initialize(http_response)\n @http_response = http_response\n @uri = http_response.uri\n @status_code = http_response.status_code\n parse_response\n # Use reason phrase as the description if description is empty\n @description = http_response.reason_phrase if (@description.nil? || @description.empty?) && http_response.reason_phrase\n super(\"#{type} (#{status_code}): #{description}\")\n end", "def initialize(response, envelope = [])\n @response = response\n @envelope = envelope\n end", "def handle_response(response)\n case response.code.to_i\n when 301, 302, 303, 307\n raise(Redirection.new(response))\n when 200...400\n response\n when 400\n raise(BadRequest.new(response))\n when 401\n raise(UnauthorizedAccess.new(response))\n when 403\n raise(ForbiddenAccess.new(response))\n when 404\n raise(ResourceNotFound.new(response))\n when 405\n raise(MethodNotAllowed.new(response))\n when 409\n raise(ResourceConflict.new(response))\n when 410\n raise(ResourceGone.new(response))\n when 422\n raise(ResourceInvalid.new(response))\n when 401...500\n raise(ClientError.new(response))\n when 500...600\n raise(ServerError.new(response))\n else\n raise(ConnectionError.new(response, \"Unknown response code: #{response.code}\"))\n end\n end", "def raise_exception(response)\n case response.code.to_i\n when 401\n raise TflApi::Exceptions::Unauthorized, logger\n when 403\n raise TflApi::Exceptions::Forbidden, logger\n when 404\n raise TflApi::Exceptions::NotFound, logger\n when 500\n raise TflApi::Exceptions::InternalServerError, logger\n when 503\n raise TflApi::Exceptions::ServiceUnavailable, logger\n else\n raise TflApi::Exceptions::ApiException, logger, \"non-successful response (#{response.code}) was returned\"\n end\n end", "def initialize(request, response)\n @request = request\n @response = response\n end", "def dispatch_default_exception(klass, request, response, e)\n controller = klass.build(request, response, e.class::STATUS)\n if e.is_a? ControllerExceptions::Redirection\n controller.headers.merge!('Location' => e.message)\n controller.instance_variable_set(\"@_body\", %{ }) #fix\n else\n @exception = e # for ERB\n controller.instance_variable_set(\"@_body\", DEFAULT_ERROR_TEMPLATE.result(binding))\n end\n [controller, e.name]\n end", "def response_error(response)\n trace = \"Response \\n\\nbody : #{response.body}\\n\\ncode: #{response.code}\\n\\nmessage: #{response.message}\"\n case @base_url\n when BASE_URLS[:quote]\n raise InterfaceError, \"Error :: Could not get stock data \\n\\n#{trace}\"\n when BASE_URLS[:history]\n raise InterfaceError, \"Error :: Could not get historical data \\n\\n#{trace}\"\n when BASE_URLS[:scrip_symbol]\n raise InterfaceError, \"Error :: Could not get stock symbol \\n\\n#{trace}\"\n else\n raise InterfaceError, \"Error connecting to #{@base_url} \\n\\n#{trace}\"\n end\n end", "def error(response)\n ChefAPI::Log.info \"Parsing response as error...\"\n\n case response[\"Content-Type\"]\n when /json/\n ChefAPI::Log.debug \"Detected error response as JSON\"\n ChefAPI::Log.debug \"Parsing error response as JSON\"\n message = JSON.parse(response.body)\n else\n ChefAPI::Log.debug \"Detected response as text/plain\"\n message = response.body\n end\n\n case response.code.to_i\n when 400\n raise Error::HTTPBadRequest.new(message: message)\n when 401\n raise Error::HTTPUnauthorizedRequest.new(message: message)\n when 403\n raise Error::HTTPForbiddenRequest.new(message: message)\n when 404\n raise Error::HTTPNotFound.new(message: message)\n when 405\n raise Error::HTTPMethodNotAllowed.new(message: message)\n when 406\n raise Error::HTTPNotAcceptable.new(message: message)\n when 504\n raise Error::HTTPGatewayTimeout.new(message: message)\n when 500..600\n raise Error::HTTPServerUnavailable.new\n else\n raise \"I got an error #{response.code} that I don't know how to handle!\"\n end\n end", "def initialize(name, query, response)\n @query_name = name\n @query_parameters = query\n @db_response = response\n super(\"Query #{@query_name} failed with the following response: #{response.inspect}\")\n # set the backtrace to everything that's going on except this initialize method\n set_backtrace(caller[1...caller.length])\n end", "def wrapped_exception; end", "def handle_response(response)\n case response.code.to_i\n when 200...400\n response\n when 404\n raise NotFoundError.new(response)\n else\n raise ConnectionError.new(response)\n end\n end", "def handle_response(response)\n case response.code.to_i\n when 200...400\n response\n when 404\n raise NotFoundError.new(response)\n else\n raise ConnectionError.new(response)\n end\n end", "def initialize(response_data = nil, error = nil)\n if response_data.class.to_s == \"Nokogiri::XML::Document\"\n @xml_data = response_data\n elsif response_data.class.to_s == \"Hash\"\n @json_data = response_data\n prepare_data(response_data)\n\n\n else\n @error = error\n end\n\n end", "def add_errors_from_response_exception(e)\n return if !e.respond_to?(:response)\n errors = (BackchatResource::Base.format.decode(e.response.body))[\"errors\"]\n if errors.any?\n errors.each do |err|\n if err.length == 1 # message only\n self.errors.add(:base, err[0])\n else #key, message(*)\n key = err[0].to_sym\n err[1..-1].each do |value|\n self.errors.add(key, value)\n end\n end\n end\n end\n end", "def if_non_200_raise(exception_klass)\n @non_200_exception = exception_klass\n self\n end", "def handle_request_error(exception)\n end", "def format_response_or_raise_error response\n if response.status / 100 == 2\n response.body\n elsif response.status == 404\n raise Unloq::APIError::NotFoundError.new(response.status, response.body)\n else\n raise Unloq::APIError.new(response.status, response.body)\n end\n end", "def extract_information_from(env)\n exception = env['action_dispatch.exception']\n exception_wrapper = ActionDispatch::ExceptionWrapper.new(env, exception)\n @rescue_response = ActionDispatch::ExceptionWrapper.rescue_responses[exception.class.name]\n @message = exception.message\n @status_code = exception_wrapper.status_code\n end", "def initialize(request, data={}) #:nodoc:\n @request, @data = request, data\n @code, @message = data[:code] || FX_OK, data[:message]\n end", "def response_for(status, exception)\n render json: {\n errors: [exception.message],\n }, status: status\n end", "def auth_exception(auth_exception)\n return @auth_exception unless auth_exception\n @auth_exception_response = 'Auth Exception'\n end", "def handle_response(response) # :nodoc:\n case response.code\n when 400\n #IN CASE WE WANT MORE PRECISE ERROR NAMES\n #data = response.parsed_response\n #case data['code']\n #when 230\n # raise ParameterDataInvalid.new data\n #else\n # raise BadRequest.new data\n #end\n raise BadRequest.new(response.parsed_response)\n when 403\n raise Unauthorized.new(response.parsed_response)\n when 404\n raise NotFound.new\n when 400...500\n raise ClientError.new\n when 500...600\n raise ServerError.new\n else\n response.parsed_response\n end\n end", "def handle_response(request, response)\n case response.code.to_i\n when 301,302\n raise(Redirection.new(request, response))\n when 200...400\n response\n when 400\n raise(BadRequest.new(request, response))\n when 401\n raise(UnauthorizedAccess.new(request, response))\n when 403\n raise(ForbiddenAccess.new(request, response))\n when 404\n raise(ResourceNotFound.new(request, response))\n when 405\n raise(MethodNotAllowed.new(request, response))\n when 409\n raise(ResourceConflict.new(request, response))\n when 412\n raise(PreconditionFailed.new(request, response))\n when 422\n raise(ResourceInvalid.new(request, response))\n when 401...500\n raise(ClientError.new(request, response))\n when 500...600\n raise(ServerError.new(request, response))\n else\n raise(ConnectionError.new(request, response, \"Unknown response code: #{response.code}\"))\n end\n begin\n if response.body.blank?\n nil\n else\n hash = JSON(response.body)\n normalize_hash(hash)\n end\n rescue JSON::ParserError => e\n raise(ConnectionError.new(request, response, \"Invalid json response: #{e.body}\"))\n end\n end", "def handle_exception e\n response.headers['Content-Type'] = 'application/json'\n response.body = { message: e.message, backtrace: e.backtrace }.to_json\n end", "def initialize(code, object = nil, status = nil, aditional_data = nil, data_root = :message)\n aditional_data = {} unless aditional_data\n response = {\n :status => status || \"success\",\n :code => code,\n :message => Response::message(code)\n }.merge(aditional_data)\n\n if object\n @_object = object\n response[:data] = {data_root => @_object}\n end\n\n @object = OpenStruct.new(response)\n end", "def initialize(object, response = nil)\n @object = object\n\n @active = object['active']\n @block_type = object['block_type']\n @created_at = object['created_at']\n @id = object['id']\n @reason_description = object['reason_description']\n @reason_type = object['reason_type']\n @resource_reference = object['resource_reference']\n @updated_at = object['updated_at']\n @response = response\n end", "def raise_if_error_present_in(response)\n response_xml = response.parsed_response\n if response_xml && !response_xml.css('error').empty?\n error_id = response_xml.css('error').first['id']\n error_message = response_xml.css('error message').first.text\n\n # Rozpoznajemy ten kod bledu i mozemy rzucic okreslona klasa wyjatku:\n if exception_class = EXCEPTION_CLASSES[error_id.to_s]\n raise exception_class, error_message\n else\n # Jakis nieznany blad - rzucamy chociaz stringiem\n raise Exceptions::UnknownError, \"ELIBRI_API ERROR #{error_id}: #{error_message}\"\n end\n end\n end", "def initialize(response)\n @status = response.code.to_i\n @headers = response.each_header { |_, _| }\n @body = extract_body(response.body, *headers[Futile::Headers::CONTENT_ENCODING])\n @status = response.code.to_i\n end", "def error_on(exception, message)\n env.logger.debug \"---BUILD ERROR RESPONSE #{self.class}---\\t #{exception.inspect} with message #{message}\"\n raise exception, message\n end", "def initialize(error_type, error_code, error_message, display_message, request_id)\n @error_type = error_type\n @error_code = error_code\n @error_message = error_message\n @display_message = display_message\n @request_id = request_id\n\n super \"\\n\"\\\n \"Error Type : #{@error_type}\\n\"\\\n \"Error Code : #{@error_code}\\n\"\\\n \"Error Message : #{@error_message}\\n\"\\\n \"Display Message : #{@display_message}\\n\"\\\n \"Request ID : #{@request_id}\\n\"\n end", "def initialize(params = {})\n @response = {\n has_errors: false,\n errors: []\n }\n @injected_params = params\n end", "def failure(response)\n catch_throttling_error(response)\n parsed_response = JSON.parse(response.body.to_s)\n raise RequestError, parsed_response['detail']\n rescue JSON::ParserError\n raise RequestError, response.status\n end", "def with_exception_handling\r\n yield\r\n rescue Timeout::Error => exc\r\n return { code: Scrapers::StatusCodes::BLOCKED_REQUEST }\r\n rescue Exception => exc\r\n @logger.error(\"\\n#{self.class} error\")\r\n @logger.error(exc)\r\n @logger.error(exc.backtrace.join(\"\\n\"))\r\n @logger.error(body)\r\n\r\n return { code: Scrapers::StatusCodes::INTERNAL_ERROR }\r\n end", "def raise_exception_or_error_response(exception, status_code)\n if raise_exceptions?\n raise exception\n else\n bail status_code, exception.message\n end\n end", "def initError(msg)\n raise ArgumentError, msg\nend", "def setup_response\n begin\n @response = @interceptor.intercept(request: @request) # TODO: ignored_routes, matched_routes, robots_json, & check_static_files options\n rescue SnapSearch::Exception => exception\n @config.on_exception.nil? ? raise(exception) : @config.on_exception.call(exception)\n end\n end", "def exception_with_internal_code(e, code, msg, internal_code, data = {})\n\n Result::Base.exception(\n e, {\n error: code,\n error_message: msg,\n data: data,\n http_code: internal_code\n }\n )\n end", "def initialize(error, json_props, server_bundle)\n @error = error\n @json_props = json_props\n @server_bundle = server_bundle\n @text = error.to_s\n end", "def log_request_response(exception = nil)\n super(exception) if exception.present?\n end", "def binding_error(status_code:, messages:)\n OpenStruct.new(status_code: status_code, messages: messages)\n end", "def build_excon_response(body, status = 200)\n response = Excon::Response.new(:body => body, :status => status)\n if body && body.key?(\"error\")\n msg = \"Google Cloud did not return an error message\"\n\n if body[\"error\"].is_a?(Hash)\n response.status = body[\"error\"][\"code\"]\n if body[\"error\"].key?(\"errors\")\n msg = body[\"error\"][\"errors\"].map { |error| error[\"message\"] }.join(\", \")\n elsif body[\"error\"].key?(\"message\")\n msg = body[\"error\"][\"message\"]\n end\n elsif body[\"error\"].is_a?(Array)\n msg = body[\"error\"].map { |error| error[\"code\"] }.join(\", \")\n end\n\n case response.status\n when 404\n raise Fog::Errors::NotFound.new(msg)\n else\n raise Fog::Errors::Error.new(msg)\n end\n end\n\n response\n end", "def from_error(err)\n return unless err\n case err[:code]\n when 503\n ::NATS::JetStream::Error::ServiceUnavailable.new(err)\n when 500\n ::NATS::JetStream::Error::ServerError.new(err)\n when 404\n case err[:err_code]\n when 10059\n ::NATS::JetStream::Error::StreamNotFound.new(err)\n when 10014\n ::NATS::JetStream::Error::ConsumerNotFound.new(err)\n else\n ::NATS::JetStream::Error::NotFound.new(err)\n end\n when 400\n ::NATS::JetStream::Error::BadRequest.new(err)\n else\n ::NATS::JetStream::API::Error.new(err)\n end\n end", "def initialize(request, response, body = nil)\n @request = request\n @response = response\n @body = body\n end", "def initialize(reason, error, failureReason=nil)\n if error.is_a? Exception\n @message = reason + '. Stack Trace:' + error.backtrace.to_s\n else\n @message = reason\n end\n ## Validate that the reason + error stacktrace are not longer then 4096 charcters \n if @message.length > 4096\n @message = @message[0,4096]\n end\n @failureReason = failureReason\n\n end", "def handle_response(response)\n case response.code.to_i\n when 200\n JSON.parse(response.body)['holidays']\n when 400\n raise BadRequest.new response.parsed_response\n when 401\n raise Unauthorized.new\n when 404\n raise NotFound.new\n when 400...500\n raise ClientError.new response.parsed_response\n when 500...600\n raise ServerError.new\n else\n response\n end\n end", "def render_parameter_missing_response(exception)\n render json: {error: exception.message}, status: 422\n end" ]
[ "0.7069889", "0.6628665", "0.65540856", "0.65407354", "0.6517642", "0.6460289", "0.64318734", "0.6425355", "0.6399185", "0.6388257", "0.6331553", "0.628075", "0.6268058", "0.6266657", "0.6239877", "0.6239677", "0.6235888", "0.6196421", "0.61874914", "0.61860734", "0.6182955", "0.61350536", "0.60868865", "0.60768116", "0.6066536", "0.6043407", "0.6040749", "0.6027317", "0.5998801", "0.59986013", "0.59986013", "0.59986013", "0.59986013", "0.5995362", "0.59950846", "0.5982207", "0.59776044", "0.59759283", "0.597006", "0.5956917", "0.59561396", "0.5948695", "0.5938584", "0.5889718", "0.58761513", "0.5873376", "0.5859225", "0.58460176", "0.5837472", "0.5835529", "0.5834725", "0.58284575", "0.58250123", "0.5823677", "0.5819808", "0.58140624", "0.5805572", "0.57990086", "0.57868105", "0.5782162", "0.57691115", "0.57635874", "0.5750665", "0.57414573", "0.5737468", "0.5737468", "0.57304716", "0.57073414", "0.570675", "0.5702965", "0.56920147", "0.5684483", "0.56747997", "0.56674117", "0.56656766", "0.5661831", "0.5650147", "0.56465775", "0.56442004", "0.5641855", "0.5641003", "0.56383586", "0.56377214", "0.563569", "0.56344706", "0.56339717", "0.56301355", "0.56269157", "0.5618495", "0.56171656", "0.5614259", "0.5590732", "0.5587199", "0.55832505", "0.5572243", "0.5567926", "0.5559012", "0.55543435", "0.55535966", "0.55415225" ]
0.71237963
0
want it to eexcute every time called
def exists? false end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bye; end", "def once\n end", "def recall; end", "def faint; end", "def faint; end", "def pass; end", "def pass; end", "def awaken!\n\t\traise 'Not implemented'\n\tend", "def reap; end", "def pausable; end", "def guard; end", "def celebration; end", "def suivre; end", "def previously_ran?; end", "def previously_ran?; end", "def run_warned; end", "def defuse!\n @@mutex.synchronize { @defused = true }\n end", "def dead?; end", "def escaper=(_); end", "def proceed!; end", "def proceed!; end", "def probers; end", "def handled!; @handled = true; end", "def refutal()\n end", "def ibu; end", "def reset() end", "def placebo?; false end", "def call() end", "def calls; end", "def calls; end", "def surge; end", "def reset!; end", "def reset!; end", "def reset!; end", "def reset!; end", "def escaper; end", "def suspend()\n #This is a stub, used for indexing\n end", "def hiss; end", "def remaining; end", "def reconsume; end", "def semact?; false; end", "def reset; end", "def reset; end", "def reset; end", "def reset; end", "def reset; end", "def reset; end", "def reset; end", "def reset; end", "def reset; end", "def reset; end", "def reset; end", "def reset; end", "def reset; end", "def reset; end", "def reset; end", "def reset; end", "def reset; end", "def reset; end", "def always_run=(_arg0); end", "def interrupt?; end", "def running; end", "def running; end", "def private; end", "def resets; end", "def used?; end", "def ignores; end", "def run_interrupted; end", "def restart; end", "def enter_pending; end", "def run() end", "def call; end", "def call; end", "def call; end", "def call; end", "def call; end", "def call; end", "def call; end", "def call; end", "def keep_going; end", "def sleepy_run; end", "def lock; end", "def lock; end", "def lock; end", "def boom\n raise \"boom\"\n end", "def reset ; end", "def at_end; end", "def forget_me!; end", "def run; end", "def run; end", "def run; end", "def run; end", "def run; end", "def run; end", "def run; end", "def run; end", "def run; end", "def whiny; end", "def halt; end", "def halt; end", "def only_once\n end" ]
[ "0.7053825", "0.6686775", "0.66590184", "0.6605249", "0.6605249", "0.64587957", "0.64587957", "0.6423222", "0.63762295", "0.6366376", "0.62914056", "0.62506443", "0.62167203", "0.6207459", "0.6207459", "0.6201841", "0.6196357", "0.61727077", "0.6152838", "0.6144347", "0.6144347", "0.6133149", "0.6131286", "0.61295545", "0.6108253", "0.6104711", "0.60983914", "0.6089941", "0.6088374", "0.6088374", "0.6085848", "0.60855126", "0.60855126", "0.60855126", "0.60855126", "0.60839796", "0.60732657", "0.60658133", "0.6061094", "0.60464525", "0.60377187", "0.60371745", "0.60371745", "0.60371745", "0.60371745", "0.60371745", "0.60371745", "0.60371745", "0.60371745", "0.60371745", "0.60371745", "0.60371745", "0.60371745", "0.60371745", "0.60371745", "0.60371745", "0.60371745", "0.60371745", "0.60371745", "0.6037158", "0.6036055", "0.6022208", "0.6022208", "0.6018163", "0.60136205", "0.6008799", "0.59979826", "0.59800357", "0.5974985", "0.5971895", "0.59647465", "0.5961096", "0.5961096", "0.5961096", "0.5961096", "0.5961096", "0.5961096", "0.5961096", "0.5961096", "0.5954811", "0.59484595", "0.59470767", "0.59470767", "0.59470767", "0.5946811", "0.5941217", "0.5936637", "0.593083", "0.592476", "0.592476", "0.592476", "0.592476", "0.592476", "0.592476", "0.592476", "0.592476", "0.592476", "0.5913739", "0.59079033", "0.59079033", "0.5906753" ]
0.0
-1
convert to Ruby's false
def plain_old_ruby_object return false end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_bool() false end", "def to_bool() true end", "def to_bool\n return false if self.downcase == \"false\"\n return true\n end", "def literal_false\n 'false'\n end", "def parse_bool() false end", "def parse_bool() false end", "def to_b\n self != \"false\"\n end", "def literal_false\n BOOL_FALSE\n end", "def to_bool\n !!self\n end", "def false \n \"false\" \n end", "def to_bool; self; end", "def to_bool; self; end", "def on_false(node)\n :false\n end", "def to_bool\n true\n end", "def convert_to_boolean(value)\n value != 'no'\n end", "def to_bool\n true\n end", "def prologify\n \"false\"\n end", "def to_boolean\r\n\t !!(self.to_s =~ /^(true|t|yes|y|1)$/i)\r\n\tend", "def true?\n !false?\n end", "def supports_is_true?\n false\n end", "def to_boolean(str)\n !(str == 'false' || str == '0')\nend", "def conditionally_false\n\t\t!self\n\tend", "def false?(param)\n !true?(param)\n end", "def false?\n value.nil? || value == false\n end", "def to_bool\n if (self.to_bool == 1)\n puts \"TRUE\"\n elsif (self.to_bool == 0)\n puts \"FALSE\"\n elsif (self.to_bool == -1)\n puts \"NaN\"\n end\nend", "def to_ruby\n true?\n end", "def to_boolean(val)\n val && (val.to_s.match(/(true|t|yes|y|1)$/i) != nil)\n end", "def false_value?(val)\n EnvHelpers::Utils.false_value?(val)\n end", "def undetermined?\n undetermined == 'true'\n end", "def to_booly\n unless self.to_booly?\n raise TypeError.new(\"#{self} cannot be converted to TrueClass or FalseClass\")\n end\n\n return true if self == \"true\" || (self.to_f? && self.to_f > 0)\n false\n end", "def to_bool\n !(self.match? %r{[Ff]alse})\n end", "def parse_bool() true end", "def false!(msg=nil)\n true\n end", "def dumb?\n false\n end", "def to_b\n return true if self =~ BOOLEAN_REGEX\n false\n end", "def _false\n\n _save = self.pos\n while true # sequence\n _tmp = match_string(\"false\")\n unless _tmp\n self.pos = _save\n break\n end\n _save1 = self.pos\n _tmp = apply(:_utfw)\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 :_false unless _tmp\n return _tmp\n end", "def to_bool(value)\n ! FALSE_VALUES.include?(value)\n end", "def unquoted_false\n 'f'\n end", "def typecast_value_boolean(value)\n case value\n when false, 0, \"0\", /\\Af(alse)?\\z/i, /\\Ano?\\z/i\n false\n else\n blank_object?(value) ? nil : true\n end\n end", "def to_boolean(str)\n str == 'true'\nend", "def falsey?(value)\n value && value.to_s =~ /^(false|f|no|n|0)$/i\n end", "def value_or_false(value)\n if value\n if value == \"false\"\n return false\n else\n return value.to_s\n end\n else\n return false\n end\n end", "def to_boolean(string)\n string == 'true'\nend", "def false_true\n alternatives false, true\n end", "def convert_nil_to_false\n self.is_admin = false unless self.is_admin == true\n return true\n end", "def convert_to_boolean(val)\n return val if val.is_a?(TrueClass) || val.is_a?(FalseClass)\n val = val.to_s.clean\n return nil if val.blank?\n if val.match?(/\\A(false|f|n|no)\\z/i)\n false\n elsif val.match?(/\\A(true|t|y|yes)\\z/i)\n true\n end\n end", "def convert_to_boolean(input)\n case input\n when false, 0, '0', 'false', 'no', nil then false\n else\n true\n end\n end", "def result?\n false\n end", "def to_boolean\n if ['true', 'True', 'TRUE', '1'].include?(self)\n return true\n else\n return false\n end\n end", "def to_bool\n return true if ['true', '1', 'yes', 'on', 't'].include? self\n return false if ['false', '0', 'no', 'off', 'f'].include? self\n return false\n end", "def boolify(val)\n\nend", "def to_boolean\n # SECURE: BNS 2012-10-09: But may behave oddly for multi-line input\n return true if self == true || self =~ (/^(true|t|yes|y|1)$/i)\n return false if self == false || self.nil? || self =~ (/^(false|f|no|n|0)$/i)\n fail ArgumentError, \"invalid value for Boolean: \\\"#{self}\\\"\"\n end", "def value_if_false\n return @value_if_false\n end", "def to_bool\n str = if @target.respond_to?(:empty?)\n @target\n else\n @target.to_s\n end\n return @target != 0 if @target.is_a? Numeric\n return true if @target == true || str =~ /(true|t|yes|y)$/i\n bm = BlankMatcher.new(@target)\n return false if @target == false || bm.blank? || str =~ /(false|f|no|n)$/i\n raise(ArgumentError, \"invalid value for Boolean: \\\"#{@target}\\\"\")\n end", "def bool\n i8u != 0\n end", "def to_bool\n\t\tif [FalseClass, NilClass].include? self.class\n\t\t\tself\n\t\telse\n\t\t\ttrue\n\t\tend\n\tend", "def to_bool\n is_a?(::TrueClass) || self == :true || self == :yes || self == :on\n end", "def true?\n self.eql?(true)\n end", "def no? ; false ; end", "def boolean\n Util.from_bytes :boolean, value\n end", "def typecast_value_boolean(opts={});true;end", "def conditionally_true\n\t\t!!self\n\tend", "def bool_conv(value)\n value == HEX_FALSE ? false : true\n end", "def to_bool(value)\n value.to_s.downcase == 'true' ? true : false\n end", "def true \n \"true\" \n end", "def boolean?\n !to_bool.nil?\n end", "def to_boolean()\n res = super(context,self)\n return res\n end", "def to_boolean(value)\n case value\n when :true, 'true'\n true\n else\n false\n end\n end", "def to_boolean\n inner_html == 'true'\n end", "def literal_true\n 'true'\n end", "def test_string_should_convert_into_boolean\n ['true', 'True', 'TRUE', '1'].each do |x|\n assert x.to_boolean\n end\n assert !\"false\".to_boolean \n end", "def void_false(*args)\n return false\n end", "def truth?\n truth\n end", "def to_bool str\r\n ActiveRecord::Type::Boolean.new.type_cast_from_user(str)\r\n end", "def evaluate?\n false\n end", "def evaluate?\n false\n end", "def false?(val)\n FALSE_VALUES.include? val\n end", "def to_bool\n dc = to_s.downcase\n\n if TRUE_WORDS.include?(dc)\n true\n elsif FALSE_WORDS.include?(dc)\n false\n end\n end", "def to_boolean(value)\n [\"true\", \"1\", \"yes\"].include?(value.to_s) ? true : false\n end", "def to_bool(questionable_string)\n\tbool = true\n\tunless questionable_string == \"true\"\n\t\tbool = false\n\tend\n\tbool\nend", "def truthy(verdad)\n\tif verdad == 't'\n\t\tverdad = true\n\telsif verdad == \"true\"\n\t\tverdad = true\n\telse\n\t\tverdad = false\n\tend\nend", "def coerce_bool(value)\n case value\n when nil, false then false\n when Numeric then !value.zero?\n else\n true\n end\n end", "def is_bool input\n !!input == input\nend", "def to_b(value)\n [0,false,nil].include?(value) ? false : true\n end", "def result\n val = value.sub(/^boolean-/, '')\n val.casecmp(\"true\").zero?\n end", "def to_boolean(value)\n [\"true\", \"1\", \"yes\"].include?(value.to_s) ? true : false\n end", "def to_b\n true\n end", "def to_bool(str)\n str = str.to_s.downcase\n return true if str == 'yes' or str == 'true' or str == 'on'\n return true if str.to_i > 0\n return false\n end", "def literal_true\n BOOL_TRUE\n end", "def primitive?\n false\n end", "def check(value)\n # We have to invert the values.\n if value == :true\n false\n else\n true\n end\n end", "def get_boolean_value\n\t\tend", "def truth\n\t\t\t\"You can't handle the truth\" ; true\n\t\tend", "def convert(value)\n case value.to_s\n when /^(yes|y|t(rue)?|1)$/i\n return true\n when /^(no|n|f(alse)?|0)$/i\n return false\n else\n fail TypeError, \"Expected boolean type, got #{value}\"\n end\n end", "def not\n\t\tself.test != true\n\tend", "def boolean_to_string(b)\n if b \n \"true\"\n else\n \"false\"\n end\nend", "def binary?\n false\n end", "def result_to_get?\n if not @result.nil?\n if @result.downcase == 'true'\n return true\n else\n return false\n end\n else\n return false\n end\n end", "def single_value?\n return false\n end", "def no? ; true ; end", "def expected?\n false\n end" ]
[ "0.8618231", "0.8069835", "0.7842985", "0.77524644", "0.7743881", "0.7743881", "0.7739689", "0.7731916", "0.7684636", "0.7671056", "0.7614487", "0.7614487", "0.760904", "0.758418", "0.75761753", "0.75724113", "0.7500706", "0.74900174", "0.7412951", "0.7342175", "0.73240656", "0.72807246", "0.7233608", "0.72287333", "0.7224168", "0.7200722", "0.71800625", "0.71755826", "0.7139385", "0.70810944", "0.70581514", "0.7055121", "0.70370495", "0.7036572", "0.70014876", "0.69965094", "0.69775003", "0.6974762", "0.6971485", "0.6958994", "0.6950644", "0.6948947", "0.6924042", "0.69070375", "0.6881926", "0.68720114", "0.686728", "0.6851791", "0.6850759", "0.68413895", "0.68381006", "0.68356097", "0.6822755", "0.68007153", "0.67951345", "0.6793683", "0.67925495", "0.67866135", "0.677514", "0.67715", "0.6764176", "0.6746981", "0.6726619", "0.6723126", "0.6719008", "0.6710728", "0.6709776", "0.6679676", "0.66671556", "0.6654363", "0.6641667", "0.6637291", "0.66348374", "0.6630913", "0.66247237", "0.66247237", "0.6622358", "0.66154283", "0.66019857", "0.659793", "0.6586286", "0.6572603", "0.6568696", "0.65472347", "0.65366113", "0.65355206", "0.6530688", "0.6525069", "0.6520687", "0.65026456", "0.6498115", "0.6490489", "0.6490144", "0.64889556", "0.6486743", "0.6484818", "0.6473891", "0.6470706", "0.64699316", "0.6455667", "0.6454554" ]
0.0
-1
Equality. All false instances are equal each other, plus a FalseClass instance is also equal to this.
def == other case other when FalseClass, self.class true else false end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ==(other); [TrueClass,FalseClass]; end", "def not_equal (other)\n (self == other).to_bool ? False : True\n end", "def ===(other); end", "def ==(other); false; end", "def ===(other)\n return false unless (self == other)\n end", "def eql?(other)\n other.is_a?(self.class) && !self.class.comparison_attrs.find{|a| send(a) != other.send(a)}\n end", "def ==(other)\n return false unless other.instance_of? self.class\n attributes == other.attributes\n end", "def ==(other)\n return false unless self.class == other.class\n self.attributes == other.attributes\n end", "def ==(other)\n other.instance_of?(self.class) && eql?(other)\n end", "def eql?(other); self == other; end", "def eql?(other)\n self.class == other.class and self == other\n end", "def ==(other)\n self.class == other.class &&\n self.attributes == other.attributes\n end", "def ==(rhs)\n self.class == rhs.class\n end", "def ==(other); end", "def ==(other); end", "def ==(other); end", "def ==(other); end", "def ==(other); end", "def ==(other); end", "def ==(other); end", "def ==(other); end", "def ==(other); end", "def ==(other); end", "def ==(other); end", "def ==(other); end", "def ==(other); end", "def ==(other); end", "def ==(other); end", "def ==(other); end", "def ==(other); end", "def ==(other); end", "def ==(other); end", "def ==(other); end", "def ==(other); end", "def ==(other); end", "def ==(other); end", "def ==(other)\n return false if other.class != self.class\n attr_hash == other.attr_hash\n end", "def ==(other)\n return true if equal?(other)\n return false unless other.class == self.class\n return true if these_fields_are_equal(other)\n\n false\n end", "def eql?(other)\n other.class == self.class && self == other\n end", "def !=(other)\n !(self == other)\n end", "def eql?(t)\n self == t\n end", "def eql?(other)\n self.class == other.class && self == other\n end", "def ==(other)\n # If the classes don't match, they cannot possibly be equal.\n if self.class != other.class\n return false\n end\n\n # If the persisted state doesn't match, they also can never be equal.\n if persisted? != other.persisted?\n return false\n end\n\n # When persisted, check the other's id to see if it's the same,\n # cannot possible be equals if they have different ids.\n if persisted? && id != other.id\n return false\n end\n\n # Finally, compare the attributes hash. If all key/values match,\n # they are considered equal.\n attributes == other.attributes\n end", "def ===(other)\n false\n end", "def ===(other)\n other.is_a?(self)\n end", "def ==(other)\n return false unless super\n true\n end", "def eql?(other)\n self.class == other.class && self == other\n end", "def eql?(other)\n self.class == other.class && self == other\n end", "def eql?(other)\n self.class == other.class && self == other\n end", "def eql?(other)\n self.class == other.class && self == other\n end", "def eql?(other)\n other.is_a?(self.class) && self == other\n end", "def eql?(other)\n other.is_a?(self.class) && self == other\n end", "def equal?(other); end", "def ===(other)\n if other.is_a?(right_class)\n value === other.value\n else\n super\n end\n end", "def eql?(other)\n return false unless self.class.eql?(other.class)\n instance_variables.map do |var|\n instance_variable_get(var).eql?(other.instance_variable_get(var))\n end.all?\n end", "def ==(other)\n self.class == other.class\n end", "def !=(other)\n !(self == other)\n end", "def !=(other)\n !(self == other)\n end", "def eql?(other)\n other.instance_of?(self.class) && self == other\n end", "def ==(v)\n v.kind_of?(self.class) &&\n __equal__(v)\n end", "def ==(v)\n v.kind_of?(self.class) &&\n __equal__(v)\n end", "def ==(v)\n v.kind_of?(self.class) &&\n __equal__(v)\n end", "def ==(other)\n self.class == other.class\n end", "def eql? other\n self == other\n end", "def ==(other)\n super\n end", "def ==(other)\n super\n end", "def eql?(other)\n return false if (other.nil? or self.class != other.class)\n ova = other.instance_variables\n iv = instance_variables\n return false if ova.size != iv.size\n iv.each do |vid|\n return false if instance_variable_get(vid) != other.instance_variable_get(vid)\n end\n true\n end", "def eql?(other)\n return false unless other.class == self.class\n\n return identity == other.identity &&\n attributes == other.attributes &&\n session == other.session\n end", "def eql?(other)\n other.class == self.class\n end", "def ==(q)\n q.kind_of?(self.class) &&\n __equal__(q)\n end", "def ==(q)\n q.kind_of?(self.class) &&\n __equal__(q)\n end", "def eql?(other); end", "def eql?(other); end", "def eql?(other); end", "def eql?(other); end", "def eql?(other); end", "def eql?(other); end", "def eql?(other); end", "def eql?(*) end", "def eql?(other)\n return false if (other.nil? or self.class != other.class)\n return false unless super(other)\n return false unless self.attributes == other.attributes\n return false unless self.nodes == other.nodes\n true\n end", "def ==(other)\n super or id(true) == other.id(true)\n rescue NoMethodError, ArgumentError\n false\n end", "def == other\n self.class == other.class and\n self.name == other.name and\n self.rw == other.rw and\n self.singleton == other.singleton\n end", "def ==(other)\n self.class == other.class &&\n attributes == other.attributes\n end", "def ===(other)\n \treturn self.equal?(other)\n end", "def ==(*) end", "def ==(*) end", "def ==(*) end", "def eql?(other)\n\t\tself == other\n\tend", "def ==(other)\n super\n end", "def ==(other)\n other.present? && self.attributes == other.attributes\n end", "def eql?(other)\n return self.instance_variables.all?{ |v|\n self.instance_variable_get(v).hash == other.instance_variable_get(v).hash\n }\n end", "def to_bool\n\t\tif [FalseClass, NilClass].include? self.class\n\t\t\tself\n\t\telse\n\t\t\ttrue\n\t\tend\n\tend", "def ==(other)\n @klass == other.class && @attributes == strip_active_record(other)\n end", "def ==(other)\n super || object == other\n end", "def ==(other)\n return false unless other.class == self.class\n\n return identity == other.identity\n end", "def ==(other)\n valid = true\n self.instance_variables.each do |v|\n valid &&= instance_variable_get(v) == other.instance_variable_get(v)\n end\n valid\n end", "def eql?(other)\n self==other\n end", "def != other\n # for equality, we must allow tests against nil\n if other.nil?\n true\n else\n call_enum \"relational\", other, :noteq\n end\n end", "def eql?(anOther)\n\t\tself == anOther\n\tend", "def eql?(other)\n return false\n end" ]
[ "0.72368556", "0.6925946", "0.6732788", "0.6704121", "0.66679466", "0.66410625", "0.6603368", "0.65989083", "0.6587162", "0.65594", "0.65432835", "0.6522678", "0.65223044", "0.6517165", "0.6517165", "0.6517165", "0.6517165", "0.6517165", "0.6517165", "0.6517165", "0.6517165", "0.6517165", "0.6517165", "0.6517165", "0.6517165", "0.6517165", "0.6517165", "0.6517165", "0.6517165", "0.6517165", "0.6517165", "0.6517165", "0.6517165", "0.6517165", "0.6517165", "0.6517165", "0.65059304", "0.6496186", "0.6480278", "0.64715093", "0.64692396", "0.6465696", "0.6464", "0.64638156", "0.644322", "0.6439616", "0.64378214", "0.64378214", "0.64378214", "0.64378214", "0.64294577", "0.64294577", "0.6394911", "0.6391541", "0.6369592", "0.6358598", "0.6356995", "0.6356995", "0.6353348", "0.6352824", "0.6352824", "0.6352824", "0.6345216", "0.63332903", "0.6331666", "0.6331666", "0.63307375", "0.63293195", "0.6328502", "0.63137156", "0.63137156", "0.6312117", "0.6312117", "0.6312117", "0.6312117", "0.6312117", "0.6312117", "0.6312117", "0.6309161", "0.63071203", "0.63059485", "0.63053143", "0.63041407", "0.6301213", "0.62943053", "0.62943053", "0.62943053", "0.6292557", "0.62824583", "0.6280472", "0.6253324", "0.6251973", "0.62482774", "0.6246915", "0.62457967", "0.62449855", "0.62275803", "0.62175137", "0.62097985", "0.6207396" ]
0.7469688
0
the number showing is set as number if number was valid otherwise it is randomly chosen
def initialize number roll unless cheat(number) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_random_number\n @lower = Number.find(params[:id]).lower_bound\n @upper = Number.find(params[:id]).upper_bound\n @random_number = rand(@lower..@upper)\n end", "def show\n @random_number = 1 + rand(10)\n @result = Number.compare_numbers(@number.input, @random_number)\n end", "def result\n user_number = params[:number1].to_i\n number = @@numbers\n if number < user_number\n @result = \"Make it less\"\n elsif number>user_number\n @result = \"Make it more\"\n else\n @result = \"Yes, The secret number is #{number}\"\n # if the player could guess the secret number, this will gonna change-\n # the number as player can play again\n # @@number_rand = rand 500\n @@numbers = rand params[:max]\n end\n end", "def generate_number\r\n \r\n #Generate and return a random number between 1 and 100\r\n return randomNo = 1 + rand($maxChallengeRange)\r\n \r\n end", "def randomizer\n number = rand(0..1)\n return number\nend", "def generate_number\r\n return randomNumber = 1 + rand(100)\r\n end", "def non_zero_digit\n rand(1..9)\n end", "def choice\n rand\n end", "def initialize(num = rand(52))\n self.num = num\n end", "def generate_number\n begin\n begin\n num = rand(10)\n end while @guessed_number.include?(num)\n @guessed_number.push(num)\n end while @guessed_number.size < 4\n end", "def any_number(*options)\n number = (rand(2 * MAX_RAND) - MAX_RAND).to_f/100.0\n if options.include? :positive\n number + MAX_RAND\n elsif options.include? :negative\n number - MAX_RAND\n else\n number\n end\n end", "def get_random_number\n\t\trandom_num = rand(@deck.length)\n\tend", "def randomNum()\r\n num = rand(1..10)\r\nend", "def next_rand\n begin\n num = rand(0...possible_products.count)\n end while(@chosen_nums[num])\n @chosen_nums[num] = 1\n num\n end", "def choose_number\n\t\tputs \"Choose a number between 1-10\"\n\t\t$input = gets.chomp.to_i\n\t\tif $input > 10 || $input < 1\n\t\t\tputs \"Invalid number. Please use a number between 1-10\"\n\t\t\tchoose_number\n\t\tend\n\tend", "def generate_number\r\n \r\n #Generate and return a random number between 1 and 1000\r\n return randomNo = 1 + rand(1000)\r\n \r\n end", "def get_random\n @num.sample.first\n end", "def pick_random_number(digits=1)\n min = 10 ** (digits - 1)\n max = (10 ** digits ) - 1\n semirandom = min + rand(max-min)\n semirandom += 1 if semirandom == 666 #would be unpleasant to receive...\n return semirandom\n end", "def random_number\n rand(0..20)\n end", "def guess_number_1\n random_number = rand(100) # rand gives random number between 0 and x-1\n puts \"Guess a number any number\"\nend", "def generate_number\n record = true\n while record\n random = \"O#{Array.new(9){rand(9)}.join}\"\n record = Order.find(:first, :conditions => [\"number = ?\", random])\n end\n self.number = random\n end", "def digit\n rand(10)\n end", "def initialize\n @number = rand(0..100)\n @answer = false\n end", "def generate_number\n \n #generate and return a random number from 1 to 100\n return randomNO = 1 + rand(1000)\n\n end", "def srand(num=0) end", "def test_random_number_generation\n rand = @game.get_random_number(0, 10)\n assert rand <= 10 && rand >= 0\n end", "def get_rand range\n\t\t@random_number = rand(range)\n\tend", "def random_no\n rand(5000)\nend", "def rand_phone options={}\r\n\t\"210#{random(1111111, 9999999).to_s}\"\r\nend", "def random\n 1 + (10 * rand(0))\n end", "def generate_order_number\n record = true\n while record\n random = \"R#{Array.new(9){rand(9)}.join}\"\n record = self.class.where(:number => random).first\n end\n self.number = random if self.number.blank?\n self.number\n end", "def random_pick(number)\n sort_by{ rand }.slice(0...number)\n end", "def guess_number_2\n random_number = rand(100) # rand gives random number between 0 and x-1\n puts \"Guess a number any number\"\nend", "def form\n @max = params[:max]\n @@numbers = rand params[:max].to_i\n render :result\n end", "def rand\n return extract_number / (2**32 -1).to_f\n end", "def roll\n @numberShowing = 1 + rand(6)\n end", "def door_num\n\t\treturn rand(3)\n\tend", "def free_passport_number\n max = 1\n @data_object.aff_passport_length.times { max *= 10 }\n\n srand\n\n 40.times do\n guess = rand(max)\n if passport_is_free(guess)\n return \"%0#{@data_object.aff_passport_length}d\" % guess\n end\n\n end\n\n nil\n end", "def random_number\n rand(1..20)\nend", "def phone_number\n case rand(0..1)\n when 0 then home_work_phone_number\n when 1 then mobile_phone_number\n end\n end", "def rand_digit #generate random digit\n\treturn rand(10)\nend", "def game (your_number)\nnumber = [0,1,2,3,4,5,6,7,8,9].sample\nif number == your_number \n\tp \"you win\" \nelsif number < your_number\n\tp \"too high\"\nelsif number > your_number\n\tp \"too low\"\n\n\tend\nend", "def phone_number\n return homework_number if rand(0..1).zero?\n\n mobile_number\n end", "def mine_fake(random)\n if @max_fake.zero?\n 0\n else\n fake = random.rand(@max_fake + 1)\n fake\n end\n end", "def kick\n rng.rand(value_range)\n end", "def phone_number\n rand(0..1).zero? ? home_work_phone_number : mobile_phone_number\n end", "def random\n card = rand(1..52)\n card.to_i\n end", "def random\n card = rand(1..52)\n card.to_i\n end", "def generate_number(store)\n store.number = loop do\n random_number = Digest::SHA1.hexdigest([Time.now, rand].join)[0..5].upcase\n break random_number unless Store.exists?(number: random_number)\n end\n end", "def phone_number\n case rand(0..2)\n when 0 then fixed_line_number\n when 1 then mobile_number\n when 2 then mobile_or_pager_number\n end\n end", "def random_number\n rand 0..20\nend", "def random_to_one\n return rand()\n end", "def random_to_one\n return rand()\n end", "def random_to_one\n return rand()\n end", "def random_to_one\n return rand()\n end", "def valid_uniform_number\n unless uniform_number.blank?\n ones_digit = uniform_number % 10\n if ones_digit == 0\n ones_digit =1;\n end\n number = Team.search(:id_eq => team_id, \n :players_uniform_number_eq => uniform_number).result.to_a\n if !number.empty?\n errors.add(:uniform_number, \"is already taken\")\n end\n if uniform_number <= -1\n errors.add(:uniform_number, \"can't be negative\")\n end\n if uniform_number > 55\n errors.add(:uniform_number, \"can't be greater than 55\")\n end\n\n if 5 % ones_digit == 5\n errors.add(:uniform_number, \"AAU Regulation: no digit greater than 5 (use numbers 0-5,10-15,20-25...)\")\n end\n end\n end", "def cheat number\n if number > 0 && number < 7\n @numberShowing = number\n return true\n end\n return false\n end", "def random_number \n rand(6) + 1 \nend", "def pick\n @gommis_count = Gommi.count\n @gommis = Gommi.offset(rand(Gommi.count)).first\nend", "def duns_number\n format('%09d', rand(10**9)).gsub(/(\\d{2})(\\d{3})(\\d{4})/, '\\\\1-\\\\2-\\\\3')\n end", "def new_account_number\n return rand(99999999)\n end", "def new_account_number\n return rand(99999999)\n end", "def generate_random_number_except_123\r\n x = rand(1000)\r\n throw :finish if x > 123 && x < 125\r\nend", "def get_new_random_number random_numbers\n random_number = 0\n begin\n random_number = rand @working_dataset.get_dataset_size\n end while (random_numbers.has_key?(random_number))\n random_numbers[random_number] = 1\n return random_number\n end", "def generate_number\n return if !self.number.blank? || !self.isic?\n\n range = self.club.card_range_for :isic\n current_max = Card.where(\n :members => {:club_id => self.club.id},\n :number => range\n ).maximum(:number)\n self.number = current_max.try(:succ) || range.begin\n end", "def get_random\n @number_list[Random.new.rand(@number_list.length)]\n end", "def display_number\n self.class.mask(number)\n end", "def santa_machine(number)\r\n\t\r\n\texample_genders = [\"male\", \"female\", \"agender\", \"bigender\", \"gender fluid\", \"other\" ]\r\n\texample_ethnicities = [\"black\", \"white\", \"Japanese\", \"lizzard\", \"merpeople\" , \"plant\"]\r\n\tnumber.times do\r\n \t\tsanta = Santa.new(example_genders.sample, example_ethnicities.sample, rand(0..140))\r\n \t\tsanta.reindeer_shuffle\r\n \t\tsanta.about\r\n \t\tend\r\n\r\nend", "def wrong_ans\n puts \"What do you think it is ?\"\n @guess_no = gets.chomp.to_i\n\n if @guess_no > @rand_no\n puts \"go a little lower\"\n elsif @guess_no < @rand_no\n puts \"go a little higher\"\n end\n\n @chances += 1\nend", "def initialize\t\n\n\t @number = Array.new\n\n\t 10.times do |i|\n\t i += 1\n\t @number << i\n\t end\n\n\t\t#select a random element from that array as the secret number\n\t @number = @number[rand(number.length)]\n \tend", "def generate_random_number\n (1..10).to_a.sample\nend", "def set_number\n return set_transaction_id if self.id\n #self.transaction_id = (Time.now.to_i).to_s(CHARACTERS_SEED)## fake number for friendly_id validator\n begin\n self.transaction_id = SecureRandom.random_number(FIXNUM_MAX)\n end while self.class.exists?(transaction_id: transaction_id)\n end", "def guess_the_number\n prog_num=rand(1..20)\ncounter=0\nwhile counter < 10\nnumber=user_guessing\ncounter+=1\nif number>prog_num\n if number-(prog_num)>5\n puts \"too large try no.#{counter}\"\n else number-(prog_num)>5\n puts \"bit large try no.#{counter}\"\n end\nelsif number<prog_num\n if (prog_num)-number>5\n puts \"too small try no.#{counter}\"\n else (prog_num)-number>5\n puts \"bit small try no.#{counter}\"\n end\nelsif number==prog_num\n return puts \"you win after #{counter} try(s).\"\nend\nend\nend", "def display_number\n self.class.mask(number)\n end", "def number_generator\n rand(1..20)\n end", "def rand_choice \n Random.rand(0...6)\n end", "def reset\n @num_1 = rand(1..20)\n @num_2 = rand(1..20)\n if @current_player == 1\n @current_player = 2\n else\n @current_player = 1\n end\n end", "def choice\r\n rand(self.last - self.first) + self.first\r\n end", "def create_phone_number\n numbers = []\n amount_of_numbers = rand(0..3)\n amount_of_numbers.times do\n kind_of_number = ['phone_number', 'cell_phone'].sample\n numbers << Faker::PhoneNumber.send(kind_of_number)\n end\n numbers\nend", "def n_generator\n number = rand(10..30)\n end", "def guess(msg, num)\n num = num.to_i\n if @started\n @tries += 1\n if @tries > 5\n msg.reply(\"Sorry, you have tried the maximum number of times. The random number was #{@random_number}\")\n @started = false\n @tries = 0\n return\n end\n\n if @random_number == num\n msg.reply(\"Correct! You win a shitty cookie! It took you #{@tries} tries!\")\n @started = false\n @tries = 0\n return\n end\n\n measure = @random_number / 5\n measures = [\n measure,\n measure * 2,\n measure * 3,\n measure * 4,\n measure * 5\n ]\n\n diff = num - @random_number\n diff = diff.abs\n\n if @tries == 1\n if num.between?(measures[4], @random_number + measures[4])\n msg.reply('You are on fire!'.freeze)\n elsif num.between?(measures[3], @random_number + measures[3])\n msg.reply('You are warm.'.freeze)\n elsif num.between?(measures[2], @random_number + measures[2])\n msg.reply('You are pretty neutral.'.freeze)\n elsif num.between?(measures[1], @random_number + measures[1])\n msg.reply('You are cold.'.freeze)\n elsif num.between?(measures[0], @random_number + measures[0])\n msg.reply('You are fucking freezing!'.freeze)\n end\n elsif diff < @previous_difference\n msg.reply('You are warmer.'.freeze)\n else\n msg.reply('You are colder.'.freeze)\n end\n\n @previous_difference = diff\n else\n msg.reply('You must start the game first.'.freeze)\n end\n end", "def guess\n num = rand(1..10)\n #variable que cada vez que se ejecuta cambia su valor\n puts \"Juego de adivina el numero en el que pienso\"\n #Condicion para saber si el numero ingresado es menor\n follow = true\n while follow == true\n puts \"¿En que numero entre el 1 y 10 estoy pensando?\"\n #pasa la respuesta del usuario a integer\n num_usuario = gets.chomp.to_i\n if num_usuario < num\n puts \"Too low \"\n #condicion para saber si el numero ingresado es mayor\n elsif num_usuario > num\n puts \"Too high \"\n else \n puts\"You got it! the number was #{num}\" \n follow = false\n end\n end\n end", "def cheat\n puts 'What number do you want to roll?'\n\tnumber = gets.chomp.to_i\n\tif number >= 1 && number <= 6\n\t @number_showing = number\n\telse\n\t puts 'Cheater!!!'\n end\n @number_showing\t\n end", "def generate_random_number_except_123\n x = rand(1000)\n throw :finish if x == 123\nend", "def secret_number\n\tnumber = '8'\nend", "def random_account_number\r\n acct_num = rand(10**11).to_s.rjust(11, '1')\r\n return acct_num\r\n end", "def gen_num\n rand(1..100)\nend", "def get_random_number(max_value = 10)\n\trand(max_value)\nend", "def seleccion_jugada(numero_random)\n '''\n Explicacion de este metodo:\n Por ejemplo para una lista de movimientos como esta\n {:Tijera => 3, :Papel => 2}\n Los rangos seran los siguientes \n {:Tijera => 3, :Papel => 5}\n Esto sera que si un numero random cae entre \n 1 y 3 (Inclusivo) devolvera Tijera\n si cae entre 4 y 5 devolvera Papel \n Esto se modela con el <= del condicional\n '''\n @rangos.each_key do |jugada| # Se recorre el diccionario \n if numero_random <= @rangos[jugada] # Cuando se consiga una jugada cuyo valor sea menor o igual\n # que el numero random se retorna dicha jugada\n return jugada \n end\n end\n end", "def apuesta(dinero, temperatura)\n if dinero <= 1000 && dinero > 0\n dinero\n elsif temperatura > 32\n dinero * rand(4..10) / 100\n elsif dinero > 1000\n dinero * rand(8..15) / 100\n end\n end", "def tired?(digits=nil) \n # ignore the arg, go with your guts\n (rand * 10 < 3)\n end", "def number_choice(num)\n case num\n when 0..50\n puts \"your number is between 0 and 50\"\n when 51..100\n puts \"your number is between 51 and 100\"\n else\n puts \"you provided a number that was not between 0 and 100\"\n end\nend", "def generate_random_number\n rand(1..6) + 1\nend", "def generate_card_number\n self.number = set_card_number\n generate_card_number if Card.exists?(number: self.number)\n end", "def random_status_number_generator\n Random.rand(1..10)\n end", "def international_phone_number\n rand(0..1).zero? ? international_mobile_phone_number : international_home_work_phone_number\n end", "def index\n \n @randomNumber1 = 0;\n @randomNumber2 = 55;\n\n end", "def guess_number_1\n random_number = rand(10) # rand gives a random number between 0 and x-1\n puts \"Guess a number, any number!\"\n answer = gets.chomp.to_i\n if answer == random_number\n puts \"You guessed right, the number is #{random_number}.\"\n else\n puts \"Unfortunately, that's not quite right. The number is #{random_number}.\"\n end\nend", "def check_num(num)\n@num_attempts+=1\n\nif num==@secret_num\n@game_over=true\np \"you win\"\nelsif num>=@secret_num\n p \"too big\"\nelse\n p \"too small\"\nend\n\nend", "def get_random_number(gender)\n\t\tcount = total_count(gender)\n\t\tset_random_seed\n\t\treturn rand(1..count)\n\tend", "def random= rnd \n @random = rnd\n @codon.random = rnd\n end" ]
[ "0.71744174", "0.70904475", "0.68139404", "0.6757829", "0.6669887", "0.65517724", "0.6537248", "0.65205514", "0.65195686", "0.6513361", "0.64588976", "0.645765", "0.64264876", "0.6405328", "0.63936865", "0.63841087", "0.63654894", "0.6353816", "0.6349735", "0.6344556", "0.63235205", "0.6322397", "0.6312152", "0.6308144", "0.6291454", "0.62850654", "0.6269187", "0.62543106", "0.62410665", "0.6230754", "0.6218423", "0.6202431", "0.6199459", "0.6149719", "0.61343145", "0.6117085", "0.6112275", "0.61109555", "0.6092886", "0.6090951", "0.60823166", "0.606034", "0.60491633", "0.6045351", "0.6040981", "0.60390717", "0.6037224", "0.6036581", "0.60324174", "0.6016807", "0.6008832", "0.59957075", "0.59957075", "0.59957075", "0.59957075", "0.59901774", "0.59877187", "0.5981312", "0.5981029", "0.5960641", "0.5949739", "0.5949739", "0.5946895", "0.5946865", "0.593684", "0.59334004", "0.5905784", "0.5905633", "0.59053147", "0.5904336", "0.5902126", "0.5897364", "0.5893134", "0.5886681", "0.58824813", "0.5871116", "0.5869088", "0.586281", "0.58541596", "0.5853607", "0.5850289", "0.58485436", "0.5837756", "0.5832443", "0.58250296", "0.58248675", "0.5813022", "0.58038884", "0.57984775", "0.5786617", "0.5783421", "0.5782851", "0.5781369", "0.577498", "0.5772007", "0.5769642", "0.57547915", "0.57491684", "0.57489604", "0.5748538", "0.5745448" ]
0.0
-1
roll the die so the number showing is randomly chosen
def roll @numberShowing = 1 + rand(6) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def roll_die\n die_roll = rand(1..6)\n #\nend", "def roll_die\n Random.new.rand(1..6)\nend", "def dice_roll\n rand(1..6)\n end", "def dice_roll\n return (rand(6) + 1)\n end", "def roll_die(sides)\n\tresult = 1 + rand(sides)\nend", "def roll\n @number = rand(1..6)\n end", "def roll\n di = [1,2,3,4,5,6]\n di_roll = rand(6)\n di[di_roll]\nend", "def roll_a_dice\n\t\trand(1..6)\n\tend", "def roll()\n raise InvalidSidesException.new(\"A number of sides is needed for a die.\") if @sides == 0\n raise InvalidSidesException.new(\"An appropriate number of sides is required.\") if @sides < 6\n \n rand(@sides) + 1\n end", "def roll\n @roll_count += 1\n @random.rand(1..6)\n end", "def roll\n @number = Random.new.rand(6) + 1\n end", "def roll\n Random.rand(6)+1\n end", "def roll_dice\n dice = rand(6) + 1\n end", "def roll\n return 1 + rand(6)\n end", "def roll\n return rand(1..6)\nend", "def roll\n rand(sides)+1\n end", "def roll\n random_nums = rand(1..6)\n random_nums\nend", "def roll\n number = rand(1..6)\n number\nend", "def roll\n randomValue = rand(6)+1\n randomValue\nend", "def randomRoll\n\t 1 + rand(6)\n\tend", "def roll\n Random.rand(6) + 1\nend", "def roll\n dice_roll = (1..6)\n #.. includes 6\nrand(dice_roll)\n # code goes here\nend", "def roll\n Random.rand(1..6)\nend", "def roll\n rand(1..6)\nend", "def roll\n rand(1..6)\nend", "def roll\n dice = (1..6).to_a\n dice.shuffle[4]\nend", "def roll\n rand(1..@sides)\n end", "def roll(n)\n @dice = (1..n).map { rand(6) + 1 }\n end", "def roll\n return rand(1..6)\nend", "def roll\n return rand(1..6)\nend", "def roll\n return rand(1..6)\nend", "def roll(dice)\n rand(1..6)*dice\nend", "def roll\n # code goes here\n # Generate an integer from 0 to 10\n\n\trand(1..6)\n\t\nend", "def roll\n 1 + rand(6)\nend", "def roll\n return rand(6) + 1\nend", "def roll\n #die = rand(1..6)\n #puts die\n #return die\n die = [1,2,3,4,5,6]\n puts die.sample\n return die.sample\nend", "def roll\n return rand 1..6\nend", "def roll\n return @showing = Random.rand(6) + 1 #instead of 0-5 inclusive, it becomes 1-6\n end", "def roll\n return rand(@sides) + 1 ## roll_value = rand(@sides) + 1\n end", "def roll\n return rand(@sides) + 1 ## roll_value = rand(@sides) + 1\n end", "def roll\n result = rand(1..6)\n print result\n result\nend", "def roll\n\t\tputs \"Rolling a #{@sides} sided die #{@rolls} times.\"\n\t\t#puts 1 + rand(@sides)\n\t\ti = 0\n\t\ttotal = 0\n\t\twhile i < @rolls do\n\t\t\troll_value = 1 + rand(@sides)\n\t\t\ttotal = total + roll_value\n\t\t\ti += 1\n\t\t\tputs \"Roll number #{i}: #{roll_value}\"\t\n\t\tend\n\t\tputs \"Total of all rolls: #{total}\"\n\tend", "def roll\n return rand(1..6) #if you use two dots it includes the 6 at the end\n # if you use three dots it excludes the last number in this case the 6\nend", "def roll\n rand(6) #=> gives a random number between 0 and 6 inclusively\n rand(1..6) #=> gives a random number between 1 and 6 inclusively \nend", "def roll\n #rand(1..6)\n ans = (1..6).to_a\n ans[rand(0..5)]\nend", "def getDiceRoll()\n\tdie1 = rand(Diemaxroll - (Dieminroll - 1)) + Dieminroll\n\tdie2 = rand(Diemaxroll - (Dieminroll - 1)) + Dieminroll\n\treturn die1 + die2\nend", "def roll\n # code goes here\n 1 + rand(6)\nend", "def first_roll\n # code goes here\n num = rand(1..6)\n num\nend", "def roll\n dice = [1, 2, 3, 4, 5, 6]\n dice_roll = dice[rand(dice.length)]\nend", "def roll\n # code goes here\n\n # Generates a random integer between 1-6, inclusive\n # Using ranges\n rand(1..6)\n\n # Using an array\n [1,2,3,4,5,6].sample\nend", "def roll_dice(num_rolls)\n num_rolls.times do\n puts \"Roll: #{rand(1..6)}\"\n end\nend", "def roll\n # code goes here\n range = rand(6) + 1\n \n range = [1,2,3,4,5,6]\n result = range[rand(6)]\n result \nend", "def roll\n # code goes here\n return 1 + rand(6)\nend", "def roll\n\n #random number using range\n rand(1..6)\n\n#random number using array\n ary = [1,2,3,4,5,6]\n ary[rand(ary.length)]\nend", "def roll\n # code goes here\n random_num = rand(6) + 1\n return random_num\nend", "def roll\n rand(1...7)\nend", "def roll\n side_count = rand(1..6)\n puts side_count\n return side_count\nend", "def roll\n\t\t\t@number = rand(1..6)\n\t\t\taudit\n\t\t\t@number \t# return the number as the caller expect a return number\n\t\tend", "def roll\n # answer using ranges\n #rand(6)+1\n\n #answer using arrays\n values = [1,2,3,4,5,6]\n values[rand(6)]\nend", "def rolls\n # theoretical dices which have X faces from 1 to X included and are evenly balance (as much as our PRNG)\n @rolls ||= (quantity ? quantity.value : 1).times.map{ rand(faces.value) + 1 }\n end", "def roll (sides = 6)\n\trand(1..sides)\nend", "def roll\n # code goes here\n rand(1..6)\n # bonus solve using array\n #possible_rolls = (1..6).to_a\n #possible_rolls[rand(0..5)]\nend", "def roll\n # code goes here\n for i in 1..6\n r = rand 1..6\n return r\n end\nend", "def roll_dice(num_dice)\n\tdice_roll_result = num_dice.times.map{ 1 + Random.rand(6) }\n\treturn dice_roll_result\nend", "def roll\n 1 + rand(6)\n # the code below also works! Keep in mind for the deli counter problem.\n # my_array = (1..6).to_a \n # random_sample = my_array.sample\nend", "def roll_dice\n Random.rand(100)\nend", "def repelling_roll( investigators_count )\n rand( 1 .. 6 ) - investigators_count\n end", "def roll\n # code goes here\n number = (1 + (rand*6)).to_i # 1+rand*6 = # between 1 and 6\n # rand = float need to convert to int (to_i)\n # puts number : used to check the value of the number\nend", "def roll\n # code goes here\n #roll = rand(1..6)\n #roll\n roll_array = [1, 2, 3, 4, 5, 6]\n roll_array.sample\nend", "def roll_dice(upper_limit)\n number = rand(1..upper_limit)\n puts \"You rolled a \" + number.to_s\nend", "def roll\n puts 1\n puts 2\n puts 3\n return 1 + rand(6)\nend", "def roll\n dice_sides = [1, 2, 3, 4, 5, 6]\n dice_sides.sample\nend", "def roll(1...7)\n puts rand(1...7)\nend", "def roll\n @upface = rand(@sides) + 1\n end", "def roll #this method takes no argument\n rand(1..6) #return a random number between 1 and 6 (a range)\nend", "def cheat\n\t\t@die = 1\n\t\t@die2 = 1 + rand(5)\n\t\tputs @die\n\t\tputs @die2\n\tend", "def die\n puts 1 + rand(6)\nend", "def dice\n rand(1..6) + rand(1..6)\nend", "def roll\n\t\t\tsum = 0\n\t\t\t@count.times do |i|\n\t\t\t\tsum += (1 + rand(@sides))\n\t\t\tend\n\t\t\treturn sum\n\t\tend", "def roll\n [1 , 2 , 3, 4, 5, 6].sample\n \nend", "def roll\n @dice.each(&:roll)\n if @dice.first == @dice.last\n dup_dice = @dice.map { |d| Die.new(id: d.id + 2, number: d.number) }\n @dice.concat(dup_dice)\n end\n end", "def roll\n @number = rand(1..6)\n audit\n @number\n end", "def roll\n # code goes here\n random = 0 + rand(6)\n array = (1..6).to_a\n return array[random]\nend", "def roll_the_dice\n numbers = [0..9]\n puts @list.shuffle[rand(5) + rand(5)]\nend", "def roll\n # code goes here\n # rand(1..6)\n counter = 1\n arr = []\n while counter <= 6\n arr.push(counter)\n counter += 1\n end\n arr[rand(0..5)]\nend", "def roll\n # code goes here\n # rand(1..6)\n values = [1,2,3,4,5,6]\n result = rand(0..5)\n return values[result]\nend", "def roll\n range = [1,2,3,4,5,6]\n result = range[rand(0..5)]\n print result\n print \"\\n\"\n return result\nend", "def roll_dice\n @dice.each do |die| \n # reset roll value of die\n die.reset\n # roll and assign value\n die.roll\n end\n end", "def roll\n numbers = [1,2,3,4,5,6]\n numbers.sample\nend", "def roll_dice(dice = 1)\n total = 0\n dice.times do |n|\n total += Random.rand(1..6)\n end\n total\nend", "def roll\n array = [1, 2, 3, 4, 5, 6]\n random = array.sample\n return random\n\nend", "def roll\nreturn [1, 2, 3, 4, 5, 6].sample\nend", "def roll\n [1, 2, 3, 4, 5, 6].sample\nend", "def roll\n [1, 2, 3, 4, 5, 6].sample\nend", "def roll\n arr = [1,2,3,5,6]\n diceRoll = Random.new\n diceRoll.rand(arr[0]..arr[arr.length-1])\nend", "def roll\n #Created a method\n case rand (1..6)\n when 1\n {name:\"Los Negros\", value: 1}\n #Assign names (by using strings in case/when scenario) to the die # roll\n when 2\n {name: \"Los Gallegos\", value: 2}\n #Assign ranking postion with number to the die # roll\n when 3\n {name: \"Jacks\", value: 3}\n when 4\n {name: \"Queen\", value: 4}\n when 5\n {name: \"King\", value: 5}\n when 6\n {name: \"Ace\", value: 6}\n end\n #End the case/when scenario\nend", "def rollDice\n value = 1\n loop do\n value = (rand * 6.5).to_i\n break if value >0\n end\n return value\n end", "def roll\n nums = [1,2,3,4,5,6]\n return nums.sample\nend", "def roll(dice)\n dice\n end", "def roll_snake_eyes\n counter = 0\n\n # loop 100 times\n 100.times do |i|\n # roll the die two times\n first_roll = rand(1..6) # random number between 1-6\n second_roll = rand(1..6) # random number between 1-6\n\n # display what the rolls are for testing\n puts \"First roll -> #{ first_roll }, second roll -> #{ second_roll }\"\n\n # check how many times the number 1 is rolled twice\n if first_roll == 1 && second_roll == 1\n # add 1 to the count\n counter += 1\n end\n end\n\n # return the count\n counter\nend" ]
[ "0.8527218", "0.83658195", "0.8145509", "0.81010586", "0.80351335", "0.80314523", "0.801649", "0.80140185", "0.797654", "0.7976043", "0.7957698", "0.7890214", "0.7850539", "0.78412217", "0.7789856", "0.77882195", "0.77838427", "0.77485967", "0.77404815", "0.7727842", "0.7698758", "0.7698031", "0.769681", "0.7696749", "0.7696749", "0.76905584", "0.76905006", "0.76836866", "0.76737046", "0.76737046", "0.76737046", "0.766776", "0.76570475", "0.76543325", "0.7653614", "0.7649025", "0.7636717", "0.76122427", "0.7605576", "0.7605576", "0.7584808", "0.75833374", "0.75639075", "0.75579166", "0.75574815", "0.7548481", "0.75399154", "0.7537339", "0.75156856", "0.7505821", "0.74827856", "0.7479044", "0.7466636", "0.7461766", "0.7458605", "0.74583143", "0.74574476", "0.7423723", "0.74211216", "0.74026954", "0.73846096", "0.73821294", "0.7381065", "0.7373655", "0.73498774", "0.7331772", "0.73304045", "0.7330138", "0.7321469", "0.7319475", "0.7315803", "0.7295519", "0.7294564", "0.72842765", "0.72746515", "0.7240665", "0.721205", "0.7208393", "0.718648", "0.71861684", "0.71836066", "0.71808183", "0.7172887", "0.71693546", "0.7167848", "0.715474", "0.71163774", "0.71136886", "0.7094974", "0.7094813", "0.7086033", "0.708221", "0.70404017", "0.70404017", "0.7036743", "0.7032982", "0.7020007", "0.70177186", "0.6991237", "0.69819754" ]
0.8049349
4
attempts to set the number showing to number and returns if cheat was successful
def cheat number if number > 0 && number < 7 @numberShowing = number return true end return false end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cheat\n puts 'What number do you want to roll?'\n\tnumber = gets.chomp.to_i\n\tif number >= 1 && number <= 6\n\t @number_showing = number\n\telse\n\t puts 'Cheater!!!'\n end\n @number_showing\t\n end", "def exercise_119 (number)\n end", "def tricky_number\n if true\n number = 17\n else\n 2\n end\nend", "def tricky_number\n\tif true\n\t\tnumber = 1\n\telse\n\t 2\n\tend\nend", "def check(number)\n \n end", "def check_num(num)\n@num_attempts+=1\n\nif num==@secret_num\n@game_over=true\np \"you win\"\nelsif num>=@secret_num\n p \"too big\"\nelse\n p \"too small\"\nend\n\nend", "def tricky_number \n if true \n number = 1 \n else \n 2 \n end \nend", "def tricky_number\n if true \n number = 1\n else\n 2\n end\nend", "def tricky_number\n if true\n number = 1\n else\n 2\n end\nend", "def tricky_number\n if true\n number = 1\n else\n 2\n end\nend", "def tricky_number\n if true\n number = 1\n else\n 2\n end\nend", "def tricky_number\n if true\n number = 1\n else\n 2\n end\nend", "def tricky_number\n if true\n number = 1\n else\n 2\n end\nend", "def tricky_number\n if true\n number = 1\n else\n 2\n end\nend", "def tricky_number\n if true\n number = 1\n else\n 2\n end\nend", "def tricky_number\n if true\n number = 1\n else\n 2\n end\nend", "def tricky_number\n if true\n number = 1\n else\n 2\n end\nend", "def initialize number\n roll unless cheat(number)\n end", "def number=(new_number)\n self.assert_non_negative(new_number)\n @number = new_number\n end", "def tricky_number\n if true\n number = 1\n else 2\n end\nend", "def crackle(number)\n\treturn \"Crackle\" if number % 3 == 0\nend", "def scream(number)\r\n\r\n if number == 0\r\n print \"crickets\"\r\n elsif number > 0\r\n print \"lol\"\r\n number.times do\r\n print \"ol\"\r\n end\r\n end\r\n \r\n\r\nend", "def set_number\n binding.pry\n @number = Number.find(params[:id])\n end", "def force(number) \n @target_number = number\n if number % 15 == 0\n @column_number = (number/15) - 1\n else\n @column_number = (number/15)\n end \n check()\n end", "def number?(num)\n loop do\n if !REGEX.match(num)\n message(TEXT['real'])\n num = Kernel.gets().chomp()\n else\n break\n end\n end\n num\nend", "def assess_situation(number, announcement, excuse)\n if number == 99\n puts \"#{excuse}\"\n elsif number == 21\n puts \"#{announcement}\"\n else number == 3\n puts \"Meh. Hard Pass\"\n end\nend", "def guess_the_number(prog_num)\ncounter=0\nwhile counter < 10\nnumber=user_guessing\ncounter+=1\nif number>prog_num\n if number-(prog_num)>5\n puts \"cooold try no.#{counter}\"\n else\n puts \"hooot try no.#{counter}\"\n end\nelsif number<prog_num\n if (prog_num)-number>5\n puts \"cold try no.#{counter}\"\n else\n puts \"hot try no.#{counter}\"\n end\nelsif number==prog_num\n return puts \"you win after #{counter} try(s).\"\nend\nend\nend", "def check_num(input)\n @num_attempts += 1\n if input == @secret_num\n @game_over = true\n puts 'you win'\n elsif input > @secret_num\n puts 'too big'\n else\n puts 'too small'\n end\n end", "def eval_num(secret_num, guess, tries)\n\tif guess == secret_num\n\t\tcongrats(secret_num, tries)\n\telsif tries >= 3\n\t\tputs \"\\nSorry that was your last try. Better luck next time!\"\n\telse\n\t\tif guess > 10\n\t\t\tputs \"\\nWhoa whoa whoa.. your guess is way too large! Remember it's a number from 1-10.\"\n\t\telsif guess < 1\n\t\t\tputs \"\\nOkay.. let me jog your memory.. Remember it's a number from 1-10.\"\n\t\telse\n\t\t\tif guess > secret_num\n\t\t\t\tputs \"\\nA little lower.. Almost there.\"\n\t\t\telsif guess < secret_num\n\t\t\t\tputs \"\\nA little higher.. You got this.\"\n\t\t\tend\n\t\tend\n\t\ttry_again(secret_num, tries)\n\tend\nend", "def consume_number; end", "def get_number\nprint \"What number do you want to check? \"\n@number = gets.to_i\nend", "def cheat_on\n if @score >= 100 and @cheat == false\n @cheat = true\n @score -= 100\n end\n end", "def set_num(user_number)\n self.num = user_number\n\n self\n end", "def update_tessera(number)\n if number.blank?\n true #\n else\n tessera = self.active_tessera\n if tessera.nil?\n tessera = Tessera.new\n tessera.character_id = self.id\n tessera.reaping_check_id = ReapingCheck.current_games_id\n tessera.previous_number = 0\n elsif tessera.approved\n tessera.previous_number = tessera.number\n end\n\n tessera.approved = tessera.previous_number == number.to_i\n tessera.number = number\n tessera.save\n false\n end\n end", "def set_number\n @number = Number.find(params[:id])\n end", "def set_number\n @number = Number.find(params[:id])\n end", "def set_number\n @number = Number.find(params[:id])\n end", "def set_number\n @number = Number.find(params[:id])\n end", "def set_number\n @number = Number.find(params[:id])\n end", "def set_number\n @number = Number.find(params[:id])\n end", "def update_cell(number, mark)\n if cell_free?(number)\n self.cells[number - 1] = mark.to_s\n show_board\n else\n puts \"Cell not empty! Choose other cell.\"\n return false\n end\n end", "def get_numerology (your_number)\r\n\tcase your_number\r\n\t\twhen 1\r\n\t\t\tputs \"You are a ONE! One is the leader. The number one indicates the ability to stand alone, and is a strong vibration. Ruled by the Sun.\"\r\n\t\twhen 2\r\n\t\t\tputs \"You are a TWO! This is the mediator and peace-lover. The number two indicates the desire for harmony. It is a gentle, considerate, and sensitive vibration. Ruled by the Moon.\"\r\n\t\twhen 3\r\n\t\t\tputs \"You are a THREE! Number Three is a sociable, friendly, and outgoing vibration. Kind, positive, and optimistic, Three’s enjoy life and have a good sense of humor. Ruled by Jupiter.\"\r\n\t\twhen 4\r\n\t\t\tputs \"You are a FOUR! This is the worker. Practical, with a love of detail, Fours are trustworthy, hard-working, and helpful. Ruled by Uranus.\"\r\n\t\twhen 5\r\n\t\t\tputs \"You are a FIVE! This is the freedom lover. The number five is an intellectual vibration. These are ‘idea’ people with a love of variety and the ability to adapt to most situations. Ruled by Mercury.\"\r\n\t\twhen 6 \r\n\t\t\tputs \"You are a SIX! This is the peace lover. The number six is a loving, stable, and harmonious vibration. Ruled by Venus.\"\r\n\t\twhen 7 \r\n\t\t\tputs \"You are a SEVEN! This is the deep thinker. The number seven is a spiritual vibration. These people are not very attached to material things, are introspective, and generally quiet. Ruled by Neptune.\"\r\n\t\twhen 8 \r\n\t\t\tputs \"You are an EIGHT! This is the manager. Number Eight is a strong, successful, and material vibration. Ruled by Saturn.\"\r\n\t\twhen 9\r\n\t\t\tputs \"You are a NINE! This is the teacher. Number Nine is a tolerant, somewhat impractical, and sympathetic vibration. Ruled by Mars.\"\r\n\t\telse \r\n\t\t\tputs \"Sorry, but your number doesn't exist.\"\r\n\tend\r\nend", "def good_guess? (number)\n\tnumber.to_i\n\tif number == 42\n\t\tp true\n\telse \n\t\tp false\n\tend\nend", "def cracklepop_number(number)\n ret = number\n ret = 'Crackle' if number.divisible_by?(3)\n ret = 'Pop' if number.divisible_by?(5)\n ret = 'CracklePop' if number.divisible_by?(3, 5)\n\n ret\nend", "def checker(n)\n n = n.to_i\n if n < 0\n print \"This is a negative number.\\n Please enter a new number to find the factorial of.\"\n end\n if n == 0\n print \"The factorial of 0 is 1.\"\n end\n if n == 1\n print \"The factorial of 1 is 1.\"\n end\n if n > 1\n return fact(n)\n end\nend", "def guess_the_number\n prog_num=rand(1..20)\ncounter=0\nwhile counter < 10\nnumber=user_guessing\ncounter+=1\nif number>prog_num\n if number-(prog_num)>5\n puts \"too large try no.#{counter}\"\n else number-(prog_num)>5\n puts \"bit large try no.#{counter}\"\n end\nelsif number<prog_num\n if (prog_num)-number>5\n puts \"too small try no.#{counter}\"\n else (prog_num)-number>5\n puts \"bit small try no.#{counter}\"\n end\nelsif number==prog_num\n return puts \"you win after #{counter} try(s).\"\nend\nend\nend", "def verse(number)\n case number\n when 0\n \"No more bottles of beer on the wall, \" +\n \"no more bottles of beer.\\n\" +\n \"Go to the store and buy some more, \" +\n \"99 bottles of beer on the wall.\\n\"\n else\n \"#{number} bottles of beer on the wall, \" +\n \"#{number} bottles of beer.\\n\" +\n \"Take #{pronoun(number)} down and pass it around, \" +\n \"#{quantity(number - 1)} #{container(number - 1)} of beer on the wall.\\n\"\n end\nend", "def featured(number)\n featured = 0\n loop do \n number += 1\n if number % 7 == 0 &&\n number.odd? &&\n number.to_s.length == number.to_s.chars.uniq.length\n featured = number\n break\n end\n if number.to_s.length > 10\n puts \"Invalid\"\n featured = 0\n break\n end\n end\n featured\nend", "def numerology(number)\n case number\n when \"1\"\n puts \"You are a Number 1.\\nOne is the leader. The number one indicates the ability to stand alone and is a strong vibration. Ruled by the Sun.\"\n when \"2\"\n puts \"You are a Number 2.\\nThis is the mediator and peace-lover. The number two indicates the desire for harmony. It is a gentle, considerate, and sensitive vibration. Ruled by the Moon.\"\n when \"3\"\n puts \"You are a Number 3.\\nNumber Three is a sociable, friendly, and outgoing vibration. Kind, positive, and optimistic, Three's enjoy life and have a good sense of humor. Ruled by Jupiter.\"\n when \"4\"\n puts \"You are a Number 4.\\nThis is the worker. Practical, with a love of detail, Fours are trustworthy, hard-working, and helpful. Ruled by Uranus.\"\n when \"5\"\n puts \"You are a Number 5.\\nThis is the freedom lover. The number five is an intellectual vibration. These are 'idea' people with a love of variety and the ability to adapt to most situations. Ruled by Mercury.\"\n when \"6\"\n puts \"You are a Number 6.\\nThis is the peace lover. The number six is a loving, stable, and harmonious vibration. Ruled by Venus.\"\n when \"7\"\n puts \"You are a Number 7.\\nThis is the deep thinker. The number seven is a spiritual vibration. These people are not very attached to material things, are introspective, and generally quiet. Ruled by Neptune.\"\n when \"8\"\n puts \"You are a Number 8.\\nThis is the manager. Number Eight is a strong, successful, and material vibration. Ruled by Saturn.\"\n when \"9\"\n puts \"You are a Number 9.\\nThis is the teacher. Number Nine is a tolerant, somewhat impractical, and sympathetic vibration. Ruled by Mars.\"\n end\nend", "def with_check_digit(number)\n sum = control_sum(number)\n check_digit = to_a(sum * 9).last\n to_a(number).push(check_digit).join.to_i\n end", "def change()\n\tcounter = 0\n100.times do \n\tif $number_a[counter] % 15 == 0\n\t\t$number_a[counter] = \"fizzbuzz\" \n\telsif $number_a[counter] % 5 == 0\n\t\t$number_a[counter] = \"buzz\"\n\telsif $number_a[counter] % 3 == 0\n\t\t$number_a[counter] = \"fizz\"\n\tend\ncounter = counter +1\nend\n# $number_a[position]\nend", "def number? (number)\r\n \r\n if number.to_i == 0\r\n if number == \"0\"\r\n # puts \"number 0\"\r\n return number.to_i\r\n else\r\n \r\n return false\r\n end\r\n else\r\n # puts \"number #{number}\"\r\n return number.to_i\r\n end\r\n \r\nend", "def featured(num)\n num += 1\n num += 1 until num.odd? && (num % 7).zero?\n loop do\n return num if num.to_s.chars.size == num.to_s.chars.uniq.size\n num += 14\n break if num > 9_876_543_210\n end\n 'There is no possible number that fulfills those requirements'\nend", "def dudeney_number?(numero)\r\n# hacemos paso por valor del argumento \r\ns = numero\t\r\n# convertimos integer a string para separar los digitos\r\nnewNumber = s.to_s\r\n# separamos los digitos del string\r\nnewNumber.split('')\r\n# tamanio del string \r\ntamanio = newNumber.length\r\n# si numero es iguala 1 se asigna a number\r\n\tif numero == 1\r\n\t\tnumber = 1\r\n# y si tamanio del argumento es de 3 cifras \t\t\r\n\telsif tamanio == 3\r\n# asignamos el valor por posicion\r\n\t\ta = newNumber[0]\r\n\t\tb = newNumber[1]\r\n\t\tc = newNumber[2]\r\n\t\t#convertimos de string a integer cada una de las asignaciones las sumamos y asi determinaremo el cubo perfecto\r\n\tnumber = a.to_i + b.to_i + c.to_i \r\n# si es de 4 cifras el argumento se hace lo mismo pero con 4 cifras \r\n\telsif tamanio == 4\r\n\t\ta = newNumber[0]\r\n\t\tb = newNumber[1]\r\n\t\tc = newNumber[2]\t\t\r\n\t\td = newNumber[3]\r\n\tnumber = a.to_i + b.to_i + c.to_i + d.to_i\r\n\tend\r\n# se eleva al cubo el numero base\r\n\tcubo =(number*number*number)\r\n# si cubo es igual valor del argumento regresa true diciendo que es un numero dudeney \r\n\tif cubo == numero\r\n\t\tr = true\r\n\telse\r\n\t\tr = false\r\n\tend\t\r\n# retorno\r\n\tr\r\nend", "def set_attempts_amount\n max_number <= 10 ? 2 : 10\nend", "def featured(integer)\n return \"There is no possible number that fulfills those requirements\" if \n integer >= 9_876_543_210\n integer += 1\n until integer % 7 == 0 && integer.odd? && integer.digits.uniq! == nil\n integer += 1\n end\n integer\nend", "def fizz_buzz number \n#prints numbers from 1 to 200\n #Modulo\n if number % 3 == 0 && number % 5 == 0\n 'FizzBuzz'\n elsif number % 3 == 0\n 'Fizz'\n elsif number % 5 == 0\n 'Buzz'\n else\n return number\n end\n\nend", "def sci_not(number)\n return \"#{number}.00E0\" if number < 10\n answer = number.to_s\n counter = 0\n num_to_check = number\n \n while num_to_check > 10\n num_to_check /= 10.to_f\n counter += 1\n end\n \n get_last_num = ((number.to_f / (10**counter)).round(2).to_s)\n get_last_num[2].nil? ? (mid_num = 0) : (mid_num = get_last_num[2])\n get_last_num[3].nil? ? (last_num = 0) : (last_num = get_last_num[3]) \n \n return \"#{answer[0]}.#{mid_num}#{last_num}E#{counter}\"\n\nend", "def call_cheat\n if (@score >= 100 and !@cheat)\n @score -= 100\n @cheat = true\n end\n end", "def set_num\n @num = Num.find(params[:id])\n end", "def update_cell(number, symbol)\n if cell_free?(number)\n self.cells[number - 1] = symbol.to_s\n show_board\n else\n puts \"la case est occupée choisis une autre case\"\n return false\n end\n end", "def featured(n)\n (n..9_999_999_999).each {|number| return number if number_valid?(n, number)}\n return \"There is no possible number that fulfills those requirements.\"\nend", "def num_convert\n\tputs 'give me a number(1...3000)'\n\tnum_input = gets.chomp\n\tif !num_input.empty?\n\t\tif num_input.to_i <= 0\n\t\t\tputs 'Must use positive integer' \n\t\t\treturn\n\t\telse\n\t\t\tputs roman_numeral num_input.to_i\n\t\t\tnum_convert\n\t\tend\n\tend\nend", "def choose_number\n\t\tputs \"Choose a number between 1-10\"\n\t\t$input = gets.chomp.to_i\n\t\tif $input > 10 || $input < 1\n\t\t\tputs \"Invalid number. Please use a number between 1-10\"\n\t\t\tchoose_number\n\t\tend\n\tend", "def next_check_number\n\t\tmaximum = cash_bank_check_offereds.maximum(\"number\")\n\t\t(maximum ? maximum+1 : initial_check_number).to_s\n\tend", "def gets_damage (number)\n @life_points = @life_points - number.to_i\n if @life_points <= 0\n puts \"#{@name} a mangé ses morts !\"\n else return show_state\n end\n end", "def check_miraban num\nend", "def incorrect_number?\n if (@message.text =~ /^[\\d]+$/).nil?\n send_text_message(\"How many labs?\")\n elsif @message.text.to_i.zero?\n send_text_message(\"Zero? Are you kidding me? How many labs?\")\n elsif @message.text.to_i > 15\n send_text_message(\"I think, that is too many labs. Please input number again.\")\n else\n false\n end\n end", "def number=(number)\n @number = number\n @target = number\n update_numbers\n end", "def featured(number)\n number += 1\n\n until number % 7 == 0 && number.odd?\n number += 1\n end\n\n loop do\n if number.digits.uniq == number.digits\n return number\n else\n number += 14\n end\n break if number.digits.size > 10\n end\n\n \"Error\"\nend", "def no_red_numbers\n if self.player.club.cash <= 0\n self.errors[:base] = I18n.t('training.errors.red_numbers')\n end\n end", "def cheat\n check(:B, 47)\n puts \"me cheat!\"\n end", "def pbChooseNum(cel)\n ret=cel\n sliderwin2=ControlWindow.new(0,0,320,32*5)\n sliderwin2.z=99999\n sliderwin2.addLabel(_INTL(\"Old Number: {1}\",cel))\n sliderwin2.addSlider(_INTL(\"New Number:\"),2,PBAnimation::MAXSPRITES,cel)\n okbutton=sliderwin2.addButton(_INTL(\"OK\"))\n cancelbutton=sliderwin2.addButton(_INTL(\"Cancel\"))\n loop do\n Graphics.update\n Input.update\n sliderwin2.update\n if sliderwin2.changed?(okbutton)\n ret=sliderwin2.value(1)\n break\n end\n if sliderwin2.changed?(cancelbutton) || Input.trigger?(Input::B)\n ret=-1\n break\n end\n end\n sliderwin2.dispose\n return ret\nend", "def result\n user_number = params[:number1].to_i\n number = @@numbers\n if number < user_number\n @result = \"Make it less\"\n elsif number>user_number\n @result = \"Make it more\"\n else\n @result = \"Yes, The secret number is #{number}\"\n # if the player could guess the secret number, this will gonna change-\n # the number as player can play again\n # @@number_rand = rand 500\n @@numbers = rand params[:max]\n end\n end", "def fizzbuzz(num)\n\n if num % 3 == 0\n \"Mined\"\n elsif num == 5\n \"Minds\"\n else\n num\n end\n\nend", "def guess\n puts 'Guess a number between 1-100, You only have 5 tries to get it right.'\n\n guess = gets.to_i\n\n if guess == @number\n puts 'WOW!! You guessed it on the first try!'\n else\n keep_guessing guess\n end\n end", "def number_fail(number)\n while number != nil\n if number == '0'\n return number \n elsif number.to_i == 0\n puts 'You entered '+number.to_s+' which isn\\'t a number. Please enter a new number'\n number = gets.chomp \n number = number\n if number == '0'\n return number \n end\n else\n return number \n end\n end\nend", "def zero?(num)\n number_prompt = TEXT['num_prompt']\n\n loop do\n break if (num.to_i) != 0\n message(number_prompt)\n ans = Kernel.gets().chomp()\n\n if ans.start_with?('y')\n num = 0\n break\n elsif ans.start_with?('n')\n message(TEXT['no_zero'])\n num = Kernel.gets().chomp()\n num = number?(num)\n end\n end\n\n num\nend", "def cases_pg_amount_more_than_zero\n\t\t@browser.div(class: 'rt-td').wait_until(&:present?)\n\t\t@row1 = @browser.div(class: 'rt-tr -odd', index: 0).div(class: 'rt-td', index: 5).text\n\t\t@row2 = @browser.div(class: 'rt-tr -even', index: 0).div(class: 'rt-td', index: 5).text\n\t\t@row3 = @browser.div(class: 'rt-tr -odd', index: 1).div(class: 'rt-td', index: 5).text\n\t\t@row4 = @browser.div(class: 'rt-tr -even', index: 1).div(class: 'rt-td', index: 5).text\n\t\t@row5 = @browser.div(class: 'rt-tr -odd', index: 2).div(class: 'rt-td', index: 5).text\n\n\t\t@row1a = @row1.gsub!(/[$]/,'')\n\t\t@row2a = @row2.gsub!(/[$]/,'')\n\t\t@row3a = @row3.gsub!(/[$]/,'')\n\t\t@row4a = @row4.gsub!(/[$]/,'')\n\t\t@row5a = @row5.gsub!(/[$]/,'')\n\n\t\tputs @row1a.to_i\n\t\tputs @row2a.to_i\n\t\tputs @row3a.to_i\n\t\tputs @row4a.to_i\n\t\tputs @row5a.to_i\n\n\t\tif (@row1a.to_i) >= 1\n\t\t\tputs \"Yes you can use the first number\"\n\t\t\t@browser.div(class: 'rt-tr -odd', index: 0).div(class: 'rt-td', index: 5).flash(color: [\"green\"]).click\n\t\telsif (@row2a.to_i) >= 1\n\t\t\tputs \"Yes you can use the second number\"\n\t\t\t@browser.div(class: 'rt-tr -even', index: 0).div(class: 'rt-td', index: 5).flash(color: [\"blue\"]).click\n\t\telsif (@row3a.to_i) >= 1\n\t\t\tputs \"Yes you can use the third number\"\n\t\t\t@browser.div(class: 'rt-tr -even', index: 0).div(class: 'rt-td', index: 5).flash(color: [\"green\"]).click\n\t\telsif (@row4a.to_i) >= 1\n\t\t\tputs \"Yes you can use the fourth number\"\n\t\t\t@browser.div(class: 'rt-tr -even', index: 0).div(class: 'rt-td', index: 5).flash(color: [\"blue\"]).click\n\t\telsif (@row5a.to_i) >= 1\n\t\t\tputs \"Yes you can use the fifth number\"\n\t\t\t@browser.div(class: 'rt-tr -even', index: 0).div(class: 'rt-td', index: 5).flash(color: [\"green\"]).click\n\t\telse\n\t\t\tputs \"No Amounts over 1.00\"\n\t\tend\n\tend", "def new_numeral_maker(num)\n i = 'I' * ((num % 5) / 1)\n v = 'V' * ((num % 10) / 5)\n x = 'X' * ((num % 50) / 10)\n l = 'L' * ((num % 100) / 50)\n c = 'C' * ((num % 500) / 100)\n\n four_error = 'IIII'\n nine_error = 'VIIII'\n forty_error = 'XXXX'\n ninety_error = 'LXXXX'\n four_hundred_error = 'CCCC'\n\n # hundreds\n if c == four_hundred_error\n print('DC')\n else\n print(c)\n end\n\n # tens\n if l + x == ninety_error\n print('XC')\n elsif x == forty_error\n print('XL')\n else\n print(x)\n end\n\n # ones and teens\n if v + i == nine_error\n print('IX')\n elsif i == four_error\n print('IV')\n else\n print(v + i)\n end\nend", "def fizz_buzz\n num = 0\n 100.times do\n num +=1\n if num % 5 == 0 && num % 3 == 0\n puts 'FizzBuzz'\n elsif num % 5 == 0\n puts 'Buzz'\n elsif num % 3 == 0\n puts 'Fizz'\n else\n puts num\n end\n end\nend", "def get_puzzle_number\n\tputs \"What puzzle(s) would you like to solve today?\"\n\tputs \"---------------------------------------------\"\n\tputs \"Please enter a number from 1-15\"\n\tinput = gets.chomp\n\ttry_again_check(input)\nend", "def fact num\n if num == 0\n 1\n elsif num == 1\n 1\n elsif num == 2\n 2\n elsif num == 10\n 3628800\n end\nend", "def featured(number)\n number += 1\n number += 1 until number.odd? && number % 7 == 0\n\n loop do\n number_chars = number.to_s.split('')\n return number if number_chars.uniq == number_chars\n number += 14\n break if number >= 9_876_543_210\n end\n\n 'There is no possible number that fulfills those requirements.'\nend", "def number; end", "def number; end", "def featured(number)\n number += 1\n number += 1 until number.odd? && number % 7 == 0\n\n loop do\n number_chars = number.to_s.split('')\n return number if number_chars.uniq == number_chars\n number += 14\n break if number > 9_876_543_210\n end\n\n 'There is no possible number that fulfills those requirements.'\nend", "def secret_number\n\tnumber = '8'\nend", "def pbChooseNum(cel)\r\n ret=cel\r\n sliderwin2=ControlWindow.new(0,0,320,32*5)\r\n sliderwin2.z=99999\r\n sliderwin2.addLabel(_INTL(\"Old Number: {1}\",cel))\r\n sliderwin2.addSlider(_INTL(\"New Number:\"),2,PBAnimation::MAX_SPRITES,cel)\r\n okbutton=sliderwin2.addButton(_INTL(\"OK\"))\r\n cancelbutton=sliderwin2.addButton(_INTL(\"Cancel\"))\r\n loop do\r\n Graphics.update\r\n Input.update\r\n sliderwin2.update\r\n if sliderwin2.changed?(okbutton)\r\n ret=sliderwin2.value(1)\r\n break\r\n end\r\n if sliderwin2.changed?(cancelbutton) || Input.trigger?(Input::BACK)\r\n ret=-1\r\n break\r\n end\r\n end\r\n sliderwin2.dispose\r\n return ret\r\nend", "def calculate_check_digit\n calculate_ponderated_values\n @check_digit = 10 - (@ponderated.inject(:+) % 10)\n end", "def display_number\n self.class.mask(number)\n end", "def magic_number?(n)\r\n \r\nend", "def set\n\t$one = \"1\"\n\t$two = \"2\"\n\t$three = \"3\"\n\t$four = \"4\"\n\t$five = \"5\"\n\t$six = \"6\"\n\t$seven = \"7\"\n\t$eight = \"8\"\n\t$nine = \"9\"\n\t$turn = 0\t\t\nend", "def update_number\r\n # If B button was pressed\r\n if Input.trigger?(Input::B)\r\n # Play cancel SE\r\n $game_system.se_play($data_system.cancel_se)\r\n # Set quantity input window to inactive / invisible\r\n @number_window.active = false\r\n @number_window.visible = false\r\n # Number Cancel Command\r\n number_cancel_command_input\r\n return\r\n end\r\n # If C button was pressed\r\n if Input.trigger?(Input::C)\r\n # Play shop SE\r\n $game_system.se_play($data_system.shop_se)\r\n # Set quantity input window to inactive / invisible\r\n @number_window.active = false\r\n @number_window.visible = false\r\n # Number Command Input\r\n number_command_input\r\n return\r\n end\r\n end", "def bigger_better_favorite_number\n\n puts 'Please type your favorite number.'\n favorite_number = gets.chomp.to_i\n\n bigger_better_number = favorite_number + 1\n\n puts \"Here's a bigger and better favorite number: #{bigger_better_number}!\"\nend", "def reprint(number)\n\t(1..100).each do |i|\n\t\tif i % 3 == 0 and i % 5 == 0\n\t\t\tputs 'FizzBuzz'\n\t\telsif i % 5 == 0\n\t\t\tputs 'Buzz'\n\t\telsif i % 3 == 0 \n\t\t\tputs 'Fizz'\t\t\n\t\telse\n\t\t\tputs i\t\t\n\t\tend\n\tend\nend", "def wheel_count=(number)\n raise 'cannot chnage'\n end", "def confirm_pur_number_warning_hops()\n $tracer.trace(\"GameStopMobileDSL : #{__method__}, Line : #{__LINE__}\")\n wait_for_landing_page_load\n invalid_number_error_hops.should_exist\n invalid_gc_msg = invalid_number_error_hops.inner_text\n invalid_gc_msg.should match(\"We're sorry but the loyalty card number you provided is not valid\")\n end", "def good_guess?(my_number)\n if my_number = 42\n return true\n else\n return false\n end\nend", "def set_number_of_wheels(value)\n puts \"hello\"\n end" ]
[ "0.7084534", "0.6498242", "0.63801116", "0.63492996", "0.63155574", "0.6196656", "0.61731446", "0.6157264", "0.614858", "0.614858", "0.614858", "0.614858", "0.614858", "0.614858", "0.614858", "0.614858", "0.614858", "0.61007816", "0.60525936", "0.60385585", "0.6005804", "0.5967518", "0.5917335", "0.589997", "0.588075", "0.58260185", "0.5810195", "0.58056635", "0.5785633", "0.5746217", "0.5735687", "0.57356197", "0.57328", "0.5723238", "0.57158434", "0.57158434", "0.57158434", "0.57158434", "0.57158434", "0.57158434", "0.57095236", "0.5708139", "0.5703843", "0.5702337", "0.56894207", "0.56676257", "0.5655567", "0.5642975", "0.5626248", "0.56224424", "0.56126755", "0.56070566", "0.5599655", "0.5599488", "0.5598478", "0.55796146", "0.5578751", "0.55699754", "0.5568129", "0.5567686", "0.55634373", "0.5556805", "0.55508965", "0.55449706", "0.5544688", "0.55371344", "0.55343926", "0.5529839", "0.5527229", "0.5527179", "0.55238086", "0.55070746", "0.5503482", "0.55008334", "0.54981273", "0.54977113", "0.5490012", "0.5487639", "0.5484605", "0.54794", "0.5477964", "0.5477732", "0.547573", "0.5457883", "0.54545397", "0.54545397", "0.5452324", "0.5448964", "0.5445268", "0.5443331", "0.5441666", "0.54410565", "0.5438515", "0.54377425", "0.5434861", "0.54343516", "0.5431495", "0.54295313", "0.54270893", "0.54225516" ]
0.7521906
0
returns the number showing
def showing return @numberShowing end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def showing \n @numberShowing\n end", "def display_number\n self['display_number'] ||= self.class.mask(number)\n self['display_number']\n end", "def display_number\n self.class.mask(number)\n end", "def display_number\n self.class.mask(number)\n end", "def display_number\n return @number if @number.blank? || @number.length < 5\n \"#{'x' * (@number.length - 4)}-#{@number[-4, 4]}\"\n end", "def number_s\n return @number_s\n end", "def number\n @number\n end", "def display(number)\n display_each([number])\n end", "def number; end", "def number; end", "def display_number\n \"XXXX-XXXX-XXXX-#{last_digits}\"\n end", "def display_number\n \"XXXX-XXXX-XXXX-#{last_digits}\"\n end", "def numcase_display numcase\n number = numcase.nil? ? 0 : numcase.n\n return '0' if number == 0\n return '< 5' if number.to_f.nan?\n return '< 5' if number < 5\n return number_with_delimiter(number, delimiter: '\\'')\n end", "def shownumbers_mand\n\t\tmult = @num1 * @num2 * @num3\n\t\tputs \"With Mandtory #{@num1} * #{@num2} * #{@num3} = #{mult}\"\n\tend", "def num\r\n @num\r\n end", "def display_number\n 'X' + id.to_s\n end", "def display_number\n # \n ('X' * (account_number.to_s.length - last_digits.size)) + last_digits\n # account_number.to_s[0..last_digits.size].to_s.size + \n # last_digits.to_s\n end", "def num\n @num\n end", "def num()\n @numerador\n end", "def human_display(number)\n base_number = digits(number)\n if base_number.length == 11 && base_number.first == '1'\n \"(#{base_number[1..3]}) #{base_number[4..6]}-#{base_number[7..10]}\"\n elsif base_number.length > 0\n \"+#{base_number}\"\n else\n nil\n end\n end", "def num()\n @num\n end", "def displayed_grade\n (grade * 4 + 1).to_i\n end", "def show\n # TODO put computation here for displaying alternate values?\n end", "def interpret\n return @number\n end", "def num; end", "def num; end", "def display_nums\n (0...9).each do |ro|\n (0...9).each do |co|\n if @grid[ro][co] == :B\n surround_nums(ro,co)\n end\n end\n end\n end", "def display_value(count)\n return \"- \" if count.nil?\n return \"0 \" if count.zero?\n\n case Math.log10(count).floor\n when 1...4 then '%d ' % count\n when 4...7 then '%dk' % (count / 1000)\n when 7...10 then '%dM' % (count / 1000_000)\n when 10...13 then '%dG' % (count / 1000_000_000)\n when 13...16 then '%dT' % (count / 1000_000_000_000)\n else '%dP' % (count / 1000_000_000_000_000)\n end\n\n end", "def number_with_formatting\n number_without_formatting\n end", "def number_with_formatting\n number_without_formatting\n end", "def show_deck_number\n @deck_number = Text.new(\n \"Deck: \" + @deck.length.to_s,\n x: 595, y: 22,\n size: 40,\n color: 'blue'\n )\n end", "def numbername\n self.number + \" - \" + self.name\n end", "def mobile_or_pager_number\n FFaker.numerify('9### ####')\n end", "def interpret\r\n return @number.to_i\r\n end", "def number_f\n return @number_f\n end", "def num\n name\n end", "def show\n @random_number = 1 + rand(10)\n @result = Number.compare_numbers(@number.input, @random_number)\n end", "def get_call_number(item_display)\n get_item_display_piece(item_display, 0)\n end", "def show_value\n return @show_value\n end", "def question_number_helper(number)\n if number\n \"#{number}<span style='padding-left:0.1em;'>)</span>\" \n else\n \"\"\n end\n end", "def draw_item_number(item, rect)\n return if item.result_n == 1\n num = sprintf('x%d', item.result_n)\n draw_text(rect, num, 2)\n end", "def to_s\n\t\treturn \"#@num/#@den\"\n\tend", "def num()\n\t\treturn @num\n\tend", "def top(number)\n 1.upto(number) { |count| puts ('*' * count).center(number) if count.odd? }\nend", "def full_info number \n\t\tshort_text = description.split(\"<br>\")[0][0..59]\n\t\tshort_text = short_text + \"...\" if short_text.length == 60\n\t\t\"#{number}. #{short_text}\"\n\tend", "def cheat number\n if number > 0 && number < 7\n @numberShowing = number\n return true\n end\n return false\n end", "def show(z = 0)\n\t\t\tto_nef(z).show\n\t\tend", "def display_count(count)\n if count == 1\n #\"\"\n else\n count.to_s\n end\n end", "def pn\n \"#{DRAWING_PN % (index+1)}\"\n end", "def french_insee_number; end", "def print_num n\n prep = n < 0 ? \"\" : \" \"\n print \"#{prep}%.2f | \" % n\nend", "def showValue(quantity)\n ActionController::Base.helpers.number_to_currency(self.getValue(quantity), precision: 0, delimiter: \".\")\n end", "def show\n \"$#{total} #{@state[0]} #{@state[1]} #{@state[2]} #{@state[3]} #{@state[4]}\"\n end", "def tenders_num(num)\n\nend", "def print_num(min)\n min.to_s.reverse.gsub(/(\\d{3})(?=\\d)/, '\\\\1,').reverse\nend", "def decimal_mark; end", "def getNumber _args\n \"getNumber _args;\" \n end", "def show_percentage\n return @show_percentage\n end", "def number_with_ext\n if ext.present?\n \"#{number} Ext: #{ext}\"\n else\n number\n end\n end", "def show_gold_popup\n draw_currency_value(@testo.to_i, \"\", 0, 0, self.width-(self.padding*2))\n end", "def n(num)\n num.to_s.reverse.gsub(/...(?=.)/,'\\&,').reverse\n end", "def vat_number; end", "def show_numbersdef\n\t\tmult = @number1 * @number2 * @number3\n\t\tputs \"With default #{@number1} * #{@number2} * #{@number3} = #{mult}\"\n\tend", "def numberToString(num)\r\n num.to_s\r\nend", "def show\n @num = @ticket.number_of_tickets\n end", "def number\n # initialize counter and index of scale\n i = note1_index\n count = 1\n \n count, i = no_unison(count, i)\n \n # Counting notes\n until_find_note2(i) { count += 1 }\n \n count = count + (8 * @step) - 1 if @step > 0\n count\n end", "def fancy_number(num)\n \"$\" + num.to_s.reverse.scan(/\\d{3}|.+/).join(\",\").reverse\n end", "def favorite_number\n 7\n end", "def visible_line_number\r\n item_max\r\n end", "def get_value\n read_attribute('number_value')\n end", "def voip_number\n FFaker.numerify('3### ####')\n end", "def number\n @number || (conversation.try(:number))\n end", "def display_quantity\n product.allow_fractional_quantity? ? quantity : quantity.to_i\n end", "def number\n \"#{self.id}\".rjust(8, \"0\")\n end", "def number\n \"#{self.id}\".rjust(8, \"0\")\n end", "def number\n \"#{self.id}\".rjust(8, \"0\")\n end", "def complete_number\n \"#{self.pre_value} #{self.value} #{self.post_value}\".squeeze(\" \").strip\n end", "def number\n read_attribute(:value)\n end", "def old_school num\n numeral = ''\n \n\n numeral += 'M'*(num/1000)\n num = num % 1000\n numeral += 'D'*(num/500)\n num = num % 500\n numeral += 'C'*(num/100)\n num = num % 100\n numeral += 'L'*(num/50)\n num = num % 50\n numeral += 'X'*(num/10)\n num = num % 10\n numeral += 'V'*(num/5)\n num = num % 5\n numeral += 'I'*(num/1)\n num = num % 1\n\n\n\n return numeral \n\nend", "def td_number_before_saison\n return 3\n end", "def short_number\n \"#{self.is_a?(PurchaseInvoice) ? 'PI' : (self.is_a?(SalesInvoice) ? 'SI' : 'IN') }-#{number_without_formatting}\"\n end", "def display_value\n case self.value_type\n when 'Numeric'\n unless self.multiplier.nil? || self.multiplier.blank?\n \"#{self.value} #{self.multiplier}(s) <span class='badge'>#{self.convert_value_by_type} bytes</span>\"\n else\n self.value\n end\n when 'Boolean'\n self.value == '1' ? 'Yes' : 'No'\n else\n self.value\n end\n end", "def short\n quality + number.to_s \n end", "def print_number(number)\n number.nil? ? \"_\" : (number + 1).to_s\n end", "def duns_number; end", "def example_number\n @example_number\n end", "def number\n @number ||= (num = name.match(/([0-9]{4})$/) and num[1].to_i)\n end", "def digit; end", "def human_readable(number, type)\n\t# Do some math then return the number in a commified form:\n\treturn (number/type).to_s.gsub(/(\\d)(?=\\d{3}+(?:\\.|$))(\\d{3}\\..*)?/,'\\1,\\2')\nend", "def short_number(prenumber,n) \n @str = prenumber.to_s + to_n(Time.now.sec.to_s,2).to_s\n return to_n(@str,n)\n end", "def facebox_link_num(num, url, title)\n if num > 0\n link_to(num, \"#\", { :class => \"vtip\", :onclick => \"tb_show('#{title}','#{url}','')\", :title => title })\n else\n 0\n end\n end", "def call_number_span\n %(<span class=\"link-text\">#{I18n.t('blacklight.holdings.browse')}</span>\\\n <span class=\"icon-bookslibrary\"></span>)\n end", "def visible_line_number\n item_max\n end", "def visible_line_number\n item_max\n end", "def visible_line_number\n item_max\n end", "def visible_line_number\n item_max\n end", "def show_total_unattendance_number\n puts 'show_total_unattendance_number'\n total_unattendance_number = @data.inject (0) do |mem, e|\n num_exams = e.size - 1.0\n mem + e.last(num_exams).count('00')\n end\n puts total_unattendance_number.to_s\n end", "def max_number_text_label\n\t\t$tracer.trace(format_method(__method__))\n return ToolTag.new(@tag.find.p.className(create_ats_regex_string(\"ats-maxnumtxtlbl\")), format_method(__method__))\n\tend", "def international_toll_free_number\n FFaker.numerify('800 ### ####')\n end", "def nhs_numberize\n return self unless length == 10\n self[0..2] + ' ' + self[3..5] + ' ' + self[6..9]\n end" ]
[ "0.76895446", "0.75263774", "0.73904663", "0.73502016", "0.7256698", "0.69704247", "0.6843486", "0.68390197", "0.6705172", "0.6705172", "0.66914254", "0.66914254", "0.66657346", "0.6662729", "0.6578317", "0.6570832", "0.65338814", "0.6527316", "0.64803106", "0.64112204", "0.63282937", "0.6300791", "0.6258138", "0.62233204", "0.6218925", "0.6218925", "0.6171967", "0.61460716", "0.61099607", "0.61099607", "0.6108127", "0.609971", "0.6081659", "0.6058143", "0.60408086", "0.6038238", "0.60306484", "0.6023776", "0.60202014", "0.6012461", "0.60099083", "0.5986664", "0.5976342", "0.59715575", "0.59668416", "0.59434634", "0.5941317", "0.59380466", "0.59371847", "0.5932593", "0.59313697", "0.5923082", "0.5911111", "0.59090173", "0.5881332", "0.5877504", "0.5868117", "0.58653826", "0.58621293", "0.5860307", "0.5841967", "0.5833129", "0.58314496", "0.58218", "0.5817857", "0.5815464", "0.5812043", "0.5803869", "0.5801977", "0.57938766", "0.57807535", "0.5775276", "0.5774938", "0.5771611", "0.5771611", "0.5771611", "0.5769639", "0.5769389", "0.57657", "0.5764402", "0.57629234", "0.57485235", "0.57381713", "0.57251537", "0.57235837", "0.57204205", "0.5719534", "0.5716239", "0.5713384", "0.5709084", "0.570755", "0.5705342", "0.5692365", "0.5692365", "0.5692365", "0.5692365", "0.5691732", "0.56905574", "0.5671222", "0.5659545" ]
0.79139525
0
I worked on this challenge with James Boyd I spent [1.5] hours on this challenge. Complete each step below according to the challenge directions and include it in this file. Also make sure everything that isn't code is commented in the file. 0. Pseudocode What is the input? An array, an integer (minimum size for output array), filler object What is the output? (i.e. What should the code return?) A new array What are the steps needed to solve the problem? 1. Compare size of array to minimum size a. If it is bigger or equal to min_size, return original array 2. When array is smaller than minimum size, pad array with the default value until it is minimum size b. 3. Return new array 1. Initial Solution
def pad!(array, min_size, value = nil) #destructive if array.length >= min_size return array end # refactor for a cooler method than while loop # use an index for looping i = array.length while i < min_size array.push value i += 1 end array end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pad(array, min_size, value = nil) #non - destructive\n array_modified = []\n if min_size <= array_modified.length\n array_modified = array.map { |x| x }\n elsif min_size == 0\n array_modified = array.map { |x| x }\n else\n array_modified = array.map { |x| x }\n (min_size - array_modified.length).times {\n array_modified.push(value)\n }\n return array_modified\n end\nend", "def pad!(array, min_size, value = nil) #destructive\n solution_array = []\n if min_size <= array.length\n #p array\n return array\n elsif min_size > array.length\n solution_array = array\n times_to_pad = min_size - array.length\n #p times_to_pad\n times_to_pad.times do\n solution_array << value\n #p solution_array\n end\n end\n return solution_array\nend", "def pad!(array, min_size, value = nil)\n if min_size <= array.length\n return array\n else\n difference = min_size - array.length\n array.fill(value, array.length, difference)\n end\nend", "def pad!(array, min_size, value = nil) #destructive\n if array.length >= min_size\n return array\n end\n if min_size > array.length\n remainder = min_size - array.length\n remainder.times do array << value\n end\n end\n p array\nend", "def pad!(array, min_size, value = nil) #destructive\n if min_size < array.length || min_size == array.length \n return array\n else \n x = min_size - array.length\n x.times do\n array.push(value)\n end\n return array\n end\nend", "def pad!(array, min_size, value = nil) #destructive\n if array.length >= min_size\n return array\n else\n difference = min_size - array.length\n for i in 1..difference\n array.push(value)\n end\n end\n return array\nend", "def pad(input_array, min_size, value = nil) #non-destructive\n array = []\n input_array.each do |x|\n array << x\n end\n if array.length < min_size\n i = array.length\n while i < min_size\n array[i] = value\n i += 1\n end\n end\n p array\nend", "def pad!(array, min_size, value = nil) #destructive\n if array.length >= min_size\n return array\n else\n diff = min_size - array.length\n diff.times do\n array << value\n end\n return array\n end\nend", "def pad(array, min_size, value = nil) #non-\n other_array=[]\n if min_size==0\n other_array << array\n other_array.flatten!\n else\n num_things=min_size-array.length\n if array == []\n num_things.times do\n other_array << value\n end\n else\n other_array << array\n other_array.flatten!\n num_things.times do\n other_array << value\n end\n end\n end\n other_array\nend", "def pad!(array, min_size, value = nil) #destructive\n if array.length >= min_size\n return array\n else\n diff = min_size - array.length\n while diff > 0\n array.push(value)\n diff -= 1\n end\n return array\n end\nend", "def pad!(array, min_size, value = nil) #destructive\n if array.size >= min_size\n \treturn array\n else\n \ti = min_size - array.size\n \ti.times { array << value }\n \tarray\n end\nend", "def pad!(array, min_size, value=nil) #destructive\n if min_size == 0 || array.length >= min_size\n return array\n else (min_size - array.length).times { |array, x| array << value.to_i } \n return array\n end\nend", "def pad!(array, min_size, value = nil) #destructive\n if min_size <= array.length \n return array\n else \n x = min_size - array.length\n x.times do\n array.push(value)\n end\n return array\n end\nend", "def pad!(array, min_size, value = nil) #destructive\n if array.length >= min_size\n return array\n else\n index = array.length\n while index < min_size\n array[index] = value\n index += 1\n end\n end\n return array\nend", "def pad!(array, min_size, value = nil) #destructive\n difference = array.length - min_size\n difference = difference.abs\n if array.length - min_size < 0\n for i in 0..difference - 1\n array.push(value)\n end\n end\n return array\nend", "def pad!(array, min_size, value = nil)\n if min_size <= array.length\n return array\n else\n while min_size - array.length > 0\n array << value\n end\n return array\n end\nend", "def pad!(array, min_size, value = nil) #destructive\n if min_size <= array.length\n return array\n else\n until array.length == min_size\n array << value\n end\n array\n end\n end", "def pad!(array, min_size, value = nil) #destructive\n # Your code here\n if array.size == min_size\n return array\n else\n while min_size > array.size\n array << value\n end\n end\n return array\nend", "def pad!(array, min_size, value = nil) #destructive\n if(min_size <= array.length)\n return array\n else\n counter = min_size - array.length\n while counter > 0\n array << value\n counter -= 1\n end \n return array\n end\nend", "def pad!(array, min_size, value = nil) #destructive\n difference = min_size - array.length\n if min_size <= array.length\n p array\n elsif min_size == 0\n p array\n elsif min_size > 0\n difference.times do |x|\n array.push(value) \n end\n end\n p array\nend", "def pad!(array, min_size, value = nil) #destructive\n if array.length >= min_size\n return array\n else\n loop do array.push(value)\n break if array.length >= min_size\n end\n p array\n return array\n end\nend", "def pad!(array, min_size, value = nil) #destructive\n if min_size <= array.length\n return array\n else\n size = min_size - array.length\n counter = 0\n while counter < size\n array << value\n counter += 1\n end\n end\n return array\nend", "def pad!(array, min_size, value = nil) #destructive\n difference = min_size - array.length\n if difference <= 0\n return array\n else\n return array.concat(Array.new(difference, value))\n end\nend", "def pad!(array, min_size, value = nil) #destructive\r\n if min_size > array.size \r\n pad_array = Array.new(min_size - array.size, value) \r\n pad_array.each do |x|\r\n array << x \r\n end \r\n else\r\n array \r\n end\r\n p array\r\nend", "def pad!(array, min_size, value = nil) #destructive\n if array.length >= min_size\n \treturn array\n else\n \tuntil array.length == min_size\n \t\tarray.push(value)\n \tend\n \treturn array\n end\nend", "def pad!(array, min_size, value = nil) #destructive\n if min_size <= array.length\n return array\n end\n \n until array.length == min_size do\n array.push(value)\n end\n array\nend", "def pad!(array, min_size, value = nil)\n\tif min_size <= array.length\n\t\treturn array\n\telse\n\t\twhile min_size - array.length > 0\n\t\t\tarray << value\n\t\tend\n\t\treturn array\n\tend\nend", "def pad!(array, min_size, value = nil) #destructive\n# Your code here\n\nif array.length == min_size || min_size == 0\n return array\nend\n\nif min_size > array.length\n until array.length == min_size\n array.push(value)\n end\n end\n array\nend", "def pad!(array, min_size, value = nil) #destructive\n\tif min_size <= array.length || min_size == 0\n\t\t\n\t\treturn array\n\n\telse\n\t\t(min_size - array.length).times {\n\n\t\t\t\tarray.push(value)\n\t\t}\n\t\t\n\t\treturn array\n\n\tend\n\nend", "def pad!(array, min_size, value = nil) #destructive\n if array.length > min_size || min_size == 0\n return array\n else\n while array.length < min_size do\n array.push(value)\n end\n return array\n end\nend", "def pad!(array, min_size, value = nil) #destructive\n difference = min_size - array.length\n #array.length #the variable len = array.length\n if difference > 0\n # puts positive amount of difference into array through default value\n difference.times { |x| array.push value }\n end\n return array\nend", "def pad!(array, min_size, value = nil) #destructive\n if array.length >= min_size\n return array\n else\n while array.length < min_size\n array.push(value)\n end\n return array\n end\nend", "def pad(array, min_size, value = nil) #non - destructive\n\n\tarray_modified = []\n\n\tif min_size <= array_modified.length || min_size == 0\n\t\t\n\t\tarray_modified = array.map { |x| x}\n\n\telse\n\t\tarray_modified = array.map { |x| x}\n\n\t\t(min_size - array_modified.length).times {\n\n\t\t\t\tarray_modified.push(value)\n\t\t}\n\n\t\treturn array_modified\n\n\tend\n \nend", "def pad!(array, min_size, value = nil) #destructive\n if array.length - min_size < 0\n difference = array.length - min_size\n difference = difference.abs\n for i in 0..difference - 1\n array.push(value)\n end\n end\n return array\nend", "def pad!(array, min_size, value = nil) #destructive\n if array.length >= min_size\n return array\n end\n until min_size <= array.length\n array << value\n end\n array\nend", "def pad(arr, min_size, value = nil) #non-destructive\n array = arr.dup\n if array.length < min_size\n padding_needed = min_size - array.length\n padding_needed.times { array.push value }\n end\n array\nend", "def pad!(array, min_size, value = nil) #destructive\n if array.size >= min_size\n return array\n end\n while array.size < min_size do\n array << value\n end\n return array\nend", "def pad!(array, min_size, value = nil) #destructive\n if array.size >= min_size\n return array\n end\n while array.size < min_size do\n array << value\n end\n return array\nend", "def pad!(array, min_size, value = nil)\n if array.length >= min_size\n return array\n else\n x = array.length\n until x == min_size; array.push value; x += 1\n end\n p array\n end\nend", "def pad!(array, min_size, value = nil) #destructive\n if array.length < min_size\n (min_size - array.length).times { array.push(value) }\n end\n return array\nend", "def pad(array, min_size, value = nil)\n array_new = [ ]\n array.each do |x|\n array_new.push(x)\n end\n while array_new.length < min_size\n array_new.push(value)\n end\n return array_new\nend", "def pad(array, min_size, value = nil)\n array_new = [ ]\n array.each do |x|\n array_new.push(x)\n end\n while array_new.length < min_size\n array_new.push(value)\n end\n return array_new\nend", "def pad!(array, min_size, value = nil) #destructive\n # Your code here\n if array.length >= min_size \n \treturn array\n else \n \t(min_size-array.length).times do\n \t\tarray.push(value)\n \tend\n \treturn array\n end\nend", "def pad!(array, min_size, value = nil) #destructive\n if array.count >= min_size\n return array\n else\n (min_size - array.count).times do\n array << value\n end\n return array\n end\nend", "def pad!(array, min_size, value = nil) #destructive\r\n iter = min_size - array.length\r\n if min_size <= array.length\r\n return array\r\n else\r\n iter.times {array << value}\r\n end\r\n return array\r\nend", "def pad!(array, min_size, value = nil) #destructive\n i = min_size - array.length\n\n i.times {array.push(value)} if array.length < min_size\n array\nend", "def pad(array, min_size, value = nil) #non-destructive\n \n new_array = [].concat(array)\n # array.each { |el| new_array << el } \n \n difference = min_size - array.length\n #array.length #the variable len = array.length\n if difference > 0\n # puts positive amount of difference into array through default value\n difference.times { |el| new_array << value }\n end\n \n \n return new_array\n \nend", "def pad!(array, min_size, value = nil) \n array.fill(value, array.length...min_size) unless min_size <= array.length\n array\nend", "def pad!(array, min_size, value = nil) #destructive\r\n\treturn array << value if array.length <= min_size\r\n\treturn array\r\n # #size_difference = min_size - array.length\r\n # (min_size - array.length).times do\r\n # array << value\r\n # end \r\n # array\r\nend", "def pad!(array, min_size, value = nil) #destructive\n if array.length >= min_size\n return array\n else\n for i in array.length...min_size\n array[i] = value\n end\n end\nend", "def pad!(array, min_size, value = nil) #destructive\n # Your code here\n if min_size <= array.length\n return array\n else\n padding = array.length - min_size\n counter = array.length\n while counter < min_size\n array << value\n counter += 1\n end\n return array\n end\n\nend", "def pad!(array, min_size, value = nil) #destructive\n if array.length < min_size\n padding_needed = min_size - array.length\n padding_needed.times { array.push value }\n end\n array\nend", "def pad!(array, min_size, value = nil) #destructive\n if array.length >= min_size\n return array\n else\n pad_size = min_size - array.length\n counter = 0\n while counter < pad_size\n array << value\n counter+=1\n end\n return array\n end\nend", "def pad!(array, min_size, value = nil) #destructive\n if array.length < min_size\n for i in 1..(min_size - array.length)\n array << value\n end\n end\n return array\nend", "def pad!(array, min_size, value = nil) #destructive\n # Your code here\n if min_size <= array.size\n return array\n else\n new_array_size = (min_size - array.size)\n while new_array_size > 0\n array.push(value)\n new_array_size = (new_array_size - 1)\n end\n end\n return array\nend", "def pad!(array, min_size, value = nil) #destructive\n # Your code here\n difference = min_size - array.length\n if difference <= 0\n return array\n else\n difference.times do\n array.push(value)\n end\n end\n\n return array\nend", "def pad!(array, min_size, value = nil)\n if min_size==0\n return array\n else\n num_things=min_size-array.length\n num_things.times do\n array << value\n end\n end\n array\nend", "def pad!(array, min_size, value = nil) #destructive\n\n if array.length >= min_size\n return array\n else\n array.push(value) until array.length == min_size\n end\n array\nend", "def pad!(array, min_size, value = nil) #destructive\n # Your code here\n return array if min_size <= array.length\n while min_size > array.length\n array.push(value)\n end\n array\nend", "def pad(array, min_size, value = nil) #non-destructive\n arrayCopy = array.dup\n\n if arrayCopy.length >= min_size\n return arrayCopy\n\n else\n while arrayCopy.length < min_size\n arrayCopy[arrayCopy.length] = value\n # p arrayCopy\n end\n return arrayCopy\n end\nend", "def pad!(array, min_size, value = nil) #destructive\n # Your code here\n if array.length >= min_size\n return array\n else\n padding = min_size - array.length\n padding.times do |x|\n array.push(value)\n end\n end\n return array\nend", "def pad!(array, min_size, value = nil) #destructive\n # Your code here\n if array.length < min_size\n x = min_size - array.length\n x.times do array << value\n end\n end\n return array\nend", "def pad!(array, min_size, value = nil) #destructive\n difference = min_size - array.length\n while difference > 0 do\n array << value\n difference-=1\n end\n array\nend", "def pad!(array, min_size, value = nil) #destructive\n # Your code here\n return array if min_size <= array.length\n while min_size > array.length\n \tarray.push(value)\n end\n array\nend", "def pad!(array, min_size, value = nil) #destructive\n length = array.length\n if length >= min_size\n return array\n else\n until array.length == min_size\n return array.push(value = nil)\n end\n end \nend", "def pad!(array, min_size, value = nil) #destructive\n # Your code here\n if min_size > array.length\n array << value\n return array\n else\n return array\n end\nend", "def pad(array, min_size, value=nil) #non-destructive\n# Your code here\n\n new_array = array.clone #sets the new array the same value of array but with a different object id essentially not affecting the original array\n\nif min_size > array.length\n until new_array.length == min_size\n new_array.push(value)\n #we are pushing to the new_array\n end\nend\n\n new_array\nend", "def pad!(array, min_size, value = nil) #destructive\n # Your code here\n array_size = array.count\n if min_size > array_size\n \tfor i in 0...(min_size - array_size)\n \t\tarray.push(value)\n \tend\n \treturn array\n else\n \treturn array\n end\nend", "def pad!(array, min_size, value = nil) #destructive\n \n if array.length >= min_size \n p array\n else\n \n while array.length < min_size\n array = array.push(value)\n end \n \n p array\n end\n \nend", "def pad!(array, min_size, value = nil)\nreturn array.fill(value, array.length..(min_size-1))\nend", "def pad!(array, min_size, value = nil) #destructive\n difference = (min_size - array.length)\n difference.times {\n array << value}\n return array\nend", "def pad!(array, min_size, value = nil) #destructive\n # Your code here\n if array.length >= min_size \n return array\n else \n until array.length == min_size\n array.push value\n end\n return array\n end\nend", "def pad!(array, min_size, value = nil)\n size_difference = min_size - array.length\n size_difference.times do\n array << value\n end\n array\nend", "def pad_size(array, min_size)\n min_size - array.length\nend", "def pad!(array, min_size, value = nil)\n#destructive\n\n length = array.length\n\n if length >= min_size\n return p array\n\n elsif min_size == 0\n p array = []\n return p array = []\n\n else\n\n while array.length < min_size\n if value != nil\n array << value\n else\n array << nil\n end\n end\n return p array\n end\nend", "def pad!(array, min_size, value = nil) #destructive\r\n # Your code here\r\n if array.length >= min_size \r\n return array\r\n else \r\n until array.length == min_size\r\n array.push value\r\n end\r\n return array\r\n end\r\nend", "def pad!(array, min_size, value = nil) #destructive\n if array.length < min_size\n i = array.length\n while i < min_size\n array[i] = value\n i += 1\n end\n end\n p array\nend", "def pad!(array, min_size, value = nil) #destructive\n diff = min_size - array.length\n times = 0 if diff < 0\n diff.times do\n array << value\n end\n array\nend", "def pad!(array, min_size, value = nil) #destructive\n # Your code here\n new_array = array\n x = array.length\n\n def greater?(x, min_size)\n if x >= min_size\n return true\n else\n return false\n end\n end\n\n if greater?(x, min_size) ||\n min_size.times do |x|\n new_array.push(array[x])\n end\n return new_array\n\n else\n min_size.times do |x|\n if array[x] == nil\n self.push(value)\n else\n new_array.push(array[x])\n end\n end\n return new_array\n end\nend", "def pad(array, min_size, value = nil) \n arr_len = array.length\n array_copy = Array.new(array)\n\n if arr_len < min_size \n padding_size = min_size - arr_len\n\n padding_size.times do \n array_copy.push(value) \n end \n end \n\n return array_copy\nend", "def pad!(array, min_size, value = nil) #destructive\n if array.length < min_size \n \tarray.push(value)\n else \n return array \nend \t\nend", "def pad!(array, min_size, value = nil) #destructive\n \n if min_size <= array.length\n p array\n else \n p array << array + [value] * (min_size - array.length) \n end\nend", "def pad!(array, min_size, value = nil) #destructive\n array.keep_if{ |a| a <= array.length}\n difference = min_size - array.length\n counter = 0\n while counter < difference\n array << value\n counter += 1\n end\n p array\n # self = ans_array\nreturn array\nend", "def pad!(array, min_size, value = nil) #destructive\n (min_size <= array.length || min_size == 0)? array:array.fill(value, array.length..min_size-1)\nend", "def pad!(array, min_size, value = nil) #destructive\n while min_size > array.length\n array.push(value)\n end\n array\nend", "def pad!(array, min_size, value = nil)\n\treturn array if min_size <= array.length\n\tneeded_pads = min_size - array.length\n\tpadding = Array.new(needed_pads, value)\n\tpadding.each { |item| array << item }\n\treturn array\nend", "def pad(array, min_size, value = nil) #non-destructive\n new_array = Array.new\n new_array += array\n new_array.fill(value, array.length...min_size)\nend", "def pad!(array, min_size, value = nil) #destructive\n # Your code here\n if array.length < min_size\n while array.length < min_size\n array << value\n end\n end\n return array\nend", "def pad!(array, min_size, value = nil) #non-destructive\n # Your code here\n array_length = array.length\n array2 = array\n\n if array_length < min_size\n\n while array_length < min_size do\n array2.push(value)\n array_length +=1\n end\n end\n return array2\nend", "def pad!(array, min_size, value = nil)\n array.fill(value, array.length, min_size-array.length)\nend", "def pad(array, min_size, value = nil) \n arr_len = array.length\n array_copy =Array.new(array)\n\n if arr_len < min_size \n padding_size = min_size - arr_len\n\n padding_size.times do \n array_copy.push(value) \n end \n end \n\n return array_copy\nend", "def pad(array, min_size, value = nil) #non-destructive\n new_array = [] + array\n while new_array.length < min_size\n new_array << value\n end\n new_array\nend", "def pad(array, min_size, value=nil)\n array.dup.fill(value, array.length...min_size)\nend", "def pad!(array, min_size, value = nil) #destructive\n array << value while min_size > array.length\n array\nend", "def pad!(array, min_size, value = nil) #destructive\n difference = min_size - array.length\n new_array = Array.new(difference, value)\n padded_array = array.push(new_array)\n array = padded_array.flatten!\n p array\nend", "def pad!(array, min_size, value = nil) #destructive\n while array.length < min_size\n array << value\n end\n return array\nend", "def pad!(array, min_size, value = nil) #destructive\n# Your code here\n\nif min_size > array.length\n until array.length == min_size\n array.push(value)\n #we are pushing to the same array\n end\n end\n array\nend", "def pad!(array, min_size, value=nil)\n array.fill(value, array.length...min_size)\nend", "def pad!(array, min_size, value = nil)\n while array.length < min_size\n array.push(value)\n end\n return array\nend", "def pad!(array, min_size, value = nil)\n while array.length < min_size\n array.push(value)\n end\n return array\nend" ]
[ "0.79110974", "0.79039675", "0.7896784", "0.7896694", "0.7891354", "0.7873531", "0.78532475", "0.78498214", "0.7846627", "0.78444684", "0.7837927", "0.7828748", "0.7827339", "0.7825683", "0.78104824", "0.7806454", "0.78062946", "0.7802543", "0.7798264", "0.7795762", "0.77893305", "0.77868795", "0.7784904", "0.77668047", "0.7759622", "0.7754719", "0.7754604", "0.7751209", "0.7749486", "0.7745497", "0.7742973", "0.7735971", "0.77326304", "0.7717166", "0.7708645", "0.7708413", "0.7707842", "0.7707842", "0.7707678", "0.7705418", "0.77050054", "0.77050054", "0.76988554", "0.7696111", "0.7692803", "0.7692489", "0.7687215", "0.76709306", "0.7667966", "0.7666637", "0.7662611", "0.76617545", "0.7661099", "0.7658374", "0.76467216", "0.7646094", "0.7645792", "0.7633103", "0.7611619", "0.7609332", "0.7607143", "0.76057434", "0.76008135", "0.75915444", "0.7580152", "0.75756973", "0.7554789", "0.75477064", "0.7545221", "0.753885", "0.7531122", "0.75176936", "0.75145704", "0.7513609", "0.7512612", "0.7511599", "0.7507403", "0.74995023", "0.7498047", "0.7496902", "0.74945575", "0.74759173", "0.74735844", "0.7460819", "0.74546623", "0.7452313", "0.74505144", "0.7435374", "0.7434438", "0.7433278", "0.74316555", "0.7420663", "0.7412081", "0.74118084", "0.7394522", "0.73909867", "0.7385736", "0.73773897", "0.7362025", "0.7362025" ]
0.76326996
58